Skip to content

Instantly share code, notes, and snippets.

@parsingphase
Last active July 22, 2016 10:22
Show Gist options
  • Save parsingphase/53756c9d32f7cfcbcb9bba788f26e013 to your computer and use it in GitHub Desktop.
Save parsingphase/53756c9d32f7cfcbcb9bba788f26e013 to your computer and use it in GitHub Desktop.
List script tags bookmarklet
javascript:(function () { var ss = [], sc = {}, dc = 0, hs = false; $("script[src]").each(function (i, tag) { var s = $(tag).attr('src'); if (!sc.hasOwnProperty(s)) { sc[s] = 0; } sc[s]++; ss.push(s); }); console.log(ss.length + ' script tags present on ' + document.URL + " \n\n" + ss.sort().join("\n")); for (var i in sc) { if (sc.hasOwnProperty(i)) { if (sc[i] > 1) { if (!hs) { console.log('** Duplicates: **'); hs = true; } dc++; console.log(i + ' seen ' + sc[i] + ' times'); } } } window.alert(ss.length + ' script URLs listed in console including ' + dc + ' duplicates');})();
@parsingphase
Copy link
Author

To use this - create a bookmark in your browser; set the name to "List script tags" and the URL to the raw content of the script above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment