您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
A button that counts clicks
// ==UserScript== // @name Click Counter Button // @namespace http://tampermonkey.net/ // @version 0.1 // @description A button that counts clicks // @author Your Name // @match *://*/* // @grant none // ==/UserScript== (function() { 'use strict'; // Create a button element const button = document.createElement('button'); button.innerText = '0'; button.style.fontSize = '24px'; button.style.padding = '10px 20px'; button.style.cursor = 'pointer'; document.body.appendChild(button); // Click event listener let clickCount = 0; button.addEventListener('click', function() { clickCount++; button.innerText = clickCount; // Check if click count reaches 1000 if (clickCount === 1000) { // Open YouTube video window.open('https://www.youtube.com/embed/NVLAPYx0dc8?', '_blank'); // Alert message after video ends setTimeout(() => { alert("Wow! You reached 1000 clicks!!"); }, 10000); // Assuming the video is approximately 10 seconds long } }); })();