您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Click every "Add to Card" and "Activate Offer" button on the AMEX offers page
// ==UserScript== // @name Add all AMEX offers // @namespace http://tampermonkey.net/ // @version 0.4 // @description Click every "Add to Card" and "Activate Offer" button on the AMEX offers page // @author peckjon // @authorurl https://greasyfork.org/en/users/824205-peckjon // @include http*://*americanexpress.* // @icon https://www.google.com/s2/favicons?domain=americanexpress.com // @grant none // ==/UserScript== var amexOfferButtons = [] var amexOfferClicker = function(index) { if(index < amexOfferButtons.length) { console.log("Clicking offer button "+index+" of "+amexOfferButtons.length); amexOfferButtons[index].click(); setTimeout(function(){ amexOfferClicker(index+1) }, 500); } } var amexOfferKickoff = function() { amexOfferButtons = Array.from(document.getElementsByClassName("offer-cta")).filter(btn => btn.title == "Add to Card" || btn.title == "Activate Offer"); console.log("Found "+amexOfferButtons.length+" AMEX offer buttons"); if(amexOfferButtons.length > 0) { amexOfferClicker(0); } else { setTimeout(amexOfferKickoff, 3000); } } setTimeout(amexOfferKickoff, 3000);