html:
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div class="checks">
<label><input type="checkbox" class="check" id="one" onchange="fun1()">auto-accept</label>
</div>
<script src="app.js"></script>
</body>
</html>
manifest:
{
"manifest_version": 2,
"name": "Fastcup Auto-Accept",
"version": "1.0",
"description": "Fastcup Auto-Accept!",
"icons": {
"128": "128.png"
},
"browser_action": {
"default_icon": "128.png",
"default_popup": "popup.html"
},
"content_scripts": [
{
"js": [ "app.js" ],
"matches": [ "https://csgo.fastcup.net/*" ],
"run_at": "document_start"
}
]
}
js:
function fun1() {
var chbox;
chbox = document.getElementById("one");
if (chbox.checked) {
function fcac() {
var ez = document.querySelectorAll(".TOkwY.PKBwK.EzdEF");
for (var i = 0; i < ez.length; i++) {
ez[i].click();
}
}
setInterval(fcac, 5000);
} else {
alert("not checked");
}
}
in console (DOM) of browser everything works but in the extension not.
The button is initially gray, the search for a match is in progress, and now it turns green when the match is located (related classes are added), you must automatically click on it, I could pack the javascript into the extension, I could also search for the button in an endless search, now it turned out to make the code work in the console, and it works, the button is pressed, but through the extension does not work.