Back navigation can be prevented with some async functions
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox132 | --- | verified |
People
(Reporter: bugzilla.mozilla.org, Unassigned)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
Steps to reproduce:
Include this code on target page:
location.search||fetch(0).then(a=>location='?x');
And click back in navigation chrome.
Live exploit:
https://fulldecent.github.io/you-cant-leave-this-page-2/
Video narrated explanation:
Actual results:
Does not go back
Expected results:
Goes back
Reporter | ||
Comment 1•1 month ago
|
||
Comment 2•1 month ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Navigation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•1 month ago
|
||
Reproduced within the safe mode, but I cannot reproduce this bug with my profile, though. I'm not sure the rules of severity about this kind of issues. Nika, could you set the severity field?
Comment 4•1 month ago
|
||
We don't currently track "user navigation involvement" in quite the way which would be necessary for us to implement this consistently. Doing something like this probably depends on the work for bug 1901045.
I think roughly what we'd want to do if we had this kind of tracking is only allow a load to cancel another "browser UI" load if it at least has "activation" or "browser UI" user navigation involvement, and to cancel the navigation otherwise.
Leaving a ni? for :farre who might have some insight about whether we already have the information required for this.
Comment 5•1 month ago
|
||
Yeah, I can't reproduce this, even in safe mode.
I'll forward this to :jjaschke and :avandolder who actually has done recent work with this.
Comment 6•1 month ago
|
||
I can repro on current Nightly both on MacOS and Ubuntu. Works in Chrome and Safari.
FWIW, in Bug 1904773 I faked "user involvement" by checking if the triggering principal is the system principal. But maybe we should implement the actual thing at some point.
Comment 7•10 days ago
|
||
I couldn't reproduce this on the latest nightly Fx 132. I also verified that if I turned off the preference browser.navigation.requireUserInteraction
, I saw the problem.
Comment 8•9 days ago
|
||
Looks fixed to me using the latest Nightly 132 across platforms (Windows 11, macOS 13 and Ubuntu 22.04). If pref browser.navigation.requireUserInteraction
is set as true
(set to default) this is fixed, if false
this will still reproduce.
I'll go ahead and mark this as fixed, please reopen if this is still reproducible for someone.
Updated•9 days ago
|
Description
•