MCPcopy
hub / github.com/GoogleChrome/workbox / executeAsyncScript

Method executeAsyncScript

infra/testing/webdriver/IframeManager.js:18–31  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

16 }
17
18 async executeAsyncScript(code) {
19 const value = await this._driver.executeAsyncScript(
20 (id, code, cb) => {
21 const iframe = document.querySelector(`#${id}`);
22 Promise.resolve(iframe.contentWindow.eval(code))
23 .then((value) => cb(value))
24 .catch((err) => cb(err.toString()));
25 },
26 this._id,
27 code,
28 );
29
30 return value;
31 }
32
33 async wait(code) {
34 await waitUntil(() => this.executeAsyncScript(code));

Callers 15

waitMethod · 0.95
clean-sw.jsFile · 0.80
node-interface.jsFile · 0.80
createIframeClientMethod · 0.80
executeAsyncAndCatchFunction · 0.80
test-all.jsFile · 0.80
test-all.jsFile · 0.80
test-all.jsFile · 0.80
test-all.jsFile · 0.80

Calls 1

cbFunction · 0.85

Tested by

no test coverage detected