您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Bypass field restrictions when pasting data from the clipboard (Ctrl + Alt + V)
当前为
// ==UserScript== // @name Field Raider Firefox // @namespace http://tampermonkey.net/ // @version 1.74 // @description Bypass field restrictions when pasting data from the clipboard (Ctrl + Alt + V) // @author Seth@WiiPlaza // @match :///* // @icon https://pbs.twimg.com/media/FR11DSvX0AI1W44.png // @grant none // ==/UserScript== (function() { 'use strict'; const excludeRegex = /https?:\/\/.*?\.(facebook\.com|messenger\.com|google\.com|github\.com|imgur\.com).*/; const includeRegex = /https?:\/\/.*/; const allowCopyAndPaste = function(e) { e.stopImmediatePropagation(); return true; }; const isRestrictedSite = () => { const location = window.location.href; return includeRegex.test(location) && !excludeRegex.test(location); }; const pasteCippi = async () => { const elemsUndeRat = document.querySelectorAll(":hover"); const lastElemUndeRat = elemsUndeRat[elemsUndeRat.length - 1]; const textInClippi = await navigator.clipboard.readText(); if (lastElemUndeRat.tagName === 'INPUT' || lastElemUndeRat.tagName === 'TEXTAREA') { lastElemUndeRat.value = textInClippi; simulateKeyPresses(textInClippi); simulateUserInput(lastElemUndeRat); } }; const simulateKeyPresses = (text) => { setTimeout(() => { const event = new KeyboardEvent('keydown', { key: ' ' }); document.dispatchEvent(event); const eventBackspace = new KeyboardEvent('keydown', { key: 'Backspace' }); document.dispatchEvent(eventBackspace); }, 0.2); }; const simulateUserInput = (element) => { const event = new InputEvent('input', { inputType: 'insertText', data: element.value }); element.dispatchEvent(event); }; const triggerMoi = (event) => { if (event.altKey && event.ctrlKey && event.key === "y") { pasteCippi(); } }; document.addEventListener('keyup', triggerMoi, false); if (isRestrictedSite()) { document.addEventListener('copy', allowCopyAndPaste, true); document.addEventListener('paste', allowCopyAndPaste, true); } })();