Last active
August 16, 2025 16:45
-
-
Save artchen/f989859b19bae385d94c44892fb9d282 to your computer and use it in GitHub Desktop.
Add Wells Fargo Offers
This file contains hidden or 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 Add WF offers | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2025-08-16 | |
| // @description - _- | |
| // @author Art Chen | |
| // @match https://web.secure.wellsfargo.com/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=wellsfargo.com | |
| // @grant none | |
| // ==/UserScript== | |
| const selectors = { | |
| addOfferButton: '[data-testid="deal-tile"]', | |
| offerBackButton: '[data-testid="modal-lightbox-close-icon"]' | |
| }; | |
| function wait(delay) { | |
| return new Promise(resolve => setTimeout(resolve, delay)); | |
| } | |
| async function waitForElement(sel) { | |
| const el = document.body.querySelector(sel); | |
| if (el) { | |
| return el; | |
| } | |
| await wait(1000); | |
| return waitForElement(sel); | |
| } | |
| function makeButton() { | |
| const button = document.createElement('button'); | |
| button.id = "add-all-offers-button"; | |
| button.textContent = 'Add all offers'; | |
| const findOffers = () => { | |
| const allOffers = [...document.querySelectorAll(selectors.addOfferButton)].filter(btn => !btn.textContent.includes('Activated'));; | |
| button.textContent = `Remaining Offers: ${allOffers.length}. Please wait...`; | |
| return allOffers; | |
| }; | |
| async function addOffer() { | |
| const offers = findOffers(); | |
| if (!offers.length) { | |
| button.textContent = `All offers added. Click to restart.`; | |
| window.scrollTo({ | |
| top: 0, | |
| left: 0, | |
| behavior: "smooth", | |
| }); | |
| return; | |
| } | |
| offers[0].click(); | |
| const closeModalButton = await waitForElement(selectors.offerBackButton); | |
| closeModalButton.click(); | |
| await wait(1000); | |
| await addOffer(); | |
| } | |
| button.addEventListener('click', addOffer); | |
| return button; | |
| } | |
| function makeStyle() { | |
| const styleEl = document.createElement('style'); | |
| const css = ` | |
| #add-all-offers-button { | |
| position: fixed; | |
| z-index: 100001; | |
| right: 20px; | |
| top: 60px; | |
| transition: background 0.24s; | |
| background: #ffffff; | |
| border: 0; | |
| border-radius: 5px; | |
| padding: 0 15px; | |
| height: 36px; | |
| align-items: center; | |
| appearance: none; | |
| background-color: #FCFCFD; | |
| box-shadow: rgba(45, 35, 66, 0.4) 0 2px 4px, rgba(45, 35, 66, 0.3) 0 7px 13px -3px, #D6D6E7 0 -3px 0 inset; | |
| box-sizing: border-box; | |
| color: #36395A; | |
| cursor: pointer; | |
| display: inline-flex; | |
| justify-content: center; | |
| line-height: 1; | |
| list-style: none; | |
| overflow: hidden; | |
| text-decoration: none; | |
| transition: box-shadow .15s, background .15s, transform .15s; | |
| user-select: none; | |
| -webkit-user-select: none; | |
| touch-action: manipulation; | |
| white-space: nowrap; | |
| will-change: box-shadow, transform; | |
| font-size: 14px; | |
| } | |
| #add-all-offers-button:hover { | |
| box-shadow: rgba(45, 35, 66, 0.4) 0 4px 8px, rgba(45, 35, 66, 0.3) 0 7px 13px -3px, #D6D6E7 0 -3px 0 inset; | |
| transform: translate3d(0, -2px, 0); | |
| } | |
| #add-all-offers-button:active { | |
| box-shadow: #D6D6E7 0 3px 7px inset; | |
| transform: translate3d(0, 2px, 0); | |
| } | |
| `; | |
| styleEl.type = 'text/css'; | |
| styleEl.appendChild(document.createTextNode(css)); | |
| return styleEl; | |
| } | |
| (async function() { | |
| 'use strict'; | |
| const addAllOfferButton = makeButton(); | |
| document.body.prepend(addAllOfferButton); | |
| const styleEl = makeStyle(); | |
| document.head.appendChild(styleEl); | |
| })(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment