允许HTTPS、HTTP混合内容,解决微信网页视频无法播放的问题

This commit is contained in:
sonichy 2021-03-02 12:52:51 +08:00
parent c603d8265b
commit f3287f3ac7
5 changed files with 13 additions and 11 deletions

BIN
app.apk

Binary file not shown.

View File

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hty.browser"
android:versionCode="4"
android:versionName="4.16">
android:versionName="4.17">
<application
android:icon="@drawable/ic_launcher"

View File

@ -9,7 +9,7 @@ p { text-indent:2em; }
</style>
</head>
<body>
<h2 align=center><img src=logo.png><br>海天鹰浏览器 V4.15</h2>
<h2 align=center><img src=logo.png><br>海天鹰浏览器 V4.17</h2>
<p>内置扩展的浏览器。</p>
<p>扩展:链接关键字过滤,链接关键字高亮,图片自定义过滤,视频独立播放。</p>
<p>作者:海天鹰</p>
@ -23,6 +23,7 @@ p { text-indent:2em; }
<p><a href="https://stackoverflow.com/questions/3462582/display-the-android-webviews-favicon" target="_blank">获取网页图标</a></p>
<p><a href="https://www.jianshu.com/p/c9a18050a249" target="_blank">字符串转Bitmap</a></p>
<h3>更新日志:</h3>
<h3>V4.17 (2021-03-02)</h3><ol><li>允许HTTPS、HTTP混合内容解决微信网页视频无法播放的问题。</li></ol>
<h3>V4.16 (2020-10-14)</h3><ol><li>取消引起崩溃的复制图片。</li></ol>
<h3>V4.15 (2020-10-01)</h3><ol><li>优化猜测下载文件名。</li></ol>
<h3>V4.14 (2020-09-20)</h3><ol><li>优化下载对话框百度网页图片文件名填充,支持修改下载文件名。</li></ol>

View File

@ -28,7 +28,6 @@ import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
@ -1204,25 +1203,27 @@ public class MainActivity extends Activity {
void settingWebView(WebView webView) {
registerForContextMenu(webView); // 注册菜单
webView.requestFocusFromTouch(); // 请求触摸焦点
if(Build.VERSION.SDK_INT >= 19) {
webView.setWebContentsDebuggingEnabled(true); // 允许调试
}
webView.setWebContentsDebuggingEnabled(true); // 允许调试
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true); // 开启JS
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);// 允许JS打开窗口
webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);// 开启缓存
webSettings.setJavaScriptCanOpenWindowsAutomatically(true); // 允许JS打开窗口
webSettings.setCacheMode(WebSettings.LOAD_DEFAULT); // 开启缓存
// 自适应屏幕
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setSupportZoom(true); // 支持缩放
webSettings.setBuiltInZoomControls(true);// 启用内置缩放控件
webSettings.setBuiltInZoomControls(true); // 启用内置缩放控件
webSettings.setDisplayZoomControls(false); // 隐藏缩放控件
webSettings.setAllowFileAccess(true);// 开启文件访问
webSettings.setAllowFileAccess(true); // 开启文件访问
webSettings.setDatabaseEnabled(true); // 开启数据库
webSettings.setDomStorageEnabled(true); // 开启localStorage
webSettings.setGeolocationEnabled(true); // 开启定位
webSettings.setSupportMultipleWindows(true); // 支持多窗口
webSettings.setAllowUniversalAccessFromFileURLs(true); // 允许跨域
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); // 允许HTTPSHTTP混合内容
}
webView.setWebViewClient(new WebViewClient() {
@Override

View File

@ -1 +1 @@
4.16
4.17