Created
March 15, 2012 19:45
-
-
Save gavinuhma/2046392 to your computer and use it in GitHub Desktop.
A quick bookmarklet to find all of the secure domains on a page.
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
var els = document.getElementsByTagName('*'); var REGEX = /^https:\/\/([^/]+)\//; var urls = {}; for (var i in els) { var el = els[i]; var url = el.href || el.src || el.action; if (REGEX.test(url)) { urls[url.match(REGEX)[1]] = true; } } for (var url in urls) { console.log(url); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment