Stop re-enabling setAllowFileAccess after the explicit setAllowFileAccess(false)#126
Open
jim-daf wants to merge 1 commit into
Open
Stop re-enabling setAllowFileAccess after the explicit setAllowFileAccess(false)#126jim-daf wants to merge 1 commit into
jim-daf wants to merge 1 commit into
Conversation
…cess(false)
MainActivity.setUpWebview did:
webSettings.setJavaScriptEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(false);
webSettings.setAllowFileAccess(false);
webSettings.setDatabaseEnabled(true);
...
webSettings.setAppCachePath(cachePath);
webSettings.setAllowFileAccess(true);
webSettings.setAppCacheEnabled(true);
The first setAllowFileAccess(false) shows the intent: the WebView is
loaded with YouTube (m.youtube.com) and never legitimately needs to
load file:// URLs. The setAllowFileAccess(true) call a few lines
later sits inside the cache-related setup and reads as a refactor
artifact rather than an intentional toggle. setAppCache does not
require file access.
Drop the second setAllowFileAccess(true) line so the initial
setAllowFileAccess(false) decision holds. file:///android_asset/*
loads remain permitted on every supported Android version
regardless of the flag.
Assisted-by: Claude (Anthropic)
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 #125.
MainActivity.setUpWebviewdoes:The first
setAllowFileAccess(false)shows the intent: the WebView is pointed at m.youtube.com and does not needfile://access. The secondsetAllowFileAccess(true)sits inside the cache setup and reads as a refactor artifact.setAppCache*does not require file access.Change
Drop the
setAllowFileAccess(true)line so the initialsetAllowFileAccess(false)decision holds.file:///android_asset/*loads remain permitted on every supported Android version regardless. No other WebView setting touched.The downstream
tobykurien/GoogleAppsfork carries the same shape and a matching fix is open at tobykurien/GoogleApps#59.Assisted-by: Claude (Anthropic)