-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(popups): add BrowserContext.evaluateOnNewDocument #1136
Conversation
docs/api.md
Outdated
- returns: <[Promise]> | ||
|
||
Adds a function which would be invoked in one of the following scenarios: | ||
- whenever the page is navigated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whenever a page is created in the context or navigated
docs/api.md
Outdated
|
||
Adds a function which would be invoked in one of the following scenarios: | ||
- whenever the page is navigated | ||
- whenever the child frame is attached or navigated. In this case, the function is invoked in the context of the newly attached frame |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whenever a child frame is attached or navigated in a page in the browser context
docs/api.md
Outdated
// preload.js | ||
|
||
// overwrite the `languages` property to use a custom getter | ||
Object.defineProperty(navigator, "languages", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a better support for overriding locale, so maybe rewrite the example to use aforementioned Math.random ?
await page.evaluateOnNewDocument(preloadFile); | ||
``` | ||
|
||
> **NOTE** The order of evaluation of multiple scripts installed via [browserContext.evaluateOnNewDocument(pageFunction[, ...args])](#browsercontextevaluateonnewdocumentpagefunction-args) and [page.evaluateOnNewDocument(pageFunction[, ...args])](#pageevaluateonnewdocumentpagefunction-args) is not defined. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it deterministic, is it chromium backend limitation?
No description provided.