-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Samsung device variant user agent strings often fail to precisely match DPDB entry #332
Samsung device variant user agent strings often fail to precisely match DPDB entry #332
Comments
I like this idea. We could just alter this line in CardboardVRDisplay to be more lenient for Samsung devices specifically, or modify the current DPDB data. I'm not terribly familiar with the Samsung UA naming convention, but seems like it'd be safer to update the cardboard-vr-display |
Samsung would benefit from a special case of handling their multiple resolutions as well, so it wouldn't be out of question to have the cardboard-vr-display special case Samsung UA's. Related issue: immersive-web/webvr-polyfill-dpdb#37 |
Oops, the above issue seems identical to this request; the multiple resolution issue is here: immersive-web/cardboard-vr-display#7 (the downside of having 4 interconnected repos) |
I agree that that's safer than adding DPDB entries - it seems best to have a prototypical entry for each Samsung hardware model. By way of example, just the variants of the Galaxy S8 hardware outnumber the stars:
But it's clear the common prefix for a hardware model is
Thoughts? |
@jsantell Okay, two options, both tested and working great on my Galaxy S8:
2: Genericize the DPDB entry for all Samsung devices, e.g.: I'd vote for 1, because 2 relies on every entry in the database following this (rather unintuitive) pattern. With 1, anytime we find a device with strange naming, we can catch the entire class of devices in a single line. |
@naftalibeder looks good to me! Do you want to send a PR to cardboard-vr-display, or I can check it out? I've been looking at general Samsung device model schemes (https://forum.xda-developers.com/wiki/Samsung/Model_naming_scheme, https://en.wikipedia.org/wiki/Samsung_Galaxy#Model_numbers) to see about other Samsung devices that would benefit from this as well, but think the |
This is still an issue. |
@jsantell I'm sorry, I forgot to reply to this! Would you mind doing the update with that line if you get a chance? @JacobHegwood In the meantime you can add the line noted in my comment above to your code locally. Also note that Samsung devices need to be set to the highest resolution in order to be detected, per this issue. |
@naftalibeder thanks for the update! i'll start pushing the changes upstream over the next few days |
Yes, I can confirm this is a fix. I ran it on my server and it works just fine for galaxy s8. |
Per issue 37 in the DPDB repo, Samsung devices in particular seem to generate a large variety of user agent string suffixes, which makes it likely an arbitrary device will fail to match against the database entry, even if the hardware model's specs are available.
As marshworks suggested in the above issue, it looks like omitting the trailing character (and the following digit, if any) at the end of the string, when executing
matchRule_()
, would still produce a 1:1 map of hardware to spec.So, if given the user agent
SM-G950U1
for the Samsung Galaxy S8, the polyfill would only checkSM-G950
, which would correctly matchSM-G950F
in the database.Would this have any repercussions I'm not considering? It would solve what seems to be a pretty common problem.
The text was updated successfully, but these errors were encountered: