Skip to content
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

Merged
merged 1 commit into from
Feb 28, 2020
Merged

feat(popups): add BrowserContext.evaluateOnNewDocument #1136

merged 1 commit into from
Feb 28, 2020

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Feb 26, 2020

No description provided.

@dgozman dgozman requested a review from aslushnikov February 27, 2020 15:54
docs/api.md Outdated
- returns: <[Promise]>

Adds a function which would be invoked in one of the following scenarios:
- whenever the page is navigated
Copy link
Member

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
Copy link
Member

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", {
Copy link
Member

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.
Copy link
Member

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?

@dgozman dgozman merged commit 7682865 into microsoft:master Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants