From 92326cddd38de8279668c8d92afe4cf358ceb6a7 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 16 Jan 2019 11:39:55 -0800 Subject: [PATCH] ensure callback compat --- lib/browser/api/web-contents.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/browser/api/web-contents.js b/lib/browser/api/web-contents.js index e7c204b0669dd..b08f3d021fad3 100644 --- a/lib/browser/api/web-contents.js +++ b/lib/browser/api/web-contents.js @@ -111,6 +111,7 @@ WebContents.prototype.send = function (channel, ...args) { return this._send(internal, sendToAll, channel, args) } + WebContents.prototype.sendToAll = function (channel, ...args) { if (typeof channel !== 'string') { throw new Error('Missing required channel argument') @@ -209,6 +210,9 @@ WebContents.prototype.executeJavaScript = function (code, hasUserGesture, callba } } +WebContents.prototype.getZoomLevel = deprecate.promisify(this.getZoomLevel, 0) +WebContents.prototype.getZoomFactor = deprecate.promisify(this.getZoomFactor, 0) + WebContents.prototype.takeHeapSnapshot = function (filePath) { return new Promise((resolve, reject) => { const channel = `ELECTRON_TAKE_HEAP_SNAPSHOT_RESULT_${getNextId()}`