X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Ffragments%2FGuideWebViewFragment.java;h=fc817af6700d13ef628f30c05dfd1009b63554b2;hp=0b0bc15741aab693f4424e50c49863da6a83deea;hb=ab11ca2de00c56982e46627c8e7fc670462b0b3c;hpb=39380e8e8bdb3b9e29569a263277c9c3112b44ac diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/GuideWebViewFragment.java b/app/src/main/java/com/stoutner/privacybrowser/fragments/GuideWebViewFragment.java index 0b0bc157..fc817af6 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/GuideWebViewFragment.java +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/GuideWebViewFragment.java @@ -1,5 +1,5 @@ /* - * Copyright © 2016-2020 Soren Stoutner . + * Copyright © 2016-2021 Soren Stoutner . * * This file is part of Privacy Browser . * @@ -27,6 +27,7 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.webkit.WebResourceRequest; import android.webkit.WebResourceResponse; import android.webkit.WebView; import android.webkit.WebViewClient; @@ -116,9 +117,10 @@ public class GuideWebViewFragment extends Fragment { } @Override - public WebResourceResponse shouldInterceptRequest(WebView webView, String url) { - // Have the WebView asset loader process the request. This allows loading of SVG files, which otherwise is prevented by the CORS policy. - return webViewAssetLoader.shouldInterceptRequest(Uri.parse(url)); + public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) { + // Have the WebView asset loader process the request. + // This allows using the `appassets.androidplatform.net` URL, which handles the loading of SVG files, which otherwise is prevented by the CORS policy. + return webViewAssetLoader.shouldInterceptRequest(webResourceRequest.getUrl()); } });