MediaWiki:Mobile.js: Unterschied zwischen den Versionen

Aus FürthWiki

K
keine Bearbeitungszusammenfassung
(register serviceworker)
Markierungen: Mobile Bearbeitung Mobile Web-Bearbeitung
 
KKeine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
if ('serviceWorker' in navigator) {
if ('serviceWorker' in navigator) {
   window.addEventListener('load', function() {
   window.addEventListener('load', function() {
     navigator.serviceWorker.register('./serviceworker.js').then(function(registration) {
     navigator.serviceWorker.register('/wiki/serviceworker.js').then(function(registration) {
       // Registration was successful
       // Registration was successful
       console.log('ServiceWorker registration successful with scope: ', registration.scope);
       console.log('ServiceWorker registration successful with scope: ', registration.scope);