lmw
2023-05-12 f67802a41f9e01444d1115f34ecc6e1beb05fc3b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.fuban.user.utils;
 
import android.util.Log;
import android.webkit.JavascriptInterface;
 
public class InnerJsInterface {
    @JavascriptInterface
    public void h5Toast(String data) {
 
    }
 
    @JavascriptInterface
    @SuppressWarnings("unused")
    public void processHTML(String html) {
        // 在这里处理html源码
        Log.i("Fuban", "processHTML: sdf" + html);
        String sHead = "<html><head><meta name=\"viewport\" content=\"width=device-width, " +"initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes\" />" +"<style>img{max-width:100% !important;height:auto !important;}</style>"+ "<style>body{max-width:100% !important;}</style>" + "</head><body>";
        html = sHead + html;
    }
 
}