Minor cleanup

This commit is contained in:
Luke Towers 2019-10-09 09:44:24 -06:00
parent 07d74ebb1b
commit fa002ce3dd
2 changed files with 22 additions and 20 deletions

View File

@ -56,15 +56,16 @@
/* Only run on HTTPS connections
* Block off Front-end Service Worker from running in the Backend allowing security injections, see GitHub #4384
*/
if (location.protocol === 'https:') {
// Unregister all service workers before signing in to prevent cache issues, see github issue: #3707
navigator.serviceWorker.getRegistrations().then(
function(registrations) {
for (let registration of registrations) {
registration.unregister();
}
});
}
if (location.protocol === 'https:') {
// Unregister all service workers before signing in to prevent cache issues, see github issue: #3707
navigator.serviceWorker.getRegistrations().then(
function(registrations) {
for (let registration of registrations) {
registration.unregister();
}
}
);
}
</script>
<?php endif; ?>

View File

@ -41,17 +41,18 @@
<script>
"use strict";
/* Only run on HTTPS connections
* Block off Front-end Service Worker from running in the Backend allowing security injections, see GitHub #4384
*/
if (location.protocol === 'https:') {
// Unregister all service workers before signing in to prevent cache issues, see github issue: #3707
navigator.serviceWorker.getRegistrations().then(
function(registrations) {
for (let registration of registrations) {
registration.unregister();
}
});
}
* Block off Front-end Service Worker from running in the Backend allowing security injections, see GitHub #4384
*/
if (location.protocol === 'https:') {
// Unregister all service workers before signing in to prevent cache issues, see github issue: #3707
navigator.serviceWorker.getRegistrations().then(
function(registrations) {
for (let registration of registrations) {
registration.unregister();
}
}
);
}
</script>
<?php endif; ?>