admin
2021-12-22 0a1336cd2b95126d66d6f3126cb48a446cdbfad1
app/src/com/hanju/video/app/ui/video/parser/WriteHandlingWebViewClient.java
@@ -27,6 +27,7 @@
public class WriteHandlingWebViewClient extends WebViewClient {
    private static final String TAG = "WriteHandlingWebViewClient";
    private final String MARKER = "AJAXINTERCEPT";
    /**
@@ -66,6 +67,7 @@
        OkHttpClient client = new OkHttpClient();
        try {
            String url = request.getUrl().toString();
            Log.i(TAG,"url:"+url);
//            if (!Pattern.matches(regex, url)) {
//                return super.shouldInterceptRequest(view, request);
//            }
@@ -208,7 +210,7 @@
        String mime = response.getMimeType();
        // WebResourceResponse的mime必须为"text/html",不能是"text/html; charset=utf-8"
        if (mime.contains("text/html")) {
        if (mime != null && mime.contains("text/html")) {
            mime = "text/html";
        }
@@ -234,7 +236,7 @@
    private InputStream injectInterceptToStream(Context context, InputStream is, String mime, String charset) {
        try {
            byte[] pageContents = Utils.consumeInputStream(is);
            if (mime.contains("text/html")) {
            if (mime != null && mime.contains("text/html")) {
                pageContents = AjaxInterceptJavascriptInterface
                        .enableIntercept(context, pageContents)
                        .getBytes(charset);