Hacker News new | ask | show | jobs
by gabrielsroka 587 days ago
i think this works for the Amex one. where do you run/test this?

  javascript:for (let b of document.querySelectorAll('.offer-cta[title="Add to Card"]')) {
    console.log("Clicking offer button");
    b.click();
    (async () => {await new Promise(r => setTimeout(r, 2e3))})();
  }
does the setTimeout work? wouldn't you need something like this (in an async function)

  for (let b of document.querySelectorAll('.offer-cta[title="Add to Card"]')) {
    console.log('Clicking offer button');
    b.click();
    await new Promise(r => setTimeout(r, 2e3));
  }
1 comments

I run it on the offers page https://global.americanexpress.com/offers/eligible

The wrapped async function is for Firefox I understand.