1. 解决微信内核为wkwebview时返回上一页,界面不刷新的问题
window
.
onpageshow
=
function
(
event
){
if
(
event
.
persisted
)
{
window
.
location
.
reload
();
}
};
2.如何在HTTPS网页中引入HTTP资源
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
意思是自动将http的不安全请求升级为https
3.如何清除微信内置浏览器的缓存
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
4. Referrer Policy 用于过滤 Referrer 报头内容,默认值为 no-referrer-when-downgrade
通过指定 name 值为 referrer 的 meta 标签,也可以达到相同的效果:
<meta name="referrer" content="strict-origin" />