Updating window.location without user interaction skips the page from history
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
People
(Reporter: weidzm, Unassigned)
References
Details
Attachments
(4 files)
Steps to reproduce:
Using either window.location.href = "..." or window.location.assign("...")
with url "https://www.firefox.com/media/img/firefox/flare/fox-brand-curious.3ea99c60c166.svg"
Open a.html in test folder.
Navigate to a next page or mousewheel-click it to open on a new tab.
Actual results:
Scenario 1 :
- Navigate "Next" through any of the pages
- Click the command-wired buttons
Browser navigate to url and history page is working correctly
Scenario 2 :
- Navigate "Next" through B.html > C.html > D.html
- Press F12
- Without clicking page viewport, paste one of the commands and execute
Browser navigate to url but D.html page becomes missing as previous page
C.html is now the previous page of the navigated url.
Scenario 3 :
- Navigate "Next" through B.html > C.html > D.html
- Press F12
- Click on the page viewport
- Paste one of the commands in console and execute.
Browser navigate to url and D.html is correctly set as previous page
Scenario 4 :
- From A.html page, scrollwheel-click "Next".
- B.html opens in a new tab
- Without clicking page viewport, paste one of the commands and execute
Browser navigate to url, there are no previous history at all as if current irl was the one opened with the tab
Scenario 5 :
- From A.html page, scrollwheel-click "Next".
- B.html opens in a new tab
- Click on the page viewport
Browser navigate to url and B.html is correctly set as previous page
Scenarios can also be replicated from addons : https://addons.mozilla.org/fr/firefox/addon/largest-image/
Expected results:
The current page from which window.location console/addon changes are fired should always be set as the previous page from the url that is navigated to.
Comment 3•3 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 4•3 months ago
|
||
The main difference between scenarios 2 and 3 is that the page is clicked before executing the console code, so this might not be related to DevTools but rather to the page having user activation or not.
Will try to reproduce without devtools before forwarding.
Comment 5•3 months ago
|
||
Comment 6•3 months ago
|
||
Comment 7•3 months ago
|
||
STRs without devtools:
- open a tab
- navigate to https://bugzilla.mozilla.org/attachment.cgi?id=9595930 (page_a.html)
- click on next (this moves you to https://bugzilla.mozilla.org/attachment.cgi?id=9595928 - page_b.html)
- wait 5 seconds for the page to navigate (do not click on the page at all)
- right click on the back button: only the first page (A) is listed
On Chrome, D and A are listed, regardless of user interaction.
Comment 8•3 months ago
|
||
I can see many related bugs eg Bug 1645231. I'll let DOM team triage this properly, but this is probably an old duplicate.
Bug 1645220 would probably be helpful here.
Comment 9•3 months ago
|
||
That seems like the expected behavior from the back button intervention, bug 1515073. I think code executed through the console should behave like in the page, so a special case wouldn't make sense to me. I'm unsure if there is a good reason for special casing extensions.
Updated•3 months ago
|
Description
•