Created
May 23, 2009 08:36
-
-
Save Griever/116550 to your computer and use it in GitHub Desktop.
Jetpack のスクリプト内で this のプロパティを for in で取得してみた
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
/* | |
jetpack.tabs.focused.contentWindow.alert(this);//[object Sandbox] | |
for (var n in this) | |
*/ | |
{ | |
location : file:///C:/test.js, | |
console : [object Object], | |
$ : function (selector, context) { | |
return new (jQuery.fn.init)(selector, context); | |
}, | |
jQuery : function (selector, context) { | |
return new (jQuery.fn.init)(selector, context); | |
}, | |
jetpack : [object Object], | |
setInterval : function (cb, ms) { | |
function cbWrapper() { | |
cb(); | |
} | |
var id = impl.setInterval(cbWrapper, ms); | |
intervals[id] = cbWrapper; | |
return id; | |
}, | |
clearInterval : function (id) { | |
if (id in intervals) { | |
delete intervals[id]; | |
impl.clearInterval(id); | |
} | |
}, | |
setTimeout : function (cb, ms) { | |
function cbWrapper() { | |
delete timeouts[id]; | |
cb(); | |
} | |
var id = impl.setTimeout(cbWrapper, ms); | |
timeouts[id] = cbWrapper; | |
return id; | |
}, | |
clearTimeout : function (id) { | |
if (id in timeouts) { | |
delete timeouts[id]; | |
impl.clearTimeout(id); | |
} | |
}, | |
addStatusBarPanel : function () { | |
throw new Error("addStatusBarPanel() has been moved to Jetpack.statusBar.append()."); | |
}, | |
Jetpack : [object Object] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment