kenaniah / chrome-navigation-plugin

A plugin for Google Chrome that allows intelligent, automatic navigation.
https://chrome.google.com/webstore/detail/ioogigbgjmadikfocfdmmdlghogaehca/details
MIT License
10 stars 5 forks source link

Doesn’t seem to work for bookdown-generated pages #6

Open ndarville opened 7 years ago

ndarville commented 7 years ago

Example: http://r4ds.had.co.nz/index.html.

<link rel="next" href="introduction.html">

The site has been built with bookdown.

Any idea why it doesn’t go to the next page?

kenaniah commented 7 years ago

Thanks for the bug report!

The links are parsed properly, and the other shortcut keys work, so this may be something related to how scroll position is detected. I'm looking into it now.

kenaniah commented 7 years ago

Postmortem - bookdown uses a fixed height for <body> and wrapping <div>s that are scrollable. Checking the body's scroll position was therefore ineffective as the main content area lived inside of a child element.

Version 9.0 now uses checks the scroll positions of elements recursively starting from the target element when the spacebar is pressed, which allows for a better experience in fixed-height layouts.

ndarville commented 7 years ago

Nice one, cheers. Should speed up my R studies significantly. :)

ndarville commented 7 years ago

Uh-oh, @kenaniah, looks like this update breaks the feature on sites like https://forums.somethingawful.com now. :/

EDIT: What a terrible issue report, I meant to mention that it now skips to the next page whenever I press Space regardless where I am on the page.

kenaniah commented 7 years ago

Indeed. Apparently this patch breaks other websites such as Python docs. Reverting for now until I can find a more sustainable solution to this.