一个老问题有了新的转折。如何使用"Referer"/Referrer将html加载到网页视图中,并从资源或可绘制目录中加载文件。
加载"Referer“或”Referrer“。
webview.loadDataWithBaseURL("www.refererurl.com", html, "text/html", "utf-8", null); 使用www.refererurl.com将阻止加载资源。
webview.loadDataWithBaseURL(null, html, "text/html", "utf-8", null); 如果html包含如下内容,则使用null作为第一个参数将从资源中加载:
file:///android_asset/ic_launcher.png那么我该如何做到这两点,从资源加载和从引用加载?
发布于 2016-06-25 05:12:23
如果我没看错文档,看起来你不能用引用加载和加载资源。
在loadDataWithBaseURL上的webview文档中:
* Note that content specified in this way can access local device files
* (via 'file' scheme URLs) only if baseUrl specifies a scheme other than
* 'http', 'https', 'ftp', 'ftps', 'about' or 'javascript'.https://stackoverflow.com/questions/38021841
复制相似问题