Skip to content

Instantly share code, notes, and snippets.

@Griever
Created May 23, 2009 08:36
Show Gist options
  • Save Griever/116550 to your computer and use it in GitHub Desktop.
Save Griever/116550 to your computer and use it in GitHub Desktop.
Jetpack のスクリプト内で this のプロパティを for in で取得してみた
/*
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