Skip to content

Instantly share code, notes, and snippets.

@michael-kudrik
Created December 10, 2024 02:54
Show Gist options
  • Select an option

  • Save michael-kudrik/c8f00e8e7613a4cdab685e14ac0d7276 to your computer and use it in GitHub Desktop.

Select an option

Save michael-kudrik/c8f00e8e7613a4cdab685e14ac0d7276 to your computer and use it in GitHub Desktop.
Zooniverse - Exoasteroids - Automatic Play Clicker
// ==UserScript==
// @name New script zooniverse.org
// @namespace Violentmonkey Scripts
// @match https://www.zooniverse.org/projects/exoasteroids/exoasteroids/classify*
// @grant none
// @version 1.0
// @author -
// @description 12/9/2024, 9:33:09 PM
// ==/UserScript==
// Function to click the target button
// Function to click the target button
// Function to simulate a click on the button
function clickSecretButton() {
const button = document.querySelector('.secret-button.subject-tools__play');
if (button) {
button.click();
console.log("Button clicked!");
}
}
// Observe DOM changes and trigger the click function
const observer = new MutationObserver(() => {
clickSecretButton(); // Try to click the button whenever a mutation is detected
});
// Configuration for the observer
const config = {
childList: true, // Look for changes in the direct children of the observed node
subtree: true // Also observe the entire subtree
};
// Start observing the body for changes
observer.observe(document.body, config);
// Initial click attempt in case the button already exists
clickSecretButton();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment