-
Notifications
You must be signed in to change notification settings - Fork 74
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
EPUB navigator: internal links replace the whole web view context #27
Comments
Yeah that's not great. The link is simply changing the URL of the webview that is in the current fragment to be that of the resource you selected, which replaces the contents of it entirely. In this case, the table of contents is completely replaced by whatever chapter you select. Probably have to intercept the request in shouldOverrideUrlLoading (or this one) and ask the |
I tried looking around to check whether there is any way to intercept the request and use the |
Yeah internal links are very broken currently in the EPUB navigator. You had the right approach, I think this should be fixed here, like Steven mentioned: kotlin-toolkit/readium/navigator/src/main/java/org/readium/r2/navigator/R2BasicWebView.kt Line 478 in 3670f7c
Taking the Swift implementation as an example, we need to check if the link is internal and remove the base URL part to get only the Then you can use this newly created |
Okay cool, I forked the repository and will open a PR as soon as i manage to fix it. Is this ok? |
Sure, thank you! Don't forget to check the "Allow edits from maintainers" when creating the PR, so we can edit the changelog or do small changes. |
I have created a pull request here |
Thanks! I'll review this Friday |
Hello there! |
Yeah I'm actually working on this right now, there was an issue with lost anchors so we were only loading the first page of the target resource. (I haven't try pushing on your branch yet, but did you enable edit from maintainers on it?) |
Yes, it is enabled :D |
I also have one more question regarding this. So the PR looks good with the changes provided by you, it can be merged from my side. |
I want to do a 2.1.1 release with these changes this week. As long as you are using the |
That sounds amazing! Thank you very much :D |
Bug Report
What happened?
When opening an epub which has a table of contents inside the publication, taping on any of the links takes me to the correct location, however the
currentLocator
observer is not triggered and the progression of the publication is altered, navigating one page back takes me to the first page in the publication, and navigating forward restarts the publication from page 1 after the selected chapter from the ToC has endend. It was observed that on iOS this does not happen and there the behaviour is normal.Expected behavior
When taping on a hyperlink of an entry in the ToC, the locator observer should be triggered and the progression / page order of the publication should not be altered in any way.
How to reproduce?
Inconjurat_de_idioti.epub.zip
currentLocator
of the navigatorEnvironment
Development environment
Testing
Android version: 10
Model: OnePlus 5T
Is it an emulator? No
Additional context
The text was updated successfully, but these errors were encountered: