Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Prev Previous commit
Next Next commit
don't call super.shouldOverrideUrlLoading
  • Loading branch information
amirh committed Mar 9, 2019
commit 530d024db48d04b2f09927b946036a1e9f9c0997
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

package io.flutter.plugins.webviewflutter;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.view.View;
import android.webkit.WebStorage;
import android.webkit.WebView;
Expand Down Expand Up @@ -139,6 +141,7 @@ private void updateSettings(MethodCall methodCall, Result result) {
result.success(null);
}

@TargetApi(Build.VERSION_CODES.KITKAT)
private void evaluateJavaScript(MethodCall methodCall, final Result result) {
String jsString = (String) methodCall.arguments;
if (jsString == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void setHasNavigationDelegate(boolean hasNavigationDelegate) {
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
if (!hasNavigationDelegate) {
return super.shouldOverrideUrlLoading(view, request);
return false;
}
notifyOnNavigationRequest(
request.getUrl().toString(), request.getRequestHeaders(), view, request.isForMainFrame());
Expand All @@ -56,7 +56,7 @@ public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (!hasNavigationDelegate) {
return super.shouldOverrideUrlLoading(view, url);
return false;
}
// This version of shouldOverrideUrlLoading is only invoked by the webview on devices with
// webview versions earlier than 67(it is also invoked when hasNavigationDelegate is false).
Expand Down