f
// ==UserScript==
// @name f
// @namespace http://tampermonkey.net/
// @version 0.1
// @description s
// @author You
// @match https://waves.exchange/signer/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=wavesducks.com
// @grant none
// ==/UserScript==
function qSelector(selector) {
return document.querySelector(selector);
}
function sleep (time=1000) {
return new Promise((resolve) => setTimeout(resolve, time));
}
// 模拟浏览器键盘事件
function keyEvent(key) {
var e = $.Event('keydown');
e.keyCode = key;
e.which = key;
$(window).trigger(e);
}
function fireKeyEvent(el, evtType, keyCode){
var doc = el.ownerDocument,
win = doc.defaultView || doc.parentWindow,
evtObj;
if(doc.createEvent){
if(win.KeyEvent) {
evtObj = doc.createEvent('KeyEvents');
evtObj.initKeyEvent( evtType, true, true, win, false, false, false, false, keyCode, 0 );
}
else {
evtObj = doc.createEvent('UIEvents');
Object.defineProperty(evtObj, 'keyCode', {
get : function() { return this.keyCodeVal; }
});
Object.defineProperty(evtObj, 'which', {
get : function() { return this.keyCodeVal; }
});
evtObj.initUIEvent( evtType, true, true, win, 1 );
evtObj.keyCodeVal = keyCode;
if (evtObj.keyCode !== keyCode) {
console.log("keyCode " + evtObj.keyCode + " 和 (" + evtObj.which + ") 不匹配");
}
}
el.dispatchEvent(evtObj);
}
else if(doc.createEventObject){
evtObj = doc.createEventObject();
evtObj.keyCode = keyCode;
el.fireEvent('on' + evtType, evtObj);
}
}
(function() {
'use strict';
const submit_button = ".css-14ilpg8"
const confirm_button = ".css-1wnx2ve"
var pid= setInterval(async function () {
try {
if (qSelector(submit_button)) {
// await sleep(2000)
// qSelector(submit_button).click()
if(qSelector(submit_button).disable!==false){
qSelector(submit_button).click()
}
} else {
}
} catch (err) {
console.log(err.message)
}
},500)
setInterval(async function () {
try {
if (qSelector(confirm_button)) {
qSelector(confirm_button).click()
} else {
}
} catch (err) {
console.log(err.message)
}
},500)
// Your code here...
})();