Skip to content

Instantly share code, notes, and snippets.

@volkankaban
Created December 12, 2023 05:09
Show Gist options
  • Select an option

  • Save volkankaban/d7efa3c2f8f3e9c43452c411da1c6036 to your computer and use it in GitHub Desktop.

Select an option

Save volkankaban/d7efa3c2f8f3e9c43452c411da1c6036 to your computer and use it in GitHub Desktop.

Revisions

  1. volkankaban created this gist Dec 12, 2023.
    14 changes: 14 additions & 0 deletions unregisterServiceWorkers.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    // Function to unregister all installed service workers in Chrome, Edge, and Firefox
    function unregisterServiceWorkers() {
    // Select all elements with the class 'unregister'
    const unregisterButtons = document.querySelectorAll('.unregister');

    // Simulate a click on each button to unregister service workers
    unregisterButtons.forEach(button => button.click());
    }

    // Call the function to unregister service workers
    unregisterServiceWorkers();

    // To stop the process of unregistering, simply comment or remove the function call
    // unregisterServiceWorkers();