mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-06 03:16:17 +03:00
feat(page): support Page.evaluateOnNewDocument for WebKit (#55)
This commit is contained in:
parent
e04910501b
commit
ac01262c88
@ -344,6 +344,11 @@ export class Page extends EventEmitter {
|
|||||||
return this._frameManager.mainFrame().evaluate(pageFunction, ...args);
|
return this._frameManager.mainFrame().evaluate(pageFunction, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async evaluateOnNewDocument(pageFunction: Function | string, ...args: Array<any>) {
|
||||||
|
const source = helper.evaluationString(pageFunction, ...args);
|
||||||
|
await this._session.send('Page.setBootstrapScript', { source });
|
||||||
|
}
|
||||||
|
|
||||||
async setCacheEnabled(enabled: boolean = true) {
|
async setCacheEnabled(enabled: boolean = true) {
|
||||||
await this._frameManager.networkManager().setCacheEnabled(enabled);
|
await this._frameManager.networkManager().setCacheEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
@ -256,7 +256,7 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.skip(WEBKIT)('Page.evaluateOnNewDocument', function() {
|
describe('Page.evaluateOnNewDocument', function() {
|
||||||
it('should evaluate before anything else on the page', async({page, server}) => {
|
it('should evaluate before anything else on the page', async({page, server}) => {
|
||||||
await page.evaluateOnNewDocument(function(){
|
await page.evaluateOnNewDocument(function(){
|
||||||
window.injected = 123;
|
window.injected = 123;
|
||||||
|
Loading…
Reference in New Issue
Block a user