// ==UserScript== // @name ✨超多动漫站点综合优化 移动&桌面端通用🎉 // @name:zh-CN ✨超多动漫站点综合优化 移动&桌面端通用🎉 // @name:zh-TW ✨超多動漫站點綜合優化 移動&桌面端通用🎉 // @namespace https://dev.ayouth.xyz/ // @version 2.8.7 // @description 令人舒畅的联想预测,适配所有网站输入框,给网站搜索提提速。OmoFun动漫、AnFuns动漫、森之屋动漫、嘛哩嘛哩、ANG动漫、橘子动漫、哔咪动漫、AGE动漫、EDD动漫、次元城动漫、饭团动漫、异世界动漫、风车动漫站点去广告等综合优化,后续会接着扩展和更新。GreasyFork脚本主页和脚本菜单都有持续更新的动漫站点推荐页的链接,不妨收藏一下🎄。 // @description:zh-CN 令人舒畅的联想预测,适配所有网站输入框,给网站搜索提提速。OmoFun动漫、AnFuns动漫、森之屋动漫、嘛哩嘛哩、ANG动漫、橘子动漫、哔咪动漫、AGE动漫、EDD动漫、次元城动漫、饭团动漫、异世界动漫、风车动漫站点去广告等综合优化,后续会接着扩展和更新。GreasyFork脚本主页和脚本菜单都有持续更新的动漫站点推荐页的链接,不妨收藏一下🎄。 // @description:zh-TW 令人舒暢的聯想預測,適配所有網站輸入框,給網站搜索提提速。 OmoFun動漫、AnFuns動漫、森之屋動漫、嘛哩嘛哩、ANG動漫、橘子動漫、嗶咪動漫、AGE動漫、EDD動漫、次元城動漫、飯糰動漫、異世界動漫、風車動漫站點去廣告等綜合優化,後續會接著擴展和更新。 GreasyFork腳本主頁和腳本菜單都有持續更新的動漫站點推薦頁的鏈接,不妨收藏一下🎄。 // @author Ayouth // @supportURL https://dev.ayouth.xyz/ayouth/msgboard/ // @match *://www.malimali6.com/* // @match *://www.17skr.com/* // @match *://www.cycacg.com/* // @match *://www.angdm.com/* // @match *://www.anfuns.cn/* // @match *://www.bimiacg4.net/* // @match *://acgfantuan.com/* // @match *://www.mgnacg.com/* // @match *://www.agemys.cc/* // @match *://www.senfun.net/* // @match *://senfun.net/* // @match *://*.dm530p.info/* // @match *://www.hdddex.com/* // @match *://www.gqdm.net/* // @match *://omofun.tv/* // @icon https://dev.ayouth.xyz/favicon.ico // @grant GM_registerMenuCommand // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant unsafeWindow // @run-at document-body // @downloadURL none // ==/UserScript== (function () { 'use strict'; class Tool { constructor() { this._services = [], this.flags = { TEXT: "characterData", ATTR: "attributes", CHILD: "childList" }, this.observer = new MutationObserver(e => { let t = new Set; for (var n of e) t.add(n.type); for (var i of this._services) i[0].some(e => t.has(e)) && this.type(i[1], "function") && i[1]() }), this.observer.observe(document.body, { attributes: !0, childList: !0, subtree: !0, characterData: !0 }), this.css("#Topen", "") } delay(...e) { return setTimeout(...e) } tick(e, t, n = !1, ...i) { t = setInterval(e, t, ...i); return n && e(), t } open(e, t = "请点击前往") { if (!1 === /macintosh|mac os x/i.test(navigator.userAgent)) window.open(e); else { if (null === document.querySelector("style#Topen")) { let e = document.createElement("style"); e.id = "Topen", e.innerHTML = '#Topen:hover { background: #4d76f3; } @keyframes scale-in-center { 0% { transform: scale(0); opacity: 1; } 100% { transform: scale(1); opacity: 1; } } #Topen { font-family:Tahoma, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;letter-spacing:1px;font-weight:bold;animation: scale-in-center 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both; transition: 0.15s; font-size: 20px; display: block; background: #6589f2; color: #efefef; text-decoration: underline; box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.35); border-radius: 4px; margin: auto; width: fit-content; height: fit-content; z-index: 9999999; position: fixed; top: 0; left: 0; right: 0; bottom: 0; padding: 12px; display: flex; align-items: center; justify-content: center }', document.head.appendChild(e) } document.querySelectorAll("a#Topen").forEach(e => e.remove()); const n = document.createElement("a"); n.target = "_blank", n.href = e, n.id = "Topen", n.textContent = t, n.onclick = () => { n.remove() }, document.documentElement.appendChild(n) } } addService(e, t) { this.type(e, "string") && (e = "*" === (e = e.trim()) ? [this.flags.ATTR, this.flags.TEXT, this.flags.CHILD] : [e]), this._services.push([e, t]) } type(e, t = null) { return t ? typeof e === t.trim().toLowerCase() : typeof e } ready(t, n = 0) { var e; "function" === T.type(t) && (e = e => { setTimeout(t, n || 0, e) }, "loading" != document.readyState ? e() : document.addEventListener("DOMContentLoaded", e)) } q(e) { try { return document.querySelector(e) } catch (e) { return null } } qs(e) { try { return [...document.querySelectorAll(e)] } catch (e) { return [] } } create(e) { return document.createElement(e) } import(i, o = "script", r = {}) { return new Promise(function (t, e) { let n = document.createElement(o);["href", "src"].forEach(e => { void 0 !== n[e] && (n[e] = i) }), Object.keys(r).forEach(e => n.setAttribute(e, r[e])), document.documentElement.appendChild(n), n.onload = function (e) { t({ evt: e, resource: n }) }, n.onerror = function () { e({ evt: evt, resource: n }) } }) } hide(t) { if (this.type(t, "string")) { let e = this.q("style[id='Toolhide']") || this.create("style"); return e.id = "Toolhide", e.innerHTML += ` ${t}{display:none !important;} `, void (e.isConnected || (document.head || document.documentElement).appendChild(e)) } t.style.setProperty("display", "none", "important") } remove(e) { this.type(e, "string") && this.qs(e).forEach(e => e.remove()) } css(...n) { if (1 === n.length) return this.type(n[0], "string") && (n[0] = this.q(n[0])), window.getComputedStyle(n[0]); { let t; if (t = this.type(n[1], "string") ? n[1] : Object.entries(n[1]).reduce((e, t) => e + t[0] + ":" + t[1] + " !important;", ""), this.type(n[0], "string")) { let e = this.q("style[id='Toolcss']") || this.create("style"); e.id = "Toolcss", e.innerHTML += ` ${n[0]}{${t};} `, e.isConnected || (document.head || document.documentElement).appendChild(e) } else Object.keys(n[1]).forEach(e => { n[0].style.setProperty(e, n[1][e], "important") }) } } on(e, t, n, i = !1) { (e = this.type(e, "string") ? this.q(e) : e).addEventListener(t, n, i) } test(e = { host: [], path: [], strict: !1, callback: void 0 }) { let t = e.host instanceof Array ? e.host : [e.host || location.host], n = e.path instanceof Array ? e.path : [e.path || location.pathname], i, o = (e, t) => e instanceof RegExp ? e.test(t) : -1 < t.indexOf(e), r = (e, t) => e instanceof RegExp ? e.test(t) : t === e; return (i = e.strict ? t.every(e => r(e, location.host)) && n.every(e => r(e, location.pathname)) : t.some(e => o(e, location.host)) && n.some(e => o(e, location.pathname))) && e.callback && e.callback(), i } } const $log = { connector: " - ", levelColor: { error: "#f91b1b", warning: "#ffc107", success: "#4EE04E", info: "initial" }, getTimeString() { let e = new Date((new Date).getTime() + 60 * (new Date).getTimezoneOffset() * 1e3 + 288e5); return e.toLocaleString() }, _print(e, t) { var n = this.levelColor[t], i = `%c${this.getTimeString()}${this.connector}%c` + e; console.log(i, "color:#1ce8e8", "color:" + n), this.saved && this._save(this.getTimeString(), e, t) }, err(e) { this._print(e, "error") }, info(e) { this._print(e, "initial") }, suc(e) { this._print(e, "success") }, warn(e) { this._print(e, "warning") } }, $browser = { env: (() => { let e = { webview: /\(.+wv\)/i.test(navigator.userAgent), android: /Android/i.test(navigator.userAgent), linux: /Linux/i.test(navigator.userAgent), ios: /ios/i.test(navigator.userAgent), macos: /macOS/i.test(navigator.userAgent), windows: /win|Windows/i.test(navigator.userAgent), iphone: /iPhone/i.test(navigator.userAgent), ipad: /iPad/i.test(navigator.userAgent), mobile: /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(navigator.userAgent) }; return e.pc = !e.mobile, e })(), platform: navigator.platform, language: navigator.browserLanguage || navigator.language, Chinese: { traditional: ["zh-TW", "zh-HK", "zh-Hant", "zh-MO"].includes((navigator.browserLanguage || navigator.language).language), simplified: ["zh-CN", "zh-Hans", "zh-SG", "zh-MY"].includes((navigator.browserLanguage || navigator.language).language) } }, T = new Tool; class Predict { lastTimestamp = null; constructor(e = "baidu", t, i = "predictiveTypingCallback", s = null) { if (this.objectName = i, this.win = t || window, this.win[i] || (this.win[i] = {}), this.api = e, this.defaultCallback = s, this._initAPI(), !this._apiComponents[e]) throw new Error("illegal api " + e) } _initAPI() { this._apiComponents = { baidu: { argsHandler(...e) { return e[0].s }, urlCreater(e, t) { return "//suggestion.baidu.com/su?wd=" + e + "&cb=" + t } }, bing: { argsHandler(...e) { try { return e[0].AS.Results[0].Suggests.map(e => e.Txt) } catch (e) { return [] } }, urlCreater(e, t) { return "//sg1.api.bing.com/qsonhs.aspx?type=cb&q=" + e + "&cb=" + t } } } } _createWrapper(t, i, s) { const l = this._apiComponents[this.api].argsHandler; return (...e) => { this.lastTimestamp === s && i(t, l(...e)) } } _generateURL(e, t) { return this._apiComponents[this.api].urlCreater(e, t) } setCallback(e) { return this.defaultCallback = e, this } setAPI(e) { if (this.api = e, this._apiComponents[e]) return this; throw new Error("illegal api " + e) } typing(e, t) { this.defaultCallback && !t && (t = this.defaultCallback); var i = this.lastTimestamp = (new Date).getTime(), t = this._createWrapper(e, t, i); e = encodeURIComponent(e), this.win[this.objectName]["_" + i] = t; const s = document.createElement("script"); return s.async = !0, s.referrerPolicy = "no-referrer", s.src = this._generateURL(e, "window." + this.objectName + "._" + i), document.body.appendChild(s), s.onload = s.onabort = s.onerror = () => { s.remove() }, this } } class EasyPredict extends Predict { constructor(e, t = { win: window, api: "baidu", theme: "light", fillValue: void 0, submitCallback: void 0, zIndex: 2022, maxNum: 8, fontFamily: void 0, fontSize: void 0 }) { super(t.api || "baidu", t.win || window), this.el = "string" == typeof e ? document.querySelector(e) : e, this.fillValue = ("function" == typeof t.fillValue ? t : EasyPredict).fillValue, this.submitCallback = "function" == typeof t.submitCallback ? t.submitCallback : () => { }, this.fontFamily = t.fontFamily || "", this.fontSize = t.fontSize || "", this.zIndex = t.zIndex || 2022, this.theme = t.theme || "light", this.maxNum = t.maxNum || 8, this.enabled = !1, this.ul = EasyPredict.createListDOM(this.maxNum), this.ul.style.zIndex = this.zIndex, this.toggleTheme(this.theme) } toggleTheme(e = "dark") { e = e.toLowerCase(); let t = ["dark"]; t.forEach(e => this.ul.classList.remove(e)), this.theme = e, !1 !== t.includes(e) && this.ul.classList.add(e) } static createListDOM(t = 8) { if (!document.querySelector("style#easy-predict-by-ayouth")) { let e = document.createElement("style"); e.innerHTML = `ul.easy-predict-by-ayouth { display: block; position: absolute; z-index: 2022; list-style: none; box-sizing: border-box; padding: 0; margin: 0; letter-spacing: 1px; overflow: hidden; border-radius: 3px; font-weight: 400; border: 1px solid rgba(0, 0, 0, 0.1); font-size: 16px; width: 200px; font-family: Tahoma, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; --bg-color: #efefef; --color: #353535; background-color: var(--bg-color, #efefef); color: var(--color, #353535); --hover-bg-color: #d3d3d3; } ul.easy-predict-by-ayouth.dark { --hover-bg-color: rgba(255, 255, 255, 0.1); --bg-color: rgba(0, 0, 0, 0.5); --color: #efefef; } ul.easy-predict-by-ayouth li { transition: 0.15s; display: block; width: auto; cursor: default; padding: 6px; margin: 0; color: inherit; background-color: inherit; font-family: inherit; position: relative; z-index: 1; } ul.easy-predict-by-ayouth li.last::before { content: 'Ayouth'; z-index: -1; font-size: 12px; padding: 1.15px; background-color: rgba(236, 118, 105, 0.75); color: rgba(255, 255, 255, 0.9); position: absolute; display: block; bottom: 0; right: 0; } ul.easy-predict-by-ayouth li.hover { background-color: var(--hover-bg-color, #d3d3d3); }`, (document.head || document.body).appendChild(e) } let i = document.createElement("ul"); i.className = "easy-predict-by-ayouth"; for (let e = 0; e < t; e++)i.appendChild(document.createElement("li")); return i } static fillValue(e, t) { e.value = t } enable() { this.enabled || (!(this.ul.style.display = "none") === this.ul.isConnected && document.body.appendChild(this.ul), this.observer || (this.observer = new MutationObserver(() => { this.followStyle() })), this.followStyle(), this.bindEvents(), this.observer.observe(document.body, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["id", "class", "style"] }), document.activeElement === this.el && document.hasFocus() && "" !== this.el.value.trim() && this.events.input(), this.enabled = !0) } disable() { this.enabled && (this.ul.style.display = "none", this.observer.disconnect(), this.unbindEvents(), this.enabled = !1) } bindEvents() { if (!this.events) { this.events = {}, this.liIndex = -1, this.setCallback((e, i) => { let s = (i = i.slice(0, this.maxNum)).length; 0 < s && e === this.el.value ? (this.ul.style.display = "block", this.ul.querySelectorAll("li").forEach((e, t) => { t < s ? (e.textContent = i[t], e.style.display = "block") : e.style.display = "none", t == s - 1 ? e.classList.add("last") : e.classList.remove("last") })) : this.ul.style.display = "none" }); let i = (t, i = !1) => { let s = [...this.ul.querySelectorAll("li")]; if (s.forEach(e => e.classList.remove("hover")), 0 <= t) { let e = s[t]; e.classList.add("hover"), i && this.fillValue(this.el, e.textContent) } }, s = !1; this.events.input = () => { "" === this.el.value.trim() ? this.ul.style.display = "none" : (this.liIndex = -1, i(this.liIndex), this.typing(this.el.value)) }, this.events.mouseover = e => { let t = [...this.ul.querySelectorAll("li")]; e = t.indexOf(e.target); this.liIndex = e, i(this.liIndex) }, this.events.mouseleave = () => { this.liIndex = -1, i(-1) }, this.events.compositionstart = () => { s = !0 }, this.events.compositionend = () => { s = !1 }, this.events.keydown = e => { var t = e.code || e.key; "Enter" === t && 0 < this.liIndex ? this.submitCallback(this.el.value) : s || "none" !== this.ul.style.display && 0 != ["ArrowDown", "ArrowUp"].includes(t) && (e.preventDefault(), this.liIndex = "ArrowDown" === t ? this.liIndex === this.maxNum - 1 ? -1 : this.liIndex + 1 : -1 == this.liIndex ? this.maxNum - 1 : this.liIndex - 1, i(this.liIndex, !0)) }, this.events.click = e => { e.target !== this.el && (this.ul.style.display = "none") }, this.events.focus = () => { "" !== this.el.value.trim() && this.events.input() }, this.events.resize = () => { this.followStyle() }, this.events.ulclick = e => { let t = [...document.querySelectorAll("li")]; t.includes(e.target) && (this.fillValue(this.el, e.target.textContent), this.submitCallback(this.el.value)) } } this.ul.addEventListener("click", this.events.ulclick), this.ul.addEventListener("mouseover", this.events.mouseover), this.ul.addEventListener("mouseleave", this.events.mouseleave), this.el.addEventListener("input", this.events.input), this.el.addEventListener("compositionstart", this.events.compositionstart), this.el.addEventListener("compositionend", this.events.compositionend), this.el.addEventListener("focus", this.events.focus), this.el.addEventListener("keydown", this.events.keydown), this.win.document.addEventListener("click", this.events.click), this.win.addEventListener("resize", this.events.resize) } unbindEvents() { this.events && (this.liIndex = -1, this.ul.removeEventListener("click", this.events.ulclick), this.ul.removeEventListener("mouseover", this.events.mouseover), this.ul.removeEventListener("mouseleave", this.events.mouseleave), this.el.removeEventListener("input", this.events.input), this.el.removeEventListener("compositionstart", this.events.compositionstart), this.el.removeEventListener("compositionend", this.events.compositionend), this.el.removeEventListener("focus", this.events.focus), this.el.removeEventListener("keydown", this.events.keydown), this.win.document.removeEventListener("click", this.events.click), this.win.removeEventListener("resize", this.events.resize)) } static getDOMLocation(e) { return { left: function (e) { let t = e.offsetLeft, i = e.offsetParent; for (; null !== i;)t += i.offsetLeft, i = i.offsetParent; return t }(e), top: function (e) { let t = e.offsetTop, i = e.offsetParent; for (; null !== i;)t += i.offsetTop, i = i.offsetParent; return t }(e) } } followStyle() { var e = EasyPredict.getDOMLocation(this.el), e = (this.ul.style.width = this.el.offsetWidth + "px", this.ul.style.fontSize = this.fontSize || this.win.getComputedStyle(this.el).fontSize, this.ul.style.fontFamily = this.fontFamily || void 0, this.ul.style.top = e.top + this.el.offsetHeight + 2 + "px", this.ul.style.left = e.left + "px", getComputedStyle(this.ul)); "hidden" === e.visibility || "none" === e.display ? this.ul.style.display = "none" : this.ul.style.display = "block" } } //注册菜单函数 function register() { if (window.top !== window) { return; } if ("undefined" == typeof GM_registerMenuCommand || "undefined" == typeof GM_getValue || "undefined" == typeof GM_setValue) { $log.err("当前不处于脚本管理器环境,停止菜单注册"); return; } if (!GM_getValue('config')) { GM_setValue("config", JSON.stringify(config)) } else { let savedConfig = JSON.parse(GM_getValue("config")); //维护和更新已保存的config if (T.type(savedConfig.option, "object")) { Object.keys(config.option).forEach(key => { if (!T.type(savedConfig.option[key], "undefined")) { config.option[key] = savedConfig.option[key]; } }) } GM_setValue("config", JSON.stringify(config)); }; // 值取true或false的菜单 const menu = { removeNotification: "移除通知", predictiveSearch: "联想词预测", darkMode: "深色预测UI", useBing: "使用Bing接口", }; let commands = []; Object.keys(menu).forEach(e => { let desc = (config.option[e] ? "✅ " : "❌ ") + menu[e]; let opposite = !config.option[e]; let callback = () => { config.option[e] = opposite; GM_setValue("config", JSON.stringify(config)); window.location.reload(); } commands.push([desc, callback]); }); for (let command of commands) { GM_registerMenuCommand(command[0], command[1]); } GM_registerMenuCommand("✨ 动漫站点推荐", function () { T.open("https://dev.ayouth.xyz/ayouth/animation.html"); }); GM_registerMenuCommand("💬 给作者留言", function () { T.open("https://dev.ayouth.xyz/ayouth/msgboard"); }); } /** * @description: 开启预测 * @param {string} sel * @param {Function} submitCallback */ function startPredict(sel, opt = {}) { T.ready(() => { let s = T.q(sel); if (!s) { return; } s.setAttribute("autocomplete", "off"); new EasyPredict(s, Object.assign({ api: config.option.useBing ? "bing" : "baidu", fontSize: "14px", theme: config.option.darkMode ? "dark" : "light", win: (typeof unsafeWindow !== "undefined" && unsafeWindow instanceof Window) ? unsafeWindow : window }, opt)).enable(); }) } var websites = { "嘛哩嘛哩": { domain: "www.malimali6.com", strict: false, mobile() { if (T.test({ path: "/play/" })) { //ad T.hide("section.leo-mod.leo-left.leo-col-12 >a:first-child") } }, pc() { }, common() { if (config.option.removeNotification && T.test({ path: "/" })) { //关闭通知 T.ready(() => { swal && swal.close() $log.suc("已经移除通知"); }); } } }, "路漫漫动漫": { domain: "www.17skr.com", strict: false, mobile() { }, pc() { }, common() { if (config.option.predictiveSearch) { startPredict("#inputSearch", { submitCallback() { let form = T.q("form#search"); form && form.submit(); } }); } } }, "次元城动漫": { //拦截https://www.cycacg.com/mxtheme/js/script.js https://sdk.51.la/js-sdk-pro.min.js domain: "www.cycacg.com", strict: false, mobile() { }, pc() { }, common() { if (config.option.removeNotification) { T.hide(".tz"); } //广告 T.hide(".module-adslist.ads_w"); if (config.option.predictiveSearch) { startPredict("input.search-input", { submitCallback() { let btn = T.q("button#searchbutton"); btn && btn.click(); } }); } } }, "ANG动漫": { domain: "www.angdm.com", strict: false, mobile() { }, pc() { }, common() { if (config.option.removeNotification) { T.hide("#container > div[style*='color']:first-child"); } if (T.test({ path: "detail" })) { T.hide("div.app-dl,.app-dl-m"); } if (config.option.predictiveSearch) { startPredict("#top_search_input", { submitCallback() { let btn = T.q(".search_submit"); btn && btn.click(); } }); } } }, "AnFuns动漫": { domain: "www.anfuns.cn", strict: false, mobile() { }, pc() { }, common() { if (config.option.removeNotification) { document.cookie = "tips=ok;path=/;expires=Fri, 31 Dec 2222 23:59:59 GMT"; } } }, "哔咪动漫": { domain: "www.bimiacg4.net", strict: false, mobile() { //去除N个广告 T.ready(() => { let s = T.qs("body > script").pop(); while (s && s.nextElementSibling) { document.body.removeChild(s.nextElementSibling); } }) T.hide("brde"); T.hide(".ssr1"); T.hide("div[id][style^='display: block; width: 100%;']"); T.css(".leo-container", "position:absolute;top:0;z-index:999999999999"); if (config.option.removeNotification) { T.hide(".leo-gonggao-body.leo-bg-a") } }, pc() { }, common() { // 广告 T.hide(".tuiguang,#HMRichBox,#HMcoupletDivleft,#HMcoupletDivright"); //播放的广告 T.hide("#adv_wrap_hh"); T.hide(".play-player > #bkcl"); if (T.test({ path: '/play/' })) { T.hide(".main >marquee:first-child"); } if (config.option.removeNotification) { T.hide(".area> .tuiguang + div[style*='color']"); } if (config.option.predictiveSearch) { startPredict("#ffsearch > .text", { submitCallback() { let form = T.q("#ffsearch"); form && form.submit(); } }); } } }, "饭团动漫": { domain: "acgfantuan.com", strict: false, mobile() { }, pc() { }, common() { if (config.option.predictiveSearch) { startPredict(".header__search-content>input", { submitCallback() { let btn = T.q(".header__search-content>button"); btn && btn.click(); } }); } //ad T.hide(".container>.row[style^='margin-bottom:']"); } }, "橘子动漫": { domain: "www.mgnacg.com", strict: false, mobile() { }, pc() { }, common() { if (config.option.predictiveSearch) { startPredict("#txtKeywords", { submitCallback() { let btn = T.q(".search-go[type='submit']"); btn && btn.click(); } }); } } }, "AGE动漫": { domain: "www.agemys.cc", strict: false, mobile() { }, pc() { }, common() { if (T.test({ path: ['/play/', '/detail/'] })) { T.hide("#container div[style^='text-align:center;']"); } if (config.option.removeNotification) { T.hide("#new_tip1,#app-dl-m,.app-dl"); } if (config.option.predictiveSearch) { startPredict("#top_search_input", { submitCallback() { let form = T.q("#top_search_from"); form && form.submit(); } }); } } }, "森之屋动漫": { domain: ["www.senfun.net", "senfun.net"], strict: false, mobile() { }, pc() { }, common() { //广告 T.hide(".module-adslist.ads_w,.adsbygoogle"); if (config.option.removeNotification) { document.cookie = "showBtn=true;path=/;expires=Fri, 31 Dec 2222 23:59:59 GMT"; } if (config.option.predictiveSearch) { startPredict(".search-input", { submitCallback() { let btn = T.q("button#searchbutton"); btn && btn.click(); } }); } } }, "风车动漫": { domain: ".dm530p.info", strict: false, mobile() { //广告 T.hide('[style*="z-index: 2147483"]'); }, pc() { }, common() { if (config.option.predictiveSearch) { startPredict("#keyw", { submitCallback() { let btn = T.q("[type='submit']"); btn && btn.click(); } }); } } }, "EDD动漫": { domain: "www.hdddex.com", strict: false, mobile() { //去除N个广告 T.ready(() => { for (let i = 1; i < 500; i++) { clearInterval(i); } let e = T.qs("body > *[id][class]:not([style])").pop(); if (e && ["div", "style", "script", "nav", "ul", "table"].includes(e.nodeName.toLowerCase()) === false) { T.hide(e.nodeName.toLowerCase()); } }, 50); }, pc() { }, common() { //解决广告直接跳转 document.cookie = "hours24=12;path=/;expires=Fri, 31 Dec 2222 23:59:59 GMT"; if (config.option.predictiveSearch) { startPredict("#wd", { submitCallback() { let form = T.q("form#search"); form && form.submit(); } }); } } }, "异世界动漫": { domain: "www.gqdm.net", strict: false, mobile() { T.hide("[style*='z-index: 21474836']"); }, pc() { }, common() { //ad T.hide(".ads,.play_list_adbox"); if (config.option.predictiveSearch) { startPredict("#search #txt", { submitCallback() { let btn = T.q("#searchbutton"); btn && btn.click(); } }); } } }, "OmoFun动漫": { domain: "omofun.tv", strict: false, mobile() { }, pc() { }, common() { //移除通知 if (config.option.removeNotification) { document.cookie = "showBtn=true;path=/;expires=Fri, 31 Dec 2222 23:59:59 GMT"; T.hide(".tz,.tz.pcbdmap"); } if (config.option.predictiveSearch) { startPredict(".search-input", { submitCallback() { let btn = T.q("#searchbutton"); btn && btn.click(); } }); } } }, } // 配置 var config = { "id": "425083", "version": "2.8.7", "option": { useBing: false, darkMode: false, predictiveSearch: true, removeNotification: false } }; $log.suc(`超多动漫站点综合优化-${config['version']} 正在运行...`); let name = null, obj = null; for (let key of Object.keys(websites)) { let item = websites[key]; if (T.test({ host: item.domain, strict: item.strict })) { name = key; obj = item; } } if (name === null) { $log.err("当前站点不在该脚本有效运行范围内!"); return; } else { $log.suc("当前站点:" + name); } // 注册 register(); //执行 $browser.env.mobile ? obj.mobile() : obj.pc(); obj.common(); //版本 (function () { if ("undefined" != typeof config) localStorage.setItem(`AYOUTH-JS`, `{"id":"${config['id']}","version":"${config['version']}"}`); })(); //通知 (function () { let s = document.createElement('script'); s.charset = 'utf-8'; s.type = 'text/javascript'; s.referrerPolicy = 'unsafe-url'; s.async = true; s.src = `//dev.ayouth.xyz/ayouth/js/post.js?id=${config['id']}&v=${config['version']}&t=${parseInt((new Date()).getTime() / (6 * 1000))}`; document.documentElement.appendChild(s) })(); })();