Tryng to set web notifications, but

I am trying to implement web notifications by taking advantage of the tutorial at, yet, as you may see at my test page the initial script stops receiving a 404 error when fetching some script.

There is no 404 error. That test page is requesting notifications… IF your browser allows them to. For Firefox, you will see a little speech bubble appear between the lock and your URL. In Chrome it may block notifications altogether (check in Settings > Privacy and Security > Site Settings > Notifications). I think in Chrome it might be set to auto block and you have a toggle to enable sites to send notifications.


Chrome Setting…

Good luck


At any rate I restored the page with several error message and Safari reported push manager error:

if ("serviceWorker" in navigator) {

  if ("PushManager" in window) {

    navigator.serviceWorker.register("ServiceWorker.js").then(function(registration) {



    .catch(function() {

      console.log("catched error");


  } else {

    console.log("Push manager error");


} else {

  console.log("serviceWorker error");


while on chrome there is still the 404 error on catch error and no bubble anywhere.
And as you may see at:
my notifications settings seem ok.

On Chrome I still receive:

A bad HTTP response code (404) was received when fetching the script.
As you may check at the given url.

I tried a different implementation and I got:

if ('serviceWorker' in navigator) {
  // then register our service worker
    .then(reg => {
      // display a success message
      console.log(`Service Worker Registration (Scope: ${reg.scope})`);
    .catch(error => {
      // display an error message
      let msg = `Service Worker Error (${error})`;
      // display a warning dialog (using Sweet Alert 2)
} else {
  // happens when the app isn't served over a TLS connection (HTTPS)
  // or if the browser doesn't support service workers
  console.warn('Service Worker not available');

Service Worker Error (TypeError: Failed to register a ServiceWorker for scope (‘’) with script (‘’): A bad HTTP response code (404) was received when fetching the script.

Ok, the issue boiled to the need to insert an empty file with the referenced name. Now I get to error.