Open Bug 1239653 Opened 8 years ago Updated 6 months ago

When there is an anchor / ref / symbol # in the address bar, pressing enter does not reload the page

Categories

(Core :: DOM: Navigation, defect, P5)

43 Branch
All
Unspecified
defect
Points:
3

Tracking

()

People

(Reporter: madjik, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: parity-chrome, uiwanted)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20160105164030

Steps to reproduce:

For example go to https://www.mozilla.org/fr/firefox/new/?scene=2#download-fx
Click cancel to the download,
go on the URL bar and type Enter


Actual results:

Nothing


Expected results:

Loading of the page, as without the #

(Bug not resolved since 2009!!!
https://bugzilla.mozilla.org/show_bug.cgi?id=516476
https://bugzilla.mozilla.org/show_bug.cgi?id=673159
https://bugzilla.mozilla.org/show_bug.cgi?id=778399)
Why the should be "Loading of the page, as without the #"? I don't think it is a good idea. You can use F5 key or Reload button to reload the page.
Component: Untriaged → Location Bar
Flags: needinfo?(madjik)
In addition, the page implementation maybe can be improved, i.e. remove the anchor, use a parameter to replace it if needed.
Why don't you think it's a good idea? It should be the same behaviour for the same command, no matter the URL.

And F5 or reload is not the same as pressing Enter on the URL bar!

F5 sends again the post data, not Enter on URL.
F5 does not clear the form fields (if modified by you), Enter does clear the fields.


I don't understand your 2d post. If I modify the URL the page is loaded as usual of course.
Flags: needinfo?(madjik)
Hardware: Unspecified → All
Anchors has its own unique role, if you don't know yet.

For example, open the https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode#w_how-to-start-firefox-in-safe-mode, scroll down, then focus to urlbar and enter, it back to the position of anchor. This is one usage, it should not be abolished.


If necessary, you can manually strip it from url and enter, but the should not be automatic, as well as for all.

If you have not encountered this situation in other pages, I think it can be improved on the site.
I know, I'm a web developer.
This is not a situation on this site, this is a bug in Firefox.

In your example the correct expected result should be to load the page and then return to the anchor. This is not often you manually return to an anchor, this is more useful and logic to follow the usual behaviour.

If you still don't understand try this:
- open this current page in a new tab
- fill the answer textarea with some random text
- hit F5 -> the page scroll to where you were and text is still here
- click in URL bar and hit Enter -> the page reload, goes to top and the text disappear
- refill the answer field
- this time add # in the URL bar and hit Enter -> the page goes to top (but no reload, no clearing of text fields)

Why 2 results for the same command? how do I clear the forms? F5 will not, the right thing should be Enter BUT it does not work now I have a # in URL! -> bug

Firefox without #, and all other browser (with or without #), (re)load the page. There is no reason to this single exception.
(In reply to madjik from comment #5)
> Firefox without #, and all other browser (with or without #), (re)load the
> page. There is no reason to this single exception.

Well, the last sentence is a important reference.

Looks the Chrome 47 to do so, but IE11 & Opera 12.17 is not. Seek the discuss and changes.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [parity-chrome]
Component: Location Bar → Document Navigation
Product: Firefox → Core
Why is this not a duplicate of bug 778399?

And this is in fact something that needs to be done in the UI.  The core code can't distinguish the "want a reload" and "don't want a reload" cases here: it's just given a URI, and if there is an anchor name involved it needs to do an anchor scroll normally, so that's what it does.  The UI would need to explicitly tell it to not do that in this one special case the UI knows about.
Component: Document Navigation → Location Bar
Product: Core → Firefox
(In reply to Boris Zbarsky [:bz] from comment #7)
> Why is this not a duplicate of bug 778399?

Although they are the same, but I think it needs more discussion, because Chrome has a different approach. It indeed have a value and seems better UI feedback for certain cases.

> And this is in fact something that needs to be done in the UI.  The core
> code can't distinguish the "want a reload" and "don't want a reload" cases
> here: it's just given a URI, and if there is an anchor name involved it
> needs to do an anchor scroll normally, so that's what it does.  The UI would
> need to explicitly tell it to not do that in this one special case the UI
> knows about.

Perhaps, I'm not sure it is implemented in the Core or UX.
Keywords: uiwanted
(In reply to YF (Yang) from comment #6)
> Looks the Chrome 47 to do so, but IE11 & Opera 12.17 is not. Seek the
> discuss and changes.

Right for IE (8 for me) and Opera 12, but newer Opera with Blink reloads, Qupzilla too.


> Although they are the same, but I think it needs more discussion, because
> Chrome has a different approach. It indeed have a value and seems better UI
> feedback for certain cases.

Thanks!
I often use Enter to empty a form or see the default values, with a # it doesn't work (and sometimes it can't be removed because the #anchor is used with Javascript so it's totally impossible to clear the page except copy/paste URL in a new tab!).

As we don't type anchors manually, the only usage of this feature is what you say: return to the anchor after scroll. I guess most of people just scroll back in this case and the Enter command would still allow to return with a reload, just losing a little time.
Hello,

Try this: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&titles=Main%20page
Change the text "Main page" and press Enter. Nothing! ---> BUG!


Is this possible to correct this annoying bug from 2011????
Depends on: 186371
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Keywords: parity-chrome
Whiteboard: [parity-chrome]
Priority: -- → P5
Points: --- → 3
Summary: When there is a symbol # in the address bar avoid, pressing enter does not load the page → When there is an anchor / ref / symbol # in the address bar, pressing enter does not reload the page

Bug exists too/again in Firefox 91.0.2 x64, Ubuntu 20.04 LTS

Severity: normal → S3
Duplicate of this bug: 1835554
No longer duplicate of this bug: 1835554
See Also: → 1835554

The address bar isn't in control of navigation to URL fragments - this is up to the docshell.

Component: Address Bar → DOM: Navigation
Product: Firefox → Core
Duplicate of this bug: 1766145
Duplicate of this bug: 1831333
You need to log in before you can comment on or make changes to this bug.