]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/fragments/GuideWebViewFragment.java
Bump the minimum API to 23. https://redmine.stoutner.com/issues/793
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / fragments / GuideWebViewFragment.java
index 0b0bc15741aab693f4424e50c49863da6a83deea..fc817af6700d13ef628f30c05dfd1009b63554b2 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright © 2016-2020 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2016-2021 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
  *
  *
  * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
  *
@@ -27,6 +27,7 @@ import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 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;
 import android.webkit.WebResourceResponse;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
@@ -116,9 +117,10 @@ public class GuideWebViewFragment extends Fragment {
             }
 
             @Override
             }
 
             @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());
             }
         });
 
             }
         });