MCPcopy Create free account
hub / github.com/chieapp/chie / executeJavaScript

Method executeJavaScript

src/view/browser-view.ts:75–87  ·  view source on GitHub ↗
(js: string)

Source from the content-addressed store, hash-verified

73
74 // Promise version of executeJavaScript.
75 executeJavaScript(js: string) {
76 if (!this.isDomReady)
77 throw new Error('Can not call executeJavaScript before page is loaded.');
78 // eslint-disable-next-line @typescript-eslint/no-explicit-any
79 return new Promise<any>((resolve, reject) => {
80 this.browser.executeJavaScript(js, (success: boolean, value) => {
81 if (success)
82 resolve(value);
83 else
84 reject(new Error('Failed to execute JavaScript.'));
85 });
86 });
87 }
88
89 // Push a task will be executed one by one in a queue.
90 // If the browser is not ready yet, the tasks will be delayed until page is

Callers 6

pushJavaScriptMethod · 0.80
appendMessageMethod · 0.80
appendPendingMessageMethod · 0.80
updateMessageMethod · 0.80
loginFunction · 0.80
loginFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected