refactor: ginify WebContents (#24651)

This commit is contained in:
Jeremy Rose 2020-07-30 09:17:57 -07:00 committed by GitHub
parent e7fc19c98e
commit b5cd9ce0b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 156 additions and 67 deletions

View file

@ -9,7 +9,6 @@ import { ipcMainInternal } from '@electron/internal/browser/ipc-main-internal';
import * as ipcMainUtils from '@electron/internal/browser/ipc-main-internal-utils';
import { parseFeatures } from '@electron/internal/common/parse-features-string';
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
import { EventEmitter } from 'events';
// session is not used here, the purpose is to make sure session is initalized
// before the webContents module.
@ -124,8 +123,6 @@ const defaultPrintingSetting = {
const binding = process._linkedBinding('electron_browser_web_contents');
const { WebContents } = binding as { WebContents: { prototype: Electron.WebContentsInternal } };
Object.setPrototypeOf(WebContents.prototype, EventEmitter.prototype);
WebContents.prototype.send = function (channel, ...args) {
if (typeof channel !== 'string') {
throw new Error('Missing required channel argument');