Skip to content

Instantly share code, notes, and snippets.

@Yukaii
Last active September 23, 2021 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yukaii/7babf087b4308c2c94a0c73d5c585669 to your computer and use it in GitHub Desktop.
Save Yukaii/7babf087b4308c2c94a0c73d5c585669 to your computer and use it in GitHub Desktop.
點 raw 安裝。我在付錢的路上...
// ==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