代码:
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname +"?"+ queryStr;
window.history.pushState({path:newurl},'',newurl)
当前情况:
每次调用 window.history.pushState()
时会快速发出favicon请求。 每次调用此函数时,它都会在网络上请求favicon。
预期情况:
应该只在页面加载时加载favicon,不希望在每个window.history.pushState()
请求中加载favicon。
在HTML页面中Favicon路径链接如下:
<!-- Favicon -->
<link rel="icon" type="image/png" href="../img/icon/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="../img/icon/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="../img/icon/favicon-96x96.png" sizes="96x96">
base64
图像,并将其放置在favicon
链接的href
中。 - Ankit Singh