Created
December 12, 2023 05:09
-
-
Save volkankaban/d7efa3c2f8f3e9c43452c411da1c6036 to your computer and use it in GitHub Desktop.
JavaScript for unregistering service workers in Chrome, Edge, and Firefox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment