Repository navigation
Closed
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 an issue that matches the one I want to file, without success.
Issue Details
- Electron Version:
- v10.1.1
- Operating System:
- v10.15.7
Expected Behavior
Uncaught (in promise) Error: ERR_ABORTED (-3) raised by
electron/lib/browser/navigation-controller.ts
Lines 77 to 86 in c41b8d5
| // the webcontents has started another unrelated navigation in the | |
| // main frame (probably from the app calling `loadURL` again); reject | |
| // the promise | |
| // We should only consider the request aborted if the "navigation" is | |
| // actually navigating and not simply transitioning URL state in the | |
| // current context. E.g. pushState and `location.hash` changes are | |
| // considered navigation events but are triggered with isSameDocument. | |
| // We can ignore these to allow virtual routing on page load as long | |
| // as the routing does not leave the document | |
| return rejectAndCleanup(-3, 'ERR_ABORTED', url); |
win.webContents.on('did-fail-load', () => {})
Actual Behavior
Error thrown by
electron/lib/browser/navigation-controller.ts
Lines 77 to 86 in c41b8d5
| // the webcontents has started another unrelated navigation in the | |
| // main frame (probably from the app calling `loadURL` again); reject | |
| // the promise | |
| // We should only consider the request aborted if the "navigation" is | |
| // actually navigating and not simply transitioning URL state in the | |
| // current context. E.g. pushState and `location.hash` changes are | |
| // considered navigation events but are triggered with isSameDocument. | |
| // We can ignore these to allow virtual routing on page load as long | |
| // as the routing does not leave the document | |
| return rejectAndCleanup(-3, 'ERR_ABORTED', url); |
const { remote } = require('electron');
const win = new remote.BrowserWindow({
width: 800,
height: 600,
show: false,
webPreferences: {
partition: LOGIN_PARTITION,
nodeIntegration: false,
},
});
win.webContents.on('did-finish-load', () => {
console.log('finish-load'); // triggered twice
});
win.webContents.on('did-fail-load', () => {
console.log('fail-load'); // never triggered
});
try {
win.loadURL(urlThatContainsAutoRedirect);
} catch (error) {
console.log('catch loadUrl'); // never triggered
}
win.show();Reproduce
Sadly the flow I use is based on Auth0 login page, that automatically redirect to a page behind authentication if we have the same partition. I cannot provide a way to reproduce.

Activity
[-]loadUrl error "ERR_ABORTED (-3) error" can't be cached[/-][+]loadUrl error "ERR_ABORTED (-3) error" can't be catched[/+]benoittgt commentedon Feb 2, 2021
Error can be catched. Do not forget
loadUrlreturn a promise.OldManMeta commentedon Apr 25, 2023
I'm getting this error - am calling loadURL exactly how @benoittgt is showing in the last comment.
OldManMeta commentedon Apr 25, 2023
Correction - I just spotted where I was not handling this in another loadURL