Closed hannesj closed 7 years ago
We identify both of those UA identifiers as chrome/34, and do not serve the Intl polyfill. Since we use the useragent npm module for UA identification, we'd need to either recognise it as a separate browser, or alias it to a browser that matches its behaviour more closely.
Seeing same issue:
on Samsung galaxy s6 Android 5.1 using Samsung's "Internet" browser OR Samsung galaxy s3 Android 4.1 using Android's stock "Browser" browser. Intl polyfill doesn't work giving me following error ReferenceError: Intl is not defined
Same problem here with a LG G3: ReferenceError: Intl is not defined
UA: Mozilla/5.0 (Linux; U; Android 5.0; es-sa; LG-D855 Build/LRX21R.A1445306351) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/34.0.1847.118 Mobile Safari/537.36
We had the exact same issue. Samsung Galaxy S6 "Internet" app. UA: Mozilla/5.0 (Linux; Android 5.1.1; SAMSUNG SM-G920F Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.2 Chrome/38.0.2125.102 Mobile Safari/537.36
Apparently useragent@2.1.8
reports this as "Chrome mobile":
> ua.parse('Mozilla/5.0 (Linux; Android 5.1.1; SAMSUNG SM-G920F Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.2 Chrome/38.0.2125.102 Mobile Safari/537.36')
Agent {
family: 'Chrome Mobile',
major: '38',
minor: '0',
patch: '2125',
source: 'Mozilla/5.0 (Linux; Android 5.1.1; SAMSUNG SM-G920F Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.2 Chrome/38.0.2125.102 Mobile Safari/537.36' }
@triblondon however if we look at the device
property on the parsed user agent, we can verify that the "family" contains Samsung
.
> ua.parse('Mozilla/5.0 (Linux; Android 5.1.1; SAMSUNG SM-G920F Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.2 Chrome/38.0.2125.102 Mobile Safari/537.36').device
Device {
family: 'Samsung $2',
major: 'S
Maybe we could recognise this case as a separate browser and call it SamsungBrowser?
Sorry, this will already be solved by https://github.com/ua-parser/uap-core/pull/123. Then we just need to treat that new family.
The useragent module can now detect Samsung, we need to update the module in our project and add Samsung into the config.json
files for the polyfill/s in question.
I am still having the same issue on a LG G3 and several other Android smartphones using the stock browser.
this is one of user agents: Mozilla/5.0 (Linux; U; Android 5.0; en-gb; LG-D855/V21a Build/LRX21R.A1446038723) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/34.0.1847.118 Mobile Safari/537.36. So it is recognized as Chrome 34 but it is actually the stock browser. Anyone still having this issue?
@bonimba Could you make a new issue for that please? I don't think it is to do with Samsung browsers, looking at the useragent it does look like a Chrome useragent.
Same problem here (galaxy s6 edge default Browser).
I'm using this cdn:<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.en"></script>
There is a PR for this functionality but it is on hold until we get support from Samsung to own that part of the effort -- https://github.com/Financial-Times/polyfill-service/pull/671
The UA referenced in this issue is now being recognised as samsung internet/2.1.0
. If someone can figure out the closest alias for this in the families that we support, then we could do something there. An imperfect but reasonable starting point would be to alias samsung internet
to early versions of Chrome, which would mean potentially serving unnecessary polyfills, but false positives here are much less important than false negatives. And aliasing is cheap. Maintaining a whole new family is expensive.
Take a look at https://github.com/Financial-Times/polyfill-service/blob/master/lib/UA.js#L45.
Would it make sense to alias it to older versions of the stock Android browser instead of Chrome? It seems like that could be a closer match based on my experience with the two.
The current version of Samsung browser is a fork of Chromium 44. So Chrome would be a good match.
Ah that's good to know - thanks. For some reason I had assumed it was a fork of the stock Android browser.
@AdaRoseEdwards Problem is Chrome has had Intl since 22 (http://caniuse.com/#search=intl), so maybe the SS fork removed support for Intl, somehow? Anyway basically the solution is simply to choose a sufficiently old version of Chrome.
@torgo do you think we could get some official determination on this from Samsung as a stopgap until we have proper support data? It's very simple for us to say 'treat version X of SB as an alias of version Y of Chrome', and it adds no maintenance overhead, so if there's a version combination of Chrome and SB where SB's featureset is a superset of Chrome's, we can use that for now and the only issue is that we will over-polyfill Samsung.
I really want to fix this as we have a fair number of people reporting it. I'll put this out as a suggestion:
samsung internet/2.1.0 == chrome/21
WDYT?
@triblondon Samsung Browser is a fork of Chromium but the they add features on their own.
The latest version supports Service Workers although it is based on Chromium 44. On the other hand it doesn't have Object.assign which Chromium 44 has.
samsung internet/2.1.0 == chrome/21 seems like a good idea, although each version should be matched with a different chrome version.
samsung internet/4.0 == chrome/43 maybe
I believe this is solved by https://github.com/Financial-Times/polyfill-service/pull/783
@JakeChampion, only for version 4 and up. We are still seeing quite a lot of v2.1 and v3 in the wild.
Samsung versions less than 4 get identified as versions of Chrome instead of Samsung Internet. But unlike chrome don't include the Intl support. Would it be Possible to add Intl to chrome <=34?
I think we can instead opt to do some custom aliasing work like we have for Facebook's In-App browser #775
if we identify the browser as chrome already an alias won't help, as we'd be changing the targeting for chrome as well. The solution is either to submit a PR to the ua-core project (if those early versions have any distinguishing characteristics in the UA at all), to make them distinguishable, or serve Intl to chrome < 34. I'm reluctant to do that because it's a large polyfill and Chrome doesn't need it after 24.
That said, serving it to an extra ten versions of Chrome that virtually no-one actually uses (due to auto-update) is not really a big deal...
Why are there so many Samsung 2.1s in the wild? Does Samsung have an auto-update mechanism?
@triblondon No they do not, this is the native Samsung browser so it is only updated when the phone is updated. At least for all the old versions.
Since Chrome < 34 has no real market share except for these forks, serving Intl to this seems like a pragmatic solution to this problem.
Mozilla/5.0 (Linux; Android 5.1.1; SAMSUNG SM-G800F Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.3 Chrome/38.0.2125.102 Mobile Safari/537.36
seems to be correctly identified as samsung_mob/3.3.0
according to https://cdn.polyfill.io/v2/polyfill.js?features=Intl&ua=Mozilla/5.0%20(Linux;%20Android%205.1.1;%20SAMSUNG%20SM-G800F%20Build/LMY47X)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20SamsungBrowser/3.3%20Chrome/38.0.2125.102%20Mobile%20Safari/537.36, but unfortunately it is still not being served the Intl polyfill. Any ideas how to resolve that?
Add the option unknown=polyfill.
PR for this --> https://github.com/Financial-Times/polyfill-service/pull/1028
I've noticed that for both user agents below, we don't supply the Intl polyfill, even tough it would be needed, as we see
Intl is not defined
errors from them.Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-G850F Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.1 Chrome/34.0.1847.76 Mobile Safari/537.36
Mozilla/5.0 (Linux; Android 5.0; SAMSUNG SM-G900F Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.1 Chrome/34.0.1847.76 Mobile Safari/537.36