How does the new Google Sign in Button (Google Identity GSI) determine user locale? - google-identity

https://developers.google.com/identity/gsi/web/reference/js-reference#locale
The pre-set locale of the button text. If it's not set, the browser's default locale or the Google session user’s preference is used. Therefore, different users might see different versions of localized buttons, and possibly with different sizes.
I am located in Lithuania (people use Lithuanian (lt) language here)
If I open up the page with login button on incognito window than the button is rendered in lt locale.
In console navigator.languages is ['en']
Network requests to page and GSI client lib are accept-language: en
How does this happen if I leave the login button locale empty? (default)

Related

How is Airbnb.com using iOS universal links from the same domain?

In Apple's Universal link documentation it says it will respect a users assumed intent to open a web browser link instead of the iOS application if a universal link is clicked on from the same domain.
When a user is browsing your website in Safari and they tap a universal link to a URL in the same domain as the current webpage, iOS respects the user’s most likely intent and opens the link in Safari. If the user taps a universal link to a URL in a different domain, iOS opens the link in your app.
But if you go to Airbnb.com on mobile Safari, select a room, then select the location on the room's page (e.g. "Seattle, Washington, United States" on this room's page) the application will be opened despite being on the same airbnb.com domain.
Is this because the user is on "www.airbnb.com" and the link is just "airbnb.com" (omitting the 'www') and Apple is interpreting this as a separate domain?
The "Seattle, Washington, United States" link you mentioned has a target="_blank" attribute:
<a rel="noopener noreferrer" target="_blank" href="https://airbnb.com/s/Seattle,Washington,United%20States/homes?_ga=2.251994633.1860762053.1606031441-1112301665.1606031441" class="_5twioja">Seattle, Washington, United States</a>
This instructs Safari to open the link in a new tab. Thus, this link escapes the navigation rule, since opening a new Safari tab would behave the same as trying to open that link from non-Safari apps.
If the link wouldn't have that attribute, then it would've been opened in the same Safari instance. So the Apple rules still apply, just that opening a new tab leads to switching to the Airbnb application due to the implicit behaviour if the target attribute.
If you want to be explicit, you can long press the link, and choose "Open in New Tab", this will keep you in Safari too.

What controls user locale when performing handover to phone

I'm currently working on an action using the Actions on Google SDK together with Microsoft's Bot Framework. In this action I've build a fallback that allows the user to enter a product code on their phone if they have failed to do so a couple times through voice. This setup works fine in English, but my action is multi-lingual and supports Dutch and French too.
The problem that I am running into is, when a user is using my action in Dutch or French, when they accept to move the conversation to their phone, the conversation continues in English once it is on my phone. Below you can find an the code I use in my handler.
New Surface handler
endpoint.intent(GoogleIntentTypes.NewSurface, async (conv: ActionsSdkConversation) => {
logger.logDebug("Received new surface request")
const locale = conv.user.locale;
if (conv.arguments!.get('NEW_SURFACE')!.status! === 'OK') {
conv.ask(this.messages.getResponse("AskForProductNumber_SSML", locale));
} else {
conv.close(this.messages.getResponse("EndConversation_SSML", locale));
};
});
From the moment the request enters my webhook, my conversations locale is switched to en-US. This makes me think that the locale is taken from a setting on my phone, but I can't find anything in the docs on this. Does anyone know what could be causing the switch in locale when performing a handover to phone?
My understanding is that the locale is based on the locale of the device that has sent the request.
This page on "languages and locales" (emphasis mine) says:
Locales are constructed using the language set in the Assistant settings and the region set in the device settings. The combination of these needs to form a supported locale. For example, a device set to the BR region and an Assistant device set to en-US results in a en-BR locale, which is not supported by Actions on Google.

iphone "add to home screen" ignores querystring parameters

I have a mobile-friendly web application which I want users to be able to access from a link sent in an email or text. The link will include a querystring parameter specific to that user, which controls what the web site displays. This link might look like this:
https://corpsite/myapplication/?show=578
When the user goes to this URL using safari, the site grabs some information which is correct for the "show=578" parameter and all is good. (Security is not a factor here.) But after the application is installed to the home screen with the "Add to Home Screen" function of the iPhone 8 I am testing with, the URL which opens upon clicking the home screen icon is:
https://corpsite/myapplication/
The querystring information is not preserved! (I ultimately wrote some debugging code that tells me the full URL when the application loads. When I click on the link from an email and go there in Safari, the reported URL includes the querystring. But when I then save that page to the home screen and later click on the home screen icon, the reported URL does not include any querystring information.)
I have added this to the index.html page of the (Angular 5) application, which I thought would be all I would need to do (aside from some icon-related tags):
<meta name="apple-mobile-web-app-capable" content="yes">
How can I make this work from the home screen icon?
I found the source of my problem here:
PWA loses its params and query params after being added to the home screen.
It turns out that I was setting the start_url in my manifest.json file, and that was overriding the value in the browser. I just removed that setting from the manifest.json file, and the phone then used the URL from the browser when saving to the home screen.

Facebook log in page in swift

When I try log in in my application with Facebook, I have page in Safari browser with text: You already have authorization PPFF. Or Are you want to have authorization in PPFF?
Also there is the gear on top of the text instead of the application logo. How I can change gear on my logo and type Application name instead of PPFF?
This has been reported earlier and is by design. This dialog will always show up when you start the login flow for a user that is already logged into your app.
You also can't change the appearance of the dialog unfortunately.
You can find the original report here: https://developers.facebook.com/bugs/1024399197610999/
Thanks.

Browser extension overriding browser functionality / url

Is it possible to create a browser extension which can change where the user is taken?
I.E. If the user puts in a certain prefix or symbol the browser will not attempt to go to the address supposedly determined by the rest of the string or search Google, etc. for the rest of the string?
E.G. YT:sdfs232 would resolve to http://www.youtube.com/watch?v=sdfs232. I'm not specifically looking to do that, it's just an example.
You don't need a new extension or Greasemonkey to do this. Firefox has had this capability for a long time.
Just use a bookmark keyword search.
For example, create a new bookmark:
Press CtrlShiftB to open the bookmark library.
Right-click wherever you want it, and select New Bookmark....
Fill in the Name: Youtube.
Fill in the Location: http://www.youtube.com/watch?v=%s
Note the %s.
Fill in the Keyword: YT.
Fill in the Description: Handy direct shortcut to a video ID.
Give it tags, if you wish.
Click the Add button.
Now you have a handy flexible shortcut.
Test this one by entering YT dQw4w9WgXcQ into the address bar.
See the article for more information.
What your looking for is called a URL Scheme. http, ftp, ssl are all URL Schemes and you can define your own on any platform you want.
This is possible, and is used quite a lot by for example by IPhone apps to launch another iphone app from a browser window when the user clicks on a link. Thats how the iphone jumps from safari to itunes app.
More details here including most common schemes http://en.wikipedia.org/wiki/URI_scheme
This link gives basic info on registering a scheme on windows
http://msdn.microsoft.com/en-us/library/ie/aa767914(v=vs.85).aspx
Ususally they are used to open a seperate application though rather than simply a differnt url, but you could do what you want with a plugin.

Resources