Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back button in Chrome Web Browser - goes to the correct section only in Firefox & Safari #4485

Open
davITnemec opened this issue Nov 15, 2022 · 9 comments

Comments

@davITnemec
Copy link

Description

Hi there; on my website, I use fullPage.js only for the homepage. From sections goes links to different pages of the website. When I click back via the browser button, I should be back on the section when I click from.

It works, but only in Firefox & Safari. In Chrome or Edge it does not work, and when I use the back button in the browser, I go to the first section every time.

Is this something that can be fixed in fullPage.js, or is this strict browser behavior?

I would like to reproduce it in jsfiddle etc., but I don't know how can I replicate there back button in browser... 😞

Versions

All browsers are the last version.
fullPage.js - 4.0.12

@alvarotrigo
Copy link
Owner

Thanks for reporting it!
We'll take a look at that!

It seems that Chrome might have changed the way it used to work.

@alvarotrigo
Copy link
Owner

alvarotrigo commented Nov 15, 2022

Alright, according to Chrome, the user must interact with the website for the URL hash change to be considered an entry on the browser history.

By user interaction they mean clicking anywhere, selecting text, etc...

Here's the Chromium feature explanation.

And here's a related issue.

So... it looks bad :)
We probably won't be able to overcome this.

@alvarotrigo alvarotrigo changed the title Back button in browser - goes to the correct section only in Firefox & Safari Back button in Chrome Web Browser - goes to the correct section only in Firefox & Safari Nov 15, 2022
@davITnemec
Copy link
Author

Thank you @alvarotrigo for the quick research and feedback. From the links you shared - it seems that this feature was in Chrome several years ago so it's not something what stopped working recently... Anyway I understand the situation. Appreciate your help.

By the way, in the Edge browser is the situation same. Would it be possible to check also this browser compatibility? Firefox and Safari browsers are working correctly.

@alvarotrigo
Copy link
Owner

From the links you shared - it seems that this feature was in Chrome several years ago so it's not something what stopped working recently...

I'm not sure when it was merged in Chrome, but never noticed it myself and we had no other complaints either.

By the way, in the Edge browser is the situation same.

Sounds like the exact same issue.
Clicking on the page will fix the issue.

@davITnemec
Copy link
Author

By the way, in the Edge browser is the situation same.

Sounds like the exact same issue. Clicking on the page will fix the issue.

Just tried it. Clicking and also marking text on the i.e. third section doesn't work (tested in Chrome and Edge). Nevermind, it's nice to have a feature and I understand that is sometimes very complicated to have some compromise with browsers 😄

@alvarotrigo
Copy link
Owner

Just tried it. Clicking and also marking text on the i.e. third section doesn't work (tested in Chrome and Edge).

I tested it on Edge and clicking or selecting text makes it work.
Video attached:

error.mp4

Same with Chrome

@alvarotrigo
Copy link
Owner

Nevermind, it's nice to have a feature and I understand that is sometimes very complicated to have some compromise with browsers 😄

But yeah, unfortunately, I guess there's nothing we can do about it.

@davITnemec
Copy link
Author

Just tried it. Clicking and also marking text on the i.e. third section doesn't work (tested in Chrome and Edge).

I tested it on Edge and clicking or selecting text makes it work. Video attached:

error.mp4
Same with Chrome

Ha, I have a different scenario. I think that the usage of anchors is the answer how to get to work in Chrome and Edge as well :-) Without anchors it works only in Firefox and Safari and marking and clicking in Edge or Chrome doesn't have any impact.

See my video:
https://ctrlv.tv/uTmk

@alvarotrigo
Copy link
Owner

Right!
That's a totally different thing yeah, and totally expected too.
We don't have control over that either in any case.

Try using the anchors option instead.
That's the only way fullPage.js can know where you were on the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants