Last active
November 22, 2023 12:29
-
-
Save whonion/e3db8f1083b5885958a0758c2a171b11 to your computer and use it in GitHub Desktop.
coinstatsapp-portfolio-rollup
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 coinstats.app portfolio rollup | |
// @namespace http://your.namespace.here/ | |
// @version 0.1 | |
// @description Click on specific elements on coinstats.app | |
// @author whonion | https://github.com/whonion | |
// @match https://old.coinstats.app/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Function to click on elements | |
function clickElements() { | |
// Get all elements with the specified title and class | |
var elements = document.querySelectorAll('span[title="Hide the sub-portfolios from the list view"].icon-arrange'); | |
// Log the number of elements found | |
console.log('Number of elements found:', elements.length); | |
// Iterate over each element and trigger a click event | |
elements.forEach(function(element) { | |
element.click(); | |
}); | |
} | |
// Log a message when the script is executed | |
console.log('Script executed.'); | |
// Run the function when the DOM content is fully loaded | |
document.addEventListener('DOMContentLoaded', function() { | |
// Wait for 3 seconds before trying to click the elements | |
setTimeout(clickElements, 3000); | |
}); | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment