forked from 14BAGIR/BotPTCFaucetPay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.js
48 lines (43 loc) · 1.5 KB
/
content.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function RunScript(TextScript) {
var injectedCode = TextScript;
var script = document.createElement('script');
script.appendChild(document.createTextNode(injectedCode));
(document.body || document.head || document.documentElement).appendChild(script);
};
if (window.location.href.match("faucetpay.io/ptc/view/")) {
RunScript("\
var stayfocus = setInterval(function () { \
window.onblur = function () { \
window.in_focus = 1; \
}; \
window.in_focus = 1; \
}, 1000); \
");
window.addEventListener('message', function (event) {
if (event.data.checked) {
document.getElementsByClassName('btn btn-lg btn-danger')[0].setAttribute("onclick","");
setInterval(function(){
if (document.readyState){
document.getElementsByClassName('btn btn-lg btn-danger')[0].click();
}
},1500);
};
}, false);
} else if(window.location.href.match("faucetpay.io/ptc")){
console.log("PTC Menu");
if (document.readyState){
if (document.getElementsByClassName('btn btn-primary btn-block').length){
document.getElementsByClassName('btn btn-primary btn-block')[0].click()
}
}
};
if (window.location.href.match(/https:\/\/www.google.com\/recaptcha\/api\d\/anchor/)){
var sid = setInterval(function() {
if (document.getElementsByClassName("recaptcha-checkbox-checked").length != 0){
window.parent.postMessage({
'checked': '1'
}, "*");
clearInterval(sid);
}
}, 500);
};