T
T
thepikal2015-03-02 23:18:01
JavaScript
thepikal, 2015-03-02 23:18:01

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

1 answer(s)
L
Leonid Sysoletin, 2015-03-03
@thepikal

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 question

Ask a Question

731 491 924 answers to any question