-
Notifications
You must be signed in to change notification settings - Fork 17k
Closed
Labels
bug 🪲bug/regression ↩️A new version of Electron broke somethingA new version of Electron broke somethingcomponent/BrowserViewhas-repro-commentIssue has repro in commentsIssue has repro in commentsstatus/confirmedA maintainer reproduced the bug or agreed with the featureA maintainer reproduced the bug or agreed with the feature
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
23.1.0
What operating system are you using?
Windows
Operating System Version
10.0.19042
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
There should be a way to close a browserView.
Actual Behavior
Neither window.close() nor webContents.close() has any effect.
You can play a video on youtube and hear the sound continue after .removeBrowserView is called. So that does not change the behavior either. Also calling window.close() in the devtools has no effect.
const electron = require( "electron" )
electron.app.whenReady().then(()=>{
let main = new electron.BrowserWindow({
"height" : 700,
"width" : 800,
show: true,
});
let view = new electron.BrowserView({});
view.webContents.loadURL("https://www.youtube.com");
main.addBrowserView(view);
view.setBounds({x: 0, y: 0, width: 800, height: 700})
view.webContents.openDevTools({ mode: "detach" });
setTimeout(() => {
console.log("calling webContents.close()")
//main.removeBrowserView(view);
//view.webContents.close();
view.webContents.executeJavaScript("window.close()");
}, 5000);
})
Testcase Gist URL
No response
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug 🪲bug/regression ↩️A new version of Electron broke somethingA new version of Electron broke somethingcomponent/BrowserViewhas-repro-commentIssue has repro in commentsIssue has repro in commentsstatus/confirmedA maintainer reproduced the bug or agreed with the featureA maintainer reproduced the bug or agreed with the feature