Say a webpage has a function like:
function abc (){
return 'abc';
}
How would I execute and receive the return value of that function from my extension? I've tried this, no dice:
var s = getBrowser.contentWindow.abc();
Thanks in advance!
Say a webpage has a function like:
function abc (){
return 'abc';
}
How would I execute and receive the return value of that function from my extension? I've tried this, no dice:
var s = getBrowser.contentWindow.abc();
Thanks in advance!
I think I've solved my own problem with:
getBrowser().contentWindow.wrappedJSObject.funcFromPage();
I think that if you want to do this without major security holes, you need to be using XPCSafeJSObjectWrapper, but I'm having trouble finding good documentation on it. https://developer.mozilla.org/en/XPConnect_wrappers has a little bit. (It might be that it happens automatically when doing the above, but I'm not sure.)