Created
September 6, 2012 14:47
-
-
Save christopherscott/3657011 to your computer and use it in GitHub Desktop.
Grep through document source
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
(function() { | |
// change this REGEXP to whatever you need | |
var PATTERN = /<title>(.*)<\/title>/g; | |
var message = '', | |
results = document.documentElement.innerHTML.match(PATTERN); | |
message = ((results && results.length) ? results.join('\n') : 'Not found.'); | |
window.alert(message); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the base; TODO: remove 'param' stuff, generalize