Commit 9eb4e195 authored by Stanley Shyiko's avatar Stanley Shyiko
Browse files

Fixed timeout that could occur if initial url gets loaded before 'devtools-opened' event

parent e070fd2d
......@@ -87,10 +87,11 @@ app.on('ready', function () {
});
}
bw.webContents.on('devtools-opened', function () {
function notifyDevToolsExtensionOfLoad() {
function notifyDevToolsExtensionOfLoad(e) {
if (e.sender.getURL() != 'chrome://ensure-electron-resolution/') {
bw.webContents.executeJavaScript('new Image().src = "https://did-finish-load/"');
}
}
// fired regardless of the outcome (success or not)
bw.webContents.on('did-finish-load', notifyDevToolsExtensionOfLoad);
......@@ -102,7 +103,6 @@ app.on('ready', function () {
JSON.stringify({errorCode: errorCode, errorDescription: errorDescription}) + ')');
}
});
});
electron.ipcMain.on('devtools-loaded', function (event) {
setTimeout(function () { bw.loadURL(url); }, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment