i'm trying to call an async function defined in my extension from a webpage and print the returned value of this function, but i get "Error: Permission denied to access property "then""
(if i do it with a non async function i still get a Permission denied error).
My extension :
let ethereum = new window.Object();
let request = async function () {
console.log("request");
return ["0x00"]; }
exportFunction(request, ethereum, {
defineAs: "request" });
window.wrappedJSObject.ethereum = ethereum;
My webpage :
const address = await ethereum.request();
The console.log("request")
works.
I think I need to Wrap the returned variable or something but can't find what....
Thanks in advance !