-
Notifications
You must be signed in to change notification settings - Fork 44
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
Detection of "credentialless" vs "require-corp" backwards #20
Comments
Ah.. thank you for sharing your findings - this looks like a bug introduced in #13 I have not tested this in various browsers, so I didn't run into this myself. Could you perhaps make a PR with the required changes? I'm happy to then test them in a few relevant browsers in BrowserStack. |
As far as I can see, Firefox doesn't support Moreover, nobody should rely on We should not detect browsers by ourselves. Therefore, That said, it can be configured anyway. |
Firefox does have support for Here is the patch from about a year ago: ... and the note on support from version 104: At the moment, this does require enrolling in an origin trial, which is done easily just as it was for Chrome -- it is what I am not sure there is a universal solution to this, given the current state of browsers :-/ It could be that manual configuration remains the best, as you well pointed out. Having That being said, fully agreed on the |
Thanks for the information! I'll try registering for the origin trial if I need credentialless. So the lowest-hanging fruit at the moment may look like // You can enable credentialless on Firefox if you use "origin-trial" (https://wiki.mozilla.org/Origin_Trials)
// but non-Chromium browsers are basically unable to handle credentialless.
coepCredentialless: () => navigator.userAgentData?.brands?.some((b) => b.brand == "Chromium") |
Re-opening this issue, as I think there is space to improve the detection of user agents that support or don't support credentialless |
If you want to try a diff, see master...tamo:coi-serviceworker:coep-ua-brand Update: Firefox 119 seems to support credentialless now. But it doesn't have userAgentData. |
The current code contains the following lines in
coi-serviceworker.js
:and
According to this logic, it says "if the browser it NOT (Chrome or Firefox), then add 'credentialless', otherwise add 'require-corp'"
However, the state of support is exactly backwards -- those are the only browsers that actually can use 'credentialless', and others (such as Safari) break when using it.
Testing with a Godot 4 app in Safari 16.5 reveals this exact behaviour -- with the current file the app is broken and we see this in the headers:
The simple change of removing the "!" from line 67 results in the app loading (after clearing caches) and this in the headers:
Testing the same in Chrome results in it also switching to "require-corp" but working nonetheless, since it supports both versions, however it appears the actual check at line 67 is not working as intended (the result when "true" is not a boolean but the actual "window.chrome" object!). Maybe this would work better?
Perhaps a more thorough review of the logic here should be conducted since the variable is used in other parts of the code as well.
The text was updated successfully, but these errors were encountered: