Open FloppyKing opened 4 years ago
related project for checking client side that has afflicted UA strings in the code for reference https://github.com/linsight/should-send-same-site-none/blob/master/index.test.js
Thanks, @FloppyKing. I would accept a pull request for this. :)
i'll have to poke around in the inner workings of BrowserDetect.pm and figure out how to create pull requests later when i get more time, but just leaving this here for now as a "rough sketch" of sorts for myself to look at later, or perhaps for someone else to reference that may already be versed in the ways of github
if(
## IOS 12
(oS() eq 'ios' && os_major()==12)
## Mac OS version 10.14 safari or embedded browser
|| ((oS() eq 'macosx' && os_major()==10 && os_minor()==14)
&& (browser() eq 'safari' || ### NOT SURE, SEE isMacEmbeddedBrowser ###))
## UC Browser < 12.13.2
|| ($browser eq 'ucbrowser'
&& (browser_version() < 12.13 || (browser_version() == 12.13 && browser_beta() < 2)))
## Chrome versions from 51 to 66
|| (chrome() && browser_major() >= 51 && browser_major() <= 66)
) { return true;}
else { return false;}
### CODE REFERENCED ABOVE FROM GOOGLE THAT I'M NOT SURE
### HOW TO CHECK FOR SINCE I'M NOT SURE WHAT DEFINES AN
### EMBEDDED BROWSER FOR MAC OS
bool isMacEmbeddedBrowser(string useragent):
string regex = "^Mozilla\/[\.\d]+ \(Macintosh;.*Mac OS X [_\d]+\) "
+ "AppleWebKit\/[\.\d]+ \(KHTML, like Gecko\)$"
return useragent.regexContains(regex)
Great, thanks for sharing this. 👍 If GitHub is the blocker, I'd accept a plain old patch too. We'd just need some appropriate tests to accompany any new code.
With google now changing the default behavior of cross-site accessible cookies and forcing us to include SameSite=None property it would be beneficial to have a short-hand method for checking for browsers that are incompatible with the None value of the SameSite cookie property.
For further explanation see https://web.dev/samesite-cookies-explained/ or https://blog.chromium.org/2019/10/developers-get-ready-for-new.html
According to google the incompatible clients include the below