-
Notifications
You must be signed in to change notification settings - Fork 30
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
One site not scrolling #17
Comments
I know that your comment is very old, but I'd been testing this site now and I obtained a good result with this extension, maybe it is a problem with your chrome. |
It looks like in https://github.com/jpablobr/simple-auto-scroll/blob/master/js/background.js
The scrolling is achieved by incrementing document scrollTop. |
OK so selecting overflow css is harder than it seems, so this just brute forces a way to find the largest element on the page by height that has overflow / overflowY as scroll or auto. const overflowElements = Array.from(document.querySelectorAll('*')).filter(a => {
const styles = getComputedStyle(a);
const overflowProps = ['overflowY', 'overflow']
const overflowValues = ['scroll', 'auto']
return overflowProps.some((prop) => overflowValues.includes(styles[prop]))
});
const scrollableEl = overflowElements.reduce(([largest,el],b) => {
const height = b.getBoundingClientRect().height
return height > largest ? [height, b] : [largest, el]
},[-Infinity, null])[1]
scrollableEl.scrollTop += 1 That doesn't work on other sites though, where |
I've got an issue you on the Chrome extension not scrolling on just one site. I know that Google-related sites do not work but I've been trying to use it on archiveofourown.org which is on independently operated servers using open-source code and all of sudden this extension no longer works on it. However, this still works on various other sites. What should I be looking for in terms of why it isn't working for me? I am very much a beginner when it comes to code so I'm not sure where to start.
The text was updated successfully, but these errors were encountered: