Skip to content

Instantly share code, notes, and snippets.

@dpnishant
Last active August 29, 2015 14:06
Show Gist options
  • Save dpnishant/db3efbc9b1f3ab986c40 to your computer and use it in GitHub Desktop.
Save dpnishant/db3efbc9b1f3ab986c40 to your computer and use it in GitHub Desktop.
if(location.href.match(/^https:\/\//gi)) {
var DOM = document.head.innerHTML.toString() + document.body.innerHTML.toString();
var http_urls = DOM.match(/http:\/\/[^\"\'\s]*/gi);
if(http_urls) {
for(var i=http_urls.length-1;i>=0;i--) {
if (http_urls[i] !== 'http://') {
if (http_urls[i].slice(-3).match(/png|jpg|gif|css|\.js|swf|mp4|svg/gi))
document.write(http_urls[i] + '<br/><br/>');
}
}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment