我遇到了 javascript 问题,从 chrome v73.0.3683.86 开始,每当我在 window.location.reload() 函数之后运行 javascript 代码时,它总是给我错误“Unchecked runtime.lastError: The message port returned before a已收到回复。”
我在互联网上搜索了很多主题,但其中大部分是关于 chrome 扩展的。因此,我尝试在认知模式下运行此代码并禁用所有扩展,但没有任何更改。
※由于某种原因,我需要在 window.location.reload() 之后运行一些东西
onClick javascript 函数是这样的
<html>
<head>
<title>Hello world!</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript">
function buttonClick() {
window.location.reload();
document.title = "Hi there";
}
</script>
</head>
<body>
<div>TODO write content</div>
<button onclick="buttonClick()">Click here</button>
</body>
</html>
你可以尝试在没有任何扩展的情况下在 chrome 上运行它吗?
- 右键单击您的 Chrome 快捷方式
- 选择属性。
- 添加到目标字段的末尾 --disable-extensions --disable-plugins
它看起来像:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" /high-dpi-support=1 /force-device-scale-factor=1 --disable-extensions --disable-plugins
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)