Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@parsingphase parsingphase commented Jul 22, 2016

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
You can’t perform that action at this time.