Last active
December 23, 2025 18:14
-
-
Save lastlink/da8e7daf64af04fd320dcd0031a66c19 to your computer and use it in GitHub Desktop.
Chase Card Add All Offers Activation Script
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 Chase offers | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2025-12-23 | |
| // @description Automatically add chase offers | |
| // @author You | |
| // @match https://secure.chase.com/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=chase.com | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| const urlPatterns = [/https:\/\/secure\.chase\.com\/web\/auth\/dashboard#\/dashboard\/merchantOffers\/offer-hub\?accountId=.*/,/https:\/\/secure\.chase\.com\/web\/auth\/dashboard#\/dashboard\/merchantOffers\/offerCategoriesPage\?accountId=.*/]; | |
| const btnSelection = '[role="button"][tabindex="0"] > :nth-child(2)'; | |
| //'.r9jbij9' manual button selection | |
| const backFunction = () => { | |
| // shadow root back button click | |
| document.querySelectorAll(`[variant="back"]`)[0].shadowRoot.querySelectorAll(`#back-button`)[0].click(); | |
| // old back method | |
| // window.history.back(); | |
| }; | |
| const a = () => { | |
| backFunction(); | |
| setTimeout(checkUrlAndRun, Math.random() * 1000 + 300); | |
| }; | |
| let count = 1; | |
| const c = () => { | |
| try { | |
| // key check for unchecked buttons to click | |
| const btns = [...document.querySelectorAll(btnSelection)].filter( | |
| (b) => b.lastChild.childNodes[0].querySelectorAll(`path`).length > 1 | |
| ); | |
| const b = btns.pop(); | |
| if (!b) { | |
| console.log('added all!'); | |
| return; | |
| } | |
| b.childNodes[0].click(); | |
| updateProgress(count, btns.length); | |
| setTimeout(a, Math.random() * 1000 + 300); | |
| document.querySelector(btnSelection).click(); | |
| } catch (e) { | |
| checkUrlAndRun(); | |
| } | |
| }; | |
| const updateProgress = (current, total) => { | |
| console.log(`Remaining: ${total}`); | |
| count++; | |
| }; | |
| const waitForElements = () => { | |
| const observer = new MutationObserver((mutations, observer) => { | |
| if (document.querySelectorAll(btnSelection).length > 0) { | |
| observer.disconnect(); | |
| c(); | |
| } | |
| }); | |
| observer.observe(document.body, { childList: true, subtree: true }); | |
| }; | |
| const checkUrlAndRun = () => { | |
| if (urlPatterns.some(urlPattern => urlPattern.test(window.location.href))) { | |
| waitForElements(); | |
| } | |
| }; | |
| // Initial check | |
| checkUrlAndRun(); | |
| // Monitor URL changes | |
| let oldHref = document.location.href; | |
| const body = document.querySelector("body"); | |
| const observer = new MutationObserver(mutations => { | |
| if (oldHref !== document.location.href) { | |
| oldHref = document.location.href; | |
| checkUrlAndRun(); | |
| } | |
| }); | |
| observer.observe(body, { childList: true, subtree: true }); | |
| })(); |
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
| !function(){"use strict";const e=[/https:\/\/secure\.chase\.com\/web\/auth\/dashboard#\/dashboard\/merchantOffers\/offer-hub\?accountId=.*/,/https:\/\/secure\.chase\.com\/web\/auth\/dashboard#\/dashboard\/merchantOffers\/offerCategoriesPage\?accountId=.*/],t='[role="button"][tabindex="0"] > :nth-child(2)',o=()=>{document.querySelectorAll('[variant="back"]')[0].shadowRoot.querySelectorAll("#back-button")[0].click(),setTimeout(l,1e3*Math.random()+300)};let c=1;const r=(e,t)=>{console.log(`Remaining: ${t}`),c++},n=()=>{new MutationObserver(((e,n)=>{document.querySelectorAll(t).length>0&&(n.disconnect(),(()=>{try{const e=[...document.querySelectorAll(t)].filter((e=>e.lastChild.childNodes[0].querySelectorAll("path").length>1)),n=e.pop();if(!n)return void console.log("added all!");n.childNodes[0].click(),r(c,e.length),setTimeout(o,1e3*Math.random()+300),document.querySelector(t).click()}catch(e){l()}})())})).observe(document.body,{childList:!0,subtree:!0})},l=()=>{e.some((e=>e.test(window.location.href)))&&n()};l();let a=document.location.href;const d=document.querySelector("body");new MutationObserver((e=>{a!==document.location.href&&(a=document.location.href,l())})).observe(d,{childList:!0,subtree:!0})}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment