fix(webview): route javascript: URLs through evaluateJavascript in the dispatcher#18
Open
jim-daf wants to merge 1 commit into
Open
fix(webview): route javascript: URLs through evaluateJavascript in the dispatcher#18jim-daf wants to merge 1 commit into
jim-daf wants to merge 1 commit into
Conversation
…the dispatcher
GoJsActivity dispatches every script call into the EidoGo board
through a single queue + runOnUiThread + wv.loadUrl(surl) pipeline.
Most viewUrl(...) call sites push a 'javascript:...' URL into that
queue, so the actual WebView call is loadUrl('javascript:...') on
every move state change. That records a synthetic history entry
every time and has no callback shape.
The file already has a long comment block noting evaluateJavascript
is the KitKat-era replacement. Doing the swap at the dispatcher
covers every existing viewUrl call site without touching them. Non
javascript URLs still go through loadUrl exactly as before.
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.
Closes #17.
GoJsActivityruns every script call into the EidoGo board through a single dispatcher (viewerq->runOnUiThread->wv.loadUrl(surl)). All theviewUrl("javascript:...")call sites end up there, so the actualWebViewcall isloadUrl("javascript:...")for every move state change. That's the legacy pattern: it adds a synthetic history entry on every script eval and cannot return a value to the caller.There's already a long comment block in this file pointing at
evaluateJavascriptas the KitKat-era replacement. The swap at the dispatcher covers every existing call site without touching them individually:Non-javascript URLs still go through
loadUrlexactly as before. Thenullcallback keeps behaviour identical for the script branch since no existing call site reads a return value.