Skip to content

Instantly share code, notes, and snippets.

@whonion
Last active November 22, 2023 12:29
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 whonion/e3db8f1083b5885958a0758c2a171b11 to your computer and use it in GitHub Desktop.
Save whonion/e3db8f1083b5885958a0758c2a171b11 to your computer and use it in GitHub Desktop.
coinstatsapp-portfolio-rollup
// ==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