Created
August 31, 2011 14:19
-
-
Save pocotan001/1183656 to your computer and use it in GitHub Desktop.
ブックマークレット: グローバル変数を一覧(alert,consoleに出力)
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
javascript:(function(){var d=document,f=d.createElement('iframe'),b=d.body,o={0:1,getInterface:1,GetWeakReference:1,console:1,loadFirebugConsole:1,_createFirebugConsole:1,_firebug:1,_FirebugCommandLine:1},c=typeof this.console!='undefined',r='';f.src=d.URL+'?';b.appendChild(f);var w=f.contentWindow;for(var i in this){if(!(i in w)&&!o[i]&&!/^script\d{13}$/.test(i)){r+=i+'\n';if(c)console.log(i+':',this[i]);}}b.removeChild(f);alert(r);})(); | |
// Uncompressed | |
javascript: | |
(function(){ | |
var d = document, | |
f = d.createElement('iframe'), | |
b = d.body, | |
o = { | |
0: 1, | |
getInterface: 1, | |
GetWeakReference: 1, | |
console: 1, | |
loadFirebugConsole: 1, | |
_createFirebugConsole: 1, | |
_firebug: 1, | |
_FirebugCommandLine: 1 | |
}, | |
c = typeof this.console != 'undefined', | |
r = ''; | |
f.src = d.URL + '?'; | |
b.appendChild(f); | |
var w = f.contentWindow; | |
for(var i in this){ | |
if(!(i in w) && !o[i] && !/^script\d{13}$/.test(i)){ | |
r += i + '\n'; | |
if(c) console.log(i + ':', this[i]); | |
} | |
} | |
b.removeChild(f); | |
alert(r); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment