-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return data from sandbox to background #5
Comments
You can directly execute puppeteer script in background using puppeteer-extension-transport package. Checkout this example |
Hey @gajananpp, I can't. I've already made ability tu run puppeteer in extension with both ways - with remote debugging port and chrome.debugger api. Everything worked fine till moment i needed to run puppeteer scripts that are fetched from external source. I have that as Manifest v3 made it all so hard to achieve... I need sandbox to be able to use eval, sandbox has to be iframed, so i've placed it in popup (it can be popup or devtools panel as You did) and when "task" starts i'm opening popup in minimized window and only then communication is possible. But still background talks with popup, popup talks with sandbox via postMessage api, then sandbox when job is done tells about result to popup so it can send message via runtime to backend and it can finish externalMessage event. I hope google will not leave manifest in such awful situation till manifest v2 deprecation occur 👍 |
@bestplay9384, yes creating or migrating to v3 extension is really difficult if it involves working with https://github.com/gajananpp/puppeteer-ide-extension/blob/main/src/background.ts#L129-L133 |
Hey,
As far as i understand from source only CDP Events are passed to background from sandbox. Is there any way to return some gathered data to background then?
I'm trying to make an extension that can be invoked by externalMessage so it can be received in background only. That is why i'm trying to find out if result of puppeteer script can be passed with simple return, other than passing data via console.log or something :)
The text was updated successfully, but these errors were encountered: