您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes the 'capture' attribute from <input> elements and shows a toast-style notification when it's done.
当前为
// ==UserScript== // @name Remove capture attribute + Notification // @namespace http://tampermonkey.net/ // @version 1.1 // @description Removes the 'capture' attribute from <input> elements and shows a toast-style notification when it's done. // @author You // @match *://*.jzetech.com/* // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; /** * Creates and shows a floating notification on the page. * @param {string} message - The message to display. */ function showNotification(message) { const toast = document.createElement('div'); toast.textContent = message; Object.assign(toast.style, { position: 'fixed', top: '20px', right: '20px', backgroundColor: '#4CAF50', color: '#fff', padding: '10px 16px', borderRadius: '8px', fontSize: '14px', boxShadow: '0 2px 8px rgba(0,0,0,0.2)', zIndex: 9999, opacity: 0, transition: 'opacity 0.5s', }); document.body.appendChild(toast); requestAnimationFrame(() => { toast.style.opacity = 1; }); setTimeout(() => { toast.style.opacity = 0; setTimeout(() => toast.remove(), 500); }, 3000); } /** * Removes the 'capture' attribute from all input elements on the page. * Also displays a toast message if any changes are made. */ function removeCaptureAttribute() { const inputsWithCapture = document.querySelectorAll('input[capture]'); if (inputsWithCapture.length > 0) { inputsWithCapture.forEach(input => { console.log('Removed capture attribute from:', input); input.removeAttribute('capture'); }); showNotification(`🎉 Removed 'capture' from ${inputsWithCapture.length} input(s)`); } } // Run immediately on page load removeCaptureAttribute(); // Observe DOM changes for dynamically added elements const observer = new MutationObserver(removeCaptureAttribute); observer.observe(document.body, { childList: true, subtree: true }); })();