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
Feature request: create isolated world #2671
Comments
@furstenheim this is interesting. Can you please share your usecase? |
@aslushnikov I'm using it webscraper-headless https://github.com/geoblink/web-scraper-chrome-extension To scrape on the server what I'm doing is opening a new context as in the snippet and injecting the code of the extension there. |
@furstenheim this looks very reasonable; once #2812 lands we'll add this one as well. |
I'd be happy to review a PR! Please make sure to add reference to https://developer.chrome.com/extensions/content_scripts when explaining isolated worlds in documentation. |
Implementes puppeteer#2671. Add documentation
Implements puppeteer#2671. PR improvements
(cross-posting from #2829 (comment)) I've played with this for a while. A few observations:
In order to have this, we need to support "persistent" isolated worlds on the protocol level. It will be also nice to support This will make a complete story around isolated worlds. With this level of isolation, things like #609 will be automatically addressed from the user-land. |
This roll includes: - https://crrev.com/593256 - Support fetching missing intermediate certificates in headless - https://crrev.com/594161 - DevTools: allow addScriptToEvaluateOnNewDocument accept optional worldName parameter. References puppeteer#2671. Fixes puppeteer#2377.
This roll includes: - https://crrev.com/593256 - Support fetching missing intermediate certificates in headless - https://crrev.com/594161 - DevTools: allow addScriptToEvaluateOnNewDocument accept optional worldName parameter. References #2671. Fixes #2377.
Once we have isolated worlds, we should push certain PPTR functions to the clean isolated world. |
yep, having issues as well running code on websites that override globals, have badly implemented polyfills, run mootools/protoype.js,... await page.createIsolatedWorld().evaluate(...) |
Hi @aslushnikov could you share the plan that when will you fix this issue? We still have the page.select() issue #3327 when we are writing automation scripts. |
This patch splits out `IsolatedWorld` class from Frame. The `IsolatedWorld` abstraction is an execution context with a designated set of DOM wrappers. References puppeteer#2671
This patch splits out `IsolatedWorld` class from Frame. The `IsolatedWorld` abstraction is an execution context with a designated set of DOM wrappers. References #2671
I'd like to create an isolated context to execute some js in the same website I'm visiting without polluting the main context. It is possible right now, but it requires to access a lot of internal methods:
It would be nice if puppeteer exposed this as a method. Something like: page.createNewIsolatedContext
If necessary I could write up the code and the tests
The text was updated successfully, but these errors were encountered: