Sunday, May 19, 2024
178
rated 0 times [  185] [ 7]  / answers: 1 / hits: 9379  / 5 Years ago, wed, april 3, 2019, 12:00:00

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>




More From » google-chrome

 Answers
1

Can you try to run it on chrome without any extension?
- Right click on your Chrome shortcut
- Select Properties.
- Add to the end of the Target field --disable-extensions --disable-plugins



It will look like:



C:Program Files (x86)GoogleChromeApplicationchrome.exe /high-dpi-support=1 /force-device-scale-factor=1 --disable-extensions --disable-plugins



  • Click on OK

  • Start Chrome.


[#8169] Monday, April 1, 2019, 5 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
leslijessalyng

Total Points: 650
Total Questions: 85
Total Answers: 109

Location: Croatia
Member since Mon, Sep 6, 2021
3 Years ago
leslijessalyng questions
Fri, Feb 21, 20, 00:00, 4 Years ago
Tue, Jul 30, 19, 00:00, 5 Years ago
Fri, Jul 5, 19, 00:00, 5 Years ago
Wed, Mar 13, 19, 00:00, 5 Years ago
Fri, Dec 14, 18, 00:00, 6 Years ago
;