puppeteer-sharp
puppeteer-sharp copied to clipboard
Improve EvaluateExpressionOnNewDocumentAsync(String)
Explain how would you like this document to be impoved. Source URL: https://github.com/kblok/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs/#L585
I would like to see the example of how to set the language as alluded to in the docs but not shown (instead it shows how to set a property on the Window:
Examples
An example of overriding the navigator.languages property before the page loads:
await page.EvaluateExpressionOnNewDocumentAsync("window.__example = true;");
Can be updated based on puppeteer doc.
- https://github.com/puppeteer/puppeteer/blob/066f440ba7bdc9aca9423d7205adf36f2858bd78/src/common/Page.ts#L2717
- https://github.com/puppeteer/puppeteer/blob/066f440ba7bdc9aca9423d7205adf36f2858bd78/docs/api/puppeteer.page.evaluateonnewdocument.md#example