I have written an extension which requires the page to fully load in order to work properly. The function myLoop() is the one which should be fired only after the page fully loads and I also want to add a 5 second delay.
Here is my code :
function like() {
step_delay_msec = step_delay * 1000;
i = 0;
console.log("Hello " + i);
myLoop();
var stepAll = setInterval(function () {
i = 0;
console.log("Hello " + i);
myLoop();
}, step_delay_msec);
}
Note : window.onload won't work because the full page loads after the window has been loaded. The elements load later.