diff --git a/dist/jop.user.js b/dist/jop.user.js index bf83ffa..ffaba6d 100644 --- a/dist/jop.user.js +++ b/dist/jop.user.js @@ -1,9 +1,9 @@ // ==UserScript== -// @name JAV 添加跳转在线观看 三合一 +// @name JAV 添加跳转在线观看 // @namespace https://greasyfork.org/zh-CN/scripts/429173 -// @version 1.1.2 +// @version 1.1.3 // @author mission522 -// @description 在 JavDB、JavBus、JavLibrary 网站的影片详情页添加跳转在线播放按钮,并在按钮上标注是否支持在线播放、包含无码或包含字幕 +// @description [高效寻找最佳的在线资源] 在影片详情页添加跳转在线播放的按钮,并注是否提供在线播放资源或无码资源、字幕资源等信息。支持 JavDB、JavBus 以及 JavLibrary // @license MIT // @icon https://javdb.com/favicon-32x32.png // @include /^https?:\/\/(\w*\.)?javdb(\d)*\.com.*$/ @@ -34,179 +34,248 @@ // @grant GM_xmlhttpRequest // ==/UserScript== -(t=>{const o=document.createElement("style");o.dataset.source="vite-plugin-monkey",o.innerText=t,document.head.appendChild(o)})(".jop-list{box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:flex-start;gap:10px;width:100%;height:100%;z-index:1;background-color:#fff;transition:right .2s ease-in-out;font-family:Roboto,Helvetica,Arial,sans-serif;color:#000}.jop-button,.jop-button_def{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:3px 10px;border-radius:4px;font-weight:500;font-size:14px;border:1px solid #dcdfe6;color:#606266;cursor:pointer}.jop-button_def{margin:10px 0;width:100px}.jop-button:visited{color:#606266}.jop-button:hover{text-decoration:none;color:#409eff;border:1px solid #c6e2ff;background-color:#ecf5ff}.jop-button_label{position:absolute;font-size:10px;padding:4px;border-radius:4px;top:-13px;right:-10px;line-height:.75;color:#67c23a;border:1px solid #e1f3d8;background:white}.jop-button_green{color:#fff!important;background-color:#67c23a}.jop-button_green:hover{color:#fff!important;background-color:#95d475}.jop-button_red{color:#fff!important;background-color:#f56c6c}.jop-button_red:hover{color:#fff!important;background-color:#f89898}.jop-loading{display:inline-block;width:14px;height:14px;margin-right:10px;border:2px dashed #dcdfe6;border-top-color:transparent;border-radius:100%;animation:btnLoading infinite 1s linear}@keyframes btnLoading{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.jop-tag{padding:3px 6px;color:#409eff!important;background:#ecf5ff;border:1px solid #d9ecff;border-radius:4px}.jop-setting-list{display:flex;flex-wrap:wrap;background-color:#fff}.jop-setting-title{margin:10px 0 5px}.jop-setting-item{display:flex;height:20px;justify-content:center;align-items:center;margin-right:15px}.db-panel .movie-panel-info div.panel-block{padding:5.5px 12px}.db-panel .jop-app{padding:15px 12px}.lib-panel .jop-app{padding:20px 30px;margin-top:10px}input[type=checkbox],input[type=radio]{margin:0 0 0 5px}"); +((t) => { + const o = document.createElement("style"); + (o.dataset.source = "vite-plugin-monkey"), (o.innerText = t), document.head.appendChild(o); +})( + ".jop-list{box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:flex-start;gap:10px;width:100%;height:100%;z-index:1;background-color:#fff;transition:right .2s ease-in-out;font-family:Roboto,Helvetica,Arial,sans-serif;color:#000}.jop-button,.jop-button_def{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:3px 10px;border-radius:4px;font-weight:500;font-size:14px;border:1px solid #dcdfe6;color:#606266;cursor:pointer}.jop-button_def{margin:10px 0;width:50px}.jop-button:visited{color:#606266}.jop-button:hover{text-decoration:none;color:#409eff;border:1px solid #c6e2ff;background-color:#ecf5ff}.jop-button_label{position:absolute;font-size:10px;padding:4px;border-radius:4px;top:-13px;right:-10px;line-height:.75;color:#67c23a;border:1px solid #e1f3d8;background:white}.jop-button_green{color:#fff!important;background-color:#67c23a}.jop-button_green:hover{color:#fff!important;background-color:#95d475}.jop-button_red{color:#fff!important;background-color:#f56c6c}.jop-button_red:hover{color:#fff!important;background-color:#f89898}.jop-loading{display:inline-block;width:14px;height:14px;margin-right:10px;border:2px dashed #dcdfe6;border-top-color:transparent;border-radius:100%;animation:btnLoading infinite 1s linear}@keyframes btnLoading{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.jop-tag{padding:3px 6px;color:#409eff!important;background:#ecf5ff;border:1px solid #d9ecff;border-radius:4px}.jop-setting-list{display:flex;flex-wrap:wrap;background-color:#fff}.jop-setting-title{margin:10px 0 5px}.jop-setting-item{display:flex;height:20px;justify-content:center;align-items:center;margin-right:15px}.db-panel .movie-panel-info div.panel-block{padding:5.5px 12px}.db-panel .jop-app{padding:15px 12px}.lib-panel .jop-app{padding:20px 30px;margin-top:10px}input[type=checkbox],input[type=radio]{margin:0 0 0 5px}", +); -(function(preact2, client) { +(function (preact2, client) { "use strict"; - const matchList = [{ - name: "javdb", - enable: true, - href: /^https:\/\/(\w*\.)?javdb(\d)*\.com.*$/, - querys: { - panelQueryStr: ".video-meta-panel>.columns.is-desktop .panel.movie-panel-info", - codeQueryStr: `[data-clipboard-text]` + const matchList = [ + { + name: "javdb", + enable: true, + href: /^https:\/\/(\w*\.)?javdb(\d)*\.com.*$/, + querys: { + panelQueryStr: ".video-meta-panel>.columns.is-desktop .panel.movie-panel-info", + codeQueryStr: `[data-clipboard-text]`, + }, + method() { + const columnVideoCover = document.querySelector(".column-video-cover"); + columnVideoCover.style.width = "60%"; + const panel = document.querySelector( + ".video-meta-panel>.columns.is-desktop>.column:not(.column-video-cover)", + ); + panel.classList.add("db-panel"); + }, }, - method() { - const columnVideoCover = document.querySelector(".column-video-cover"); - columnVideoCover.style.width = "60%"; - const panel = document.querySelector(".video-meta-panel>.columns.is-desktop>.column:not(.column-video-cover)"); - panel.classList.add("db-panel"); - } - }, { - name: "javbus", - enable: true, - href: /^https?:\/\/(\w*\.)?(javbus|seejav|javsee)*\.(com|cc|me|life).*$/, - querys: { - panelQueryStr: ".movie>div.info", - codeQueryStr: `span[style="color:#CC0000;"]` + { + name: "javbus", + enable: true, + href: /^https?:\/\/(\w*\.)?(javbus|seejav|javsee)*\.(com|cc|me|life).*$/, + querys: { + panelQueryStr: ".movie>div.info", + codeQueryStr: `span[style="color:#CC0000;"]`, + }, + method() {}, }, - method() { - } - }, { - name: "javlib", - enable: true, - href: /^https?:\/\/(\w*\.)?(javlib|javlibrary)*\.com.*$/, - querys: { - panelQueryStr: "#video_jacket_info #video_info", - codeQueryStr: `#video_id td.text` + { + name: "javlib", + enable: true, + href: /^https?:\/\/(\w*\.)?(javlib|javlibrary)*\.com.*$/, + querys: { + panelQueryStr: "#video_jacket_info #video_info", + codeQueryStr: `#video_id td.text`, + }, + method() { + const panel = document.querySelector("#video_info"); + panel.classList.add("lib-panel"); + }, }, - method() { - const panel = document.querySelector("#video_info"); - panel.classList.add("lib-panel"); - } - }]; + ]; function getCode(cms) { - const { - codeQueryStr - } = cms.querys; + const { codeQueryStr } = cms.querys; const codeNode = document.querySelector(codeQueryStr); - const codeText = cms.name === "javdb" ? codeNode == null ? void 0 : codeNode.dataset.clipboardText : codeNode == null ? void 0 : codeNode.innerText.replace("\u590D\u5236", ""); + if (!codeNode) return ""; + const codeText = + cms.name === "javdb" + ? codeNode.dataset.clipboardText + : codeNode.innerText.replace("复制", ""); + if (codeText == null ? void 0 : codeText.includes("FC2")) return codeText.split("-")[1]; return codeText; } const style = ""; - var r, u, i, o$1, f = 0, c = [], e = [], a = preact2.options.__b, v = preact2.options.__r, l = preact2.options.diffed, m = preact2.options.__c, d = preact2.options.unmount; + var r, + u, + i, + o$1, + f = 0, + c = [], + e = [], + a = preact2.options.__b, + v = preact2.options.__r, + l = preact2.options.diffed, + m = preact2.options.__c, + d = preact2.options.unmount; function p(t, r2) { - preact2.options.__h && preact2.options.__h(u, t, f || r2), f = 0; + preact2.options.__h && preact2.options.__h(u, t, f || r2), (f = 0); var i2 = u.__H || (u.__H = { __: [], __h: [] }); return t >= i2.__.length && i2.__.push({ __V: e }), i2.__[t]; } function y(n) { - return f = 1, h(C$1, n); + return (f = 1), h(C$1, n); } function h(n, t, i2) { var o2 = p(r++, 2); - if (o2.t = n, !o2.__c && (o2.__ = [i2 ? i2(t) : C$1(void 0, t), function(n2) { - var t2 = o2.__N ? o2.__N[0] : o2.__[0], r2 = o2.t(t2, n2); - t2 !== r2 && (o2.__N = [r2, o2.__[1]], o2.__c.setState({})); - }], o2.__c = u, !u.u)) { + if ( + ((o2.t = n), + !o2.__c && + ((o2.__ = [ + i2 ? i2(t) : C$1(void 0, t), + function (n2) { + var t2 = o2.__N ? o2.__N[0] : o2.__[0], + r2 = o2.t(t2, n2); + t2 !== r2 && ((o2.__N = [r2, o2.__[1]]), o2.__c.setState({})); + }, + ]), + (o2.__c = u), + !u.u)) + ) { u.u = true; var f2 = u.shouldComponentUpdate; - u.shouldComponentUpdate = function(n2, t2, r2) { - if (!o2.__c.__H) - return true; - var u2 = o2.__c.__H.__.filter(function(n3) { + u.shouldComponentUpdate = function (n2, t2, r2) { + if (!o2.__c.__H) return true; + var u2 = o2.__c.__H.__.filter(function (n3) { return n3.__c; }); - if (u2.every(function(n3) { - return !n3.__N; - })) + if ( + u2.every(function (n3) { + return !n3.__N; + }) + ) return !f2 || f2.call(this, n2, t2, r2); var i3 = false; - return u2.forEach(function(n3) { - if (n3.__N) { - var t3 = n3.__[0]; - n3.__ = n3.__N, n3.__N = void 0, t3 !== n3.__[0] && (i3 = true); - } - }), !!i3 && (!f2 || f2.call(this, n2, t2, r2)); + return ( + u2.forEach(function (n3) { + if (n3.__N) { + var t3 = n3.__[0]; + (n3.__ = n3.__N), (n3.__N = void 0), t3 !== n3.__[0] && (i3 = true); + } + }), + !!i3 && (!f2 || f2.call(this, n2, t2, r2)) + ); }; } return o2.__N || o2.__; } function s(t, i2) { var o2 = p(r++, 3); - !preact2.options.__s && B$1(o2.__H, i2) && (o2.__ = t, o2.i = i2, u.__H.__h.push(o2)); + !preact2.options.__s && B$1(o2.__H, i2) && ((o2.__ = t), (o2.i = i2), u.__H.__h.push(o2)); } function g$1() { - for (var t; t = c.shift(); ) + for (var t; (t = c.shift()); ) if (t.__P && t.__H) try { - t.__H.__h.forEach(w$1), t.__H.__h.forEach(z$1), t.__H.__h = []; + t.__H.__h.forEach(w$1), t.__H.__h.forEach(z$1), (t.__H.__h = []); } catch (r2) { - t.__H.__h = [], preact2.options.__e(r2, t.__v); + (t.__H.__h = []), preact2.options.__e(r2, t.__v); } } - preact2.options.__b = function(n) { - "function" != typeof n.type || n.o || n.type === preact2.Fragment ? n.o || (n.o = n.__ && n.__.o ? n.__.o : "") : n.o = (n.__ && n.__.o ? n.__.o : "") + (n.__ && n.__.__k ? n.__.__k.indexOf(n) : 0), u = null, a && a(n); - }, preact2.options.__r = function(n) { - v && v(n), r = 0; - var t = (u = n.__c).__H; - t && (i === u ? (t.__h = [], u.__h = [], t.__.forEach(function(n2) { - n2.__N && (n2.__ = n2.__N), n2.__V = e, n2.__N = n2.i = void 0; - })) : (t.__h.forEach(w$1), t.__h.forEach(z$1), t.__h = [])), i = u; - }, preact2.options.diffed = function(t) { - l && l(t); - var r2 = t.__c; - r2 && r2.__H && (r2.__H.__h.length && (1 !== c.push(r2) && o$1 === preact2.options.requestAnimationFrame || ((o$1 = preact2.options.requestAnimationFrame) || k)(g$1)), r2.__H.__.forEach(function(n) { - n.i && (n.__H = n.i), n.__V !== e && (n.__ = n.__V), n.i = void 0, n.__V = e; - })), i = u = null; - }, preact2.options.__c = function(t, r2) { - r2.some(function(t2) { - try { - t2.__h.forEach(w$1), t2.__h = t2.__h.filter(function(n) { - return !n.__ || z$1(n); - }); - } catch (u2) { - r2.some(function(n) { - n.__h && (n.__h = []); - }), r2 = [], preact2.options.__e(u2, t2.__v); - } - }), m && m(t, r2); - }, preact2.options.unmount = function(t) { - d && d(t); - var r2, u2 = t.__c; - u2 && u2.__H && (u2.__H.__.forEach(function(n) { - try { - w$1(n); - } catch (n2) { - r2 = n2; - } - }), u2.__H = void 0, r2 && preact2.options.__e(r2, u2.__v)); - }; + (preact2.options.__b = function (n) { + "function" != typeof n.type || n.o || n.type === preact2.Fragment + ? n.o || (n.o = n.__ && n.__.o ? n.__.o : "") + : (n.o = (n.__ && n.__.o ? n.__.o : "") + (n.__ && n.__.__k ? n.__.__k.indexOf(n) : 0)), + (u = null), + a && a(n); + }), + (preact2.options.__r = function (n) { + v && v(n), (r = 0); + var t = (u = n.__c).__H; + t && + (i === u + ? ((t.__h = []), + (u.__h = []), + t.__.forEach(function (n2) { + n2.__N && (n2.__ = n2.__N), (n2.__V = e), (n2.__N = n2.i = void 0); + })) + : (t.__h.forEach(w$1), t.__h.forEach(z$1), (t.__h = []))), + (i = u); + }), + (preact2.options.diffed = function (t) { + l && l(t); + var r2 = t.__c; + r2 && + r2.__H && + (r2.__H.__h.length && + ((1 !== c.push(r2) && o$1 === preact2.options.requestAnimationFrame) || + ((o$1 = preact2.options.requestAnimationFrame) || k)(g$1)), + r2.__H.__.forEach(function (n) { + n.i && (n.__H = n.i), n.__V !== e && (n.__ = n.__V), (n.i = void 0), (n.__V = e); + })), + (i = u = null); + }), + (preact2.options.__c = function (t, r2) { + r2.some(function (t2) { + try { + t2.__h.forEach(w$1), + (t2.__h = t2.__h.filter(function (n) { + return !n.__ || z$1(n); + })); + } catch (u2) { + r2.some(function (n) { + n.__h && (n.__h = []); + }), + (r2 = []), + preact2.options.__e(u2, t2.__v); + } + }), + m && m(t, r2); + }), + (preact2.options.unmount = function (t) { + d && d(t); + var r2, + u2 = t.__c; + u2 && + u2.__H && + (u2.__H.__.forEach(function (n) { + try { + w$1(n); + } catch (n2) { + r2 = n2; + } + }), + (u2.__H = void 0), + r2 && preact2.options.__e(r2, u2.__v)); + }); var j$1 = "function" == typeof requestAnimationFrame; function k(n) { - var t, r2 = function() { - clearTimeout(u2), j$1 && cancelAnimationFrame(t), setTimeout(n); - }, u2 = setTimeout(r2, 100); + var t, + r2 = function () { + clearTimeout(u2), j$1 && cancelAnimationFrame(t), setTimeout(n); + }, + u2 = setTimeout(r2, 100); j$1 && (t = requestAnimationFrame(r2)); } function w$1(n) { - var t = u, r2 = n.__c; - "function" == typeof r2 && (n.__c = void 0, r2()), u = t; + var t = u, + r2 = n.__c; + "function" == typeof r2 && ((n.__c = void 0), r2()), (u = t); } function z$1(n) { var t = u; - n.__c = n.__(), u = t; + (n.__c = n.__()), (u = t); } function B$1(n, t) { - return !n || n.length !== t.length || t.some(function(t2, r2) { - return t2 !== n[r2]; - }); + return ( + !n || + n.length !== t.length || + t.some(function (t2, r2) { + return t2 !== n[r2]; + }) + ); } function C$1(n, t) { return "function" == typeof t ? t(n) : t; } function g(n, t) { - for (var e2 in t) - n[e2] = t[e2]; + for (var e2 in t) n[e2] = t[e2]; return n; } function C(n, t) { - for (var e2 in n) - if ("__source" !== e2 && !(e2 in t)) - return true; - for (var r2 in t) - if ("__source" !== r2 && n[r2] !== t[r2]) - return true; + for (var e2 in n) if ("__source" !== e2 && !(e2 in t)) return true; + for (var r2 in t) if ("__source" !== r2 && n[r2] !== t[r2]) return true; return false; } function E(n) { @@ -214,162 +283,268 @@ } function w(n, e2) { function r2(n2) { - var t = this.props.ref, r3 = t == n2.ref; - return !r3 && t && (t.call ? t(null) : t.current = null), e2 ? !e2(this.props, n2) || !r3 : C(this.props, n2); + var t = this.props.ref, + r3 = t == n2.ref; + return ( + !r3 && t && (t.call ? t(null) : (t.current = null)), + e2 ? !e2(this.props, n2) || !r3 : C(this.props, n2) + ); } function u2(e3) { - return this.shouldComponentUpdate = r2, preact2.createElement(n, e3); + return (this.shouldComponentUpdate = r2), preact2.createElement(n, e3); } - return u2.displayName = "Memo(" + (n.displayName || n.name) + ")", u2.prototype.isReactComponent = true, u2.__f = true, u2; + return ( + (u2.displayName = "Memo(" + (n.displayName || n.name) + ")"), + (u2.prototype.isReactComponent = true), + (u2.__f = true), + u2 + ); } - (E.prototype = new preact2.Component()).isPureReactComponent = true, E.prototype.shouldComponentUpdate = function(n, t) { - return C(this.props, n) || C(this.state, t); - }; + ((E.prototype = new preact2.Component()).isPureReactComponent = true), + (E.prototype.shouldComponentUpdate = function (n, t) { + return C(this.props, n) || C(this.state, t); + }); var R = preact2.options.__b; - preact2.options.__b = function(n) { - n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), R && R(n); + preact2.options.__b = function (n) { + n.type && n.type.__f && n.ref && ((n.props.ref = n.ref), (n.ref = null)), R && R(n); }; var O = preact2.options.__e; - preact2.options.__e = function(n, t, e2, r2) { + preact2.options.__e = function (n, t, e2, r2) { if (n.then) { - for (var u2, o2 = t; o2 = o2.__; ) + for (var u2, o2 = t; (o2 = o2.__); ) if ((u2 = o2.__c) && u2.__c) - return null == t.__e && (t.__e = e2.__e, t.__k = e2.__k), u2.__c(n, t); + return null == t.__e && ((t.__e = e2.__e), (t.__k = e2.__k)), u2.__c(n, t); } O(n, t, e2, r2); }; var T = preact2.options.unmount; function I(n, t, e2) { - return n && (n.__c && n.__c.__H && (n.__c.__H.__.forEach(function(n2) { - "function" == typeof n2.__c && n2.__c(); - }), n.__c.__H = null), null != (n = g({}, n)).__c && (n.__c.__P === e2 && (n.__c.__P = t), n.__c = null), n.__k = n.__k && n.__k.map(function(n2) { - return I(n2, t, e2); - })), n; + return ( + n && + (n.__c && + n.__c.__H && + (n.__c.__H.__.forEach(function (n2) { + "function" == typeof n2.__c && n2.__c(); + }), + (n.__c.__H = null)), + null != (n = g({}, n)).__c && (n.__c.__P === e2 && (n.__c.__P = t), (n.__c = null)), + (n.__k = + n.__k && + n.__k.map(function (n2) { + return I(n2, t, e2); + }))), + n + ); } function L(n, t, e2) { - return n && (n.__v = null, n.__k = n.__k && n.__k.map(function(n2) { - return L(n2, t, e2); - }), n.__c && n.__c.__P === t && (n.__e && e2.insertBefore(n.__e, n.__d), n.__c.__e = true, n.__c.__P = e2)), n; + return ( + n && + ((n.__v = null), + (n.__k = + n.__k && + n.__k.map(function (n2) { + return L(n2, t, e2); + })), + n.__c && + n.__c.__P === t && + (n.__e && e2.insertBefore(n.__e, n.__d), (n.__c.__e = true), (n.__c.__P = e2))), + n + ); } function U() { - this.__u = 0, this.t = null, this.__b = null; + (this.__u = 0), (this.t = null), (this.__b = null); } function D(n) { var t = n.__.__c; return t && t.__a && t.__a(n); } function M() { - this.u = null, this.o = null; + (this.u = null), (this.o = null); } - preact2.options.unmount = function(n) { + (preact2.options.unmount = function (n) { var t = n.__c; t && t.__R && t.__R(), t && true === n.__h && (n.type = null), T && T(n); - }, (U.prototype = new preact2.Component()).__c = function(n, t) { - var e2 = t.__c, r2 = this; - null == r2.t && (r2.t = []), r2.t.push(e2); - var u2 = D(r2.__v), o2 = false, i2 = function() { - o2 || (o2 = true, e2.__R = null, u2 ? u2(l2) : l2()); - }; - e2.__R = i2; - var l2 = function() { - if (!--r2.__u) { - if (r2.state.__a) { - var n2 = r2.state.__a; - r2.__v.__k[0] = L(n2, n2.__c.__P, n2.__c.__O); + }), + ((U.prototype = new preact2.Component()).__c = function (n, t) { + var e2 = t.__c, + r2 = this; + null == r2.t && (r2.t = []), r2.t.push(e2); + var u2 = D(r2.__v), + o2 = false, + i2 = function () { + o2 || ((o2 = true), (e2.__R = null), u2 ? u2(l2) : l2()); + }; + e2.__R = i2; + var l2 = function () { + if (!--r2.__u) { + if (r2.state.__a) { + var n2 = r2.state.__a; + r2.__v.__k[0] = L(n2, n2.__c.__P, n2.__c.__O); + } + var t2; + for (r2.setState({ __a: (r2.__b = null) }); (t2 = r2.t.pop()); ) t2.forceUpdate(); + } + }, + c2 = true === t.__h; + r2.__u++ || c2 || r2.setState({ __a: (r2.__b = r2.__v.__k[0]) }), n.then(i2, i2); + }), + (U.prototype.componentWillUnmount = function () { + this.t = []; + }), + (U.prototype.render = function (n, e2) { + if (this.__b) { + if (this.__v.__k) { + var r2 = document.createElement("div"), + o2 = this.__v.__k[0].__c; + this.__v.__k[0] = I(this.__b, r2, (o2.__O = o2.__P)); } - var t2; - for (r2.setState({ __a: r2.__b = null }); t2 = r2.t.pop(); ) - t2.forceUpdate(); + this.__b = null; } - }, c2 = true === t.__h; - r2.__u++ || c2 || r2.setState({ __a: r2.__b = r2.__v.__k[0] }), n.then(i2, i2); - }, U.prototype.componentWillUnmount = function() { - this.t = []; - }, U.prototype.render = function(n, e2) { - if (this.__b) { - if (this.__v.__k) { - var r2 = document.createElement("div"), o2 = this.__v.__k[0].__c; - this.__v.__k[0] = I(this.__b, r2, o2.__O = o2.__P); - } - this.__b = null; - } - var i2 = e2.__a && preact2.createElement(preact2.Fragment, null, n.fallback); - return i2 && (i2.__h = null), [preact2.createElement(preact2.Fragment, null, e2.__a ? null : n.children), i2]; - }; - var V = function(n, t, e2) { - if (++e2[1] === e2[0] && n.o.delete(t), n.props.revealOrder && ("t" !== n.props.revealOrder[0] || !n.o.size)) + var i2 = e2.__a && preact2.createElement(preact2.Fragment, null, n.fallback); + return ( + i2 && (i2.__h = null), + [preact2.createElement(preact2.Fragment, null, e2.__a ? null : n.children), i2] + ); + }); + var V = function (n, t, e2) { + if ( + (++e2[1] === e2[0] && n.o.delete(t), + n.props.revealOrder && ("t" !== n.props.revealOrder[0] || !n.o.size)) + ) for (e2 = n.u; e2; ) { - for (; e2.length > 3; ) - e2.pop()(); - if (e2[1] < e2[0]) - break; + for (; e2.length > 3; ) e2.pop()(); + if (e2[1] < e2[0]) break; n.u = e2 = e2[2]; } }; - (M.prototype = new preact2.Component()).__a = function(n) { - var t = this, e2 = D(t.__v), r2 = t.o.get(n); - return r2[0]++, function(u2) { - var o2 = function() { - t.props.revealOrder ? (r2.push(u2), V(t, n, r2)) : u2(); - }; - e2 ? e2(o2) : o2(); + ((M.prototype = new preact2.Component()).__a = function (n) { + var t = this, + e2 = D(t.__v), + r2 = t.o.get(n); + return ( + r2[0]++, + function (u2) { + var o2 = function () { + t.props.revealOrder ? (r2.push(u2), V(t, n, r2)) : u2(); + }; + e2 ? e2(o2) : o2(); + } + ); + }), + (M.prototype.render = function (n) { + (this.u = null), (this.o = /* @__PURE__ */ new Map()); + var t = preact2.toChildArray(n.children); + n.revealOrder && "b" === n.revealOrder[0] && t.reverse(); + for (var e2 = t.length; e2--; ) this.o.set(t[e2], (this.u = [1, 0, this.u])); + return n.children; + }), + (M.prototype.componentDidUpdate = M.prototype.componentDidMount = + function () { + var n = this; + this.o.forEach(function (t, e2) { + V(n, e2, t); + }); + }); + var j = ("undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element")) || 60103, + z = + /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, + B = "undefined" != typeof document, + H = function (n) { + return ( + "undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/i : /fil|che|ra/i + ).test(n); }; - }, M.prototype.render = function(n) { - this.u = null, this.o = /* @__PURE__ */ new Map(); - var t = preact2.toChildArray(n.children); - n.revealOrder && "b" === n.revealOrder[0] && t.reverse(); - for (var e2 = t.length; e2--; ) - this.o.set(t[e2], this.u = [1, 0, this.u]); - return n.children; - }, M.prototype.componentDidUpdate = M.prototype.componentDidMount = function() { - var n = this; - this.o.forEach(function(t, e2) { - V(n, e2, t); + (preact2.Component.prototype.isReactComponent = {}), + ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function ( + t, + ) { + Object.defineProperty(preact2.Component.prototype, t, { + configurable: true, + get: function () { + return this["UNSAFE_" + t]; + }, + set: function (n) { + Object.defineProperty(this, t, { configurable: true, writable: true, value: n }); + }, + }); }); - }; - var j = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103, z = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, B = "undefined" != typeof document, H = function(n) { - return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/i : /fil|che|ra/i).test(n); - }; - preact2.Component.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) { - Object.defineProperty(preact2.Component.prototype, t, { configurable: true, get: function() { - return this["UNSAFE_" + t]; - }, set: function(n) { - Object.defineProperty(this, t, { configurable: true, writable: true, value: n }); - } }); - }); var q = preact2.options.event; - function G() { - } + function G() {} function J() { return this.cancelBubble; } function K() { return this.defaultPrevented; } - preact2.options.event = function(n) { - return q && (n = q(n)), n.persist = G, n.isPropagationStopped = J, n.isDefaultPrevented = K, n.nativeEvent = n; + preact2.options.event = function (n) { + return ( + q && (n = q(n)), + (n.persist = G), + (n.isPropagationStopped = J), + (n.isDefaultPrevented = K), + (n.nativeEvent = n) + ); }; - var X = { configurable: true, get: function() { - return this.class; - } }, nn = preact2.options.vnode; - preact2.options.vnode = function(n) { - var t = n.type, e2 = n.props, u2 = e2; + var X = { + configurable: true, + get: function () { + return this.class; + }, + }, + nn = preact2.options.vnode; + preact2.options.vnode = function (n) { + var t = n.type, + e2 = n.props, + u2 = e2; if ("string" == typeof t) { var o2 = -1 === t.indexOf("-"); - for (var i2 in u2 = {}, e2) { + for (var i2 in ((u2 = {}), e2)) { var l2 = e2[i2]; - B && "children" === i2 && "noscript" === t || "value" === i2 && "defaultValue" in e2 && null == l2 || ("defaultValue" === i2 && "value" in e2 && null == e2.value ? i2 = "value" : "download" === i2 && true === l2 ? l2 = "" : /ondoubleclick/i.test(i2) ? i2 = "ondblclick" : /^onchange(textarea|input)/i.test(i2 + t) && !H(e2.type) ? i2 = "oninput" : /^onfocus$/i.test(i2) ? i2 = "onfocusin" : /^onblur$/i.test(i2) ? i2 = "onfocusout" : /^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i2) ? i2 = i2.toLowerCase() : o2 && z.test(i2) ? i2 = i2.replace(/[A-Z0-9]/g, "-$&").toLowerCase() : null === l2 && (l2 = void 0), /^oninput$/i.test(i2) && (i2 = i2.toLowerCase(), u2[i2] && (i2 = "oninputCapture")), u2[i2] = l2); + (B && "children" === i2 && "noscript" === t) || + ("value" === i2 && "defaultValue" in e2 && null == l2) || + ("defaultValue" === i2 && "value" in e2 && null == e2.value + ? (i2 = "value") + : "download" === i2 && true === l2 + ? (l2 = "") + : /ondoubleclick/i.test(i2) + ? (i2 = "ondblclick") + : /^onchange(textarea|input)/i.test(i2 + t) && !H(e2.type) + ? (i2 = "oninput") + : /^onfocus$/i.test(i2) + ? (i2 = "onfocusin") + : /^onblur$/i.test(i2) + ? (i2 = "onfocusout") + : /^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i2) + ? (i2 = i2.toLowerCase()) + : o2 && z.test(i2) + ? (i2 = i2.replace(/[A-Z0-9]/g, "-$&").toLowerCase()) + : null === l2 && (l2 = void 0), + /^oninput$/i.test(i2) && ((i2 = i2.toLowerCase()), u2[i2] && (i2 = "oninputCapture")), + (u2[i2] = l2)); } - "select" == t && u2.multiple && Array.isArray(u2.value) && (u2.value = preact2.toChildArray(e2.children).forEach(function(n2) { - n2.props.selected = -1 != u2.value.indexOf(n2.props.value); - })), "select" == t && null != u2.defaultValue && (u2.value = preact2.toChildArray(e2.children).forEach(function(n2) { - n2.props.selected = u2.multiple ? -1 != u2.defaultValue.indexOf(n2.props.value) : u2.defaultValue == n2.props.value; - })), n.props = u2, e2.class != e2.className && (X.enumerable = "className" in e2, null != e2.className && (u2.class = e2.className), Object.defineProperty(u2, "className", X)); + "select" == t && + u2.multiple && + Array.isArray(u2.value) && + (u2.value = preact2.toChildArray(e2.children).forEach(function (n2) { + n2.props.selected = -1 != u2.value.indexOf(n2.props.value); + })), + "select" == t && + null != u2.defaultValue && + (u2.value = preact2.toChildArray(e2.children).forEach(function (n2) { + n2.props.selected = u2.multiple + ? -1 != u2.defaultValue.indexOf(n2.props.value) + : u2.defaultValue == n2.props.value; + })), + (n.props = u2), + e2.class != e2.className && + ((X.enumerable = "className" in e2), + null != e2.className && (u2.class = e2.className), + Object.defineProperty(u2, "className", X)); } - n.$$typeof = j, nn && nn(n); + (n.$$typeof = j), nn && nn(n); }; var tn = preact2.options.__r; - preact2.options.__r = function(n) { + preact2.options.__r = function (n) { tn && tn(n), n.__c; }; const print = (name) => { @@ -383,9 +558,9 @@ url: "https://jable.tv/videos/{{code}}/", fetcher: "get", domQuery: { - subQuery: ".header-right>h6" + subQuery: ".header-right>h6", }, - method: print + method: print, }, { name: "MISSAV", @@ -395,9 +570,9 @@ fetcher: "get", domQuery: { subQuery: '.space-y-2 a.text-nord13[href="https://missav.com/chinese-subtitle"]', - leakQuery: ".order-first div.rounded-md a[href]:last-child" + leakQuery: ".order-first div.rounded-md a[href]:last-child", }, - method: print + method: print, }, { name: "Supjav", @@ -407,9 +582,9 @@ fetcher: "parser", domQuery: { linkQuery: `.posts.clearfix>.post>a.img[title]`, - titleQuery: `h3>a[rel="bookmark"][itemprop="url"]` + titleQuery: `h3>a[rel="bookmark"][itemprop="url"]`, }, - method: print + method: print, }, { name: "NETFLAV", @@ -419,9 +594,9 @@ fetcher: "parser", domQuery: { linkQuery: ".grid_cell>a", - titleQuery: ".grid_cell>a>.grid_title" + titleQuery: ".grid_cell>a>.grid_title", }, - method: print + method: print, }, { name: "Avgle", @@ -431,9 +606,9 @@ fetcher: "parser", domQuery: { linkQuery: ".container>.row .row .well>a[href]", - titleQuery: ".container>.row .row .well .video-title" + titleQuery: ".container>.row .row .well .video-title", }, - method: print + method: print, }, { name: "JAVHHH", @@ -443,9 +618,9 @@ fetcher: "parser", domQuery: { linkQuery: ".typelist>.i-container>a[href]", - titleQuery: ".typelist>.i-container>a[href]" + titleQuery: ".typelist>.i-container>a[href]", }, - method: print + method: print, }, { name: "BestJP", @@ -455,9 +630,9 @@ fetcher: "parser", domQuery: { linkQuery: "article.thumb-block>a", - titleQuery: "article.thumb-block>a" + titleQuery: "article.thumb-block>a", }, - method: print + method: print, }, { name: "JAVMENU", @@ -466,9 +641,9 @@ url: "https://javmenu.com/{{code}}", fetcher: "get", domQuery: { - videoQuery: "a.nav-link[aria-controls='pills-0']" + videoQuery: "a.nav-link[aria-controls='pills-0']", }, - method: print + method: print, }, { name: "Jav.Guru", @@ -478,9 +653,9 @@ fetcher: "parser", domQuery: { linkQuery: ".imgg>a[href]", - titleQuery: ".inside-article>.grid1 a[title]" + titleQuery: ".inside-article>.grid1 a[title]", }, - method: print + method: print, }, { name: "JAVMOST", @@ -490,9 +665,9 @@ fetcher: "parser", domQuery: { linkQuery: "#content .card a#MyImage", - titleQuery: "#content .card-block .card-title" + titleQuery: "#content .card-block .card-title", }, - method: print + method: print, }, { name: "HAYAV", @@ -501,7 +676,7 @@ url: "https://hayav.com/video/{{code}}/", fetcher: "get", domQuery: {}, - method: print + method: print, }, { name: "AvJoy", @@ -511,9 +686,9 @@ fetcher: "parser", domQuery: { titleQuery: `.content-info>.content-title`, - linkQuery: `.content-row>a` + linkQuery: `.content-row>a`, }, - method: print + method: print, }, { name: "JAVFC2", @@ -523,9 +698,9 @@ fetcher: "parser", domQuery: { linkQuery: "article.loop-video>a[href]", - titleQuery: "article.loop-video .entry-header" + titleQuery: "article.loop-video .entry-header", }, - method: print + method: print, }, { name: "baihuse", @@ -535,9 +710,9 @@ fetcher: "parser", domQuery: { linkQuery: "div.col>div.card>a[href]", - titleQuery: "div.card img.card-img-top" + titleQuery: "div.card img.card-img-top", }, - method: print + method: print, }, { name: "GGJAV", @@ -549,9 +724,9 @@ listIndex: 1, spaceCode: true, titleQuery: "div.columns.large-3.medium-6.small-12.item.float-left>div.item_title>a.gray_a", - linkQuery: "div.columns.large-3.medium-6.small-12.item.float-left>div.item_title>a.gray_a" + linkQuery: "div.columns.large-3.medium-6.small-12.item.float-left>div.item_title>a.gray_a", }, - method: print + method: print, }, { name: "AV01", @@ -561,9 +736,9 @@ fetcher: "parser", domQuery: { linkQuery: "div[id].well-sm>a", - titleQuery: ".video-views>.pull-left" + titleQuery: ".video-views>.pull-left", }, - method: print + method: print, }, { name: "JavBus", @@ -573,14 +748,10 @@ url: "https://javbus.com/{{code}}", fetcher: "get", domQuery: {}, - method: print - } + method: print, + }, ]; - function videoPageParser(responseText, { - subQuery, - leakQuery, - videoQuery - }) { + function videoPageParser(responseText, { subQuery, leakQuery, videoQuery }) { const doc = new DOMParser().parseFromString(responseText, "text/html"); const subNode = subQuery ? doc.querySelector(subQuery) : ""; const subNodeText = subNode ? subNode.innerHTML : ""; @@ -588,36 +759,39 @@ const videoNode = videoQuery ? doc.querySelector(videoQuery) : true; return { isSuccess: !!videoNode, - hasSubtitle: subNodeText.includes("\u5B57\u5E55") || subNodeText.includes("subtitle"), - hasLeakage: !!leakNode + hasSubtitle: subNodeText.includes("字幕") || subNodeText.includes("subtitle"), + hasLeakage: !!leakNode, }; } - function serachPageParser(responseText, { - linkQuery, - titleQuery, - listIndex = 0, - spaceCode = false - }, siteHostName, CODE) { + function serachPageParser( + responseText, + { linkQuery, titleQuery, listIndex = 0, spaceCode = false }, + siteHostName, + CODE, + ) { const doc = new DOMParser().parseFromString(responseText, "text/html"); const linkNode = linkQuery ? doc.querySelectorAll(linkQuery)[listIndex] : null; const titleNode = titleQuery ? doc.querySelectorAll(titleQuery)[listIndex] : null; - const titleNodeText = titleNode ? titleNode == null ? void 0 : titleNode.outerHTML : ""; + const titleNodeText = titleNode ? (titleNode == null ? void 0 : titleNode.outerHTML) : ""; function query() { const envCodeWithSpace = spaceCode ? CODE.replace("-", " ") : CODE; - const condition = linkNode && titleNode && (titleNodeText.includes(envCodeWithSpace) || titleNodeText.includes(CODE)); + const condition = + linkNode && + titleNode && + (titleNodeText.includes(envCodeWithSpace) || titleNodeText.includes(CODE)); if (condition) { return { isSuccess: true, targetLink: linkNode.href.replace(linkNode.hostname, siteHostName), - hasLeakage: titleNodeText.includes("\u65E0\u7801") || titleNodeText.includes("Uncensored"), - hasSubtitle: titleNodeText.includes("\u5B57\u5E55") || titleNodeText.includes("subtitle") + hasLeakage: titleNodeText.includes("无码") || titleNodeText.includes("Uncensored"), + hasSubtitle: titleNodeText.includes("字幕") || titleNodeText.includes("subtitle"), }; } else { return { targetLink: "", isSuccess: false, hasSubtitle: false, - hasLeakage: false + hasLeakage: false, }; } } @@ -636,20 +810,19 @@ targetLink, hasSubtitle: false, hasLeakage: false, - msg: "\u5E94\u8BE5\u662F\u6CA1\u6709\u8D44\u6E90" + msg: "应该是没有资源", }); } else { - const { - hasSubtitle, - hasLeakage, - isSuccess - } = videoPageParser(response.responseText, siteItem.domQuery); + const { hasSubtitle, hasLeakage, isSuccess } = videoPageParser( + response.responseText, + siteItem.domQuery, + ); resolve({ isSuccess, targetLink, hasSubtitle, hasLeakage, - msg: "[get]\uFF0C\u5B58\u5728\u8D44\u6E90" + msg: "[get],存在资源", }); } } else if (siteItem.fetcher === "parser") { @@ -657,14 +830,14 @@ targetLink: targetLink2, isSuccess, hasLeakage, - hasSubtitle + hasSubtitle, } = serachPageParser(response.responseText, siteItem.domQuery, siteItem.hostname, CODE); resolve({ isSuccess, targetLink: isSuccess ? targetLink2 : targetLink2, hasSubtitle, hasLeakage, - msg: "[parser]\u5B58\u5728\u8D44\u6E90" + msg: "[parser]存在资源", }); } }, @@ -674,170 +847,202 @@ targetLink, hasSubtitle: false, hasLeakage: false, - msg: error.error + msg: error.error, }); - } + }, }); }); return xhrPromise; } var _ = 0; function o(o2, e2, n, t, f2) { - var l2, s2, u2 = {}; - for (s2 in e2) - "ref" == s2 ? l2 = e2[s2] : u2[s2] = e2[s2]; - var a2 = { type: o2, props: u2, key: n, ref: l2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --_, __source: f2, __self: t }; + var l2, + s2, + u2 = {}; + for (s2 in e2) "ref" == s2 ? (l2 = e2[s2]) : (u2[s2] = e2[s2]); + var a2 = { + type: o2, + props: u2, + key: n, + ref: l2, + __k: null, + __: null, + __b: 0, + __e: null, + __d: void 0, + __c: null, + __h: null, + constructor: void 0, + __v: --_, + __source: f2, + __self: t, + }; if ("function" == typeof o2 && (l2 = o2.defaultProps)) - for (s2 in l2) - void 0 === u2[s2] && (u2[s2] = l2[s2]); + for (s2 in l2) void 0 === u2[s2] && (u2[s2] = l2[s2]); return preact2.options.vnode && preact2.options.vnode(a2), a2; } - const SiteButton = w(({ - siteItem, - CODE - }) => { - const { - name - } = siteItem; + const SiteButton = w(({ siteItem, CODE }) => { + const { name } = siteItem; + const link = siteItem.url.replace("{{code}}", CODE); const [status, setStatus] = y({ isSuccess: "pedding", hasSubtitle: false, hasLeakage: false, - targetLink: "" + targetLink: "", }); - const link = siteItem.url.replace("{{code}}", CODE); - const { - isSuccess, - hasSubtitle, - hasLeakage, - targetLink - } = status; + const { isSuccess, hasSubtitle, hasLeakage, targetLink } = status; s(() => { xhr(siteItem, link, CODE).then((res) => { setStatus({ isSuccess: res.isSuccess ? "fulfilled" : "rejected", hasSubtitle: res.hasSubtitle, hasLeakage: res.hasLeakage, - targetLink: res.targetLink + targetLink: res.targetLink, }); }); }, [xhr, siteItem, CODE, link]); - const colorClass = isSuccess === "pedding" ? " " : isSuccess === "fulfilled" ? "jop-button_green " : "jop-button_red "; + const colorClass = + isSuccess === "pedding" + ? " " + : isSuccess === "fulfilled" + ? "jop-button_green " + : "jop-button_red "; return o("a", { className: "jop-button " + colorClass, target: "_blank", href: targetLink === "" ? link : targetLink, - children: [(hasSubtitle || hasLeakage) && o("div", { - className: "jop-button_label", - children: [hasSubtitle && o("span", { - children: "\u5B57\u5E55 " - }), hasLeakage && o("span", { - children: " \u65E0\u7801" - })] - }), o("span", { - children: name - })] + children: [ + (hasSubtitle || hasLeakage) && + o("div", { + className: "jop-button_label", + children: [ + hasSubtitle && + o("span", { + children: "字幕 ", + }), + hasLeakage && + o("span", { + children: " 无码", + }), + ], + }), + o("span", { + children: name, + }), + ], }); }); - const Setting = ({ - sites, - setSites, - disable - }) => { + const Setting = ({ sites, setSites, disable }) => { const [showSetting, setShowSetting] = y(false); const newDisable = disable; return o(preact2.Fragment, { - children: [!showSetting ? o("div", { - className: "jop-button_def", - onClick: (e2) => { - setShowSetting(!showSetting); - }, - children: "\u8BBE\u7F6E" - }) : o("h4", { - className: "jop-setting-title", - children: "\u52FE\u9009\u9ED8\u8BA4\u663E\u793A\u7684\u7F51\u7AD9" - }), showSetting && o(preact2.Fragment, { - children: [o("div", { - className: "jop-setting", - children: o("div", { - className: "jop-setting-list", - children: sites.map((item, index) => o("div", { - className: "jop-setting-item", - children: [item.name, o("input", { - type: "checkbox", - className: "jop-setting-checkbox", - checked: !disable.includes(item.name), - onChange: (e2) => { - var _a; - const checked = (_a = e2.target) == null ? void 0 : _a.checked; - sites[index].disable = !checked; - if (!checked) { - newDisable.push(item.name); - } else { - newDisable.forEach((name, index2) => { - if (name === item.name) - newDisable.splice(index2, 1); - }); - } - } - })] - })) - }) - }), o("div", { - className: "jop-button_def", - onClick: (e2) => { - setShowSetting(!showSetting); - client.GM_setValue("disable", newDisable); - setSites([...sites]); - }, - children: "\u4FDD\u5B58" - })] - })] + children: [ + !showSetting + ? o("div", { + className: "jop-button_def", + onClick: (e2) => { + setShowSetting(!showSetting); + }, + children: "设置", + }) + : o("h4", { + className: "jop-setting-title", + children: "勾选默认显示的网站", + }), + showSetting && + o(preact2.Fragment, { + children: [ + o("div", { + className: "jop-setting", + children: o("div", { + className: "jop-setting-list", + children: sites.map((item, index) => + o("div", { + className: "jop-setting-item", + children: [ + item.name, + o("input", { + type: "checkbox", + className: "jop-setting-checkbox", + checked: !disable.includes(item.name), + onChange: (e2) => { + var _a; + const checked = (_a = e2.target) == null ? void 0 : _a.checked; + sites[index].disable = !checked; + if (!checked) { + newDisable.push(item.name); + } else { + newDisable.forEach((name, index2) => { + if (name === item.name) newDisable.splice(index2, 1); + }); + } + }, + }), + ], + }), + ), + }), + }), + o("div", { + className: "jop-button_def", + onClick: (e2) => { + setShowSetting(!showSetting); + client.GM_setValue("disable", newDisable); + setSites([...sites]); + }, + children: "保存", + }), + ], + }), + ], }); }; - const App = w(function({ - current, - CODE - }) { + const App = w(function ({ current, CODE }) { const disable = client.GM_getValue("disable", ["AvJoy", "baihuse", "AV01"]); const [sites, setSites] = y(siteList); - const sitesDisHost = sites.filter((item) => item.disableHostname !== current.name && !item.disable); + const sitesDisHost = sites.filter( + (item) => item.disableHostname !== current.name && !item.disable, + ); const filter = sitesDisHost.filter((item) => { - if (!disable.includes(item.name)) - return item; + if (!disable.includes(item.name)) return item; }); return o(preact2.Fragment, { - children: [o("div", { - class: "jop-list", - children: filter.map((item) => o(SiteButton, { - siteItem: item, - CODE - })) - }), o("div", { - children: o(Setting, { - sites, - setSites, - disable - }) - })] + children: [ + o("div", { + class: "jop-list", + children: filter.map((item) => + o(SiteButton, { + siteItem: item, + CODE, + }), + ), + }), + o("div", { + children: o(Setting, { + sites, + setSites, + disable, + }), + }), + ], }); }); function main() { const current = matchList.find((item) => item.href.test(window.location.href)); const CODE = getCode(current); - if (CODE === void 0) - return; current.method(); const panel = document.querySelector(current.querys.panelQueryStr); - if (panel === null) - return; + if (panel === null) return; const app = document.createElement("div"); app.classList.add("jop-app"); panel.append(app); - preact2.render(o(App, { - current, - CODE - }), app); + preact2.render( + o(App, { + current, + CODE, + }), + app, + ); } main(); -})(preact, (window.monkeyWindow = window, window)); +})(preact, ((window.monkeyWindow = window), window)); diff --git a/package.json b/package.json index 1f89878..83d9b02 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,19 @@ -{ - "name": "userjs-jop", - "private": true, - "version": "0.0.0", - "type": "module", - "scripts": { - "dev": "vite", - "build": "tsc && vite build" - }, - "dependencies": { - "preact": "10.11.0" - }, - "devDependencies": { - "@preact/preset-vite": "^2.4.0", - "typescript": "^4.8.4", - "vite": "^3.1.8", - "vite-plugin-monkey": "^2.8.0" - } -} +{ + "name": "userjs-jop", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build" + }, + "dependencies": { + "preact": "10.11.3" + }, + "devDependencies": { + "@preact/preset-vite": "^2.5.0", + "typescript": "^4.9.4", + "vite": "^4.0.3", + "vite-plugin-monkey": "^2.10.2" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eb1c0d3..14e8b7a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,20 +1,20 @@ lockfileVersion: 5.4 specifiers: - '@preact/preset-vite': ^2.4.0 - preact: 10.11.0 - typescript: ^4.8.4 - vite: ^3.1.8 - vite-plugin-monkey: ^2.8.0 + '@preact/preset-vite': ^2.5.0 + preact: 10.11.3 + typescript: ^4.9.4 + vite: ^4.0.3 + vite-plugin-monkey: ^2.10.2 dependencies: - preact: 10.11.0 + preact: 10.11.3 devDependencies: - '@preact/preset-vite': 2.4.0_preact@10.11.0+vite@3.1.8 - typescript: 4.8.4 - vite: 3.1.8 - vite-plugin-monkey: 2.8.0_vite@3.1.8 + '@preact/preset-vite': 2.5.0_preact@10.11.3+vite@4.0.3 + typescript: 4.9.4 + vite: 4.0.3 + vite-plugin-monkey: 2.10.2_vite@4.0.3 packages: @@ -262,8 +262,8 @@ packages: to-fast-properties: 2.0.0 dev: true - /@esbuild/android-arm/0.15.12: - resolution: {integrity: sha512-IC7TqIqiyE0MmvAhWkl/8AEzpOtbhRNDo7aph47We1NbE5w2bt/Q+giAhe0YYeVpYnIhGMcuZY92qDK6dQauvA==} + /@esbuild/android-arm/0.16.12: + resolution: {integrity: sha512-CTWgMJtpCyCltrvipZrrcjjRu+rzm6pf9V8muCsJqtKujR3kPmU4ffbckvugNNaRmhxAF1ZI3J+0FUIFLFg8KA==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -271,8 +271,89 @@ packages: dev: true optional: true - /@esbuild/linux-loong64/0.15.12: - resolution: {integrity: sha512-tZEowDjvU7O7I04GYvWQOS4yyP9E/7YlsB0jjw1Ycukgr2ycEzKyIk5tms5WnLBymaewc6VmRKnn5IJWgK4eFw==} + /@esbuild/android-arm64/0.16.12: + resolution: {integrity: sha512-0LacmiIW+X0/LOLMZqYtZ7d4uY9fxYABAYhSSOu+OGQVBqH4N5eIYgkT7bBFnR4Nm3qo6qS3RpHKVrDASqj/uQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64/0.16.12: + resolution: {integrity: sha512-sS5CR3XBKQXYpSGMM28VuiUnbX83Z+aWPZzClW+OB2JquKqxoiwdqucJ5qvXS8pM6Up3RtJfDnRQZkz3en2z5g==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64/0.16.12: + resolution: {integrity: sha512-Dpe5hOAQiQRH20YkFAg+wOpcd4PEuXud+aGgKBQa/VriPJA8zuVlgCOSTwna1CgYl05lf6o5els4dtuyk1qJxQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64/0.16.12: + resolution: {integrity: sha512-ApGRA6X5txIcxV0095X4e4KKv87HAEXfuDRcGTniDWUUN+qPia8sl/BqG/0IomytQWajnUn4C7TOwHduk/FXBQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64/0.16.12: + resolution: {integrity: sha512-AMdK2gA9EU83ccXCWS1B/KcWYZCj4P3vDofZZkl/F/sBv/fphi2oUqUTox/g5GMcIxk8CF1CVYTC82+iBSyiUg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64/0.16.12: + resolution: {integrity: sha512-KUKB9w8G/xaAbD39t6gnRBuhQ8vIYYlxGT2I+mT6UGRnCGRr1+ePFIGBQmf5V16nxylgUuuWVW1zU2ktKkf6WQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm/0.16.12: + resolution: {integrity: sha512-vhDdIv6z4eL0FJyNVfdr3C/vdd/Wc6h1683GJsFoJzfKb92dU/v88FhWdigg0i6+3TsbSDeWbsPUXb4dif2abg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64/0.16.12: + resolution: {integrity: sha512-29HXMLpLklDfmw7T2buGqq3HImSUaZ1ArmrPOMaNiZZQptOSZs32SQtOHEl8xWX5vfdwZqrBfNf8Te4nArVzKQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32/0.16.12: + resolution: {integrity: sha512-JFDuNDTTfgD1LJg7wHA42o2uAO/9VzHYK0leAVnCQE/FdMB599YMH73ux+nS0xGr79pv/BK+hrmdRin3iLgQjg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64/0.16.12: + resolution: {integrity: sha512-xTGzVPqm6WKfCC0iuj1fryIWr1NWEM8DMhAIo+4rFgUtwy/lfHl+Obvus4oddzRDbBetLLmojfVZGmt/g/g+Rw==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -280,6 +361,105 @@ packages: dev: true optional: true + /@esbuild/linux-mips64el/0.16.12: + resolution: {integrity: sha512-zI1cNgHa3Gol+vPYjIYHzKhU6qMyOQrvZ82REr5Fv7rlh5PG6SkkuCoH7IryPqR+BK2c/7oISGsvPJPGnO2bHQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64/0.16.12: + resolution: {integrity: sha512-/C8OFXExoMmvTDIOAM54AhtmmuDHKoedUd0Otpfw3+AuuVGemA1nQK99oN909uZbLEU6Bi+7JheFMG3xGfZluQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64/0.16.12: + resolution: {integrity: sha512-qeouyyc8kAGV6Ni6Isz8hUsKMr00EHgVwUKWNp1r4l88fHEoNTDB8mmestvykW6MrstoGI7g2EAsgr0nxmuGYg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x/0.16.12: + resolution: {integrity: sha512-s9AyI/5vz1U4NNqnacEGFElqwnHusWa81pskAf8JNDM2eb6b2E6PpBmT8RzeZv6/TxE6/TADn2g9bb0jOUmXwQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64/0.16.12: + resolution: {integrity: sha512-e8YA7GQGLWhvakBecLptUiKxOk4E/EPtSckS1i0MGYctW8ouvNUoh7xnU15PGO2jz7BYl8q1R6g0gE5HFtzpqQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64/0.16.12: + resolution: {integrity: sha512-z2+kUxmOqBS+6SRVd57iOLIHE8oGOoEnGVAmwjm2aENSP35HPS+5cK+FL1l+rhrsJOFIPrNHqDUNechpuG96Sg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64/0.16.12: + resolution: {integrity: sha512-PAonw4LqIybwn2/vJujhbg1N9W2W8lw9RtXIvvZoyzoA/4rA4CpiuahVbASmQohiytRsixbNoIOUSjRygKXpyA==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64/0.16.12: + resolution: {integrity: sha512-+wr1tkt1RERi+Zi/iQtkzmMH4nS8+7UIRxjcyRz7lur84wCkAITT50Olq/HiT4JN2X2bjtlOV6vt7ptW5Gw60Q==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64/0.16.12: + resolution: {integrity: sha512-XEjeUSHmjsAOJk8+pXJu9pFY2O5KKQbHXZWQylJzQuIBeiGrpMeq9sTVrHefHxMOyxUgoKQTcaTS+VK/K5SviA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32/0.16.12: + resolution: {integrity: sha512-eRKPM7e0IecUAUYr2alW7JGDejrFJXmpjt4MlfonmQ5Rz9HWpKFGCjuuIRgKO7W9C/CWVFXdJ2GjddsBXqQI4A==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64/0.16.12: + resolution: {integrity: sha512-iPYKN78t3op2+erv2frW568j1q0RpqX6JOLZ7oPPaAV1VaF7dDstOrNw37PVOYoTWE11pV4A1XUitpdEFNIsPg==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@jridgewell/gen-mapping/0.1.1: resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} engines: {node: '>=6.0.0'} @@ -318,21 +498,21 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true - /@preact/preset-vite/2.4.0_preact@10.11.0+vite@3.1.8: - resolution: {integrity: sha512-EiUMHuiCThuTuK+eH2r5uDg+CJbbt4aWJGePuszrHuXUpRv6WAeO4S+/DTJsEHtPtGmPRR3cLQ68N5097eOSRA==} + /@preact/preset-vite/2.5.0_preact@10.11.3+vite@4.0.3: + resolution: {integrity: sha512-BUhfB2xQ6ex0yPkrT1Z3LbfPzjpJecOZwQ/xJrXGFSZD84+ObyS//41RdEoQCMWsM0t7UHGaujUxUBub7WM1Jw==} peerDependencies: '@babel/core': 7.x - vite: 2.x || 3.x + vite: 2.x || 3.x || 4.x dependencies: '@babel/plugin-transform-react-jsx': 7.19.0 '@babel/plugin-transform-react-jsx-development': 7.18.6 - '@prefresh/vite': 2.2.9_preact@10.11.0+vite@3.1.8 + '@prefresh/vite': 2.2.9_preact@10.11.3+vite@4.0.3 '@rollup/pluginutils': 4.2.1 babel-plugin-transform-hook-names: 1.0.2 debug: 4.3.4 kolorist: 1.6.0 resolve: 1.22.1 - vite: 3.1.8 + vite: 4.0.3 transitivePeerDependencies: - preact - supports-color @@ -342,19 +522,19 @@ packages: resolution: {integrity: sha512-/EvgIFMDL+nd20WNvMO0JQnzIl1EJPgmSaSYrZUww7A+aSdKsi37aL07TljrZR1cBMuzFxcr4xvqsUQLFJEukw==} dev: true - /@prefresh/core/1.4.1_preact@10.11.0: + /@prefresh/core/1.4.1_preact@10.11.3: resolution: {integrity: sha512-og1vaBj3LMJagVncNrDb37Gqc0cWaUcDbpVt5hZtsN4i2Iwzd/5hyTsDHvlMirhSym3wL9ihU0Xa2VhSaOue7g==} peerDependencies: preact: ^10.0.0 dependencies: - preact: 10.11.0 + preact: 10.11.3 dev: true /@prefresh/utils/1.1.3: resolution: {integrity: sha512-Mb9abhJTOV4yCfkXrMrcgFiFT7MfNOw8sDa+XyZBdq/Ai2p4Zyxqsb3EgHLOEdHpMj6J9aiZ54W8H6FTam1u+A==} dev: true - /@prefresh/vite/2.2.9_preact@10.11.0+vite@3.1.8: + /@prefresh/vite/2.2.9_preact@10.11.3+vite@4.0.3: resolution: {integrity: sha512-1ERBF85Ja9/lkrfaltmo4Gca7R2ClQPSHHDDysFgfvPzHmLUeyB0x9WHwhwov/AA1DnyPhsfYT54z3yQd8XrgA==} peerDependencies: preact: ^10.4.0 @@ -362,11 +542,11 @@ packages: dependencies: '@babel/core': 7.19.6 '@prefresh/babel-plugin': 0.4.4 - '@prefresh/core': 1.4.1_preact@10.11.0 + '@prefresh/core': 1.4.1_preact@10.11.3 '@prefresh/utils': 1.1.3 '@rollup/pluginutils': 4.2.1 - preact: 10.11.0 - vite: 3.1.8 + preact: 10.11.3 + vite: 4.0.3 transitivePeerDependencies: - supports-color dev: true @@ -507,214 +687,34 @@ packages: engines: {node: '>=0.12'} dev: true - /esbuild-android-64/0.15.12: - resolution: {integrity: sha512-MJKXwvPY9g0rGps0+U65HlTsM1wUs9lbjt5CU19RESqycGFDRijMDQsh68MtbzkqWSRdEtiKS1mtPzKneaAI0Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /esbuild-android-arm64/0.15.12: - resolution: {integrity: sha512-Hc9SEcZbIMhhLcvhr1DH+lrrec9SFTiRzfJ7EGSBZiiw994gfkVV6vG0sLWqQQ6DD7V4+OggB+Hn0IRUdDUqvA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /esbuild-darwin-64/0.15.12: - resolution: {integrity: sha512-qkmqrTVYPFiePt5qFjP8w/S+GIUMbt6k8qmiPraECUWfPptaPJUGkCKrWEfYFRWB7bY23FV95rhvPyh/KARP8Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /esbuild-darwin-arm64/0.15.12: - resolution: {integrity: sha512-z4zPX02tQ41kcXMyN3c/GfZpIjKoI/BzHrdKUwhC/Ki5BAhWv59A9M8H+iqaRbwpzYrYidTybBwiZAIWCLJAkw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /esbuild-freebsd-64/0.15.12: - resolution: {integrity: sha512-XFL7gKMCKXLDiAiBjhLG0XECliXaRLTZh6hsyzqUqPUf/PY4C6EJDTKIeqqPKXaVJ8+fzNek88285krSz1QECw==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-freebsd-arm64/0.15.12: - resolution: {integrity: sha512-jwEIu5UCUk6TjiG1X+KQnCGISI+ILnXzIzt9yDVrhjug2fkYzlLbl0K43q96Q3KB66v6N1UFF0r5Ks4Xo7i72g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-32/0.15.12: - resolution: {integrity: sha512-uSQuSEyF1kVzGzuIr4XM+v7TPKxHjBnLcwv2yPyCz8riV8VUCnO/C4BF3w5dHiVpCd5Z1cebBtZJNlC4anWpwA==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-64/0.15.12: - resolution: {integrity: sha512-QcgCKb7zfJxqT9o5z9ZUeGH1k8N6iX1Y7VNsEi5F9+HzN1OIx7ESxtQXDN9jbeUSPiRH1n9cw6gFT3H4qbdvcA==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-arm/0.15.12: - resolution: {integrity: sha512-Wf7T0aNylGcLu7hBnzMvsTfEXdEdJY/hY3u36Vla21aY66xR0MS5I1Hw8nVquXjTN0A6fk/vnr32tkC/C2lb0A==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-arm64/0.15.12: - resolution: {integrity: sha512-HtNq5xm8fUpZKwWKS2/YGwSfTF+339L4aIA8yphNKYJckd5hVdhfdl6GM2P3HwLSCORS++++7++//ApEwXEuAQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-mips64le/0.15.12: - resolution: {integrity: sha512-Qol3+AvivngUZkTVFgLpb0H6DT+N5/zM3V1YgTkryPYFeUvuT5JFNDR3ZiS6LxhyF8EE+fiNtzwlPqMDqVcc6A==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-ppc64le/0.15.12: - resolution: {integrity: sha512-4D8qUCo+CFKaR0cGXtGyVsOI7w7k93Qxb3KFXWr75An0DHamYzq8lt7TNZKoOq/Gh8c40/aKaxvcZnTgQ0TJNg==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-riscv64/0.15.12: - resolution: {integrity: sha512-G9w6NcuuCI6TUUxe6ka0enjZHDnSVK8bO+1qDhMOCtl7Tr78CcZilJj8SGLN00zO5iIlwNRZKHjdMpfFgNn1VA==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-s390x/0.15.12: - resolution: {integrity: sha512-Lt6BDnuXbXeqSlVuuUM5z18GkJAZf3ERskGZbAWjrQoi9xbEIsj/hEzVnSAFLtkfLuy2DE4RwTcX02tZFunXww==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-netbsd-64/0.15.12: - resolution: {integrity: sha512-jlUxCiHO1dsqoURZDQts+HK100o0hXfi4t54MNRMCAqKGAV33JCVvMplLAa2FwviSojT/5ZG5HUfG3gstwAG8w==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-openbsd-64/0.15.12: - resolution: {integrity: sha512-1o1uAfRTMIWNOmpf8v7iudND0L6zRBYSH45sofCZywrcf7NcZA+c7aFsS1YryU+yN7aRppTqdUK1PgbZVaB1Dw==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-sunos-64/0.15.12: - resolution: {integrity: sha512-nkl251DpoWoBO9Eq9aFdoIt2yYmp4I3kvQjba3jFKlMXuqQ9A4q+JaqdkCouG3DHgAGnzshzaGu6xofGcXyPXg==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-32/0.15.12: - resolution: {integrity: sha512-WlGeBZHgPC00O08luIp5B2SP4cNCp/PcS+3Pcg31kdcJPopHxLkdCXtadLU9J82LCfw4TVls21A6lilQ9mzHrw==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-64/0.15.12: - resolution: {integrity: sha512-VActO3WnWZSN//xjSfbiGOSyC+wkZtI8I4KlgrTo5oHJM6z3MZZBCuFaZHd8hzf/W9KPhF0lY8OqlmWC9HO5AA==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-arm64/0.15.12: - resolution: {integrity: sha512-Of3MIacva1OK/m4zCNIvBfz8VVROBmQT+gRX6pFTLPngFYcj6TFH/12VveAqq1k9VB2l28EoVMNMUCcmsfwyuA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild/0.15.12: - resolution: {integrity: sha512-PcT+/wyDqJQsRVhaE9uX/Oq4XLrFh0ce/bs2TJh4CSaw9xuvI+xFrH2nAYOADbhQjUgAhNWC5LKoUsakm4dxng==} + /esbuild/0.16.12: + resolution: {integrity: sha512-eq5KcuXajf2OmivCl4e89AD3j8fbV+UTE9vczEzq5haA07U9oOTzBWlh3+6ZdjJR7Rz2QfWZ2uxZyhZxBgJ4+g==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.15.12 - '@esbuild/linux-loong64': 0.15.12 - esbuild-android-64: 0.15.12 - esbuild-android-arm64: 0.15.12 - esbuild-darwin-64: 0.15.12 - esbuild-darwin-arm64: 0.15.12 - esbuild-freebsd-64: 0.15.12 - esbuild-freebsd-arm64: 0.15.12 - esbuild-linux-32: 0.15.12 - esbuild-linux-64: 0.15.12 - esbuild-linux-arm: 0.15.12 - esbuild-linux-arm64: 0.15.12 - esbuild-linux-mips64le: 0.15.12 - esbuild-linux-ppc64le: 0.15.12 - esbuild-linux-riscv64: 0.15.12 - esbuild-linux-s390x: 0.15.12 - esbuild-netbsd-64: 0.15.12 - esbuild-openbsd-64: 0.15.12 - esbuild-sunos-64: 0.15.12 - esbuild-windows-32: 0.15.12 - esbuild-windows-64: 0.15.12 - esbuild-windows-arm64: 0.15.12 + '@esbuild/android-arm': 0.16.12 + '@esbuild/android-arm64': 0.16.12 + '@esbuild/android-x64': 0.16.12 + '@esbuild/darwin-arm64': 0.16.12 + '@esbuild/darwin-x64': 0.16.12 + '@esbuild/freebsd-arm64': 0.16.12 + '@esbuild/freebsd-x64': 0.16.12 + '@esbuild/linux-arm': 0.16.12 + '@esbuild/linux-arm64': 0.16.12 + '@esbuild/linux-ia32': 0.16.12 + '@esbuild/linux-loong64': 0.16.12 + '@esbuild/linux-mips64el': 0.16.12 + '@esbuild/linux-ppc64': 0.16.12 + '@esbuild/linux-riscv64': 0.16.12 + '@esbuild/linux-s390x': 0.16.12 + '@esbuild/linux-x64': 0.16.12 + '@esbuild/netbsd-x64': 0.16.12 + '@esbuild/openbsd-x64': 0.16.12 + '@esbuild/sunos-x64': 0.16.12 + '@esbuild/win32-arm64': 0.16.12 + '@esbuild/win32-ia32': 0.16.12 + '@esbuild/win32-x64': 0.16.12 dev: true /escalade/3.1.1: @@ -863,8 +863,8 @@ packages: engines: {node: '>=8.6'} dev: true - /postcss/8.4.18: - resolution: {integrity: sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==} + /postcss/8.4.20: + resolution: {integrity: sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.4 @@ -872,8 +872,8 @@ packages: source-map-js: 1.0.2 dev: true - /preact/10.11.0: - resolution: {integrity: sha512-Fk6+vB2kb6mSJfDgODq0YDhMfl0HNtK5+Uc9QqECO4nlyPAQwCI+BKyWO//idA7ikV7o+0Fm6LQmNuQi1wXI1w==} + /preact/10.11.3: + resolution: {integrity: sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg==} /resolve/1.22.1: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} @@ -884,9 +884,9 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true - /rollup/2.78.1: - resolution: {integrity: sha512-VeeCgtGi4P+o9hIg+xz4qQpRl6R401LWEXBmxYKOV4zlF82lyhgh2hTZnheFUbANE8l2A41F458iwj2vEYaXJg==} - engines: {node: '>=10.0.0'} + /rollup/3.9.0: + resolution: {integrity: sha512-nGGylpmblyjTpF4lEUPgmOw6OVxRvnI6Iuuh6Lz4O/X66cVOX1XJSsqP1YamxQ+mPuFE7qJxLFDSCk8rNv5dDw==} + engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: fsevents: 2.3.2 @@ -931,8 +931,8 @@ packages: engines: {node: '>=4'} dev: true - /typescript/4.8.4: - resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==} + /typescript/4.9.4: + resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} engines: {node: '>=4.2.0'} hasBin: true dev: true @@ -948,11 +948,11 @@ packages: picocolors: 1.0.0 dev: true - /vite-plugin-monkey/2.8.0_vite@3.1.8: - resolution: {integrity: sha512-lvPeW0AJ9VYHCWa+PBne3nW5lCAsBvLM1HT6estKpbKJei/qUG/dbKJyMgL8gXIWU5lbVawRTMBNRoPhj4+9dA==} + /vite-plugin-monkey/2.10.2_vite@4.0.3: + resolution: {integrity: sha512-TNKEpUHlNNntwjUvBbQezDJdizXigKr2XcIJdjVFVb+VYs0Z6AR9Q3cXNiPGZzpS1oDjvz39k6zO8HhFV3MsgQ==} engines: {node: ^14.18 || >= 16, pnpm: '>=6'} peerDependencies: - vite: ^2.0.0 || ^3.0.0 + vite: '>=3.0.0' dependencies: cross-spawn: 7.0.3 detect-port: 1.5.1 @@ -960,34 +960,40 @@ packages: mrmime: 1.0.1 open: 8.4.0 picocolors: 1.0.0 - vite: 3.1.8 + vite: 4.0.3 transitivePeerDependencies: - supports-color dev: true - /vite/3.1.8: - resolution: {integrity: sha512-m7jJe3nufUbuOfotkntGFupinL/fmuTNuQmiVE7cH2IZMuf4UbfbGYMUT3jVWgGYuRVLY9j8NnrRqgw5rr5QTg==} + /vite/4.0.3: + resolution: {integrity: sha512-HvuNv1RdE7deIfQb8mPk51UKjqptO/4RXZ5yXSAvurd5xOckwS/gg8h9Tky3uSbnjYTgUm0hVCet1cyhKd73ZA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: + '@types/node': '>= 14' less: '*' sass: '*' stylus: '*' + sugarss: '*' terser: ^5.4.0 peerDependenciesMeta: + '@types/node': + optional: true less: optional: true sass: optional: true stylus: optional: true + sugarss: + optional: true terser: optional: true dependencies: - esbuild: 0.15.12 - postcss: 8.4.18 + esbuild: 0.16.12 + postcss: 8.4.20 resolve: 1.22.1 - rollup: 2.78.1 + rollup: 3.9.0 optionalDependencies: fsevents: 2.3.2 dev: true diff --git a/src/components/backup/Info.tsx b/src/components/backup/Info.tsx deleted file mode 100644 index 305c54e..0000000 --- a/src/components/backup/Info.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { memo } from "preact/compat"; - -/** 从原 info panel 抄一点精简的信息 */ -export type Infos = { - codeText?: string; - actorList: { - text: string; - link: string; - // avatart:string - }[]; -}; - -const Info = memo(({ infos }: { infos: Infos }) => { - const { codeText, actorList } = infos; - return ( -
- codeText && navigator.clipboard.writeText(codeText)} - > - {codeText ? codeText : "暂无"} - - -
- - {actorList.length !== 0 ? ( - <> - - {actorList[0].text} - - - - ) : ( - 无演员信息 - )} - -
-
- ); -}); - -export default Info; diff --git a/src/components/backup/ListSetting.tsx b/src/components/backup/ListSetting.tsx deleted file mode 100644 index 0388915..0000000 --- a/src/components/backup/ListSetting.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { StateUpdater } from "preact/hooks"; -import { GM_setValue } from "vite-plugin-monkey/dist/client"; -import { RenderSiteItem } from "../App"; - -export const ListSetting = ({ - siteLists, - setSiteLists, -}: { - siteLists: RenderSiteItem[]; - setSiteLists: StateUpdater; -}) => { - return ( -
- {siteLists.map((item, index) => ( -
- {item.name} - { - const checked: boolean = e.target?.checked; - // siteLists[index].disable = !checked; - // console.log("|siteLists", siteLists); - GM_setValue("gmSiteList", siteLists); - setSiteLists([...siteLists]); - }} - /> -
- ))} -
- ); -}; diff --git a/src/components/backup/Top.tsx b/src/components/backup/Top.tsx deleted file mode 100644 index 46e43ea..0000000 --- a/src/components/backup/Top.tsx +++ /dev/null @@ -1,208 +0,0 @@ -import { GM_getValue, GM_setValue } from "$"; -import { StateUpdater, useState } from "preact/hooks"; -import { RenderSiteItem } from "../App"; -import { ListSetting } from "./ListSetting"; - -const Top = ({ - showPanel, - setShowPanel, - siteLists, - setSiteLists, -}: { - showPanel: boolean; - setShowPanel: (showPanel: boolean) => void; - siteLists: RenderSiteItem[]; - setSiteLists: StateUpdater; -}) => { - const [showSettingPanel, setShowSettingPanel] = useState(false); - const gmShowPanel = GM_getValue("gmShowPanel", true); - const lsjCompatible = GM_getValue("lsjCompatible", false); - - return ( -
- {showPanel && ( -
{ - e.stopPropagation(); - setShowSettingPanel(!showSettingPanel); - }} - > -
- - - - - - - - - - - -
-
- )} - {/* setting */} - {showSettingPanel && showPanel && ( -
-

脚本设置

-
- 默认显示脚本界面 - { - const checked: boolean = e.target.checked; - GM_setValue("gmShowPanel", checked); - setShowPanel(checked); - }} - /> -
-
- 适配 jav 老司机 - { - const checked: boolean = e.target.checked; - GM_setValue("lsjCompatible", checked); - }} - /> -
- {/* */} -
- )} - -
{ - e.stopPropagation(); - setShowPanel(!showPanel); - }} - > - {showPanel ? ( - - - - - - ) : ( - - - - - )} -
-
- ); -}; - -export default Top; diff --git a/vite.config.ts b/vite.config.ts index 695cf65..a030adc 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,7 +7,7 @@ const connectList = siteList.map((site) => site.hostname).concat(["javdb005.com" const UserscriptConfig: MonkeyUserScript = { author: "mission522", - version: "1.1.2", + version: "1.1.3", license: "MIT", name: "JAV 添加跳转在线观看", match: ["*://*/cn/?v=jav*"],