// ==UserScript== // @name 【移动端】百度系优化 // @namespace https://github.com/WhiteSevs/TamperMonkeyScript // @version 2025.9.2 // @author WhiteSevs // @description 用于【移动端】的百度系列产品优化,包括【百度搜索】、【百家号】、【百度贴吧】、【百度文库】、【百度经验】、【百度百科】、【百度知道】、【百度翻译】、【百度图片】、【百度地图】、【百度好看视频】、【百度爱企查】、【百度问题】、【百度识图】等 // @license GPL-3.0-only // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABZlJREFUeF7VW+1x2zAMhdpkjjobeIM2kzT+HfeuG6TeoHdNfsedpM4G3iDpHO1VDUjJIimC+CB1bvXTlkTwEQQeHqEOFrrWn/ob6OEjAHyAHl6ggxcA2B3vu8NCQ5pe25meKjy0/tyv4Dc8uonnrg42x2/dXjvuAOjq9b2HliC2B2Db/yAnP85aAcI6/74DXMDm+LVDr6q6mgKw3vZfAOBOZNEFXJUmwHoSDsK8Q2JHMwAGg58lgw73YDxAwLIXsfLzeytBaAeAZvXHaRDGqzzJB1YSSG5B2gFw2z++RvobbsDo/wwABk8CUMSU1L52AEiC33z0WUZQrr5/Yw/740O3UYE/3NwSgF5tQLJyptX3ALwcH7or9fivxKQJABWGRyu33vbIHTCNqq/jfWeai+mhnHXr2/4ZOkCiIr8S1zW5/7/gAWiDCYAkgv/fAFiCIMB1SGvXlkzi/Q3p8bXc9aY7W24BdRpM9+3A97GO0F5mLiACYAhOziiqEFEHsEzkNgFQkQFwPkUAnEtiVRcGN1/afocL2KdcXhkHZqtmzCbm1S8CIODis4rMeUEPuBXK2aCwaioQK1efBEAcjdEbLuE69AT2WcZo5VaKgqg2cGQBMLjh3JWxMEI1aO4JqAaxqhALorfcJKykIM1igGjwOdSzlRiAxOLovZPE3sCTRgkqbCcSRBdEPTFaOQkOvY2R4CIADKvvoagoRji3HWzCCa3gLRxyIgoTew4YtCnwYwC8kGnJw5geRSmVm7D2f3Hq7GEPl7BLAYwBsIgao8WVyox24o5+ewG2SoVKAeAFTcrScwBgoc6JnTEAlhee0wO2vV6DSOJVMwAsMcC58HBpJW6D+0++G3hBmxigYGQuaP2BuyxHKETrdOcZ07V/DQmAPQuw5aiAWo9zFB16VAEQkKg5EbIoO4w0rZj8yCuQOO1KxKlCO4hYZBMmSO1/0elOKf8VMstiALj8qvMCshxVr3wKRqbYGm+pAiBQorLsza3cL/jBlrUFKapqj4ZAECCIGWDGw0KPJelrkV97UWRDqkN6hsYRwVzFaZPQk4zF8vehPkeh4x1WdGhpMTjJvYebdPr/HATdVh3fF72HBUBrZfW+Lw8YGW+KAyUqrJ1shpyUaom0NSbfQcIZEUxAEauyq48/NvMAZjUiolRFY5OgqAAhS9aaACBw+3YA4LLltMixKcurQZMoizoAUmxCGaoGQDB5NHmG/tpSycXbQ0SZuR1lBkDJ8pYAwAFb2yxlAkA5+aU8YKobEmmeW/XwfzUAQt0+jfhPaR9Pgy0wzaNAmTkwVAAUJ++l72IFFxoTAHBwQW264qO48XcMZgMRcz+NXajxcqrPCsQAMCvP6gEZzuDlrISYkOk0baehBFzlgYkIgGLeNp4JnDygNQAeafGBqQwAqvmBkMJOhxnBsqd5eGEAxCCwADBlba5AyTVK0GlwGQ/w0Auk+nJ/QKmszTU40Acr5wFA0DpTBqB0UpQHgNLpzwUA6wUcAHR1lwDAFDjnA4AJiBwA9MlLCkC5yfGcABRTNC2JcbJWbgvQCs35AGAObeweoCExpWpwySwwlM6lPuIyALzmFktUtB4o9wDq6EzKBFPKWekB/HF5rucf40HSWkcSIYK6hr2JOKfM89LPc2wxAAcVafvGSiw4fDHV9CLbBLSYJ0KSAxIDCMnp0y7XeFkqZaUAcMf2PBXWNU24hqSkvKXmkX4XgBoCnjvIPqz0bXjcJzpsUcQDsNxBB6dV1P9fWwuMFjh3yzc+1hu53BvY1cehWQ8IQJD1AS83Ic2bxQKNGACXFVpsB5S2xquDn8GssKM01vQ1U57uFa38ZIJhkNOBqW+DnXeGD22q7tWjjkd0eabDB2IKHp1pQFFnEtUWMODU7JETKUJyNQLuP8f3n8xVfJL/F9CfBX10dPIcAAAAAElFTkSuQmCC // @supportURL https://github.com/WhiteSevs/TamperMonkeyScript/issues // @match *://*.baidu.com/* // @match *://www.tieba.com/* // @match *://jump2.bdimg.com/* // @match *://uf9kyh.smartapps.cn/* // @require https://fastly.jsdelivr.net/gh/WhiteSevs/TamperMonkeyScript@86be74b83fca4fa47521cded28377b35e1d7d2ac/lib/CoverUMD/index.js // @require https://fastly.jsdelivr.net/gh/WhiteSevs/TamperMonkeyScript@86be74b83fca4fa47521cded28377b35e1d7d2ac/lib/showdown/index.js // @require https://fastly.jsdelivr.net/npm/@whitesev/utils@2.7.5/dist/index.umd.js // @require https://fastly.jsdelivr.net/npm/@whitesev/domutils@1.6.5/dist/index.umd.js // @require https://fastly.jsdelivr.net/npm/@whitesev/pops@2.3.7/dist/index.umd.js // @require https://fastly.jsdelivr.net/npm/qmsg@1.4.0/dist/index.umd.js // @require https://fastly.jsdelivr.net/npm/viewerjs@1.11.7/dist/viewer.min.js // @require https://fastly.jsdelivr.net/npm/vue@3.5.20/dist/vue.global.prod.js // @require https://fastly.jsdelivr.net/npm/vue-demi@0.14.10/lib/index.iife.min.js // @require https://fastly.jsdelivr.net/npm/pinia@3.0.3/dist/pinia.iife.prod.js // @require https://fastly.jsdelivr.net/npm/vue-router@4.5.1/dist/vue-router.global.js // @require https://fastly.jsdelivr.net/gh/WhiteSevs/TamperMonkeyScript@aab44c2d00b25ba1d78ffb8ee690c1b41aea01db/lib/Element-Plus/index.js // @require https://fastly.jsdelivr.net/npm/@element-plus/icons-vue@2.3.2/dist/index.iife.min.js // @resource ElementPlusResourceCSS https://fastly.jsdelivr.net/npm/element-plus@2.11.1/dist/index.min.css // @resource ViewerCSS https://fastly.jsdelivr.net/npm/viewerjs@1.11.7/dist/viewer.min.css // @connect * // @connect www.baidu.com // @connect m.baidu.com // @connect tieba.baidu.com // @connect www.tieba.com // @connect baike.baidu.com // @connect chat.baidu.com // @connect chat-ws.baidu.com // @connect wappass.baidu.com // @connect tiebaswan.baidu.com // @grant GM_addStyle // @grant GM_deleteValue // @grant GM_getResourceText // @grant GM_getValue // @grant GM_info // @grant GM_registerMenuCommand // @grant GM_setValue // @grant GM_unregisterMenuCommand // @grant GM_xmlhttpRequest // @grant unsafeWindow // @run-at document-start // @downloadURL none // ==/UserScript== (function (Qmsg, DOMUtils, Utils, pops, vue, Viewer, pinia, iconsVue, vueDemi, vueRouter, ElementPlus) { 'use strict'; const d=new Set;const importCSS = async t=>{d.has(t)||(d.add(t),(a=>{function r(n){if(typeof GM_addStyle=="function")return GM_addStyle(n);let e=document.createElement("style");if(e.setAttribute("type","text/css"),e.setAttribute("data-type","gm-css"),globalThis.trustedTypes){const l=globalThis.trustedTypes.createPolicy("safe-innerHTML",{createHTML:i=>i});e.innerHTML=l.createHTML(n);}else e.innerHTML=n;return (document.head||document.documentElement).appendChild(e),e}r(a);})(t));}; importCSS(' @charset "UTF-8";#small-toolbar[data-v-bd816662]{position:fixed;bottom:0;width:100%;background:#fff;height:.56rem;display:flex;align-items:center;z-index:1000}#small-toolbar .icon[data-v-bd816662]{width:.2rem;height:.2rem}#small-toolbar #reply-editor[data-v-bd816662]{flex:1}#small-toolbar .small-editor-toolbar[data-v-bd816662]{flex:1;margin:10px 15px;width:100%;font-size:.16rem;line-height:.16rem;display:flex;align-items:center;position:relative}#small-toolbar .small-editor-toolbar .small-editor-toolbar-input[data-v-bd816662]{width:100%;background:#e9e9e9;border-radius:.06rem;padding:.06rem;border:0;outline:none;font-size:.14rem;line-height:.14rem;cursor:default}#small-toolbar .small-editor-toolbar .small-editor-toolbar-emoji-btn[data-v-bd816662]{position:absolute;top:50%;right:.06rem;transform:translateY(-50%)}#small-toolbar .small-editor-toolbar .small-editor-toolbar-input[data-v-bd816662]:focus,#small-toolbar .small-editor-toolbar .small-editor-toolbar-input[data-v-bd816662]:visited,#small-toolbar .small-editor-toolbar .small-editor-toolbar-input[data-v-bd816662]:focus-within,#small-toolbar .small-editor-toolbar .small-editor-toolbar-input[data-v-bd816662]:focus-visible{border:0;outline:none}#small-toolbar .gm-reply-other-toolbar[data-v-bd816662]{flex:0 auto;display:flex;align-items:safe center}#small-toolbar .gm-reply-other-toolbar .reply-comment-count[data-v-bd816662],#small-toolbar .gm-reply-other-toolbar .reply-good-count[data-v-bd816662]{padding:8px;display:flex;flex-direction:column;align-items:center}#small-toolbar .gm-reply-other-toolbar .reply-comment-count p.text[data-v-bd816662],#small-toolbar .gm-reply-other-toolbar .reply-good-count p.text[data-v-bd816662]{font-size:.1rem}.tiptap p.is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}#reply-editor .tiptap{width:100%;height:100%;outline:0!important;font-size:.16rem}.tiptap-input-image{width:.18rem;height:.18rem}#reply-editor[data-v-515fa91d]{overflow:auto;background-color:#e5e5e5;padding:.06rem;height:100%;border-radius:5px}.icon-active[data-v-16c51a10]{fill:#7557ff}#full-toolbar[data-v-16c51a10]{position:fixed;bottom:0;width:100%;background:#fff;display:flex;align-items:center;z-index:100099;flex-flow:column}#full-toolbar .full-toolbar-top-reply-user[data-v-16c51a10]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#adb5bd;width:-webkit-fill-available;width:-moz-available;padding-left:.2rem;padding-top:.06rem}#full-toolbar .full-toolbar-top-container[data-v-16c51a10]{display:flex;align-items:end;width:-moz-available;width:-webkit-fill-available;padding:.06rem .1rem;height:.6rem}#full-toolbar .full-toolbar-top-container .full-toolbar-top-left-container[data-v-16c51a10]{display:flex;flex-direction:column;flex:1;overflow:hidden;margin:0px .1rem;height:100%}#full-toolbar .full-toolbar-top-container .full-toolbar-top-right-container[data-v-16c51a10]{flex:0 auto;display:flex;flex-direction:column;align-items:center;justify-content:space-between;height:100%}#full-toolbar .full-toolbar-bottom-container[data-v-16c51a10]{margin:.06rem 0;padding:0px 0px .06rem;margin-right:auto}#full-toolbar .full-toolbar-bottom-container .full-toolbar-emoji-btn[data-v-16c51a10],#full-toolbar .full-toolbar-bottom-container .full-toolbar-panel-at-btn[data-v-16c51a10]{margin:0 20px;display:flex;flex-direction:column;align-items:center}#full-toolbar .emoji-panel[data-v-16c51a10]{width:100%;height:30vh;background-color:#efefef;overflow:auto}.emoji-panel-huaji[data-v-16c51a10]{padding:.03rem;overflow-y:auto}.emoji-panel-huaji .el-avatar[data-v-16c51a10]{margin:16px}#full-toolbar[data-v-16c51a10]:has(.full-toolbar-top-container[data-full=true]){height:-moz-available;height:100%;height:-webkit-fill-available}#full-toolbar:has(.full-toolbar-top-container[data-full=true]) .full-toolbar-top-container[data-v-16c51a10],#full-toolbar:has(.full-toolbar-top-container[data-full=true]) #reply-editor[data-v-16c51a10]{height:-moz-available;height:100%;height:-webkit-fill-available}#full-toolbar:has(.full-toolbar-top-container[data-full=true]) .full-toolbar-top-reply-user[data-v-16c51a10],#full-toolbar:has(.full-toolbar-top-container[data-full=true]) .full-toolbar-top-right-container[data-v-16c51a10]{display:none}#full-toolbar:has(.full-toolbar-top-container[data-full=true]) .full-toolbar-top-container[data-v-16c51a10]{flex-direction:column}#full-toolbar:has(.full-toolbar-top-container[data-full=true]) .full-toolbar-top-left-container[data-v-16c51a10]{width:-webkit-fill-available;width:-moz-available}.full-toolbar-top-nav-container[data-v-16c51a10]{display:flex;width:-webkit-fill-available;width:-moz-available;align-items:center;justify-content:space-between;padding:.16rem}#full-toolbar .full-toolbar-top-container{max-height:calc(100vh - .12rem - 40px)}#full-toolbar[data-show-bottom-panel=true] .full-toolbar-top-container{max-height:calc(70vh - .12rem - 40px)}.posts-container-item[data-v-03f2f267]{width:-webkit-fill-available;width:-moz-available}.posts-item-title[data-v-03f2f267]{font-weight:700}.posts-item-title[data-v-03f2f267],.posts-item-content[data-v-03f2f267],.posts-item-media-container[data-v-03f2f267]{margin:10px 0}.posts-item-footer[data-v-03f2f267]{margin:15px 0 5px}.posts-item-footer .el-col[data-v-03f2f267]{text-align:center}.posts-item-footer-icon-container[data-v-03f2f267]{display:flex;align-items:center;justify-content:center;gap:0px 6px}.posts-item-right-user-info[data-v-03f2f267]{padding:0 10px}.posts-container[data-v-c87cf9db]{background:#f2f2f4;padding:10px}.posts-container-item[data-v-c87cf9db]{background:#fff;border-radius:12px;margin:10px 0;padding:10px}.posts-item-title[data-v-c87cf9db]{font-weight:700}.posts-item-title[data-v-c87cf9db],.posts-item-content[data-v-c87cf9db],.posts-item-media-container[data-v-c87cf9db]{margin:10px 0}.posts-item-footer[data-v-c87cf9db]{margin:15px 0 5px}.posts-item-footer .el-col[data-v-c87cf9db]{text-align:center}.posts-item-footer-icon-container[data-v-c87cf9db]{display:flex;align-items:center;justify-content:center;gap:0px 6px}.posts-item-right-user-info[data-v-c87cf9db]{padding:0 10px}.follow-forum-container[data-v-fc2491a8]{background:#f2f2f4;padding:10px}.follow-forum-list-container[data-v-fc2491a8]{background:#fff;border-radius:12px;margin:10px 0;padding:10px}.follow-forum-item[data-v-fc2491a8]{width:50%;max-width:50%;display:flex;align-items:flex-start;margin:10px 0}.follow-forum-avatar[data-v-fc2491a8]{border-radius:12px}.follow-forum-item-right-container[data-v-fc2491a8]{margin:0 10px;width:inherit;display:flex;flex-direction:column}.follow-forum-item-name[data-v-fc2491a8]{display:flex;align-items:center;width:-webkit-fill-available;width:-moz-available}.follow-forum-item-level[data-level][data-v-fc2491a8]{margin:5px;padding:2px;border-radius:3px;font-size:.6rem;line-height:.6rem;font-weight:700;text-align:center;background:var(--c4fc5984);color:var(--632896fa)}.follow-forum-item-level[data-level="0"][data-v-fc2491a8],.follow-forum-item-level[data-level="1"][data-v-fc2491a8],.follow-forum-item-level[data-level="2"][data-v-fc2491a8],.follow-forum-item-level[data-level="3"][data-v-fc2491a8]{background:var(--67c41881)}.follow-forum-item-level[data-level="4"][data-v-fc2491a8],.follow-forum-item-level[data-level="5"][data-v-fc2491a8],.follow-forum-item-level[data-level="6"][data-v-fc2491a8],.follow-forum-item-level[data-level="7"][data-v-fc2491a8],.follow-forum-item-level[data-level="8"][data-v-fc2491a8],.follow-forum-item-level[data-level="9"][data-v-fc2491a8]{background:var(--67c4278b)}.follow-forum-item-level[data-level="10"][data-v-fc2491a8],.follow-forum-item-level[data-level="11"][data-v-fc2491a8],.follow-forum-item-level[data-level="12"][data-v-fc2491a8],.follow-forum-item-level[data-level="13"][data-v-fc2491a8],.follow-forum-item-level[data-level="14"][data-v-fc2491a8],.follow-forum-item-level[data-level="15"][data-v-fc2491a8]{background:var(--f1cd3cbe)}.follow-forum-item-level[data-level="16"][data-v-fc2491a8],.follow-forum-item-level[data-level="17"][data-v-fc2491a8],.follow-forum-item-level[data-level="18"][data-v-fc2491a8]{background:var(--f1c7c844)}.follow-forum-item-info[data-v-fc2491a8]{word-wrap:break-word}#main[data-v-c9e3d74e]{z-index:1000;width:100%;height:100%}.big-text[data-v-c9e3d74e]{font-weight:700}.top-container[data-v-c9e3d74e]{width:-webkit-fill-available;width:-moz-available;padding:15px 15px 0}.user-info-bg[data-v-c9e3d74e]{width:100%;height:100px}.user-info-bg-main[data-v-c9e3d74e]{width:100%;height:160px;position:absolute;background:url(https://tb2.bdstatic.com/tb/mobile/suser/img/home_card_back_6cdfca5.jpg);background-size:100%;background-repeat:no-repeat}.user-avatar-top-background[data-v-c9e3d74e]{position:absolute;width:100%;height:40%;padding:0;margin:0;border-top-left-radius:12px;border-top-right-radius:12px;background:#fff;transform:translateY(100%)}.user-info-container[data-v-c9e3d74e]{padding:0 10px}.nav-left-arrow-icon[data-v-8128767d]{align-content:center;padding-left:0!important}.nav-title[data-v-8128767d]{font-weight:700;text-align:center;padding:10px}.user-avatar[data-v-8128767d]{text-align:center;padding-bottom:20px}.user-info-item[data-v-8128767d]{display:flex;padding:10px;flex-wrap:wrap}.user-desc-key[data-v-8128767d]{width:60px;display:block}.user-end-text[data-v-8128767d]{padding:0 20px}.user-top[data-v-42d9f9f5]{height:40px;width:100%;position:relative}.top-left-arrow-icon[data-v-42d9f9f5]{align-content:center;padding-left:0!important}.top-title-name[data-v-42d9f9f5]{text-align:center;padding:10px}.user-main[data-v-42d9f9f5]{padding:0;position:absolute;inset:40px 0 0;width:100%;height:calc(100% - 40px)}.user-container[data-v-42d9f9f5]{padding:0 10px}.user-container .el-scrollbar__view[data-v-42d9f9f5]{height:100%}.user-item[data-v-42d9f9f5]{margin:10px 0}.user-item-row[data-v-42d9f9f5]{display:flex;align-items:center;justify-content:space-between}.user-item-row-center[data-v-42d9f9f5]{padding:0 10px}.user-name[data-v-42d9f9f5],.user-sign-text[data-v-42d9f9f5]{text-align:left}.user-sign-text[data-v-42d9f9f5]{color:#a2a2a2}.user-follow-btn[data-v-42d9f9f5]{float:right}.user-info[data-v-42d9f9f5]{display:grid}.user-item-row-left[data-v-42d9f9f5]{display:flex}.user-item-row-right[data-v-42d9f9f5]{float:right}.user-top[data-v-205eb1c6]{height:40px;width:100%;position:relative}.top-left-arrow-icon[data-v-205eb1c6]{align-content:center;padding-left:0!important}.top-title-name[data-v-205eb1c6]{text-align:center;padding:10px}.user-main[data-v-205eb1c6]{padding:0;position:absolute;inset:40px 0 0;width:100%;height:calc(100% - 40px)}.user-container[data-v-205eb1c6]{padding:0 10px}.user-container .el-scrollbar__view[data-v-205eb1c6]{height:100%}.user-item[data-v-205eb1c6]{margin:10px 0}.user-item-row[data-v-205eb1c6]{display:flex;align-items:center;justify-content:space-between}.user-item-row-center[data-v-205eb1c6]{padding:0 10px;align-content:center}.user-name[data-v-205eb1c6],.user-sign-text[data-v-205eb1c6]{text-align:left}.user-sign-text[data-v-205eb1c6]{color:#a2a2a2}.user-follow-btn[data-v-205eb1c6]{float:right}.user-info[data-v-205eb1c6]{display:grid}.user-item-row-left[data-v-205eb1c6]{display:flex}.user-item-row-right[data-v-205eb1c6]{float:right}.router-view-container[data-v-37c7691d]{padding:20px}.router-view-container .layout-item[data-v-37c7691d]{display:flex;align-items:center;gap:10px;padding:10px 0}.router-view-container .layout-icon img[data-v-37c7691d]{width:100%;height:100%}.router-view-container .layout-text[data-v-37c7691d]{flex:1}.post-list-item[data-v-449f473f]{display:flex;flex-direction:column;gap:10px;padding:10px 15px;border-bottom:5px solid #efefef}.post-list-item[data-v-449f473f]:last-child{border-bottom:0}.user-info[data-v-449f473f]{display:flex;align-items:center;gap:5px}.user-time[data-v-449f473f]{font-size:.8em;color:#999}.user-avatar img[data-v-449f473f]{width:35px;height:35px;border-radius:50%}.reply-content[data-v-449f473f]{font-size:.9em;color:#4a4a4a}.post-info[data-v-449f473f]{display:flex;align-items:center;background-color:#efefef;color:#434343;border-radius:6px}.post-info__inner[data-v-449f473f]{display:flex;align-items:center;height:100px;width:100%}.post-content[data-v-449f473f]{overflow:hidden;line-clamp:2;-webkit-line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical;color:#545454;margin-left:5px}.post-image[data-v-449f473f]{width:100px;height:100px}.post-image img[data-v-449f473f]{width:inherit;height:inherit;border-radius:6px}.fname-text[data-v-449f473f]{color:#999}.bottom-msg[data-v-449f473f]{text-align:center;color:#999;padding:10px 0}.post-list-item[data-v-ec39056c]{display:flex;flex-direction:column;gap:10px;padding:10px 15px;border-bottom:5px solid #efefef}.post-list-item[data-v-ec39056c]:last-child{border-bottom:0}.user-info[data-v-ec39056c]{display:flex;align-items:center;gap:5px}.user-time[data-v-ec39056c]{font-size:.8em;color:#999}.user-avatar img[data-v-ec39056c]{width:35px;height:35px;border-radius:50%}.reply-content[data-v-ec39056c]{font-size:.9em;color:#4a4a4a}.post-info[data-v-ec39056c]{display:flex;align-items:center;background-color:#efefef;color:#434343;border-radius:6px}.post-info__inner[data-v-ec39056c]{display:flex;align-items:center;height:100px;width:100%}.post-content[data-v-ec39056c]{overflow:hidden;line-clamp:2;-webkit-line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical;color:#545454;margin-left:5px}.post-info[data-v-ec39056c]:has(.quote-user){flex-direction:column;align-items:start;padding:10px;gap:10px}.post-info:has(.quote-user) .post-content[data-v-ec39056c]{flex:1;align-content:center;padding:0 10px;margin-left:0;background:#fff;height:inherit}.post-image[data-v-ec39056c]{width:100px;height:100px}.post-image img[data-v-ec39056c]{width:inherit;height:inherit;border-radius:6px}.fname-text[data-v-ec39056c]{color:#999}.bottom-msg[data-v-ec39056c],.bottom-msg[data-v-38eb1bd2]{text-align:center;color:#999;padding:10px 0}.user-top[data-v-3c912918]{--el-header-height: 40px;display:flex;align-items:center;position:fixed;top:0;left:0;right:0;background:#fff}.top-nav-container[data-v-3c912918]{align-items:center;width:100%}.top-title-name[data-v-3c912918]{text-align:center;position:absolute;left:50%;transform:translate(-50%)}.main[data-v-3c912918]{padding:0;margin:40px 0 0} '); var __getOwnPropNames = Object.getOwnPropertyNames; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var require_entrance_001 = __commonJS({ "entrance-C4WwLlIB.js"(exports, module) { var _GM_deleteValue = (() => typeof GM_deleteValue != "undefined" ? GM_deleteValue : void 0)(); var _GM_getResourceText = (() => typeof GM_getResourceText != "undefined" ? GM_getResourceText : void 0)(); var _GM_getValue = (() => typeof GM_getValue != "undefined" ? GM_getValue : void 0)(); var _GM_info = (() => typeof GM_info != "undefined" ? GM_info : void 0)(); var _GM_registerMenuCommand = (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)(); var _GM_setValue = (() => typeof GM_setValue != "undefined" ? GM_setValue : void 0)(); var _GM_unregisterMenuCommand = (() => typeof GM_unregisterMenuCommand != "undefined" ? GM_unregisterMenuCommand : void 0)(); var _GM_xmlhttpRequest = (() => typeof GM_xmlhttpRequest != "undefined" ? GM_xmlhttpRequest : void 0)(); var _unsafeWindow = (() => typeof unsafeWindow != "undefined" ? unsafeWindow : void 0)(); var _monkeyWindow = (() => window)(); const BaiduRouter = { isSearch() { return Boolean(window.location.href.match(/^http(s|):\/\/(m[0-9]{0,2}|www).baidu.com\/.*/g)); }, isSearchBh() { return Boolean(this.isSearch() && window.location.pathname.startsWith("/bh")); }, isSearchVideo() { return Boolean(this.isSearch() && window.location.pathname.startsWith("/video/page")); }, isSearchHome() { return Boolean( window.location.href.match(/^http(s|):\/\/(m[0-9]{0,2}|www).baidu.com\/$/g) || window.location.href.match(/^http(s|):\/\/(m[0-9]{0,2}|www).baidu.com\/(\?ref=|\?tn=|\?from=|#\/)/g) ); }, isSearchVSearch() { return this.isSearch() && window.location.pathname.startsWith("/sf/vsearch"); }, isSearchVSearch_image_content() { let searchParams = new URLSearchParams(window.location.search); return this.isSearchVSearch() && searchParams.has("pd", "image_content"); }, isSearchVSearch_note() { let searchParams = new URLSearchParams(window.location.search); return this.isSearchVSearch() && searchParams.has("pd", "note"); }, isSearchWenDaTab() { let searchParams = new URLSearchParams(window.location.search); return this.isSearchVSearch() && searchParams.has("pd", "wenda_tab"); }, isBaiJiaHao() { return Boolean(window.location.href.match(/^http(s|):\/\/baijiahao.baidu.com/g)); }, isTieBa() { return Boolean( window.location.href.match( /^http(s|):\/\/(tieba|ala|static.tieba|nba|fexclick|youhua|tiebaswan).baidu.com/g ) || window.location.href.match(/^http(s|):\/\/(www.tieba|jump2.bdimg).com/g) ); }, isTieBaPost() { return Boolean(this.isTieBa() && window.location.pathname.startsWith("/p/")); }, isTieBaNewTopic() { return Boolean(this.isTieBa() && window.location.pathname.startsWith("/mo/q/newtopic/topicTemplate")); }, isTieBaHottopic() { return Boolean(this.isTieBa() && window.location.pathname.startsWith("/hottopic/browse/hottopic")); }, isTieBaHybrid() { return Boolean(this.isTieBa() && window.location.pathname.startsWith("/mo/q/hybrid/search")); }, isTieBaHybridUserGrowBase() { return Boolean( this.isTieBa() && window.location.pathname.startsWith("/mo/q/hybrid-usergrow-base/commentFocus") ); }, isTieBaCheckUrl() { return Boolean(this.isTieBa() && window.location.pathname.startsWith("/mo/q/checkurl")); }, isTieBaNei() { return Boolean(this.isTieBa() && window.location.pathname === "/f"); }, isTieBaIndex() { return Boolean(this.isTieBa() && window.location.pathname.startsWith("/index")); }, isTieBaHome() { return Boolean(this.isTieBa() && window.location.pathname.startsWith("/home/main")); }, isTieBaCollectionCenter() { return Boolean( this.isTieBa() && window.location.pathname.startsWith("/mo/q/hybrid-main-user/collectionCenter") ); }, isWenKu() { return Boolean(window.location.href.match(/^http(s|):\/\/(wk|tanbi).baidu.com/g)); }, isJingYan() { return Boolean(window.location.href.match(/^http(s|):\/\/jingyan.baidu.com/g)); }, isBaiKe() { return Boolean(window.location.href.match(/^http(s|):\/\/(baike|wapbaike).baidu.com/g)); }, isBaiKeTaShuo() { return Boolean(this.isBaiKe() && window.location.pathname.startsWith("/tashuo")); }, isZhiDao() { return Boolean(window.location.href.match(/^http(s|):\/\/zhidao.baidu.com/g)); }, isFanYi() { return Boolean(window.location.href.match(/^http(s|):\/\/fanyi.baidu.com/g)); }, isFanYiApp() { return Boolean(window.location.href.match(/^http(s|):\/\/fanyi-app.baidu.com/g)); }, isImage() { return Boolean(window.location.href.match(/^http(s|):\/\/image.baidu.com/g)); }, isMap() { return Boolean(window.location.href.match(/^http(s|):\/\/map.baidu.com/g)); }, isMbd() { return Boolean(window.location.href.match(/^http(s|):\/\/mbd.baidu.com/g)); }, isXue() { return Boolean(window.location.href.match(/^http(s|):\/\/xue.baidu.com/g)); }, isAiQiCha() { return Boolean(window.location.href.match(/^http(s|):\/\/aiqicha.baidu.com/g)); }, isPos() { return Boolean(window.location.href.match(/^http(s|):\/\/pos.baidu.com/g)); }, isHaoKan() { return Boolean(window.location.href.match(/^http(s|):\/\/haokan.baidu.com/g)); }, isGraph() { return Boolean(window.location.href.match(/^http(s|):\/\/graph.baidu.com/g)); }, isPan() { return Boolean(window.location.href.match(/^http(s|):\/\/pan.baidu.com/g)); }, isYiYan() { return Boolean(window.location.href.match(/^http(s|):\/\/yiyan.baidu.com/g)); }, isChat() { return Boolean(window.location.href.match(/^http(s|):\/\/chat.baidu.com/g)); }, isMiniJiaoYu() { return Boolean(window.location.href.match(/^http(s|):\/\/uf9kyh.smartapps.cn/g)); }, isEasyLearn() { return Boolean(window.location.href.match(/^http(s|):\/\/easylearn.baidu.com/g)); }, isISite() { return Boolean(window.location.href.match(/^http(s|):\/\/isite.baidu.com\/site\/wjz2tdly/g)); }, isAiStudy() { return Boolean(window.location.href.match(/^http(s|):\/\/aistudy.baidu.com/g)); }, isSmartApps_Tieba() { return Boolean(window.location.hostname === "byokpg.smartapps.baidu.com"); } }; const KEY = "GM_Panel"; const ATTRIBUTE_INIT = "data-init"; const ATTRIBUTE_KEY = "data-key"; const ATTRIBUTE_DEFAULT_VALUE = "data-default-value"; const ATTRIBUTE_INIT_MORE_VALUE = "data-init-more-value"; const PROPS_STORAGE_API = "data-storage-api"; const PanelSizeUtil = { get width() { return globalThis.innerWidth; }, get height() { return globalThis.innerHeight; } }; const PanelUISize = { setting: { get width() { if (PanelSizeUtil.width < 550) { return "88vw"; } else if (PanelSizeUtil.width < 700) { return "550px"; } else { return "700px"; } }, get height() { if (PanelSizeUtil.height < 450) { return "70vh"; } else if (PanelSizeUtil.height < 550) { return "450px"; } else { return "550px"; } } }, settingMiddle: { get width() { return PanelSizeUtil.width < 350 ? "88vw" : "350px"; } }, info: { get width() { return PanelSizeUtil.width < 350 ? "88vw" : "350px"; }, get height() { return PanelSizeUtil.height < 250 ? "88vh" : "250px"; } } }; class StorageUtils { storageKey; listenerData; constructor(key) { if (typeof key === "string") { let trimKey = key.trim(); if (trimKey == "") { throw new Error("key参数不能为空字符串"); } this.storageKey = trimKey; } else { throw new Error("key参数类型错误,必须是字符串"); } this.listenerData = new Utils.Dictionary(); } getLocalValue() { let localValue = _GM_getValue(this.storageKey); if (localValue == null) { localValue = {}; this.setLocalValue(localValue); } return localValue; } setLocalValue(value) { _GM_setValue(this.storageKey, value); } set(key, value) { let oldValue = this.get(key); let localValue = this.getLocalValue(); Reflect.set(localValue, key, value); this.setLocalValue(localValue); this.triggerValueChangeListener(key, oldValue, value); } get(key, defaultValue) { let localValue = this.getLocalValue(); return Reflect.get(localValue, key) ?? defaultValue; } getAll() { let localValue = this.getLocalValue(); return localValue; } delete(key) { let oldValue = this.get(key); let localValue = this.getLocalValue(); Reflect.deleteProperty(localValue, key); this.setLocalValue(localValue); this.triggerValueChangeListener(key, oldValue, void 0); } has(key) { let localValue = this.getLocalValue(); return Reflect.has(localValue, key); } keys() { let localValue = this.getLocalValue(); return Reflect.ownKeys(localValue); } values() { let localValue = this.getLocalValue(); return Reflect.ownKeys(localValue).map( (key) => Reflect.get(localValue, key) ); } clear() { _GM_deleteValue(this.storageKey); } addValueChangeListener(key, callback) { let listenerId = Math.random(); let listenerData = this.listenerData.get(key) || []; listenerData.push({ id: listenerId, key, callback }); this.listenerData.set(key, listenerData); return listenerId; } removeValueChangeListener(listenerId) { let flag = false; for (const [key, listenerData] of this.listenerData.entries()) { for (let index = 0; index < listenerData.length; index++) { const value = listenerData[index]; if (typeof listenerId === "string" && value.key === listenerId || typeof listenerId === "number" && value.id === listenerId) { listenerData.splice(index, 1); index--; flag = true; } } this.listenerData.set(key, listenerData); } return flag; } triggerValueChangeListener(key, oldValue, newValue) { if (!this.listenerData.has(key)) { return; } let listenerData = this.listenerData.get(key); for (let index = 0; index < listenerData.length; index++) { const data = listenerData[index]; if (typeof data.callback === "function") { let value = this.get(key); let __newValue; let __oldValue; if (typeof oldValue !== "undefined" && arguments.length >= 2) { __oldValue = oldValue; } else { __oldValue = value; } if (typeof newValue !== "undefined" && arguments.length > 2) { __newValue = newValue; } else { __newValue = value; } data.callback(key, __oldValue, __newValue); } } } } const PopsPanelStorageApi = new StorageUtils(KEY); const PanelContent = { $data: { __contentConfig: null, get contentConfig() { if (this.__contentConfig == null) { this.__contentConfig = new utils.Dictionary(); } return this.__contentConfig; } }, addContentConfig(configList) { if (!Array.isArray(configList)) { configList = [configList]; } let index = this.$data.contentConfig.keys().length; this.$data.contentConfig.set(index, configList); }, getAllContentConfig() { return this.$data.contentConfig.values().flat(); }, getConfig(index = 0) { return this.$data.contentConfig.get(index) ?? []; }, getDefaultBottomContentConfig() { return [ { id: "script-version", title: `版本:${_GM_info?.script?.version || "未知"}`, isBottom: true, forms: [], clickFirstCallback(event, rightHeaderElement, rightContainerElement) { let supportURL = _GM_info?.script?.supportURL || _GM_info?.script?.namespace; if (typeof supportURL === "string" && utils.isNotNull(supportURL)) { window.open(supportURL, "_blank"); } return false; } } ]; } }; const PanelMenu = { $data: { __menuOption: [ { key: "show_pops_panel_setting", text: "⚙ 设置", autoReload: false, isStoreValue: false, showText(text) { return text; }, callback: () => { Panel.showPanel(PanelContent.getConfig(0)); } } ], get menuOption() { return this.__menuOption; } }, init() { this.initExtensionsMenu(); }, initExtensionsMenu() { if (!Panel.isTopWindow()) { return; } GM_Menu.add(this.$data.menuOption); }, addMenuOption(option) { if (!Array.isArray(option)) { option = [option]; } this.$data.menuOption.push(...option); }, updateMenuOption(option) { if (!Array.isArray(option)) { option = [option]; } option.forEach((optionItem) => { let findIndex = this.$data.menuOption.findIndex((it) => { return it.key === optionItem.key; }); if (findIndex !== -1) { this.$data.menuOption[findIndex] = optionItem; } }); }, getMenuOption(index = 0) { return this.$data.menuOption[index]; }, deleteMenuOption(index = 0) { this.$data.menuOption.splice(index, 1); } }; const CommonUtil = { waitRemove(...args) { args.forEach((selector) => { if (typeof selector !== "string") { return; } utils.waitNodeList(selector).then((nodeList) => { nodeList.forEach(($el) => $el.remove()); }); }); }, addBlockCSS(...args) { let selectorList = []; if (args.length === 0) { return; } if (args.length === 1 && typeof args[0] === "string" && args[0].trim() === "") { return; } args.forEach((selector) => { if (Array.isArray(selector)) { selectorList = selectorList.concat(selector); } else { selectorList.push(selector); } }); return addStyle$1(`${selectorList.join(",\n")}{display: none !important;}`); }, setGMResourceCSS(resourceMapData) { let cssText = typeof _GM_getResourceText === "function" ? _GM_getResourceText(resourceMapData.keyName) : null; if (typeof cssText === "string" && cssText) { addStyle$1(cssText); } else { CommonUtil.loadStyleLink(resourceMapData.url); } }, async loadStyleLink(url) { let $link = document.createElement("link"); $link.rel = "stylesheet"; $link.type = "text/css"; $link.href = url; DOMUtils.ready(() => { document.head.appendChild($link); }); }, async loadScript(url) { let $script = document.createElement("script"); $script.src = url; return new Promise((resolve) => { $script.onload = () => { resolve(null); }; (document.head || document.documentElement).appendChild($script); }); }, fixUrl(url) { url = url.trim(); if (url.match(/^http(s|):\/\//i)) { return url; } else if (url.startsWith("//")) { if (url.startsWith("///")) ; else { url = window.location.protocol + url; } return url; } else { if (!url.startsWith("/")) { url += "/"; } url = window.location.origin + url; return url; } }, fixHttps(url) { if (url.startsWith("https://")) { return url; } if (!url.startsWith("http://")) { return url; } let urlInstance = new URL(url); urlInstance.protocol = "https:"; return urlInstance.toString(); }, lockScroll(...args) { let $hidden = document.createElement("style"); $hidden.innerHTML = ` .pops-overflow-hidden-important { overflow: hidden !important; } `; let $elList = [document.documentElement, document.body].concat(...args || []); $elList.forEach(($el) => { $el.classList.add("pops-overflow-hidden-important"); }); (document.head || document.documentElement).appendChild($hidden); return { recovery() { $elList.forEach(($el) => { $el.classList.remove("pops-overflow-hidden-important"); }); $hidden.remove(); } }; }, async getClipboardText() { function readClipboardText(resolve) { navigator.clipboard.readText().then((clipboardText) => { resolve(clipboardText); }).catch((error) => { log.error("读取剪贴板内容失败👉", error); resolve(""); }); } function requestPermissionsWithClipboard(resolve) { navigator.permissions.query({ name: "clipboard-read" }).then((permissionStatus) => { readClipboardText(resolve); }).catch((error) => { log.error("申请剪贴板权限失败,尝试直接读取👉", error.message ?? error.name ?? error.stack); readClipboardText(resolve); }); } function checkClipboardApi() { if (typeof navigator?.clipboard?.readText !== "function") { return false; } if (typeof navigator?.permissions?.query !== "function") { return false; } return true; } return new Promise((resolve) => { if (!checkClipboardApi()) { resolve(""); return; } if (document.hasFocus()) { requestPermissionsWithClipboard(resolve); } else { window.addEventListener( "focus", () => { requestPermissionsWithClipboard(resolve); }, { once: true } ); } }); }, escapeHtml(unsafe) { return unsafe.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/©/g, "©").replace(/®/g, "®").replace(/™/g, "™").replace(/→/g, "→").replace(/←/g, "←").replace(/↑/g, "↑").replace(/↓/g, "↓").replace(/—/g, "—").replace(/–/g, "–").replace(/…/g, "…").replace(/ /g, " ").replace(/\r\n/g, "
").replace(/\r/g, "
").replace(/\n/g, "
").replace(/\t/g, "    "); }, interval(fn, intervalTime, timeout = 5e3) { let timeId; let maxTimeout = timeout - intervalTime; let intervalTimeCount = intervalTime; let loop = async (isTimeout) => { let result = await fn(isTimeout); if (typeof result === "boolean" && !result || isTimeout) { utils.workerClearTimeout(timeId); return; } intervalTimeCount += intervalTime; if (intervalTimeCount > maxTimeout) { loop(true); return; } timeId = utils.workerSetTimeout(() => { loop(false); }, intervalTime); }; loop(false); }, findParentNode($el, selector, parentSelector) { if (parentSelector) { let $parent = DOMUtils.closest($el, parentSelector); if ($parent) { let $target = $parent.querySelector(selector); return $target; } } else { if (DOMUtils.matches($el, selector)) { return $el; } let $parent = DOMUtils.closest($el, selector); return $parent; } } }; const Panel = { $data: { __contentConfigInitDefaultValue: null, __onceExecMenuData: null, __onceExecData: null, __panelConfig: {}, $panel: null, panelContent: [], get contentConfigInitDefaultValue() { if (this.__contentConfigInitDefaultValue == null) { this.__contentConfigInitDefaultValue = new utils.Dictionary(); } return this.__contentConfigInitDefaultValue; }, contentConfigInitDisabledKeys: [], get onceExecMenuData() { if (this.__onceExecMenuData == null) { this.__onceExecMenuData = new utils.Dictionary(); } return this.__onceExecMenuData; }, get onceExecData() { if (this.__onceExecData == null) { this.__onceExecData = new utils.Dictionary(); } return this.__onceExecData; }, get scriptName() { return SCRIPT_NAME; }, get panelConfig() { return this.__panelConfig; }, set panelConfig(value) { this.__panelConfig = value; }, key: KEY, attributeKeyName: ATTRIBUTE_KEY, attributeDefaultValueName: ATTRIBUTE_DEFAULT_VALUE }, init() { this.initContentDefaultValue(); PanelMenu.init(); }, isTopWindow() { return _unsafeWindow.top === _unsafeWindow.self; }, initContentDefaultValue() { const initDefaultValue = (config) => { if (!config.attributes) { return; } if (config.type === "button" || config.type === "forms" || config.type === "deepMenu") { return; } let menuDefaultConfig = new Map(); let key = config.attributes[ATTRIBUTE_KEY]; if (key != null) { const defaultValue = config.attributes[ATTRIBUTE_DEFAULT_VALUE]; menuDefaultConfig.set(key, defaultValue); } let moreMenuDefaultConfig = config.attributes[ATTRIBUTE_INIT_MORE_VALUE]; if (typeof moreMenuDefaultConfig === "object" && moreMenuDefaultConfig) { Object.keys(moreMenuDefaultConfig).forEach((key2) => { menuDefaultConfig.set(key2, moreMenuDefaultConfig[key2]); }); } if (!menuDefaultConfig.size) { log.warn(["请先配置键", config]); return; } let __attr_init__ = config.attributes[ATTRIBUTE_INIT]; if (typeof __attr_init__ === "function") { let __attr_result__ = __attr_init__(); if (typeof __attr_result__ === "boolean" && !__attr_result__) { return; } } if (config.type === "switch") { let disabled = typeof config.disabled === "function" ? config.disabled() : config.disabled; if (typeof disabled === "boolean" && disabled) { this.$data.contentConfigInitDisabledKeys.push(...menuDefaultConfig.keys()); } } for (const [__key, __defaultValue] of menuDefaultConfig.entries()) { this.setDefaultValue(__key, __defaultValue); } }; const loopInitDefaultValue = (configList) => { for (let index = 0; index < configList.length; index++) { let configItem = configList[index]; initDefaultValue(configItem); let child_forms = configItem.forms; if (child_forms && Array.isArray(child_forms)) { loopInitDefaultValue(child_forms); } } }; const contentConfigList = [...PanelContent.getAllContentConfig()]; for (let index = 0; index < contentConfigList.length; index++) { let leftContentConfigItem = contentConfigList[index]; if (!leftContentConfigItem.forms) { continue; } const rightContentConfigList = leftContentConfigItem.forms; if (rightContentConfigList && Array.isArray(rightContentConfigList)) { loopInitDefaultValue(rightContentConfigList); } } this.$data.contentConfigInitDisabledKeys = [...new Set(this.$data.contentConfigInitDisabledKeys)]; }, setDefaultValue(key, defaultValue) { if (this.$data.contentConfigInitDefaultValue.has(key)) { log.warn("请检查该key(已存在): " + key); } this.$data.contentConfigInitDefaultValue.set(key, defaultValue); }, setValue(key, value) { PopsPanelStorageApi.set(key, value); }, getValue(key, defaultValue) { let localValue = PopsPanelStorageApi.get(key); if (localValue == null) { if (this.$data.contentConfigInitDefaultValue.has(key)) { return this.$data.contentConfigInitDefaultValue.get(key); } return defaultValue; } return localValue; }, deleteValue(key) { PopsPanelStorageApi.delete(key); }, hasKey(key) { return PopsPanelStorageApi.has(key); }, addValueChangeListener(key, callback) { let listenerId = PopsPanelStorageApi.addValueChangeListener(key, (__key, __newValue, __oldValue) => { callback(key, __oldValue, __newValue); }); return listenerId; }, removeValueChangeListener(listenerId) { PopsPanelStorageApi.removeValueChangeListener(listenerId); }, triggerMenuValueChange(key, newValue, oldValue) { PopsPanelStorageApi.triggerValueChangeListener(key, oldValue, newValue); }, exec(queryKey, callback, checkExec, once = true) { const that = this; let queryKeyFn; if (typeof queryKey === "string" || Array.isArray(queryKey)) { queryKeyFn = () => queryKey; } else { queryKeyFn = queryKey; } let isArrayKey = false; let queryKeyResult = queryKeyFn(); let keyList = []; if (Array.isArray(queryKeyResult)) { isArrayKey = true; keyList = queryKeyResult; } else { keyList.push(queryKeyResult); } let findNotInDataKey = keyList.find((it) => !this.$data.contentConfigInitDefaultValue.has(it)); if (findNotInDataKey) { log.warn(`${findNotInDataKey} 键不存在`); return; } let storageKey = JSON.stringify(keyList); if (once) { if (this.$data.onceExecMenuData.has(storageKey)) { return; } this.$data.onceExecMenuData.set(storageKey, 1); } let storeValueList = []; let listenerIdList = []; let dynamicAddStyleNodeCallback = (value, $style) => { let dynamicResultList = []; if (!Array.isArray($style)) { $style = [$style]; } $style.forEach(($styleItem) => { if ($styleItem == null) { return; } if ($styleItem instanceof HTMLStyleElement) { dynamicResultList.push($styleItem); return; } }); { storeValueList = storeValueList.concat(dynamicResultList); } }; let getMenuValue = (key) => { let value = this.getValue(key); return value; }; let clearBeforeStoreValue = () => { for (let index = 0; index < storeValueList.length; index++) { let $css = storeValueList[index]; $css.remove(); storeValueList.splice(index, 1); index--; } }; let checkMenuExec = () => { let flag = false; if (typeof checkExec === "function") { flag = checkExec(keyList); } else { flag = keyList.every((key) => getMenuValue(key)); } return flag; }; let valueChangeCallback = (valueOption) => { let execFlag = checkMenuExec(); let resultList = []; if (execFlag) { let valueList = keyList.map((key) => this.getValue(key)); let callbackResult = callback({ value: isArrayKey ? valueList : valueList[0], addStyleElement: (...args) => { return dynamicAddStyleNodeCallback(true, ...args); } }); if (!Array.isArray(callbackResult)) { callbackResult = [callbackResult]; } callbackResult.forEach((it) => { if (it == null) { return; } if (it instanceof HTMLStyleElement) { resultList.push(it); return; } }); } clearBeforeStoreValue(); storeValueList = [...resultList]; }; once && keyList.forEach((key) => { let listenerId = this.addValueChangeListener(key, (key2, newValue, oldValue) => { valueChangeCallback(); }); listenerIdList.push(listenerId); }); valueChangeCallback(); let result = { clear() { this.clearStoreStyleElements(); this.removeValueChangeListener(); once && that.$data.onceExecMenuData.delete(storageKey); }, clearStoreStyleElements: () => { return clearBeforeStoreValue(); }, removeValueChangeListener: () => { listenerIdList.forEach((listenerId) => { this.removeValueChangeListener(listenerId); }); } }; return result; }, execMenu(key, callback, isReverse = false, once = false) { return this.exec( key, (option) => { return callback(option); }, (keyList) => { let execFlag = keyList.every((__key__) => { let flag = !!this.getValue(__key__); let disabled = Panel.$data.contentConfigInitDisabledKeys.includes(__key__); if (disabled) { flag = false; log.warn(`.execMenu${once ? "Once" : ""} ${__key__} 被禁用`); } isReverse && (flag = !flag); return flag; }); return execFlag; }, once ); }, execMenuOnce(key, callback, isReverse = false) { return this.execMenu(key, callback, isReverse, true); }, deleteExecMenuOnce(key) { this.$data.onceExecMenuData.delete(key); let flag = PopsPanelStorageApi.removeValueChangeListener(key); return flag; }, onceExec(key, callback) { key = this.transformKey(key); if (typeof key !== "string") { throw new TypeError("key 必须是字符串"); } if (this.$data.onceExecData.has(key)) { return; } callback(); this.$data.onceExecData.set(key, 1); }, deleteOnceExec(key) { key = this.transformKey(key); this.$data.onceExecData.delete(key); }, showPanel(content, title = `${SCRIPT_NAME}-设置`, preventDefaultContentConfig = false, preventRegisterSearchPlugin = false) { this.$data.$panel = null; this.$data.panelContent = []; let checkHasBottomVersionContentConfig = content.findIndex((it) => { let isBottom = typeof it.isBottom === "function" ? it.isBottom() : Boolean(it.isBottom); return isBottom && it.id === "script-version"; }) !== -1; if (!preventDefaultContentConfig && !checkHasBottomVersionContentConfig) { content.push(...PanelContent.getDefaultBottomContentConfig()); } let $panel = __pops.panel({ ...{ title: { text: title, position: "center", html: false, style: "" }, content, btn: { close: { enable: true, callback: (details, event) => { details.close(); this.$data.$panel = null; } } }, mask: { enable: true, clickEvent: { toClose: true, toHide: false }, clickCallBack: (originalRun, config) => { originalRun(); this.$data.$panel = null; } }, width: PanelUISize.setting.width, height: PanelUISize.setting.height, drag: true, only: true }, ...this.$data.panelConfig }); this.$data.$panel = $panel; this.$data.panelContent = content; if (!preventRegisterSearchPlugin) { this.registerConfigSearch({ $panel, content }); } }, registerConfigSearch(config) { const { $panel, content } = config; let asyncQueryProperty = async (target, handler) => { if (target == null) { return; } let handleResult = await handler(target); if (handleResult && typeof handleResult.isFind === "boolean" && handleResult.isFind) { return handleResult.data; } return await asyncQueryProperty(handleResult.data, handler); }; let scrollToElementAndListen = ($el, callback) => { const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { callback?.(); observer.disconnect(); } }); }, { root: null, threshold: 1 } ); observer.observe($el); $el.scrollIntoView({ behavior: "smooth", block: "center" }); }; let addFlashingClass = ($el) => { const flashingClassName = "pops-flashing"; domUtils.animationend($el, () => { $el.classList.remove(flashingClassName); }); $el.classList.add(flashingClassName); }; let dbclick_event = (evt, selectorTarget) => { utils.preventEvent(evt); let $alert = __pops.alert({ title: { text: "搜索配置", position: "center" }, content: { text: ( `
` ), html: true }, btn: { ok: { enable: false } }, mask: { clickEvent: { toClose: true } }, width: PanelUISize.settingMiddle.width, height: "auto", drag: true, style: ( ` ${__pops.config.cssText.panelCSS} .search-wrapper{ border-bottom: 1px solid rgb(235, 238, 245, 1); } .pops-content:has(.search-result-wrapper:empty) .search-wrapper{ border-bottom: 0; } .search-config-text{ width: 100%; border: 0; height: 32px; padding: 0px 10px; outline: none; } .search-result-wrapper{ max-height: 400px; overflow: auto; } .search-result-item{ cursor: pointer; padding: 5px 10px; display: flex; flex-direction: column; } .search-result-item:hover{ background-color: #D8F1FD; } .search-result-item-path{ display: flex; align-items: center; } .search-result-item-description{ font-size: 0.8em; color: #6c6c6c; } ${config.searchDialogStyle ?? ""} ` ) }); $alert.$shadowRoot.querySelector(".search-wrapper"); let $searchInput = $alert.$shadowRoot.querySelector(".search-config-text"); let $searchResultWrapper = $alert.$shadowRoot.querySelector(".search-result-wrapper"); $searchInput.focus(); let clearSearchResult = () => { domUtils.empty($searchResultWrapper); }; let createSearchResultItem = (pathInfo) => { const searchPath = utils.queryProperty(pathInfo, (target) => { if (target?.next) { return { isFind: false, data: target.next }; } else { return { isFind: true, data: target }; } }); let $item = domUtils.createElement("div", { className: "search-result-item", innerHTML: ( `
${searchPath.matchedData?.path}
${searchPath.matchedData?.description ?? ""}
` ) }); domUtils.on($item, "click", (clickItemEvent) => { let $asideItems = $panel.$shadowRoot.querySelectorAll( "aside.pops-panel-aside .pops-panel-aside-top-container li" ); let $targetAsideItem = $asideItems[pathInfo.index]; if (!$targetAsideItem) { Qmsg.error(`左侧项下标${pathInfo.index}不存在`); return; } $targetAsideItem.scrollIntoView({ behavior: "smooth", block: "center" }); $targetAsideItem.click(); asyncQueryProperty(pathInfo.next, async (target) => { if (target?.next) { let $findDeepMenu = await utils.waitNode(() => { return Array.from( $panel.$shadowRoot.querySelectorAll(".pops-panel-deepMenu-nav-item") ).find(($deepMenu) => { const __formConfig__ = Reflect.get($deepMenu, "__formConfig__"); return typeof __formConfig__ === "object" && __formConfig__ != null && __formConfig__.text === target.name; }); }, 2500); if ($findDeepMenu) { $findDeepMenu.click(); } else { Qmsg.error("未找到对应的二级菜单"); return { isFind: true, data: target }; } return { isFind: false, data: target.next }; } else { let $findTargetMenu = await utils.waitNode(() => { return Array.from( $panel.$shadowRoot.querySelectorAll(`li:not(.pops-panel-deepMenu-nav-item)`) ).find(($menuItem) => { const __formConfig__ = Reflect.get($menuItem, "__formConfig__"); return __formConfig__ === target.matchedData?.formConfig; }); }, 2500); if ($findTargetMenu) { scrollToElementAndListen($findTargetMenu); let $fold = $findTargetMenu.closest(`.pops-panel-forms-fold[data-fold-enable]`); if ($fold) { let $foldWrapper = $fold.querySelector(".pops-panel-forms-fold-container"); $foldWrapper.click(); await utils.sleep(500); } scrollToElementAndListen($findTargetMenu, () => { addFlashingClass($findTargetMenu); }); } else { Qmsg.error("未找到对应的菜单项"); } return { isFind: true, data: target }; } }); }); return $item; }; let execSearch = (searchText) => { const searchTextRegExp = new RegExp(searchText, "i"); const searchConfigResult = []; const loopContentConfig = (configList, path) => { for (let index = 0; index < configList.length; index++) { const configItem = configList[index]; let child_forms = configItem.forms; if (child_forms && Array.isArray(child_forms)) { const deepMenuPath = utils.deepClone(path); if (configItem.type === "deepMenu") { const deepNext = utils.queryProperty(deepMenuPath, (target) => { if (target?.next) { return { isFind: false, data: target.next }; } else { return { isFind: true, data: target }; } }); deepNext.next = { name: configItem.text }; } loopContentConfig(child_forms, deepMenuPath); } else { let text = Reflect.get(configItem, "text"); let description = Reflect.get(configItem, "description"); const delayMatchedTextList = [text, description]; let matchedIndex = delayMatchedTextList.findIndex((configText) => { if (typeof configText !== "string") { return; } return configText.match(searchTextRegExp); }); if (matchedIndex !== -1) { const matchedPath = utils.deepClone(path); const deepNext = utils.queryProperty(matchedPath, (target) => { if (target?.next) { return { isFind: false, data: target.next }; } else { return { isFind: true, data: target }; } }); deepNext.next = { name: text, matchedData: { path: "", formConfig: configItem, matchedText: delayMatchedTextList[matchedIndex], description } }; const pathList = []; utils.queryProperty(matchedPath, (target) => { const name = target?.name; if (typeof name === "string" && name.trim() !== "") { pathList.push(name); } if (target?.next) { return { isFind: false, data: target.next }; } else { return { isFind: true, data: target }; } }); const pathStr = pathList.join(CommonUtil.escapeHtml(" - ")); deepNext.next.matchedData.path = pathStr; searchConfigResult.push(matchedPath); } } } }; for (let index = 0; index < content.length; index++) { const leftContentConfigItem = content[index]; if (!leftContentConfigItem.forms) { continue; } if (leftContentConfigItem.isBottom && leftContentConfigItem.id === "script-version") { continue; } const rightContentConfigList = leftContentConfigItem.forms; if (rightContentConfigList && Array.isArray(rightContentConfigList)) { let text = leftContentConfigItem.title; if (typeof text === "function") { text = text(); } loopContentConfig(rightContentConfigList, { index, name: text }); } } let fragment = document.createDocumentFragment(); for (const pathInfo of searchConfigResult) { let $resultItem = createSearchResultItem(pathInfo); fragment.appendChild($resultItem); } clearSearchResult(); $searchResultWrapper.append(fragment); }; domUtils.on( $searchInput, "input", utils.debounce((evt2) => { utils.preventEvent(evt2); let searchText = domUtils.val($searchInput).trim(); if (searchText === "") { clearSearchResult(); return; } execSearch(searchText); }, 200) ); }; let clickElement = null; let isDoubleClick = false; let timer = void 0; domUtils.on( $panel.$shadowRoot, "dblclick", `aside.pops-panel-aside .pops-panel-aside-item:not(#script-version)`, dbclick_event ); domUtils.on( $panel.$shadowRoot, "touchend", `aside.pops-panel-aside .pops-panel-aside-item:not(#script-version)`, (evt, selectorTarget) => { clearTimeout(timer); timer = void 0; if (isDoubleClick && clickElement === selectorTarget) { isDoubleClick = false; clickElement = null; dbclick_event(evt); } else { timer = setTimeout(() => { isDoubleClick = false; }, 200); isDoubleClick = true; clickElement = selectorTarget; } }, { capture: true } ); $panel.$shadowRoot.appendChild( domUtils.createElement("style", { type: "text/css", textContent: ( ` .pops-flashing{ animation: double-blink 1.5s ease-in-out; } @keyframes double-blink { 0% { background-color: initial; } 25% { background-color: yellow; } 50% { background-color: initial; } 75% { background-color: yellow; } 100% { background-color: initial; } } ` ) }) ); }, transformKey(key) { if (Array.isArray(key)) { const keyArray = key.sort(); return JSON.stringify(keyArray); } else { return key; } } }; const GM_RESOURCE_MAPPING = { ElementPlus: { keyName: "ElementPlusResourceCSS", url: "https://fastly.jsdelivr.net/npm/element-plus@latest/dist/index.min.css" }, Viewer: { keyName: "ViewerCSS", url: "https://fastly.jsdelivr.net/npm/viewerjs@latest/dist/viewer.min.css" } }; const PanelSettingConfig = { qmsg_config_position: { key: "qmsg-config-position", defaultValue: "bottom" }, qmsg_config_maxnums: { key: "qmsg-config-maxnums", defaultValue: 3 }, qmsg_config_showreverse: { key: "qmsg-config-showreverse", defaultValue: false } }; const utils = Utils.noConflict(); const domUtils = DOMUtils.noConflict(); const __pops = pops; const log = new utils.Log( _GM_info, _unsafeWindow.console || _monkeyWindow.console ); let SCRIPT_NAME = _GM_info?.script?.name || void 0; pops.config.Utils.AnyTouch(); const DEBUG = false; log.config({ debug: DEBUG, logMaxCount: 1e3, autoClearConsole: true, tag: true }); Qmsg.config({ isHTML: true, autoClose: true, showClose: false, consoleLogContent(qmsgInst) { const qmsgType = qmsgInst.getSetting().type; if (qmsgType === "loading") { return false; } const content = qmsgInst.getSetting().content; if (qmsgType === "warning") { log.warn(content); } else if (qmsgType === "error") { log.error(content); } else { log.info(content); } return true; }, get position() { return Panel.getValue( PanelSettingConfig.qmsg_config_position.key, PanelSettingConfig.qmsg_config_position.defaultValue ); }, get maxNums() { return Panel.getValue( PanelSettingConfig.qmsg_config_maxnums.key, PanelSettingConfig.qmsg_config_maxnums.defaultValue ); }, get showReverse() { return Panel.getValue( PanelSettingConfig.qmsg_config_showreverse.key, PanelSettingConfig.qmsg_config_showreverse.defaultValue ); }, get zIndex() { let maxZIndex = Utils.getMaxZIndex(); let popsMaxZIndex = pops.config.InstanceUtils.getPopsMaxZIndex().zIndex; return Utils.getMaxValue(maxZIndex, popsMaxZIndex) + 100; } }); __pops.GlobalConfig.setGlobalConfig({ zIndex: () => { let maxZIndex = Utils.getMaxZIndex(void 0, void 0, ($ele) => { if ($ele?.classList?.contains("qmsg-shadow-container")) { return false; } if ($ele?.closest("qmsg") && $ele.getRootNode() instanceof ShadowRoot) { return false; } }); let popsMaxZIndex = pops.config.InstanceUtils.getPopsMaxZIndex().zIndex; return Utils.getMaxValue(maxZIndex, popsMaxZIndex) + 100; }, mask: { enable: true, clickEvent: { toClose: false, toHide: false } }, drag: true }); const GM_Menu = new utils.GM_Menu({ GM_getValue: _GM_getValue, GM_setValue: _GM_setValue, GM_registerMenuCommand: _GM_registerMenuCommand, GM_unregisterMenuCommand: _GM_unregisterMenuCommand }); const httpx = new utils.Httpx({ xmlHttpRequest: _GM_xmlhttpRequest, logDetails: DEBUG }); httpx.interceptors.request.use((data) => { return data; }); httpx.interceptors.response.use(void 0, (data) => { log.error("拦截器-请求错误", data); if (data.type === "onabort") { Qmsg.warning("请求取消", { consoleLogContent: true }); } else if (data.type === "onerror") { Qmsg.error("请求异常", { consoleLogContent: true }); } else if (data.type === "ontimeout") { Qmsg.error("请求超时", { consoleLogContent: true }); } else { Qmsg.error("其它错误", { consoleLogContent: true }); } return data; }); const OriginPrototype = { Object: { defineProperty: _unsafeWindow.Object.defineProperty }, Function: { apply: _unsafeWindow.Function.prototype.apply, call: _unsafeWindow.Function.prototype.call }, Element: { appendChild: _unsafeWindow.Element.prototype.appendChild }, setTimeout: _unsafeWindow.setTimeout }; const addStyle$1 = utils.addStyle.bind(utils); const $ = DOMUtils.selector.bind(DOMUtils); const $$ = DOMUtils.selectorAll.bind(DOMUtils); const VUE_ELE_NAME_ID = "vite-app"; const MountVue = async function(targetApp, plugin = []) { DOMUtils.ready(async () => { const app = vue.createApp(targetApp); let $mount = DOMUtils.createElement("div", { id: VUE_ELE_NAME_ID }); { if (ElementPlusIconsVue != null) { for (const [key, component] of Object.entries(ElementPlusIconsVue)) { app.component(key, component); } } } document.body.appendChild($mount); plugin.forEach((item) => { app.use(item); }); app.mount($mount); }); CommonUtil.setGMResourceCSS(GM_RESOURCE_MAPPING.ElementPlus); }; new utils.GM_Cookie(); class LoadingView { config; loadingViewElement; loadingViewHTML; loadingViewIconHTML; constructor(withIcon, isEnd) { this.config = { className: "whitesev-load-view", textClassName: "whitesev-load-view-text", iconClassName: "whitesev-load-view-icon", outSideClassName: "whitesev-load-view-icon-outside", withInClassName: "whitesev-load-view-icon-within" }; this.loadingViewElement = void 0; this.loadingViewHTML = `
Loading...
`.trim(); this.loadingViewIconHTML = `
`.trim(); this.initCSS(); this.initLoadingView(withIcon, isEnd); } initCSS() { if (this.isExistsCSS()) { return; } let loadingViewCSSText = ( ` .${this.config.className}{ margin: 0.08rem; background: #fff; font-size: 15px; text-align: center; width: inherit; border-radius: 0.12rem; } .${this.config.iconClassName}{ width: 45px; } .${this.config.className}, .${this.config.iconClassName}{ height: 45px; line-height: 45px; display: flex; align-items: center; justify-content: center; } .${this.config.outSideClassName}, .${this.config.withInClassName}{ position: absolute; margin-left: 140px; border: 5px solid rgba(0, 183, 229, 0.9); opacity: .9; border-radius: 50px; width: 20px; height: 20px; margin: 0 auto; } .${this.config.outSideClassName}{ background-color: rgba(0, 0, 0, 0); border-right: 5px solid rgba(0, 0, 0, 0); border-left: 5px solid rgba(0, 0, 0, 0); box-shadow: 0 0 35px #2187e7; -moz-animation: spinPulse 1s infinite ease-in-out; -webkit-animation: spinPulse 1s infinite ease-in-out; -o-animation: spinPulse 1s infinite ease-in-out; -ms-animation: spinPulse 1s infinite ease-in-out; } .${this.config.withInClassName}{ background: rgba(0, 0, 0, 0) no-repeat center center; border-top: 5px solid rgba(0, 0, 0, 0); border-bottom: 5px solid rgba(0, 0, 0, 0); box-shadow: 0 0 15px #2187e7; -moz-animation: spinoffPulse 3s infinite linear; -webkit-animation: spinoffPulse 3s infinite linear; -o-animation: spinoffPulse 3s infinite linear; -ms-animation: spinoffPulse 3s infinite linear; } @-moz-keyframes spinPulse{0%{-moz-transform:rotate(160deg);opacity:0;box-shadow:0 0 1px #505050} 50%{-moz-transform:rotate(145deg);opacity:1} 100%{-moz-transform:rotate(-320deg);opacity:0} } @-moz-keyframes spinoffPulse{0%{-moz-transform:rotate(0)} 100%{-moz-transform:rotate(360deg)} } @-webkit-keyframes spinPulse{0%{-webkit-transform:rotate(160deg);opacity:0;box-shadow:0 0 1px #505050} 50%{-webkit-transform:rotate(145deg);opacity:1} 100%{-webkit-transform:rotate(-320deg);opacity:0} } @-webkit-keyframes spinoffPulse{0%{-webkit-transform:rotate(0)} 100%{-webkit-transform:rotate(360deg)} } @-o-keyframes spinPulse{0%{-o-transform:rotate(160deg);opacity:0;box-shadow:0 0 1px #505050} 50%{-o-transform:rotate(145deg);opacity:1} 100%{-o-transform:rotate(-320deg);opacity:0} } @-o-keyframes spinoffPulse{0%{-o-transform:rotate(0)} 100%{-o-transform:rotate(360deg)} } @-ms-keyframes spinPulse{0%{-ms-transform:rotate(160deg);opacity:0;box-shadow:0 0 1px #505050} 50%{-ms-transform:rotate(145deg);opacity:1} 100%{-ms-transform:rotate(-320deg);opacity:0} } @-ms-keyframes spinoffPulse{0%{-ms-transform:rotate(0)} 100%{-ms-transform:rotate(360deg)} } ` ); utils.addStyle(loadingViewCSSText); } initLoadingView(withIcon = false, isEnd = true) { this.setLoadingViewElement(); let divElement = document.createElement("div"); divElement.innerHTML = this.loadingViewHTML; let resultElement = divElement.firstChild; if (withIcon) { let iconElement = document.createElement("div"); iconElement.innerHTML = this.loadingViewIconHTML; if (isEnd) { resultElement.appendChild(iconElement.firstChild); } else { resultElement.insertBefore( iconElement.firstChild, resultElement.firstChild ); } } this.setLoadingViewElement(resultElement); return resultElement; } setLoadingViewElement(element) { this.loadingViewElement = element; } getLoadingViewElement() { if (!this.loadingViewElement) { throw new Error("object loadingViewElement is null"); } return this.loadingViewElement; } getIconElement() { return this.getLoadingViewElement().querySelector( "." + this.config.iconClassName ); } show() { this.getLoadingViewElement().style.display = ""; } hide() { this.getLoadingViewElement().style.display = "none"; } showIcon() { let iconElement = this.getIconElement(); iconElement && (iconElement.style.display = ""); } hideIcon() { let iconElement = this.getIconElement(); iconElement && (iconElement.style.display = "none"); } setText(text, withIcon = false, isEnd = true) { this.getLoadingViewElement().innerHTML = `${text}`; if (withIcon) { let iconElement = this.getIconElement(); if (!iconElement) { let divElement = document.createElement("div"); divElement.innerHTML = this.loadingViewIconHTML; iconElement = divElement.firstChild; if (isEnd) { this.getLoadingViewElement().appendChild(iconElement); } else { this.getLoadingViewElement().insertBefore( iconElement, this.getLoadingViewElement().firstChild ); } } iconElement.style.display = ""; } else { this.getIconElement()?.remove(); } } setHTML(text) { this.getLoadingViewElement().innerHTML = text; } destory() { this.getLoadingViewElement()?.remove(); this.setLoadingViewElement(); } removeAll() { document.querySelectorAll("." + this.config.className).forEach((item) => item.remove()); } isExists() { return Boolean(document.querySelector(`.${this.config.className}`)); } isExistsIcon() { return Boolean(this.getIconElement()); } isExistsText() { return Boolean( this.getLoadingViewElement().querySelector( `.${this.config.textClassName}` ) ); } isExistsCSS() { return Boolean( document.querySelector( "style[data-from='loadingView'][type='text/css'][data-author='whitesev']" ) ); } } _monkeyWindow.showdown || _unsafeWindow.showdown; const loadingView = new LoadingView(true); const SearchShieldCSS = `.c-container.na-ec-item,\r .c-container.ec-container,\r div[data-type="ad"],\r .c-result.sfc-log[data-tpl="adv_wenku_fc"],\r .c-recomm-wrap.new-ux-recom-wrapper.animation,\r #results-pre,\r .video-recommend,\r .c-result.sfc-log[data-tpl="search_recomm"],\r .sfc-image-content-waterfall-item[wat-item-data-id="no-img"],\r .se-results-pre,\r .ec_wise_ad,\r div#copyright + div,\r div#pop-up,\r div[class*='ad-wrapper__'],\r div[class*='rec-wrapper__'],\r .brand-entry,\r .barea-ad,\r .swan-ad-fc-rcmd.swan-ad-fc-base-wrap[data-platform],\r div#page-bd div.recommend,\r div.short-mini div[data-module="rec:undefined-undefined"],\r /* 相关软件 */\r div[srcid="sigma_celebrity_rela"],\r /* 搜一些隐私的内容时弹出的来的,开启无痕模式----保护隐私,安全浏览 */\r div:has(p.ivk-private-p),\r /* 智能卡片的 更多 按钮 */\r .c-result-content div[rl-type="stop"]:has(div[data-module="lgsd"]) {\r display: none !important;\r }\r /* 搜索框 */\r .searchboxtop.newsearch-white-style .se-form {\r border-color: #4e6ef2 !important;\r }\r /* 百度一下 按钮 */\r .searchboxtop.newsearch-white-style .se-bn {\r color: #fff !important;\r background: #4e6ef2 !important;\r }\r .se-head-logo .se-logo img {\r display: inherit !important;\r }\r /* 选项卡,如综合、笔记、视频等 */\r .se-head-tablink {\r border-bottom: 1px solid #e6e6e6 !important;\r /*background-color: #fff !important;*/\r background-color: transparent !important;\r }\r \r a.se-tabitem span {\r color: #000 !important;\r }\r /*div.c-peak-layer{\r display:none !important;\r } 百度关键字背景*/\r .se-tablink-scroll-wrapper .se-tab-cur:after {\r border-bottom: 2px solid #38f !important;\r }\r .c-tags-scroll.c-padding-x {\r display: none !important;\r }\r .white-bdsearch-isredirecrt {\r display: inline-flex;\r background: #43ba76;\r color: #fff;\r width: 28px;\r font-size: 16px;\r line-height: 25px;\r justify-content: center;\r align-items: center;\r border-radius: 5px;\r margin: 0 auto;\r margin-right: 6px;\r }\r /* 修复图片显示问题 */\r .image-strong-card div[class*="image-content__"] > div {\r display: inline-block;\r overflow: hidden;\r vertical-align: top;\r }\r .c-result-content div[class*="tieba-newxml-forum-img-class__"] {\r display: -webkit-box;\r display: -webkit-flex;\r display: flex;\r -webkit-box-align: center;\r -moz-box-align: center;\r -webkit-align-items: center;\r align-items: center;\r }\r \r .c-result-content div[class*="tieba-newxml-forum-img__"] {\r width: 0.553rem;\r height: 0.553rem;\r }\r \r .c-result-content div[class*="tieba-newxml-forum-img__"] img {\r width: 100%;\r height: 100%;\r border-radius: 0.09rem;\r }\r .c-result-content div[class*="tieba-newxml-forum-class__"] {\r display: -webkit-flex;\r display: flex;\r -webkit-box-orient: vertical;\r -moz-box-orient: vertical;\r -webkit-box-direction: normal;\r -moz-box-direction: normal;\r -webkit-flex-direction: column;\r -moz-flex-direction: column;\r flex-direction: column;\r -webkit-box-pack: center;\r -moz-box-pack: center;\r -webkit-justify-content: center;\r -moz-justify-content: center;\r justify-content: center;\r max-width: 2.2rem;\r }\r .c-result-content div[class*="c-img-content-btn__"] {\r position: absolute;\r right: 0;\r width: 0.55rem;\r text-align: center;\r line-height: 0.28rem;\r border: 1px solid rgba(31, 31, 31, 0.5);\r border-radius: 0.15rem;\r font-family: PingFangSC-Medium;\r font-size: 0.13rem;\r color: #1f1f1f;\r }\r .c-result-content div[class*="tieba-newxml-thread-comment-user__"] {\r display: -webkit-flex;\r display: flex;\r -webkit-box-align: center;\r -moz-box-align: center;\r -webkit-align-items: center;\r -moz-align-items: center;\r align-items: center;\r margin-top: 0.03rem;\r }\r .c-result-content div[class*="tieba-newxml-thread-comment-user__"] img {\r width: 0.16rem;\r height: 0.16rem;\r border-radius: 50%;\r }\r .c-result-content div[class*="tieba-newxml-thread-comment-user__"] span {\r margin-right: 0.08rem;\r }\r .whitesev-gm-refactor-everyone-searching {\r width: 100%;\r box-sizing: border-box;\r height: 2.857em;\r line-height: 2.857;\r background-color: #f5f6f9;\r border-color: #f5f6f9;\r padding: 0 0.08rem;\r /*vertical-align: middle;*/\r outline: 0;\r font-size: 14px;\r overflow: hidden;\r border-radius: 9px;\r text-align: center;\r text-decoration: none;\r -webkit-tap-highlight-color: transparent;\r -moz-tap-highlight-color: transparent;\r text-overflow: ellipsis;\r white-space: nowrap;\r -webkit-box-orient: horizontal;\r -moz-box-orient: horizontal;\r -webkit-box-align: stretch;\r -moz-box-align: stretch;\r display: block;\r justify-content: space-between;\r -webkit-justify-content: space-between;\r -moz-justify-content: space-between;\r -webkit-align-items: stretch;\r -moz-align-items: stretch;\r align-items: stretch;\r flex-wrap: nowrap;\r -webkit-flex-wrap: nowrap;\r -moz-flex-wrap: nowrap;\r }\r \r /* 让搜索中某些视频的阶段可以横向滚动 */\r div[class^="new-summary-container_"] {\r overflow: auto;\r }\r \r /* 智能卡片 展开更多,这里是拼音 */\r .c-result-content\r div[class*="multi-pinyin_"]\r div[class*="multi-pinyin-item"][style*="display: none"] {\r display: block !important;\r }\r `; const SearchHealthShieldCSS = '/* 右下角悬浮的健康直播间图标按钮 */\r\ndiv[class^="index_brandEntry"],\r\n/* 底部的推荐的广告 */\r\n.moduleItemWrap:has([data-ad-id]) {\r\n display: none !important;\r\n}\r\n'; const BaiduHeadlth = { init() { addStyle$1(SearchHealthShieldCSS); log.info("插入CSS规则"); Panel.execMenuOnce("baidu_search_headlth_shield_other_info", () => { return this.shieldOtherInfo(); }); Panel.execMenuOnce("baidu_search_headlth_shield_bottom_toolbar", () => { return this.shieldServiceButtonsRow(); }); }, shieldOtherInfo() { log.info("【屏蔽】底部其它信息"); return CommonUtil.addBlockCSS( 'article[class] > div[class^="index_container"]', '#main > div[class^="index_container"]' ); }, shieldServiceButtonsRow() { log.info("【屏蔽】底部工具栏"); return CommonUtil.addBlockCSS( 'article[class] > div[class^="index_healthServiceButtonsRow"]', '#main > div[class^="index_interactWrap"]' ); } }; const BaiduHook = { $isHook: { windowBoxJSBefore: false, objectDefineProperty_search: false, windowJQueryAppend: false, windowOpenBox: false, windowWebpackJsonp_tieba: false, windowWebpackJsonp_haokan: false, window_openContentBox: false, functionCall_baijiahao_map: false }, $data: { functionApply: [], functionCall: [], elementAppendChild: [], setTimeout: [], windowDefine: [] }, functionApply(mode) { this.$data.functionApply.push(mode); if (this.$data.functionApply.length > 1) { log.info("Function.property.apply hook新增劫持参数:" + mode); return; } let that = this; log.info("初始化Function.property.apply hook"); _unsafeWindow.Function.prototype.apply = function(...args) { if (that.$data.functionApply.includes("copy")) { try { let firstParam = args[1]; if (args.length === 2 && typeof firstParam === "object" && "" + firstParam === "[object Arguments]" && firstParam.length === 1 && typeof firstParam[0] === "object" && firstParam[0] != null && "appName" in firstParam[0] && "checkTokenCopied" in firstParam[0] && "deeplink" in firstParam[0] && "scheme" in firstParam[0] && "token" in firstParam[0] && "useDeeplink" in firstParam[0]) { log.success(["劫持复制到剪贴板函数", ...firstParam]); return new Promise(function(resolve) { log.success(["修改参数并劫持复制到剪贴板返回true"]); resolve({ status: true }); }); } } catch (error) { } } if (that.$data.functionApply.includes("scheme")) { try { let firstParam = args[1]; if (args.length === 2 && typeof firstParam === "object" && "" + firstParam === "[object Arguments]" && firstParam.length === 2 && firstParam[1] === "scheme") { log.success(["劫持Scheme", ...firstParam]); return; } } catch (error) { } } return OriginPrototype.Function.apply.call(this, ...args); }; }, functionCall(mode) { this.$data.functionCall.push(mode); if (this.$data.functionCall.length > 1) { log.info("Function.property.call hook新增劫持参数:" + mode); return; } log.info("初始化Function.property.call hook"); let originCall = _unsafeWindow.Function.prototype.call; _unsafeWindow.Function.prototype.call = function(...args) { let result = originCall.apply(this, args); if (mode === "baijiahao_invoke") { if (args.length === 4 && typeof args[1]?.["exports"] === "object" && "execCopy" in args[1]?.["exports"] && "invokeApp" in args[1]?.["exports"] && "invokeMarket" in args[1]?.["exports"] && "invokeTpApp" in args[1]?.["exports"]) { args[1]["exports"]["execCopy"] = function(...args2) { return new Promise((resolve) => { log.success(["阻止调用execCopy", args2]); resolve(null); }); }; args[1]["exports"]["invokeApp"] = function(...args2) { return new Promise((resolve) => { log.success(["阻止调用invokeApp", args2]); resolve(null); }); }; args[1]["exports"]["invokeMarket"] = function(...args2) { return new Promise((resolve) => { log.success(["阻止调用invokeMarket", args2]); resolve(null); }); }; args[1]["exports"]["invokeTpApp"] = function(...args2) { return new Promise((resolve) => { log.success(["阻止调用invokeTpApp", args2]); resolve(null); }); }; } else if (args.length === 2 && args[0] === void 0 && args[1] != null && "arg" in args[1] && "delegate" in args[1] && "done" in args[1] && "method" in args[1] && "next" in args[1] && "prev" in args[1]) { log.success(["修改参数", args[1]]); args[1]["method"] = "return"; args[1]["next"] = "end"; args[1]["prev"] = 24; } } else if (mode === "map") { if (args.length === 2 && args[0] === void 0 && args[1] != null && "arg" in args[1] && "delegate" in args[1] && "done" in args[1] && "method" in args[1] && "next" in args[1] && "prev" in args[1]) { log.success(["修改参数", args[1]]); args[1]["method"] = "return"; args[1]["next"] = "end"; args[1]["prev"] = 24; } } return result; }; }, windowDefine(path, requirePathList, callback) { this.$data.windowDefine.push({ path, requirePathList, callback }); if (this.$data.windowDefine.length > 1) { log.info("define hook新增劫持参数:" + path); return; } let that = this; let safeDefine = void 0; let unsafeDefine = function(...args) { let define_path = args[0]; let define_requrePathList = args[1]; args[2]; for (let index = 0; index < that.$data.windowDefine.length; index++) { let hookConfig = that.$data.windowDefine[index]; if (hookConfig.path === define_path && JSON.stringify(hookConfig.requirePathList) === JSON.stringify(define_requrePathList)) { args[2] = hookConfig.callback; break; } } safeDefine(...args); }; unsafeDefine.prototype.amd = {}; OriginPrototype.Object.defineProperty(_unsafeWindow, "define", { get() { if (safeDefine == null) { return; } return unsafeDefine; }, set(v) { log.success(["define ==> ", v]); safeDefine = v; } }); }, objectDefineProperty_search(menuKeyName) { if (this.$isHook.objectDefineProperty_search) { return; } this.$isHook.objectDefineProperty_search = true; _unsafeWindow.Object.defineProperty = function(target, propertyKey, _attributes) { if (propertyKey === "_onClick") { log.info(["成功劫持_onClick", arguments]); let oldFn = _attributes["value"]; _attributes["value"] = function(event) { let eventNode = this._getNode(event.target); let eventNodeName = this._getType(eventNode); if (eventNodeName === "link") { let linkProps2 = this._getLinkProps(eventNode); log.success(["点击事件-linkProps信息", linkProps2]); if (!linkProps2.href) { domUtils.trigger(document, "click", event, false); return; } utils.preventEvent(event); if (Panel.getValue("baidu_search_hijack__onClick_to_blank")) { log.success("新标签页打开: " + linkProps2.href); window.open(linkProps2.href, "_blank"); } else { window.location.href = linkProps2.href; } } else { log.success([ "点击事件-this._getType(eventNode)不为link", eventNodeName, event ]); oldFn.call(this, ...arguments); } }; } return OriginPrototype.Object.defineProperty.call(this, ...arguments); }; }, elementAppendChild(handleCallBack = function(element) { if (element instanceof HTMLIFrameElement) { if (typeof element?.src === "string" && !element.src.startsWith("http")) { log.success(["劫持iframe唤醒:" + element.src, element]); return true; } } }) { this.$data.elementAppendChild.push(handleCallBack); if (this.$data.elementAppendChild.length > 1) { log.info("Element.prototype.appendChild hook新增劫持判断回调"); return; } _unsafeWindow.Element.prototype.appendChild = function(element) { if (typeof handleCallBack === "function") { let handleResult = handleCallBack(element); if (handleResult) { return; } } return OriginPrototype.Element.appendChild.call(this, ...arguments); }; }, windowJQueryAppend() { if (this.$isHook.windowJQueryAppend) { return; } this.$isHook.windowJQueryAppend = true; let originAppend = _unsafeWindow.$.fn.append; _unsafeWindow.$.fn.append = function(params) { if (typeof params === "string") { params = params.trim(); if (params.startsWith('