electronmon
electronmon copied to clipboard
BrowserView doesn't get reloaded
When having a BrowserView nested inside BrowserWindow and a renderer file changes for the BrowserView, the change is detected in the console, but the BrowserView doesn't get refreshed, so one is currently forced to manually restart.
Hmm, I am not seeing that in my apps that use BrowserView
. Are you able to provide a small example application that reproduces this issue?
Sorry, was very busy and didn't have time to create a test. I did go through your code though, found & fixed the issue.
the affected script is hook.js
The current code
function reload() {
const windows = electron.BrowserWindow.getAllWindows()>
if (windows && windows.length) {
for (const win of windows) {
win.webContents.reloadIgnoringCache()
}
}
}
My Code that actually reloads all BrowserViews associated with the Window:
function reload() {
const windows = electron.BrowserWindow.getAllWindows();
if (windows && windows.length) {
for (const win of windows) {
win.webContents.reloadIgnoringCache()
const views = win.getBrowserViews()
views.forEach(function(view){
view.webContents.reloadIgnoringCache()
})
}
}
}
Could just be added as a quick Pull request to fix it upstream, sadly will have to get back right away to work and won't be able to do it myself, but the fix is there.