Repository navigation
Closed
Labels
bug 🪲bug/regression ↩️A new version of Electron broke somethingcomponent/BrowserViewhas-repro-commentIssue has repro in commentsstatus/confirmedA 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
Metadata
Metadata
Assignees
Labels
bug 🪲bug/regression ↩️A new version of Electron broke somethingcomponent/BrowserViewhas-repro-commentIssue has repro in commentsstatus/confirmedA maintainer reproduced the bug or agreed with the feature
Activity
dsanders11 commentedon Feb 23, 2023
Can confirm that YouTube video continues to play after
view.webContents.close(). It looks like this regressed in v23.1.0, likely due to #37205.cc @codebytere