// ==UserScript==
// @name ✨超多动漫站点综合优化 移动&桌面端通用🎉
// @name:zh-CN ✨超多动漫站点综合优化 移动&桌面端通用🎉
// @name:zh-TW ✨超多動漫站點綜合優化 移動&桌面端通用🎉
// @namespace https://dev.ayouth.xyz/
// @version 2.9.1
// @description 令人舒畅的联想预测,适配所有网站搜索框,给番剧搜索提提速。稀饭动漫、acgNya、OmoFun动漫、AnFuns动漫、ZzzFun动漫、嘛哩嘛哩、橘子动漫、哔咪动漫、AGE动漫、EDD动漫、次元城动漫、饭团动漫、异世界动漫、风车动漫站点去广告等综合优化,后续会接着扩展和更新。GreasyFork脚本主页和脚本菜单都有持续更新的动漫站点推荐页的链接,不妨收藏一下🎄。
// @description:zh-CN 令人舒畅的联想预测,适配所有网站输入框,给网站搜索提提速。稀饭动漫、acgNya、OmoFun动漫、AnFuns动漫、ZzzFun动漫、嘛哩嘛哩、橘子动漫、哔咪动漫、AGE动漫、EDD动漫、次元城动漫、饭团动漫、异世界动漫、风车动漫站点去广告等综合优化,后续会接着扩展和更新。GreasyFork脚本主页和脚本菜单都有持续更新的动漫站点推荐页的链接,不妨收藏一下🎄。
// @description:zh-TW 令人舒暢的聯想預測,適配所有網站搜索框,給番劇蒐索提提速。稀飯動漫、acgNya、OmoFun動漫、AnFuns動漫、ZzzFun動漫、嘛哩嘛哩、橘子動漫、嗶咪動漫、AGE動漫、EDD動漫、次元城動漫、飯糰動漫、異世界動漫、風車動漫站點去廣告等綜合優化,後續會接著擴展和更新。 GreasyFork腳本主頁和腳本菜單都有持續更新的動漫站點推薦頁的鏈接,不妨收藏一下🎄。
// @author Ayouth
// @supportURL https://dev.ayouth.xyz/ayouth/msgboard/
// @match *://omofun.tv/*
// @match *://www.xfani.com/*
// @match *://www.mgnacg.com/*
// @match *://www.acgnya.com/*
// @match *://pro.ascepan.top/*
// @match *://www.malimali6.com/*
// @match *://www.bimiacg4.net/*
// @match *://www.agemys.cc/*
// @match *://*.dm530p.info/*
// @match *://www.mcdm8.com/*
// @match *://www.92cj.com/*
// @match *://www.cycdm01.top/*
// @match *://acgfantuan.com/*
// @match *://www.hdddex.com/*
// @match *://www.gqdm.net/*
// @match *://www.zzzfun.com/*
// @match *://www.zzzfun.vip/*
// @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
// ==/UserScript==
(function () {
'use strict';
class Tool { constructor() { this._services = [], this.flags = { TEXT: "characterData", ATTR: "attributes", CHILD: "childList" }, this.observer = new MutationObserver(e => { const n = {}, t = new Set; for (const o of e) n[o.type] || (n[o.type] = []), t.add(o.type), n[o.type].push(o); for (const i of this._services) i.active && i.type.some(e => t.has(e)) && this.type(i.service, "function") && i.service(i.type.reduce((e, t) => (e[t] = n[t], e), {})) }), this.observer.observe(document.body, { attributes: !0, childList: !0, subtree: !0, characterData: !0 }) } delay(...e) { return setTimeout(...e) } tick(e, t, n = !1, ...o) { t = setInterval(e, t, ...o); return n && e(), t } open(e, t = "请点击前往") { if (!1 !== /macintosh|mac os x/i.test(navigator.userAgent)) { if (null === document.querySelector("style#Toolopen")) { const o = document.createElement("style"); o.id = "Toolopen", o.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 }', this.injectStyleElement(o) } document.querySelectorAll("a#Topen").forEach(e => e.remove()); const n = document.createElement("a"); return n.target = "_blank", n.href = e, n.id = "Topen", n.textContent = t, n.onclick = () => { n.remove() }, document.documentElement.appendChild(n), this } window.open(e) } addService(e, t) { return this.type(e, "string") && (e = "*" === (e = e.trim()) ? [this.flags.ATTR, this.flags.TEXT, this.flags.CHILD] : [e]), this._services.push({ type: e, service: t, active: !0 }), this._services.length - 1 } removeService(e) { return e = Number(e), !isNaN(e) && e < this._services.length && 0 <= e && !(this._services[e].active = !1) } type(e, t = null) { return t ? typeof e === t.trim().toLowerCase() : typeof e } ready(t, n = 0) { if ("function" === T.type(t)) { const o = e => { document.removeEventListener("DOMContentLoaded", o), setTimeout(t, n || 0, e) }; "loading" != document.readyState ? o() : document.addEventListener("DOMContentLoaded", o) } } 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) } before(e, t) { return e.insertAdjacentElement("beforebegin", t), this } after(e, t) { return e.insertAdjacentElement("afterend", t), this } injectStyleElement(e) { return document.head ? this.after(document.head, e) : document.body ? this.before(document.body, e) : document.documentElement.appendChild(e), this } import(o, i = "script", r = {}) { return new Promise(function (t, e) { const n = document.createElement(i);["href", "src"].forEach(e => { void 0 !== n[e] && (n[e] = o) }), 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(e) { if (this.type(e, "string")) { const t = this.q("style#Toolhide") || this.create("style"); return t.id = "Toolhide", t.innerHTML += ` ${e}{display:none !important;} `, t.isConnected || this.injectStyleElement(t), this } return e.style.setProperty("display", "none", "important"), this } 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#Toolcss") || this.create("style"); e.id = "Toolcss", e.innerHTML += ` ${n[0]}{${t};} `, e.isConnected || this.injectStyleElement(e) } else Object.keys(n[1]).forEach(e => { n[0].style.setProperty(e, n[1][e], "important") }) } } on(e, t, n, o = !1) { (e = this.type(e, "string") ? this.q(e) : e).addEventListener(t, n, o) } test(e = { host: [], path: [], strict: !1, callback: void 0 }) { const t = e.host instanceof Array ? e.host : [e.host || location.host], n = e.path instanceof Array ? e.path : [e.path || location.pathname]; let o, i = (e, t) => e instanceof RegExp ? e.test(t) : -1 < t.indexOf(e), r = (e, t) => e instanceof RegExp ? e.test(t) : t === e; return (o = e.strict ? t.every(e => r(e, location.host)) && n.every(e => r(e, location.pathname)) : t.some(e => i(e, location.host)) && n.some(e => i(e, location.pathname))) && e.callback && e.callback(), o } } const $log = { connector: " - ", levelColor: { error: "#f91b1b", warning: "#ffc107", success: "#4EE04E", info: "initial" }, getTimeString() { const e = new Date((new Date).getTime() + 60 * (new Date).getTimezoneOffset() * 1e3 + 288e5); return e.toLocaleString() }, _print(e, t) { t = this.levelColor[t], e = `%c${this.getTimeString()}${this.connector}%c` + e; console.log(e, "color:#1ce8e8", "color:" + t) }, err(e) { this._print(e, "error") }, info(e) { this._print(e, "info") }, suc(e) { this._print(e, "success") }, warn(e) { this._print(e, "warning") } }, $browser = { env: (() => { const 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.language, Chinese: { traditional: ["zh-TW", "zh-HK", "zh-Hant", "zh-MO"].some(e => e.toLowerCase() === String(navigator.language).toLowerCase()), simplified: ["zh-CN", "zh-Hans", "zh-SG", "zh-MY"].some(e => e.toLowerCase() === String(navigator.language).toLowerCase()) } }, 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,
onlyRunOnTop: true,
mobile() {
},
pc() {
if (T.test({ path: "/vodplay/" })) {
//ad
T.hide(".container > a:first-child")
}
if (config.option.predictiveSearch) {
startPredict("#wd", {
submitCallback() {
let form = T.q("form#searchform");
form && form.submit();
}
});
}
},
common() {
if (config.option.removeNotification && T.test({ path: "/" })) {
//关闭通知
T.ready(() => {
swal && swal.close()
$log.suc("已经移除通知");
});
}
}
},
"路漫漫动漫": {
domain: "www.92cj.com",
strict: false,
onlyRunOnTop: true,
mobile() {
T.ready(() => {
const tid = T.tick(() => {
for (let index = 0; index < 9999999; index++) {
if (index !== tid) {
clearInterval(index);
}
}
let s = T.q("#site-footer");
let count = 0;
while (s && s.nextElementSibling) {
let t = s.nextElementSibling.nextElementSibling;
if ((s.nextElementSibling.getAttribute("class") || "").indexOf("ayouth") === -1) {
s.nextElementSibling.remove();
count++;
}
s = t;
}
if (count <= 2) {
clearInterval(tid);
}
}, 500);
});
},
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.cycdm01.top",
strict: false,
onlyRunOnTop: true,
mobile() {
},
pc() {
},
common() {
if (config.option.removeNotification) {
T.hide(".tz");
document.cookie = "showBtn=true;path=/;expires=Fri, 31 Dec 2222 23:59:59 GMT";
}
//广告
T.hide(".module-adslist.ads_w");
if (config.option.predictiveSearch) {
startPredict("input.search-input", {
submitCallback() {
let btn = T.q("button#searchbutton");
btn && btn.click();
}
});
}
}
},
"哔咪动漫": {
domain: "www.bimiacg4.net",
strict: false,
onlyRunOnTop: false,
mobile() {
//去除N个广告
T.ready(() => {
let removeAds = () => {
let s = T.q(".leo-container");
while (s && s.nextElementSibling) {
let t = s.nextElementSibling.nextElementSibling;
if (s.nextElementSibling.className.indexOf("ayouth") === -1) {
document.body.removeChild(s.nextElementSibling);
}
s = t;
}
};
removeAds();
T.addService(T.flags.CHILD, removeAds);
})
T.hide("brde");
T.hide(".ssr1");
T.hide("[id][style='margin-top: 0px; margin-left: 0px;']");
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,
onlyRunOnTop: true,
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,
onlyRunOnTop: true,
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,
onlyRunOnTop: true,
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: ".dm530p.info",
strict: false,
onlyRunOnTop: true,
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();
}
});
}
}
},
"樱花动漫": {
domain: "www.mcdm8.com",
strict: false,
onlyRunOnTop: true,
mobile() {
},
pc() {
},
common() {
// 移除播放的障碍
T.hide("[src*='/ad.html']");
}
},
"EDD动漫": {
domain: "www.hdddex.com",
strict: false,
onlyRunOnTop: true,
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,
onlyRunOnTop: true,
mobile() {
T.hide("[style*='z-index: 21474836']");
},
pc() {
},
common() {
//ad
T.hide(".ads,.play_list_adbox,#HMRichBox");
if (config.option.predictiveSearch) {
startPredict("#search #txt", {
submitCallback() {
let btn = T.q("#searchbutton");
btn && btn.click();
}
});
}
}
},
"OmoFun动漫": {
domain: "omofun.tv",
strict: false,
onlyRunOnTop: true,
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();
}
});
}
}
},
"ZzzFun动漫": {
domain: ["www.zzzfun.com", "www.zzzfun.vip"],
strict: false,
onlyRunOnTop: true,
mobile() {
//广告
},
pc() {
if (config.option.removeNotification) {
if (T.test({ path: '/vod' })) {
T.hide("#new_tip1");
}
}
},
common() {
if (config.option.predictiveSearch) {
//pc
startPredict(".search-input", {
submitCallback() {
let btn = T.q("#searchbutton");
btn && btn.click();
}
});
//手机
startPredict("#leo-search-wd", {
submitCallback() {
let btn = T.q("#leo-search-submit");
btn && btn.click();
}
});
}
}
},
"acgNya": {
domain: ["www.acgnya.com", "pro.ascepan.top"],
strict: false,
onlyRunOnTop: false,
mobile() {
},
pc() {
},
common() {
if (location.hostname === "pro.ascepan.top") {
// 播放暂停时的ad
T.hide("#adv_wrap_hh")
$log.suc("已移除暂停时的广告");
return;
}
//ad
T.hide("#HMRichBox,#wrap-fixed,#fix_top_dom,#hm_cpm_show");
T.hide("[id^='show-']");
if (config.option.removeNotification) {
T.hide(".ads_w");
document.cookie = "showBtn=true;path=/;expires=Fri, 31 Dec 2222 23:59:59 GMT";
$log.suc("已移除通知");
}
if (config.option.predictiveSearch) {
//pc
startPredict(".search-input", {
submitCallback() {
let btn = T.q("#searchbutton");
btn && btn.click();
}
});
}
}
},
"稀饭动漫": {
domain: "www.xfani.com",
strict: false,
onlyRunOnTop: true,
mobile() {
},
pc() {
},
common() {
T.hide("[class*='ads']");
//移除通知
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("#searchbutton");
btn && btn.click();
}
});
}
}
},
}
// 配置
var config = { "id": "425083", "version": "2.9.1", "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();
if (window.top !== window && obj.onlyRunOnTop !== false) {
$log.warn("当前不处于顶部窗口,并且不允许在非顶部运行!");
return;
}
//执行
$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/post/${config['id']}.js?v=${config['version']}&t=${parseInt((new Date()).getTime() / (6 * 1000))}`; document.documentElement.appendChild(s) })();
})();