MCPcopy Index your code
hub / github.com/microsoft/playwright / extend

Method extend

packages/injected/src/injectedScript.ts:583–591  ·  view source on GitHub ↗
(source: string, params: any)

Source from the content-addressed store, hash-verified

581 }
582
583 extend(source: string, params: any): any {
584 const constrFunction = this.window.eval(`
585 (() => {
586 const module = {};
587 ${source}
588 return module.exports.default();
589 })()`);
590 return new constrFunction(this, params);
591 }
592
593 async viewportRatio(element: Element): Promise<number> {
594 return await new Promise(resolve => {

Callers

nothing calls this directly

Calls 1

evalMethod · 0.80

Tested by

no test coverage detected