chore: open rewards links by clicking the elements
This commit is contained in:
+4
-11
@@ -4,7 +4,7 @@
|
|||||||
// @description Utilities to semiautomate Bing reward point redemption
|
// @description Utilities to semiautomate Bing reward point redemption
|
||||||
// @include https://www.bing.com/*
|
// @include https://www.bing.com/*
|
||||||
// @match https://rewards.bing.com/
|
// @match https://rewards.bing.com/
|
||||||
// @version 1.6.1
|
// @version 1.6.2
|
||||||
// @updateURL https://git.alexbcberio.com/alexbcberio/userscripts/raw/branch/main/bing-rewarder/index.js
|
// @updateURL https://git.alexbcberio.com/alexbcberio/userscripts/raw/branch/main/bing-rewarder/index.js
|
||||||
// @downloadURL https://git.alexbcberio.com/alexbcberio/userscripts/raw/branch/main/bing-rewarder/index.js
|
// @downloadURL https://git.alexbcberio.com/alexbcberio/userscripts/raw/branch/main/bing-rewarder/index.js
|
||||||
// @grant GM.registerMenuCommand
|
// @grant GM.registerMenuCommand
|
||||||
@@ -25,9 +25,6 @@
|
|||||||
// Wait times to close tab
|
// Wait times to close tab
|
||||||
const minBaseTimeout = 3000;
|
const minBaseTimeout = 3000;
|
||||||
const maxBaseTimeout = 5000;
|
const maxBaseTimeout = 5000;
|
||||||
// Extra time to wait to perform next click
|
|
||||||
const minExtraTimeout = 500;
|
|
||||||
const maxExtraTimeout = 1750;
|
|
||||||
|
|
||||||
const pendingElements = document.querySelectorAll("mee-rewards-points .mee-icon-AddMedium");
|
const pendingElements = document.querySelectorAll("mee-rewards-points .mee-icon-AddMedium");
|
||||||
|
|
||||||
@@ -45,19 +42,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const link = pendingElements[num].closest("a");
|
const link = pendingElements[num].closest("a");
|
||||||
const timeoutMs = minBaseTimeout + Math.random() * (maxBaseTimeout - minBaseTimeout);
|
|
||||||
|
|
||||||
if (link) {
|
if (link) {
|
||||||
const linkLocation = link.getAttribute("href");
|
link.click();
|
||||||
const tab = window.open(linkLocation);
|
|
||||||
setTimeout(() => {
|
|
||||||
tab.close();
|
|
||||||
}, timeoutMs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const timeoutMs = minBaseTimeout + Math.random() * (maxBaseTimeout - minBaseTimeout);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
collectPoint(num+1);
|
collectPoint(num+1);
|
||||||
}, timeoutMs + minExtraTimeout + Math.random() * (maxExtraTimeout - minExtraTimeout));
|
}, timeoutMs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user