Open Bug 186371 Opened 22 years ago Updated 2 years ago

urls with local anchors won't reload if you press enter in Location bar (or click "go" button)

Categories

(Core :: DOM: Navigation, defect)

defect

Tracking

()

People

(Reporter: hossman, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: ux-consistency, ux-efficiency)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021205 Debian/1.2.1-1.01
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021205 Debian/1.2.1-1.01

There are many actions a user can perform to cause a page to reload, some of
these actions don't work if the URL includes a local anchor (ie:
http://www.foo.com/bar#local_anchor)

NOTE: The page does reload correctly if you explicitly click the "reload" button.

Reproducible: Always

Steps to Reproduce:
1. visit this url...
   <http://jimmy.qmuc.ac.uk/jimtools/datetime.shtml>
2. click in the Location bar, and hit enter/return a few times
3. click the "Go" button a few times
4. now add a "#foo" to the end of the URL...
   <http://jimmy.qmuc.ac.uk/jimtools/datetime.shtml#foo>
5. click in the Location bar, and hit enter/return a few times
6. click the "Go" button a few times



Actual Results:  
After steps 2 & 3, the page reloads each time (you can see the time stamp update)

After steps 5 & 6, the page does NOT reload.

Expected Results:  
The fact that the URL inclues a local anchor should not affect wether or not the
page reloads ... it should reload after steps 5 & 6 as well.


The URL listed in the steps to reproduce was choosen at random from Google
results, purely because if had javascript to update a timestamp with seconds
granularity, and no "Expires" info.

In the example above, the local anchor doesn't acctually exist on this page, but
that doesn't affect the behavior.

I'll attach a smaller example in a moment.
Attached file Local exploit for bug
This file can be used to demonstrate the bug, using the same steps as the
orriginal URL posted.

It has the benefits of being simpler, and of having the local anchor "foo"
defined.
In the other bugs on this, the bug has been that the page DID reload when going
to a local anchor. The expected behaviour being that the page should simply
scroll to the anchor, and NOT perform a reload. This was first fixed in bug 644,
later complained about in bug 79953, 127251 and others.

According to those fixes, this bug is invalid.
There is a distinction beteween this bug, and the bugs you cited.

in all of those bugs, the complaint was that clicking on a link to a named
anchor on a page which was allready loaded would forcibly reload the page.

My point is not about clicking the link to the named anchor, my point is about
pressing the "Go" button (or pressing enter while in the Location bar).  I agree
completely with the other bugs: when clicking on a link to a local named anchor
(ie: <a href="#foo">foo</a>) there is no need for the page to be reloaded, the
window should just scroll to the named anchor -- but after that has happened,
shouldn't pressing the "Go" button forcibly reload the page AND scroll to the
named anchor?


I guess what this all boils down to is my assumption/presumption that if the
user loads a url (ANY url), and then clicks the "Go" button (without modifying
the contents of the Location bar) the Go button should do at least as much as
clicking the reload button (and in my opinion: as much as a "shift-reload").



I suppose so, if Go reloads the page then it should always do so...
However, what happens when that anchor DOES exist on the page? Is behaviour
different?
Status: UNCONFIRMED → NEW
Component: Event Handling → Browser-General
Ever confirmed: true
Product: Browser → Seamonkey
The behavior is the same even if the anchor exists.
Assignee: saari → location-bar
Component: General → Location Bar
OS: Linux → All
Product: Mozilla Application Suite → Core
QA Contact: rakeshmishra
Hardware: PC → All
*** Bug 292679 has been marked as a duplicate of this bug. ***
Confirming this with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2)
Gecko/20050502 Firefox/1.0+
Severity: normal → minor
Product: Core → SeaMonkey
This is not only happening for SeaMonkey but all Gecko applications. One more example would be a link to the following URL which should be handled by the internal PDF viewer.

http://www.gesetze-im-internet.de/bundesrecht/bgb/gesamt.pdf#page=1&zoom=auto,0,586

If you load the page once and scroll away, a reload will not scroll the page back to the location as initially loaded.

What would be the best component?
Severity: minor → normal
Component: Location Bar → Document Navigation
Flags: needinfo?
Product: SeaMonkey → Core
(In reply to Henrik Skupin (:whimboo) from comment #10)
> This is not only happening for SeaMonkey but all Gecko applications. One
> more example would be a link to the following URL which should be handled by
> the internal PDF viewer.
> 
> http://www.gesetze-im-internet.de/bundesrecht/bgb/gesamt.
> pdf#page=1&zoom=auto,0,586
> 
> If you load the page once and scroll away, a reload will not scroll the page
> back to the location as initially loaded.

This seems to work for me now with nightly. Is it still broken for you?
Flags: needinfo? → needinfo?(hskupin)
Yes, its working for me too. Looks like some patch in the last 3 years fixed it.
Flags: needinfo?(hskupin)
It looks like Edge and IE behave the same as Firefox here but Chrome does not.

dbaron, do you know if there is a standard or something around this (and I know you're away for a few more days)?
Flags: needinfo?(dbaron)
I don't know of a standard (although that doesn't mean there isn't one) -- but it does seem like it could be nice to fix so that we do a reload if the anchor is the same but don't reload if it's different -- at least if that matches Chrome's behavior.
Flags: needinfo?(dbaron)
Isn't this expected behaviour? When I click the Go button or hit Enter in the URL bar, I don't expect the current page to be reloaded if it's already at the desired URL. What I do expect is the anchor (#identifier), if there is one at the end of the URL, to be brought to the start of the content area (or the page to be scrolled to the very bottom if that anchor's distance from the page bottom is shorter than the content height).
Blocks: 1239653

I run into this a few times a day trying to deal with Outlook Web Access. While I as a web developer at least understand why Reload doesn't work as expected when there's a fragment in the address bar, I imagine that many users do not understand these subtleties, and something like what :dbaron proposes in comment 14 would be a big improvement.

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

Attachment

General

Creator:
Created:
Updated:
Size: