Advertisement
caffeine314

Untitled

Jan 22nd, 2025 (edited)
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Download Fidelity
  3. // @namespace    http://tampermonkey.net/
  4. // @version      2025-01-21
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://digital.fidelity.com/ftgw/digital/portfolio/positions
  8. // @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13.     'use strict';
  14.  
  15.     // Function to wait for the element to exist
  16.     const waitForElement = (selector, callback) =>
  17.     {
  18.         console.log('three')
  19.         const interval = setInterval(() =>
  20.         {
  21.             const element = document.querySelector(selector);
  22.             console.log('four')
  23.             if (element)
  24.             {
  25.                 console.log('five')
  26.                 clearInterval(interval);
  27.                 callback(element);
  28.             }
  29.         }, 100); // Check every 100ms
  30.       return interval;
  31.     };
  32.  
  33.  
  34.     console.log('one')
  35.     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';
  36.     const selector2 = '#kebabmenuitem-download';
  37.     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'
  38.     const selector4 = '#posweb-grid_top-kebab_popover-button > s-root > button'
  39.     const selector5 = '#posweb-grid_top-kebab_popover-button'
  40.     const selector6 = '#kebabmenuitem-download'
  41.  
  42.  
  43.     console.log('two')
  44.     waitForElement(selector1, (element) =>
  45.     {
  46.         console.log('Element Found, proceed to click.');
  47.         element.click();
  48.     }
  49.  
  50. );
  51.  
  52.  
  53. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement