Repository navigation
Conversation
SystemBrowser's OIDC sign-in in the simulator waits for its BrowserWindow to report the redirect URI. With a custom scheme (com.example.app:/oauth2redirect?code=...) that never happened, so the simulator stayed on the sign-in form after a successful login: - JavaFX's web view drops every navigation to a scheme java.net.URL has no handler for -- a 302 redirect, a meta refresh, a link -- without a load or a location change. - Even when it navigates, the load fails, and FXBrowserWindowSE reported only loads that SUCCEEDED. So, when a browser window opens, AbstractBrowserWindowSE installs (once, and only if no factory is installed yet) a URLStreamHandlerFactory that answers for app schemes the JDK does not handle; their connections fail quietly. FXBrowserWindowSE then reports such an address once, when its location reaches it or its load fails. A script's location.replace() to such an address is still dropped inside WebKit; a page that redirects that way needs a link the person clicks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SZMcbmyfhDCp3DQ3U1YvWh
|
Compared 301 screenshots: 301 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Native fidelity (Android, Material 3)54 pairs compared -- median 95.6%, worst 91.3% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
|
Compared 12 screenshots: 12 matched. |
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
The previous commit picked up maven/.m2-repo, a local Maven cache that scripts/pre-push-gates.sh fills; master doesn't track it. The change itself is the three Java files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SZMcbmyfhDCp3DQ3U1YvWh
|
Compared 403 screenshots: 403 matched. |
|
Closing this in favour of signing in through the user's own browser on JavaSE (a loopback redirect, RFC 8252 §7.3), which a follow-up PR adds. This change makes the JavaFX Generated by Claude Code |
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
|
Reopening. The earlier test that seemed to fail never ran this change: the tool I used to run the simulator against a local build passed Generated by Claude Code |
|
@shannah doesn't this need a CEF change too? |
|
@shai-almog Yeah. I have a 2nd PR in the works to change it to use the system browser, but I thought I'd fix this while I was at it since it's low-hanging. I don't know if it needs a CEF fix. This is just what I hit when I tried Oidc in the simulator. It is using the Cef port, but for the SystemBrowser (i.e. popup browser window used by Oidc auth), it still uses the JavaFX webview implementation. Would be better if it used CEF. But in any case, the right solution for Oidc will be my 2nd PR that changes it to use the system browser instead of a popup. |
shai-almog
left a comment
There was a problem hiding this comment.
@shannah just don't merge it today as I'm still working on 287 and don't want to disrupt it yet.
|
@shai-almog Okay. |
Cloudflare Preview
|












































































































Summary
An OIDC sign-in in the simulator never finished when the redirect URI used the app's own scheme (
com.example.app:/oauth2redirect, the form RFC 8252 recommends and the oneOidcClientapps use on Android and iOS). The person signed in, the identity provider redirected, and the app stayed on its sign-in form.SystemBrowser.authenticateBrowserWindowwaits for theBrowserWindowto report an address starting with the redirect URI. In the simulator that window isFXBrowserWindowSE, and it never reported one:java.net.URLhas no handler for: a 302, a meta refresh, a link click. It does so without a load event or a location change. Measured with JavaFX 21: nothing at all is reported.FXBrowserWindowSEreported only loads thatSUCCEEDED.The fix:
AbstractBrowserWindowSE.installAppSchemeHandler(), called when anFXBrowserWindowSEis created, installs aURLStreamHandlerFactoryonce per JVM. It answers only for a scheme thatisAppSchemeUrlaccepts and that neither the JDK norjava.protocol.handler.pkgshandles, and returns null for everything else. Its connections throwFileNotFoundException, which the web view reports as a failed load without logging a stack trace. If a factory is already installed, it logs that and changes nothing.FXBrowserWindowSEreports such an address once to its load listeners, both when the engine's location reaches it and when its load fails.What the window sees, measured with JavaFX 21 and the real
FXBrowserWindowSE:<meta http-equiv=refresh>location.replace()/location.assign()So a page that hands back only by script still needs a link the person clicks in the simulator.
Test plan
AbstractBrowserWindowSETest: which addresses are an app's; only schemes the JDK does not handle get the handler (ftp,mailto,jar,httpkeep theirs)End to end, in a real window under Xvfb (JDK 17, JavaFX 21):
FXBrowserWindowSEfrom the releasedcodenameone-javase-7.0.287.jar, then the same with this PR's two classes first on the classpath. A local server played the provider, and the listener waits asSystemBrowser.authenticateBrowserWindowdoes, for a load event starting withca.weblite.xataworks.mobile:/oauth2redirect:?code=abclocation.replace()/location.href =, at once, after a delay or on loadlocation.replace()with a "Return to app" link, then the link clickedA trace of the bare web view shows why the script cases stay out of reach: the link click reaches the stream handler, while
location.hrefproduces no location change, no load, no error and no console message.A full
OidcClientsign-in in the simulator against a live provider (not run: the check above stops at the window and its listener)Local gate:
scripts/pre-push-gates.sh --fullcould not complete in the container this was written in. Source gates passed, as did the build hint catalog and cast semantics. What failed is all download or tooling:codenameone-javasebecause the proxy refused thecodenameone-skinsarchive download.So SpotBugs, PMD, Checkstyle and the Maven unit tests have not run here; CI is their first run. The new test was compiled and run on its own (4/4 passing), and both changed classes compile against JavaFX 8 (
jfxrt.jar) and JavaFX 21.https://claude.ai/code/session_01SZMcbmyfhDCp3DQ3U1YvWh
Generated by Claude Code