-
Notifications
You must be signed in to change notification settings - Fork 3
/
adyenlib.js
34 lines (29 loc) · 1.21 KB
/
adyenlib.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
// ==UserScript==
// @name ADYEN lib
// @namespace napali.boardriders
// @version 22.6.16.1
// @description let's capture better
// @author Benjamin Delichere
// @match https://*.adyen.com/*
// @icon https://ca-test.adyen.com/ca/img/adyen/favicon.ico
// @grant none
// @copyright Benjamin Delichere
// @license X11 (MIT)
// ==/UserScript==
(function(){
var runForestRun = function () {
jQuery('#app-content').on('click', '.loading-button',() => {autoClickLoadMoreWebhooks();});
autoClickLoadMoreWebhooks();
};
var waitForElm = function (selector) {
return new Promise(resolve => {
if (document.querySelector(selector)) {return resolve(document.querySelector(selector));}
const observer = new MutationObserver(mutations => {if (document.querySelector(selector)) {resolve(document.querySelector(selector));observer.disconnect();}});
observer.observe(document.body, {childList: true,subtree: true});
});
};
var autoClickLoadMoreWebhooks = function () {
waitForElm('.loading-button').then((elm) => {window.setTimeout(()=>{jQuery(elm).click();},500);});
}
runForestRun();
})();