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

Using Snaplinks makes the website automatically scroll to the bottom #410

Open
betweenthefog opened this issue Jan 5, 2022 · 8 comments
Labels
bug verified Bug is reproducable

Comments

@betweenthefog
Copy link

betweenthefog commented Jan 5, 2022

This is an odd bug I've only encountered on one website so far.

When using SnapLinksPlus or even right clicking at all on this website, the website scrolls to the bottom: https://www.dianeseeds.com/Index.html

At first I thought it was some weird right click protection, but disabling Snaplinks allows right click to work normally (ie I can open a link in another tab), just without SnapLinksPlus working. I think something in the scripting of that website is colliding with Snaplinks and interpreting any possible use of it as a page down command.

I use Firefox (ver. 95.0.2 (64-bit), so no idea if this happens on the Chrome version of Snaplinks, or if it can be replicated on OSes that aren't Win 10.

It's not a deal breaker since this is one random website, but I figured I'd mention it in case this is a more widespread bug.

@remi-garcia remi-garcia added bug verified Bug is reproducable labels Jan 5, 2022
@remi-garcia
Copy link
Collaborator

I've to clean up the issues but I believe this has already been reported, we might have some discussion about the reasons of that bug on another issue.
Thanks for the report, I already saw that bug years ago for the first time. We should do something about it.

Info for devs:
Console log on right click: Error in parsing value for ‘height’. Declaration dropped.

@cpriest
Copy link
Owner

cpriest commented Jan 5, 2022

Thanks @remi-garcia, yes this website uses some weird layout which causes our document height calculation to fail. It will need to be triaged more closely to figure out if there is a way around the website issue.

Thanks,

-Clint

@remi-garcia
Copy link
Collaborator

Current info
document.documentElement.scrollHeight is equal to 8
document.documentElement.offsetHeight is equal to 8
document.documentElement.clientHeight is equal to 8

document.body.scrollHeight is equal to 1850
document.body.offsetHeight is equal to 0
document.body.clientHeight is equal to x x being the expected value.

Replacing docHeight = docElem.scrollHeight by docHeight = Math.max(docElem.scrollHeight, document.body.scrollHeight) in GetDocumentDims() does not solve anything

@betweenthefog
Copy link
Author

Thanks for checking! I had looked, but since I didn't know the exact problem, it could've slipped by me easily.

If you need any other info or want me to test anything on my end, let me know.

@remi-garcia
Copy link
Collaborator

remi-garcia commented Jan 5, 2022

The bug is clear and easily reproducible, we should not need to bother you. Thank you for suggesting your help 👍🏼 .
Note that we are not many on that project, and when I say "we" it is really mainly cpriest alone, so fixing this bug might take quite some time. Sorry about that.

@betweenthefog
Copy link
Author

It's alright! It's easy enough to disable Snaplinks for this specific site and then re-enable when I'm done. Maybe there'll be a clue here that will help you solve the similar report.

@cpriest
Copy link
Owner

cpriest commented Jan 17, 2022

Replacing docHeight = docElem.scrollHeight by docHeight = Math.max(docElem.scrollHeight, document.body.scrollHeight) in GetDocumentDims() does not solve anything

What do you mean? Are you saying you tried that and it didn't fix it?

@remi-garcia
Copy link
Collaborator

Yes, the values are good but it still scrolls to the bottom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug verified Bug is reproducable
Projects
None yet
Development

No branches or pull requests

3 participants