Skip to content

Prevent external links from replacing the slide deck - #104

Merged
freakboy3742 merged 3 commits into
beeware:mainfrom
Gise23:36-block-external-links
Nov 13, 2026
Merged

freakboy3742 merged 3 commits into
beeware:mainfrom
Gise23:36-block-external-links

Conversation

@Gise23

@Gise23 Gise23 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Both the slides and speaker-notes WebViews now have an on_navigation_starting handler. Navigation to URLs served by the deck is allowed, any other URL is opened in the system browser.

Each WebView navigates to about:blank on startup, so that URL is ignored.

Testing

  • Tested on macOS in both the slides and speaker-notes windows.
  • Confirmed that in presentation mode Podium hides the cursor, so links can't be clicked.
  • Not covered on GTK/Linux, as Toga doesn't support on_navigation_starting there.

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:

  • I will abide by the BeeWare Code of Conduct
  • I have read and have followed the CONTRIBUTING.md file
  • This PR was generated or assisted using an AI tool

Assisted-by: Claude Opus 5.5

@freakboy3742 freakboy3742 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@freakboy3742

Copy link
Copy Markdown
Member

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!

@Gise23

Gise23 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

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.

@freakboy3742 freakboy3742 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome - nice work!

@freakboy3742
freakboy3742 merged commit 183071e into beeware:main Nov 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

External href links are death traps

2 participants