Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

window.pageXOffset and window.pageYOffset not working anymore

more options

Hi,

in earlier firefox versions window.pageXOffset gave the correct value from the left border of the website to the scrolled left screen border in pixels. After the last Update it doesn't matter where I move my screen to, it always says zero.

Is the feature removed or a bug? If it's removed, how I can get the window position relative to the viewport for javascript?

Firefox Version on Android: 63.0.2 last Update: 07.11.2018

Greetings,

Udo

Hi, in earlier firefox versions window.pageXOffset gave the correct value from the left border of the website to the scrolled left screen border in pixels. After the last Update it doesn't matter where I move my screen to, it always says zero. Is the feature removed or a bug? If it's removed, how I can get the window position relative to the viewport for javascript? Firefox Version on Android: 63.0.2 last Update: 07.11.2018 Greetings, Udo

All Replies (3)

more options

I have not heard of this being removed. Is there a sample page which demonstrates the problem?

more options

Hi,

go to the Page:

https://ubxd.de/test/firefox_problem.php

there is a simple div Box. If you click the Box, the values of window.pageXOffset and window.pageYOffset gets shown inside the box.

If you open the site in Firefox for PC and make the window smaller that you can scroll the box, the values changing if you scroll to the right or down and press the box again.

If you open the site in Firefox for Android, no matter where the viewport is, it always shows zero. In earlier Versions of Firefox it had the same behavior like Firefox on PC and shows the correct Distance of the site window to the viewport borders.

LG,

Udo

more options

Thanks, Udo. It seems to behave very inconsistently. After I zoom into the page so some scrolling is needed, it may or may not show me new values as I move the rectangle around and tap. Seems sometimes the horizontal gets stuck on 0 until I do a little vertical scrolling, then it starts working. I don't know why it is behaving that way.