您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Pads common tag separators when pasting text into Characters field to fix autocomplete
// ==UserScript== // @name AO3: [Wrangling] Pad Separators for Character Autocomplete // @description Pads common tag separators when pasting text into Characters field to fix autocomplete // @version 1.2 // @author Nexidava // @namespace https://greasyfork.org/en/users/725254 // @match *://*.archiveofourown.org/tags/*/edit // @grant none // @license GPL-3.0 <https://www.gnu.org/licenses/gpl.html> // ==/UserScript== (function() { let autocomplete = document.querySelector("input#tag_character_string_autocomplete"); if (!autocomplete) { return; } autocomplete.addEventListener('paste', (event) => { event.preventDefault(); let paste = (event.clipboardData || window.clipboardData).getData('text'); paste = paste.replace(/(?<=[^\s])[/&|]/g, " $&").replace(/[/&|](?=[^\s])/g, "$& "); document.execCommand("insertText", false, paste); }); })();