balazsgerlei / SecureWebView

Android WebView wrapper with secure defaults to avoid security issues caused by misconfiguring WebViews.
Creative Commons Zero v1.0 Universal
3 stars 2 forks source link

🐞 loadUrlWithoutEscapingJavascript doesn't respect allow/block lists #5

Closed balazsgerlei closed 3 months ago

balazsgerlei commented 3 months ago

After realizing that it's not enough to check the allow/block list when loading a URL in shouldOverrideUrlLoading as that's not called when loading a page is initiated via loadUrl, the same filtering was added to not allow loading URIs that are on the blocklist, or if a whitelist is present not on it.

Unfortunately the other loadUrl method called loadUrlWithoutEscapingJavascript (which differs in not blocking JavaScript execution by escaping it) was not modified so the same logic should be added there as well.