您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
增强黎明版的一些交互
当前为
// ==UserScript== // @name 增强黎明版 // @namespace no1xsyzy // @version 0.1.3 // @description 增强黎明版的一些交互 // @author no1xsyzy // @match http://adnmb1.com/* // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @license Apache License, Version 2.0 (Apache-2.0); https://opensource.org/licenses/Apache-2.0 // ==/UserScript== (function() { 'use strict'; var parsedSearch = (function(s){ var m = {} s.replace(/^\?/, "").split("&").forEach(function(kvp){ var kvl=kvp.split("=",2) m[kvl[0]]=kvl[1] }) return m })(window.location.search) console.log(parsedSearch) // Different pages if(window.location.href.includes("doReplyThread")){ // 回复成功 if(!document.getElementsByClassName('success')[0].innerText.includes("回复成功")){ return false } var postid=/https?:\/\/[^/]+(\/t\/\d+)/.exec(document.getElementById('href').href)[1] GM_deleteValue(postid) }else if(window.location.href.includes("/t/")){ var theinputbox = document.querySelector("textarea.h-post-form-textarea") theinputbox.value = GM_getValue(window.location.pathname, parsedSearch.r?">>No."+parsedSearch.r+"\n":"") var updateInputboxValue = function(){ GM_setValue(window.location.pathname, theinputbox.value) } theinputbox.addEventListener("change", updateInputboxValue) document.querySelectorAll("a.h-threads-info-id").forEach(function(m){ m.addEventListener("click", function(e){ if(theinputbox.value.length > 0 && !theinputbox.value.endsWith("\n")){ theinputbox.value += "\n" } theinputbox.value += ">>"+m.innerText+"\n" updateInputboxValue() console.log(e) e.preventDefault() }) }) } })();