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
PocketBook: Open links in the on-device web browser #11787
Conversation
7b5ebb5
to
a1969c3
Compare
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.
lgtm
I asked @sdasda7777 to test this on PB624 (Basic Touch, released in 2013, stuck on firmware 4.4) and had to make some adjustments (that also led to the discovery of |
3cd6b43
to
62d3310
Compare
We're still having some trouble making this work on PB624, but while researching how stuff works there, I've managed to simplify the implementation to a single The troublesome scenario on the PB624 is this:
For some reason, the last step fails—the browser doesn't switch to the new URL. But we discovered that it doesn't work with the built-in reader software either, so we could perhaps just call it broken and leave it as is. Or, we could check if the firmware is super old and if it is, kill the browser and then open a new one. I've already wasted so much time on this that a little extra won't hurt 😆 |
62d3310
to
bfedf1a
Compare
Okay so I can't make the browser killing work even on the InkPad 3, but I looked a bit deeper into how browser.app on PB624 implements the request handler and it seems that And even if it isn't, we now have a single-line implementation that, if nothing else, doesn't crash KOReader because that API has been there since forever. I'm calling it a day. :-) |
Would you mind posting the other thing for posterity? Force pushing seems like a bit of a pity in this case. :-) |
Oh, absolutely, I can make this into two commits, where one implements the most complicated thing I had with the comments about |
Many PocketBook devices include a web browser, but when clicking a link in KOReader, there was no option to open the link in the browser, there was only an option to show a QR code (which can then be scanned by a smartphone). This commit implements `canOpenLink`/`openLink` on PocketBook using the "browser.app", if available. Tested on PB740 (InkPad 3) and PB624 (Basic Touch). On the older device (PB624) it doesn't work quite as well—an already running browser ignores the request to switch URL, but it doesn't work with the built-in book reader software either. Fixes: koreader#11782 Related: koreader#6597
Somewhat unintuitively, OpenBook does exactly what we want if we pass the browser binary as the book and the URL as parameters. It does a couple extra things we don't need, like checking if the browser binary is being viewed by the built-in epub reading software, and possibly some more stuff I don't quite understand, but at the end it does almost exactly what OpenTask from the new PocketBook SDK does. Actually, OpenBook2 is closer to OpenTask, as it takes `const char **argv` rather than a single argument, but: we don't need multiple arguments, and the single-argument version might work better on older PocketBook firmwares (like the PB624 which is stuck with InkView 4.4).
bfedf1a
to
916050d
Compare
(force)pushed 🙂 |
Okay, final update: PB624 still won't switch the URL, even with (I'll be happy to investigate if there's bugs with any 5.* or 6.* firmware devices, but 4.4 is really to old to spend more time on it.) |
Thanks, then I'll squash and merge with GH. You're sure you're ready? 😆 |
Well if you squash you won't preserve the intermediate state... |
But we will, right here. I could rebase it if you really prefer but I just wanted it in the PR. |
Okay, whatever works 🙂 |
Actually, the PR desc is fine (sorry am on mobile, short attention span) |
Many PocketBook devices include a web browser, but when clicking a link in KOReader, there was no option to open the link in the browser, there was only an option to show a QR code (which can then be scanned by a smartphone).
This commit implements
canOpenLink
/openLink
on PocketBook using the "browser.app", if available.Tested on PB740 (InkPad 3).
Fixes: #11782
Related: #6597
This change is