Last active
September 23, 2021 03:27
-
-
Save Yukaii/7babf087b4308c2c94a0c73d5c585669 to your computer and use it in GitHub Desktop.
點 raw 安裝。我在付錢的路上...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Workona auto click | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1.0 | |
// @description Auto click open button for legacy workspaces | |
// @author Yukaii | |
// @match https://workona.com/* | |
// @icon https://www.google.com/s2/favicons?domain=workona.com | |
// @downloadURL https://gist.github.com/Yukaii/7babf087b4308c2c94a0c73d5c585669/raw/workona-clicker.user.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const buttonSelector = '[class*="btnPrimary"][class*="footerBtn"]'; | |
const root = document.querySelector('#___gatsby') | |
new MutationObserver(function (mutations) { | |
mutations.forEach(function (mutation) { | |
if (mutation.addedNodes.length) { | |
const button = mutation.addedNodes[0].querySelector(buttonSelector); | |
if (button) { | |
button.click(); | |
} | |
} | |
}); | |
}).observe(root, { | |
subtree: true, | |
childList: true, | |
attributes: true, | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment