Answer the question
In order to leave comments, you need to log in
How to update popup.html from outside?
Add-on for Google Chrome, there is a popup.html page, when trying to update it via location.reload(), an
Uncaught TypeError: Illegal invocation error occurs.
Here is the popup.js code:
var intID;
function start_script() {
intID = setInterval(location.reload,100);
}
function stop_script() {
clearInterval(intID);
}
document.addEventListener( "DOMContentLoaded" , function () {
document.getElementById("bt_1").addEventListener( "click" , start_script);
});
document.addEventListener( "DOMContentLoaded" , function () {
document.getElementById("bt_2").addEventListener( "click" , stop_script);
});
Answer the question
In order to leave comments, you need to log in
So you can't pass a function.
Should help
setInterval( function(){ window.location.reload() }, 100 );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question