您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Click every "clip" coupon button on the QFC coupons page www.qfc.com/savings/cl/coupons/
// ==UserScript== // @name Clip all QFC or Fred Meyer coupons // @namespace http://tampermonkey.net/ // @version 1.1 // @description Click every "clip" coupon button on the QFC coupons page www.qfc.com/savings/cl/coupons/ // @author peckjon // @authorurl https://greasyfork.org/en/users/824205-peckjon // @include http*://*qfc.com/savings/cl/coupons* // @include http*://*fredmeyer.com/savings/cl/coupons* // @icon https://www.google.com/s2/favicons?domain=qfc.com // @grant none // @license MIT // ==/UserScript== var offerButtons = [] var offerClicker = function(index) { if(index < offerButtons.length) { if (document.body.textContent.includes("reached the maximum")) { console.log("Maximum number of coupons reached"); } else { console.log("Clicking offer button "+(index+1)+" of "+offerButtons.length); offerButtons[index].click(); setTimeout(function(){ offerClicker(index+1) }, 500); if (offerButtons.length>0 && index>=offerButtons.length-1) { console.log("Scrolling to obtain more coupons..."); window.scrollBy(0,1000); setTimeout(offerKickoff, 3000); } } } } var offerKickoff = function() { offerButtons = Array.from(document.getElementsByClassName("CouponCard-button")).filter(btn => btn.textContent.startsWith("Clip")); console.log("Found "+offerButtons.length+" QFC offer buttons"); if(offerButtons.length > 0) { offerClicker(0); } else { console.log("Scrolling to obtain more coupons..."); window.scrollBy(0,1000); setTimeout(offerKickoff, 3000); } } setTimeout(offerKickoff, 3000);