Browse Source

fix: inspector context menu throwing an error (#29436)

Shelley Vohr 3 years ago
parent
commit
3b75549511
2 changed files with 1 additions and 2 deletions
  1. 1 1
      lib/browser/devtools.ts
  2. 0 1
      typings/internal-electron.d.ts

+ 1 - 1
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}`);

+ 0 - 1
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;