Repository navigation
Prevent external links from replacing the slide deck - #104
Conversation
freakboy3742
left a comment
There was a problem hiding this comment.
Thanks for the fix! The approach you've taken here looks correct; the only suggestion I'd make would be that is_doc_url should be a method on the Deck, rather than a free-standing method.
|
As for your question about opening links in the system browser - if you can make that work, it definitely sounds preferable to silently swallowing the click. My only concern would be what happens when the app is in presentation mode... but I guess in presentation mode you don't have a cursor, so this might not be an issue? If you can confirm this isn't a problem in practice, and you can implement the "open in system browser" approach, then go for it! |
I confirmed that links can't be clicked in presentation mode, so I've implemented opening external links in the system browser. Each WebView navigates to about:blank on startup, so I excluded that URL. |
Both the slides and speaker-notes WebViews now have an
on_navigation_startinghandler. Navigation to URLs served by the deck is allowed, any other URL is opened in the system browser.Each WebView navigates to
about:blankon startup, so that URL is ignored.Testing
on_navigation_startingthere.Clicking an external link in a slide or the speaker notes navigated the window away from the presentation, with no way to get back.
Fixes #36
PR Checklist:
Assisted-by: Claude Opus 5.5