MediaWiki:Mobile.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(register serviceworker) Markierungen: Mobile Bearbeitung Mobile Web-Bearbeitung |
(kein Unterschied)
|
Version vom 11. September 2017, 17:34 Uhr
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('./serviceworker.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
});
}