您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Skip through all optional pages once you decide to checkout
当前为
// ==UserScript== // @name Ocado auto-next when checking out // @namespace http://tampermonkey.net/ // @version 2025-04-30 // @description Skip through all optional pages once you decide to checkout // @author pepepepepe // @match https://www.ocado.com/webshop/beforeYouGo* // @icon https://www.google.com/s2/favicons?sz=64&domain=ocado.com // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const TARGET_TEXTS = [ "Continue checkout", "No free gift" ]; function clickTargetButtons() { const buttons = document.getElementsByTagName('button'); let clickedAny = false; for (const button of buttons) { const btnText = button.textContent.trim(); if (TARGET_TEXTS.some(target => btnText.includes(target))) { button.click(); console.log(`Clicked: "${btnText}"`); clickedAny = true; // Don't return here - allow multiple clicks if needed } } return clickedAny; } function attemptClicks() { if (!clickTargetButtons()) { console.log("Target buttons not found yet..."); } } // Initial attempt window.addEventListener('load', attemptClicks); // Monitor DOM changes const observer = new MutationObserver(attemptClicks); observer.observe(document.body, { childList: true, subtree: true }); })();