I need simple extension for my side job. I want it to be activated when I click extension icon. That part I have already done with this code:
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript(null, {file: "script.js"});
});
But I need the script itself.
I want to click button(role=”button” class=”button-red”) randomly using something like:
document.getElementById("demo").innerHTML = Math.random() * 10 + 25;
but with fixed number of digits so the time looks like this for example:
27.457
I tried doing some function and repeating it using setInterval(function, x) but I have no idea what to put under X so its random every time(keep in mind that the time must have 5 digits so its like 23.842).
aetpr546 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
4