Skip to content
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

Skip installation of service worker from post embed iframe #182

Merged
merged 2 commits into from
Jul 1, 2019

Conversation

westonruter
Copy link
Collaborator

Skip installing service worker from context of post embed iframe, as the post embed iframe does not need the service worker. Also, installation via post embed iframe could be seen to be somewhat sneaky. Lastly, if the post embed is on the same site and contained iframe is sandbox without allow-same-origin, then the service worker will fail to install with an exception:

Uncaught DOMException: Failed to read the 'serviceWorker' property from 'Navigator': Service worker is disabled because the context is sandboxed and lacks the 'allow-same-origin' flag.

Screen Shot 2019-06-30 at 18 33 54

This PR also moves SW installation from the head to the footer.

@westonruter westonruter merged commit b0dcc2d into master Jul 1, 2019
@westonruter westonruter deleted the fix/post-embed-iframe-sw-install branch July 1, 2019 16:09
@westonruter westonruter added this to the 0.3 milestone Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants