Is it possible to have arguments in callbacks sent to a exported function

Manuel Reimer manuel.reimer at gmx.de
Sat Aug 5 08:28:44 UTC 2017


Hello,

in my WebExtension, I export a function from "content script" to the 
page javascript like so:


function Test(aCallback) {
   var my_return = {test: "test"};
   aCallback(my_return);
}
exportFunction(Test, window, {defineAs: "my_addon_test"});


I export a function and this function is expected to get a callback 
function from page javascript. I want to pass a javascript object as 
parameter to this callback.

If I try to do so, I get the following in browser console as soon as I 
try to access the javascript object from my page script:


Permission denied to access property Symbol.toPrimitive


Is there any *secure* way to do what I need? Is there any way to pass a 
parameter to such callback functions?

Thanks in advance

Manuel


More information about the Dev-addons mailing list