From 3b755495113dd88bd2d8bc6c89e2c861acc353e7 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 2 Jun 2021 05:39:48 +0200 Subject: [PATCH] fix: inspector context menu throwing an error (#29436) --- lib/browser/devtools.ts | 2 +- typings/internal-electron.d.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/browser/devtools.ts b/lib/browser/devtools.ts index 7330cc493505..fbfc965b483b 100644 --- a/lib/browser/devtools.ts +++ b/lib/browser/devtools.ts @@ -54,7 +54,7 @@ const isChromeDevTools = function (pageURL: string) { }; const assertChromeDevTools = function (contents: Electron.WebContents, api: string) { - const pageURL = contents._getURL(); + const pageURL = contents.getURL(); if (!isChromeDevTools(pageURL)) { console.error(`Blocked ${pageURL} from calling ${api}`); throw new Error(`Blocked ${api}`); diff --git a/typings/internal-electron.d.ts b/typings/internal-electron.d.ts index bf7f79127206..f4d381fd63db 100644 --- a/typings/internal-electron.d.ts +++ b/typings/internal-electron.d.ts @@ -56,7 +56,6 @@ declare namespace Electron { } interface WebContents { - _getURL(): string; _loadURL(url: string, options: ElectronInternal.LoadURLOptions): void; _stop(): void; _goBack(): void;