Don't use the SW when in an iFrame.

This is cheap sandstorm detection. I need a better way but this works for now.
This commit is contained in:
Timothy Farrell 2018-01-04 08:22:26 -06:00
parent 923320bb11
commit d84e756ac4

View File

@ -20,7 +20,7 @@ function go() {
router.start('home');
}
if ('serviceWorker' in navigator) {
if ('serviceWorker' in navigator && window.top === window) {
navigator.serviceWorker
.register('/assets/sw.bundle.js', { scope: '/' })
.then(go)