Decide where a page may navigate (story 10, Canvas 34) - #62
Merged
Merged
Conversation
WebViewComponent.setNavigationHandler asks the application, before any request is sent, about every navigation of the view and its frames: links, script navigation, forms, meta refreshes, back/forward, reload and redirects. A refused navigation never starts. The event carries the target and current URL, the cause, and whether the application itself asked for it (setUrl, and redirects of it). A throwing handler refuses; without a handler nothing changes; isNavigationHandlerSupported() reports an older native. Native: WebKitGTK decide-policy (lightweight and heavyweight engines, adopted popups), WKWebView decidePolicyForNavigationAction (reproducing WebKit's default when it allows), WebView2 NavigationStarting and FrameNavigationStarting. Also records in CLAUDE.md, in bold, that Linux is lightweight only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQdakxaBx7mVXvdCcKJdrw
shannah
marked this pull request as ready for review
October 1, 2026 22:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
WebViewComponent.setNavigationHandlerlets an application refuse a page's navigation before any request is sent. A content security policy confines what a page loads, but not where it goes: a link,location.href = …, a form posted to_topor a meta refresh sends whatever the page puts in the address. This closes that channel, which the Agentic App Framework needs before agents may hand data to user-built "creations".downloadlinks),location.*, forms, meta refreshes, back/forward, reload and server redirects. New windows stay with the popup handler.url(),currentUrl(),cause()(LINK,FORM,BACK_FORWARD,RELOAD,REDIRECTorOTHER) andapplicationInitiated(). That last one is true for the application's ownsetUrl, and for a server redirect of one it allowed, so an address bar still works.isNavigationHandlerSupported()is false against an older native.decide-policyonOffEngine,Engineand adopted popups. The four new symbols go through the runtime loader, so there is no new link dependency.decidePolicyForNavigationAction. When it allows, it reproduces WebKit's own default (downloads,mailto:and external schemes).NavigationStartingandFrameNavigationStarting.CLAUDE.mdnow says, in bold, that Linux is lightweight only, so agents stop running or debugging heavyweight on Linux.Story, analysis and Canvas:
requirements/[User-story-10]decide-where-a-page-may-navigate.md;spdd/analysis/GGQPA-XXX-202609301715-…;spdd/prompt/34-20260930-1720-[Feat]-Decide-Where-A-Page-May-Navigate.md.Checks
mvn testpasses, 257 tests including the 21 newNavigationDispatcherTestcases.NAVDEMO_AUTO=1 ./run-linux-navigation-demo.shgives PASS on all 18 checks (AC1–AC10).setUrl(AC5), and one after the handler was removed (AC8).NAVDEMO_AUTO=1 ./run-mac-navigation-demo.sh,run-windows-navigation-demo.bat) runs the same checks there.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQdakxaBx7mVXvdCcKJdrw
Generated by Claude Code