Closed Bug 1294080 Opened 8 years ago Closed 6 years ago

Scroll position restoration upon Back behaves differently than Chrome

Categories

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

48 Branch
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: dtaylor887, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160726073904

Steps to reproduce:

Cleared cache, restarted computer.


Actual results:

Same thing happened as described.


Expected results:

When I click on the back arrow Firefox should have taken me back to the previous page to where I left off originally. It takes me back to the previous page but now it no longer takes me to where I originally left off and not I have to scroll back down to find my place again on the page.
Can you describe more about the steps to reproduce?
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines

1. What's the URL of the page the issue happens?
2. Which link or button do you click before clicking back arrow button?
   (what's the previous page?)
3. Does the issue happen with safe mode, and clean profile?
Flags: needinfo?(dtaylor887)
(In reply to Tooru Fujisawa [:arai] from comment #1)
> Can you describe more about the steps to reproduce?
> https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines
> 
> 1. What's the URL of the page the issue happens?
> 2. Which link or button do you click before clicking back arrow button?
>    (what's the previous page?)
> 3. Does the issue happen with safe mode, and clean profile?


1.  https://fetlife.com/home/v4#everything
    https://fetlife.com/home/v4#pictures
    http://www.foxnews.com/

2.  Issue happens in safe mode and clean profile.

3.  I have noticed this since updating to 48.0 that has popped up. What I am seeing is when I am scrolling down a page on a website that maybe has a list of links to click on and read and I see something interesting I click on a link to go there. When I am done at the link that I had clicked on I then click on the back arrow of my browser to go back to original page I was on but when I do it no longer takes me back to where I left off originally on that page. Now I am having to scroll back down the page to find where I left off at. This is really becoming aggravating to keep doing this.
So, about http://www.foxnews.com/ for example,
how can I reproduce the issue?
after opening the URL, which link or which button to click ?  or do I need scroll or something?  before clicking back arrow button.
(In reply to Tooru Fujisawa [:arai] from comment #3)
> So, about http://www.foxnews.com/ for example,
> how can I reproduce the issue?
> after opening the URL, which link or which button to click ?  or do I need
> scroll or something?  before clicking back arrow button.

Just scroll down the webpage and click on a link to read then use your back arrow to go back to the main page of FOX and you will see that it will not take you back to where you left off. Instead it takes you back to the top and you have to scroll back down to find where you left off. This happens as well to the other sites.
Thanks.
So, the issue is that scroll position is not restored in the previous page when you go back to it, right?
 (In reply to Tooru Fujisawa [:arai] from comment #5)
> Thanks.
> So, the issue is that scroll position is not restored in the previous page
> when you go back to it, right?

That is correct.
http://www.foxnews.com/ seems to be using JavaScript to reset scroll position after the page is loaded.
that's the website's issue.
Can you try with JavaScript disabled?
(In reply to Tooru Fujisawa [:arai] from comment #8)
> Can you try with JavaScript disabled?

I do not run JavaScript.
I cannot reproduce the scroll position reset without JavaScript.

Can you test with clean profile with JavaScript disabled by setting "javascript.enabled" pref to false?
Does the issue happen there too?
I could reproduce this issue with JavaScript enabled or disabled. I don't think this is regression either as I went back and tested on few Firefox older versions 40,43 & 47 and observed same behavior.
I also compared this behavior with Chrome and it works fine there.
Status: UNCONFIRMED → NEW
Component: Untriaged → Document Navigation
Ever confirmed: true
Product: Firefox → Core
This is to confirm that after setting "javascript.enabled" pref to false, this issue is not reproducible.
(In reply to Kanchan Kumari QA from comment #12)
> This is to confirm that after setting "javascript.enabled" pref to false,
> this issue is not reproducible.

I agree with you the that the issue is no longer present after I set Java to False but then I cannot read my emails in RoadRunner, Yahoo or GMail as an example. I had to set Java back back to True.
Flags: needinfo?(dtaylor887)
Does Firefox behave differently than Chrome here?
Flags: needinfo?(kkumari)
Yes, with default pref (javascript.enabled to true) Firefox behaves differently than Chrome. Scrolling position is getting restored on Chrome whereas on Firefox it always resets to top position.
Flags: needinfo?(kkumari)
(I'm clarifying a bit but haven't yet had a chance to reproduce myself)

STR:

1. Visit http://www.foxnews.com/
2. Scroll down and click on a link to an araticvle
3. Press browser's Back button

Expected:
- previous page is restored at its previously-scrolled position

Actual:
- Chrome restores to the same scroll position, Firefox does not

Marcos, do you know about this? Is it https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop ?
Flags: needinfo?(mcaceres)
Priority: -- → P2
Summary: Back Arrow Not Taking Me To Where I Left Off On Previous Page Since Updating to 48.0 → Scroll position restoration upon Back behaves differently than Chrome
New STR:

1. Visit http://www.foxnews.com
2. Scroll down until you see article entitled "Australian man seeks investors for the Hamdog, a hot dog-hamburger hybrid" and click on it
3. Check out the hamdog, pride of Australia (really the main reason I had needinfo'd Marcos to begin with)
4. Press Back

Expected: scroll position restored on foxnews.com

Actual in Chrome: page scrolled to top
Actual in Firefox: page scrolled to top
Actual in Edge: page scrolled to top
Actual in IE: scroll position restored

Feels like Tech Evangelism ... Mike, WDYT? Maybe related to bug 1083932?
Flags: needinfo?(mcaceres) → needinfo?(miket)
Safari seems to work as expected. 

And can also confirm that disabling JS "fixes" it.

@arai, which one of the scripts did you track down as changing the scroll position?
Flags: needinfo?(arai.unmht)
In Chrome, it seems to scroll to top when document loads and on the first navigation forward/back. Then it seems to kinda work as expected. However, they are definitely doing something very odd there with some JS.
In Chrome, it seems to scroll to top when document loads and on the first navigation forward/back. Then it seems to kinda work as expected. However, they are definitely doing something very odd there with some JS.
(In reply to Marcos Caceres [:marcosc] from comment #18)
> Safari seems to work as expected. 
> 
> And can also confirm that disabling JS "fixes" it.
> 
> @arai, which one of the scripts did you track down as changing the scroll
> position?

I haven't tracked down.
just confirmed that the issue doesn't happen if I disable JS.
Flags: needinfo?(arai.unmht)
Priority: P2 → P3
(In reply to Andrew Overholt [:overholt] from comment #17)
> New STR:
> 
> 1. Visit http://www.foxnews.com
> 2. Scroll down until you see article entitled "Australian man seeks
> investors for the Hamdog, a hot dog-hamburger hybrid" and click on it
> 3. Check out the hamdog, pride of Australia (really the main reason I had
> needinfo'd Marcos to begin with)
> 4. Press Back
> 
> Expected: scroll position restored on foxnews.com
> 
> Actual in Chrome: page scrolled to top
> Actual in Firefox: page scrolled to top
> Actual in Edge: page scrolled to top
> Actual in IE: scroll position restored
> 
> Feels like Tech Evangelism ... Mike, WDYT? Maybe related to bug 1083932?

18 months seems like an appropriate amount of time to break my silence here. 

Unfortunately this no longer reproduces on foxnews.com... (even for non-Hamdog articles).

Don, do you know of other sites with this reported behavior? Otherwise, we should probably close as incomplete.
Flags: needinfo?(miket) → needinfo?(dtaylor887)
Go ahead and close.
Flags: needinfo?(dtaylor887)
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INCOMPLETE
Hi I'm experiencing this issue on a website that I am developing. 

Firefox desktop and on my android phone will not restore the scroll position when I press back button.
Chrome desktop, chrome android and native browser android restores the scroll position.

I am using react/react-router framework. Unfortunately the website is not yet deployed for public.
(In reply to partohap.ayushka from comment #24)
> Hi I'm experiencing this issue on a website that I am developing. 
> 
> Firefox desktop and on my android phone will not restore the scroll position
> when I press back button.
> Chrome desktop, chrome android and native browser android restores the
> scroll position.
> 
> I am using react/react-router framework. Unfortunately the website is not
> yet deployed for public.

Hi! Please file a new bug, and include any relevant code that you use for scrolling or history navigating, thanks!
You need to log in before you can comment on or make changes to this bug.