You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I stumbled upon this PR which enables accessing the execution context of content scripts (injected by extensions). It's great, I cherry pick that commit into my fork of master and I'm now able to call myContentScriptExecutionContext.evaluate and access globally exposed
functions from there.
But you decided to revert that (via this PR).
So my question is, is there an official way of doing this as of now?
Thanks again for your hard work on puppeteer.
The text was updated successfully, but these errors were encountered:
If anyone else is wondering how to do this, you can look at this forked branch. I've been using this for my project (direct reference to that branch in my package.json) and it works fine for my needs.
The following snippet allows accessing data from the content script's execution context:
letcontentScriptExecutionHandler=(()=>Array.from(page.executionContexts().values()).find(ec=>ec.name()==='MY_EXTENSION_NAME'))();constdataFromContentScript=awaitcontentScriptExecutionHandler.evaluate(()=>window.my_content_script_variable);// set in the content script
I stumbled upon this PR which enables accessing the execution context of content scripts (injected by extensions). It's great, I cherry pick that commit into my fork of master and I'm now able to call myContentScriptExecutionContext.evaluate and access globally exposed
functions from there.
Hey !
I stumbled upon this PR which enables accessing the execution context of content scripts (injected by extensions). It's great, I cherry pick that commit into my fork of master and I'm now able to call
myContentScriptExecutionContext.evaluate
and access globally exposedfunctions from there.
But you decided to revert that (via this PR).
So my question is, is there an official way of doing this as of now?
Thanks again for your hard work on puppeteer.
The text was updated successfully, but these errors were encountered: