Skip to content

Instantly share code, notes, and snippets.

@brianleejackson
Created February 16, 2026 23:16
Show Gist options
  • Select an option

  • Save brianleejackson/a046baf70c46fb4537add10036d9cff0 to your computer and use it in GitHub Desktop.

Select an option

Save brianleejackson/a046baf70c46fb4537add10036d9cff0 to your computer and use it in GitHub Desktop.
Check for duplicate scripts on a page using Chrome DevTools
// 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