- 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());