Repository navigation
Fix postMessage_ when Safari empties document.referrer - #117
Open
marco-n-dream wants to merge 2 commits into
Open
marco-n-dream wants to merge 2 commits into
marco-n-dream wants to merge 2 commits into
Conversation
Safari's privacy protections return an empty document.referrer when the referrer's site differs from the frame's origin, as in sandboxed or cross-site game frames. postMessage(data, "") throws, so 'ready' never reached the platform and the screen stayed on its loader. Fall back to the parent's origin from location.ancestorOrigins; without one, keep the old throw-and-log path.
Contributor
|
Technically LGTM but 2 points need to be addressed
And note: if this is merged, it requires the next airconsole-appengine to update the submodule. normally the one updating the api has to take care of that as no PR can be merged without adopting the update to api (git submodules master up to date requirement) |
Same change as 03a562c for the deprecated bundles that games still load. They get no spec; coverage stays on 1.11.0 and later.
Author
|
Thanks Marc.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Safari's privacy protections return an empty
document.referrerin sandboxed or cross-site game frames (WebKitDocument::referrerForBindings).postMessage_passes it astargetOrigin, sopostMessagethrows, the game'sreadynever reaches the screen, and the screen stays on its loader. Seen on a Safari screen with a custom-URL game served with a CSPsandboxheader.postMessage_inairconsole-1.11.0.js(in place),beta/airconsole-1.12.0.jsanddeprecated/airconsole-1.7.0.jsto1.10.0: with an empty referrer it targetslocation.ancestorOrigins[0], the parent's origin; without one,""keeps the old throw-and-log path.readyat the parent; it runs in the 1.11.0 and 1.12.0 runners.Testing:
npx playwright test --project Chromium7/7 passed, locally and in CI; with the two bundle changes reverted the new spec fails in both runners; both runners pass in Playwright WebKit.Out of scope: bumping the
airconsole-apisubmodule in airconsole-appengine, which is what serves these files.