Reputation: 63
I'm building an addon that works on a page where the canvas
element prototype has been modified, this means any new canvas
element I create on the page or in the addon with have the same modified state.
Is there a way to get around this? I tried using eval()
but it also uses the page "version" of the HTMLCanvasElement
.
To get around it in the browser manually I can create an iframe
and execute a script inside it that sets a variable on the parent window which I can then of course .call()
with the context I want, the problem is that WebExtensions doesn't allow access to variables set by page scripts.
Upvotes: 0
Views: 41
Reputation: 63
After some more reading I found out that there's a property called wrappedJSObject
that allows the content script to access properties set by the page script.
More information: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts#Accessing_page_script_objects_from_content_scripts
Upvotes: 0