您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Enables pasting in Human or Not game
// ==UserScript== // @name Enable pasting // @namespace http://tampermonkey.net/ // @version 0.2 // @description Enables pasting in Human or Not game // @author suggestingpain // @match https://*.humanornot.ai/ // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to handle pasting text function handlePaste(event) { // Prevent default paste behavior event.preventDefault(); // Get text from clipboard const clipboardData = event.clipboardData || window.clipboardData; const pastedText = clipboardData.getData('text'); // Insert pasted text into the contentEditable div const div = event.target; const selection = window.getSelection(); if (selection.rangeCount > 0) { const range = selection.getRangeAt(0); range.deleteContents(); range.insertNode(document.createTextNode(pastedText)); } } // Function to check for new contentEditable divs function checkForNewDivs() { const divs = document.querySelectorAll('div[contentEditable="true"]:not(.handled)'); divs.forEach(div => { div.classList.add('handled'); div.addEventListener('paste', handlePaste); }); } // Polling function to periodically check for new contentEditable divs function pollForNewDivs() { setInterval(checkForNewDivs, 100); } // Start polling for new divs pollForNewDivs(); })();