I'm having an issue with javascript, since chrome v73.0.3683.86, whenever I run my javascript code after window.location.reload() function it always give me the error Unchecked runtime.lastError: The message port closed before a response was received.
I've searching for many topics over the internet but most of it is about chrome extension. So I tried to run this code in cognito mode and disable all extension but there's no changes.
※For some reason I need to run something after window.location.reload()
onClick javascript function like this
<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>