Closed braco closed 12 years ago
All content scripts are sandboxed. If you want to include external script, you should use kango.xhr + eval.
@kadot, why not expose a reference between the sandbox and main context?
Firefox 15 throws this warning:
Exposing chrome JS objects to content without __exposedProps__ is insecure and deprecated. See https://developer.mozilla.org/en/XPConnect_wrappers for more information. @ chrome://[...]/content/kango/lang.js:50
when accessing data.response here:
kango.xhr.send(details, function(data) {
console.log(data.response);
https://developer.mozilla.org/en-US/docs/XPConnect_wrappers#__exposedProps__
if script DOM injection doesnt work and something like unsafeWindow isnt exposed, it would be very nice if there was a built in way to load external scripts without a hassle. this could be used for google-hosted jquery and whatever else the user needs. xhr won't cache, will it?
For anyone finding this thread in the future, the context still needs to be passed in:
kango.xhr.send.call(this, details, function(data) {
eval(data.response);
});
which seems to (??) eliminate the Firefox warning above.
exposedProps issue fixed in v 0.9.9
why not expose a reference between the sandbox and main context?
Technical limitation of Chrome, Safari and Opera.
content.js:
external_script.js:
output:
any idea whats going on?