Created
February 16, 2026 23:16
-
-
Save brianleejackson/a046baf70c46fb4537add10036d9cff0 to your computer and use it in GitHub Desktop.
Check for duplicate scripts on a page using Chrome DevTools
This file contains hidden or 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
| // Paste into Chrome DevTools console | |
| var scripts = document.getElementsByTagName('script'); | |
| var srcList = []; | |
| for (var i = 0; i < scripts.length; i++) { | |
| if (scripts[i].src) srcList.push(scripts[i].src.split('?')[0]); | |
| } | |
| var duplicates = srcList.filter((item, index) => srcList.indexOf(item) !== index); | |
| console.log("Duplicate Scripts Found:", duplicates.length ? duplicates : "None!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment