Skip to content

Instantly share code, notes, and snippets.

@gavinuhma
Created March 15, 2012 19:45
Show Gist options
  • Save gavinuhma/2046392 to your computer and use it in GitHub Desktop.
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.
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