Open Bug 2045839 Opened 3 months ago Updated 3 months ago

Updating window.location without user interaction skips the page from history

Categories

(Core :: DOM: Navigation, defect)

Firefox 151
defect

Tracking

()

UNCONFIRMED

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.

Attached file Test pages
Attached file Video captures

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.

Component: Untriaged → Console
Product: Firefox → DevTools

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.

Flags: needinfo?(jdescottes)
Attached file page_b.html
Flags: needinfo?(jdescottes)

STRs without devtools:

On Chrome, D and A are listed, regardless of user interaction.

Component: Console → DOM: Navigation
Product: DevTools → Core
Summary: Manipulating window.location from console/addons breaks history → Updating window.location without user interaction skips the page from history

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.

See Also: → 1645220, 1645231

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.

Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: