Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Download Fidelity
- // @namespace http://tampermonkey.net/
- // @version 2025-01-21
- // @description try to take over the world!
- // @author You
- // @match https://digital.fidelity.com/ftgw/digital/portfolio/positions
- // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- // Function to wait for the element to exist
- const waitForElement = (selector, callback) =>
- {
- console.log('three')
- const interval = setInterval(() =>
- {
- const element = document.querySelector(selector);
- console.log('four')
- if (element)
- {
- console.log('five')
- clearInterval(interval);
- callback(element);
- }
- }, 100); // Check every 100ms
- return interval;
- };
- console.log('one')
- const selector1 = '#posweb-grid_top-kebab_popover-button > s-root > button > div > span.pvd-button__icon.pvd-button__icon--left > s-slot > s-fallback-wrapper > pvd-scoped-icon-93413549 > svg';
- const selector2 = '#kebabmenuitem-download';
- const selector3 = '#posweb-grid_top-kebab_popover-button > s-root > button > div > span.pvd-button__icon.pvd-button__icon--left > s-slot > s-fallback-wrapper > pvd-scoped-icon-50260553'
- const selector4 = '#posweb-grid_top-kebab_popover-button > s-root > button'
- const selector5 = '#posweb-grid_top-kebab_popover-button'
- const selector6 = '#kebabmenuitem-download'
- console.log('two')
- waitForElement(selector1, (element) =>
- {
- console.log('Element Found, proceed to click.');
- element.click();
- }
- );
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement