diff --git a/lib/browser/api/browser-window.js b/lib/browser/api/browser-window.js index 9904a893ed..05fe450786 100644 --- a/lib/browser/api/browser-window.js +++ b/lib/browser/api/browser-window.js @@ -127,15 +127,6 @@ BrowserWindow.fromBrowserView = (browserView) => { return null } -BrowserWindow.fromDevToolsWebContents = (webContents) => { - for (const window of BrowserWindow.getAllWindows()) { - const { devToolsWebContents } = window - if (devToolsWebContents != null && devToolsWebContents.equal(webContents)) { - return window - } - } -} - // Helpers. Object.assign(BrowserWindow.prototype, { loadURL (...args) { diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index e47694423a..fe4bb8886d 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -233,24 +233,6 @@ describe('BrowserWindow module', () => { }) }) - describe('BrowserWindow.fromDevToolsWebContents(webContents)', () => { - let contents = null - - beforeEach(() => { contents = webContents.create({}) }) - - afterEach(() => { contents.destroy() }) - - it('returns the window with the webContents', (done) => { - w.webContents.once('devtools-opened', () => { - expect(BrowserWindow.fromDevToolsWebContents(w.devToolsWebContents).id).to.equal(w.id) - expect(BrowserWindow.fromDevToolsWebContents(w.webContents)).to.be.undefined() - expect(BrowserWindow.fromDevToolsWebContents(contents)).to.be.undefined() - done() - }) - w.webContents.openDevTools() - }) - }) - describe('BrowserWindow.openDevTools()', () => { it('does not crash for frameless window', () => { w.destroy()