Skip to content

Commit

Permalink
chore: do not log warning for webContents.executeJS
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Jun 15, 2020
1 parent 6a01cae commit d300a3f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/renderer/api/web-frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ for (const name in binding) {
}
return binding[name](this.context, ...args);
};
// TODO(MarshallOfSound): Remove once the above deprecation is removed
if (name.startsWith('executeJavaScript')) {
(WebFrame as any).prototype[`_${name}`] = function (...args: Array<any>) {
return binding[name](this.context, ...args);
};
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions lib/renderer/web-frame-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export const webFrameInit = () => {
ipcRendererUtils.handle('ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', (
event, method: keyof WebFrameMethod, ...args: any[]
) => {
// TODO(MarshallOfSound): Remove once the world-safe-execute-javascript deprecation warning is removed
if (method.startsWith('executeJavaScript')) {
return (webFrame as any)[`_${method}`](...args);
}

// The TypeScript compiler cannot handle the sheer number of
// call signatures here and simply gives up. Incorrect invocations
// will be caught by "keyof WebFrameMethod" though.
Expand Down

0 comments on commit d300a3f

Please sign in to comment.