New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loadURL / loadFile calls throw "ERR_ABORTED (-3) error" if location.hash or history.pushState called on the page before page loaded #17526
Comments
Hey @vladimiry This is currently the expected behavior, the promise that If you navigate before the page has completed loading you have aborted that load, hence the |
@MarshallOfSound I still believe such logic is going to break a lot of SPA apps, but I got it that it's expected behavior. There are a few points I'd like you to consider:
|
How can it break apps? This feature was only just introduced in |
@MarshallOfSound Single page applications often use routing based on either html5 history api (push state thing) or url hash. Normally SPA doesn't wait for the full page loading but starts working asap which means html5 hitstory or url hash might be changed before page got fully loaded and it doesn't mean that a new page starts loading but it's only the client side url change. This is actually how I noticed the problem in action. See applied workaround here
Correct. I started trying v5 beta in action and I open issues if I face bugs or blockers (this one, for example, got successfully fixed). I think it's better to handle the apparent issue before final v5 release gets published. I think at least making the error message more detailed would be a good idea. |
This is also blocking loading dataURL like so:
|
I will just repeat. Calling |
This is still happening even after 5.0.2 |
* as electron/electron#17526 got resolved
* as electron/electron#17526 got resolved
Still happening in 6.0.9. I not sure what the proper behavior should be, but it causes pain when I want to load angular hash route from electron. My case is notification window should open hash route on the main window. |
@preslavsh you could try bootstrapping the Angular app in |
* as electron/electron#17526 got resolved
Electron v5.0.0-beta.6 will likely break every single page application / SPA that uses routing as it's uncommon to trigger the routing only after the page loading event has been fired. See workaround in additional Information section below.
Issue Details
Expected Behavior
Page loading completes without errors even if that's a SPA.
Actual Behavior
window.location.hash = '123'
called on page:history.pushState({}, "title", "url")
called on page:To Reproduce
Screenshots
N/A
Additional Information
The workaround is changing the hash / history state afte page got loaded:
See relater PR #15855 and code line https://github.com/electron/electron/pull/15855/files#diff-fc5b6704bed639bfab5927de1eccbcc3R85
CC @nornagon
The text was updated successfully, but these errors were encountered: