Skip to content

Instantly share code, notes, and snippets.

@smaharj1
Last active November 19, 2023 07:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smaharj1/6d96b368f93c1951ed301cffe87c783e to your computer and use it in GitHub Desktop.
Save smaharj1/6d96b368f93c1951ed301cffe87c783e to your computer and use it in GitHub Desktop.
Chase bank auto apply offers
/**
APPLY CHASE BANK CC OFFERS
This script helps you apply all the Chase bank credit cards automatically.
- Login to Chase and go to https://secure03b.chase.com/web/auth/dashboard#/dashboard/offers/index.
- Open 'Inspect Element'
- Go to Scripts tab and copy this script.
- Run this script.
*/
const BUTTON_CLASSNAME = 'sixersoffers__cta';
const ALREADY_APPLIED_OFFER_CLASSNAME = 'confirmation';
function timeout(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
const getButtons = () => {
const allButtons = document.getElementsByClassName(BUTTON_CLASSNAME);
let validButtons = [];
for (let j=0; j < allButtons.length; j++) {
if (allButtons[j].getElementsByClassName(ALREADY_APPLIED_OFFER_CLASSNAME).length <= 0) {
validButtons.push(allButtons[j])
}
}
return validButtons;
}
const begin = async () => {
let buttons = getButtons();
while (buttons.length > 0) {
let btn = buttons[0];
btn.click();
await timeout(1500);
let close = document.getElementById('flyoutClose');
close.click();
await timeout(1500);
buttons = getButtons();
}
}
begin();
@nachtien
Copy link

nachtien commented May 31, 2023

working script as of 6/19/2023:

/**
  APPLY CHASE BANK CC OFFERS
  This script helps you apply all the Chase bank credit cards automatically. 
      - Login to Chase and go to https://secure03b.chase.com/web/auth/dashboard#/dashboard/offers/index.
      - Open 'Inspect Element'
      - Paste this in the console and hit enter
*/
const BUTTON_CLASSNAME = 'iconAddToCard';
const ALREADY_APPLIED_OFFER_CLASSNAME = 'confirmation';
function timeout(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}

const getButtons = () => {
    const allButtons = document.getElementsByClassName(BUTTON_CLASSNAME);

    let validButtons = [];

    for (let j=0; j < allButtons.length; j++) {
        if (allButtons[j].getElementsByClassName(ALREADY_APPLIED_OFFER_CLASSNAME).length <= 0) {
            validButtons.push(allButtons[j])
        }
    }

    return validButtons;
}


const begin = async () => {
    let buttons = getButtons();

    while (buttons.length > 0) {
        let btn = buttons[0];
        btn.click();

        await timeout(1500);

        let close = document.getElementById('flyoutClose');
        close.click();

        await timeout(1500);
        
        buttons = getButtons();
    }
}

begin();

@jowdyboy
Copy link

@nachtien - Chase recently updated their "Offers" page again, so this no longer works as of 11/18/2023.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment