-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add reader mode for in-app browser #1184
Add reader mode for in-app browser #1184
Conversation
Hey! Finally getting around to this one - my only worry with this is that the package will be come outdated as time goes on. We can create a fork of this on the thunder repo, but it most likely means we'll have to maintain it. Do you have any thoughts on this? |
It's totally your call if you don't mind taking on another package to maintain. Of course I'm willing to help as needed! But I do think this is a pretty neat feature to have to flesh out in the in-app browser, and this package fits in perfectly with our existing browser controller architecture. |
@hjiangsu I'm trying to go through my old PRs one-by-one to see what needs to be done to either complete or close them. For this one, I did just resolve the merge conflicts, so it's working with the latest. However, I know you expressed some concern about introducing a dependency on a package that doesn't seem to have been updated in a while, and that also goes against your general philosophy of trying to slim down the app outlined here. So my question is: how do feel about introducing this dependency? If you think it's worth it, I'd say let's merge this now so it doesn't generate any more conflicts, and then we can fork the package later. If you don't think it's worth, I'm totally ok closing this. Just let me know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with bringing this in, since the PR was created before #1578 (and it also seems like a fairly useful feature to have)!
I know you expressed some concern about introducing a dependency on a package that doesn't seem to have been updated in a while
I did a quick skim of the package, and it seems to be fairly straight forward implementation so my initial concerns are lessened (since it'll be easy for us to fork it and fix it up if needed).
I'll go ahead and merge this in!
Pull Request Description
This PR adds a reader mode for Android (and iOS) using the in-app browser. Where previously the reader mode option would only be shown on iOS, it is now shown on Android too if the in-app browser is selected. It can also be toggled on/off dynamically in the in-app browser, regardless of the default. Note that history isn't shared between the modes.
One potential downside is that the package I'm using for this hasn't been updated for a while, but after a considerable amount of searching (which took a while, since it isn't even on pub.dev), it was not only exactly what I was looking for but seems to work very well. (I would've been happy with a simple web scraper that returns the body contents for us to render, but this has a whole controller architecture and everything.)
Aside from that I think it's pretty easy to sell the usefulness of a cross-platform reader mode. It makes page loads and navigation much faster and scrolling is more responsive.
Note: I also introduced some abstraction to handle the different types of controllers so there aren't a lot of conditionals everywhere.
Issue Being Fixed
Issue Number: #760
Screenshots / Recordings
https://files.catbox.moe/aetnb4.mp4
Checklist
semanticLabel
s where applicable for accessibility?