You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
We want the page to be reloaded. But then when clicking the notification, the browser can not find the tab (because it was replaced) and will open a new one at /.
Options:
remove Notifications
dont make reload
...?
The text was updated successfully, but these errors were encountered:
<!DOCTYPE html><html><body><buttononclick="mybutton()">Focus a Window OR Open</button><scripttype="text/javascript">functionregisterServiceWorker(){returnnavigator.serviceWorker.register('service-worker.js').then(function(registration){console.log('Service worker successfully registered.');returnregistration;}).catch(function(err){console.error('Unable to register service worker.',err);});}window.addEventListener('load',function(){returnregisterServiceWorker().then(function(registration){window.registration=registrationnavigator.serviceWorker.addEventListener('message',function(event){console.log('Received a message from service worker: ',event.data);});})})functionmybutton(){constoptions={body: 'Clicking on this notification will focus on an open window '+'otherwise open a new one.',tag: 'focus-window'};registration.showNotification('Focus or Open a Window',options);};</script></body></html>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We want the page to be reloaded. But then when clicking the notification, the browser can not find the tab (because it was replaced) and will open a new one at /.
Options:
The text was updated successfully, but these errors were encountered: