diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/SCRIPT_VERSION.json" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/SCRIPT_VERSION.json" index 578495755..486dc8bbb 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/SCRIPT_VERSION.json" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/SCRIPT_VERSION.json" @@ -1,4 +1,4 @@ { - "time": 1719378532890, - "version": "2024.6.26" + "time": 1719664875297, + "version": "2024.6.29" } \ No newline at end of file diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.min.user.js" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.min.user.js" index 5c9767ab9..560e8c004 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.min.user.js" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.min.user.js" @@ -1,7 +1,7 @@ // ==UserScript== // @name 抖音优化 // @namespace https://github.com/WhiteSevs/TamperMonkeyScript -// @version 2024.6.26 +// @version 2024.6.29 // @author WhiteSevs // @description 过滤广告、过滤直播、可自定义过滤视频的屏蔽关键字、伪装登录、直播屏蔽弹幕、礼物特效等 // @license GPL-3.0-only @@ -11,7 +11,7 @@ // @require https://update.greasyfork.org/scripts/494167/1376186/CoverUMD.js // @require https://update.greasyfork.org/scripts/456485/1398647/pops.js // @require https://fastly.jsdelivr.net/npm/qmsg@1.1.2/dist/index.umd.js -// @require https://fastly.jsdelivr.net/npm/@whitesev/utils@1.5.8/dist/index.umd.js +// @require https://fastly.jsdelivr.net/npm/@whitesev/utils@1.5.9/dist/index.umd.js // @require https://fastly.jsdelivr.net/npm/@whitesev/domutils@1.1.2/dist/index.umd.js // @grant GM_addStyle // @grant GM_deleteValue @@ -25,13 +25,23 @@ // @run-at document-start // ==/UserScript== -(function (S, Te, Me) { +(function (C, Te, Me) { 'use strict'; - var ye=e=>{throw TypeError(e)};var Se=(e,i,t)=>i.has(e)||ye("Cannot "+t);var E=(e,i,t)=>(Se(e,i,"read from private field"),t?t.call(e):i.get(e)),z=(e,i,t)=>i.has(e)?ye("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,t),U=(e,i,t,n)=>(Se(e,i,"write to private field"),i.set(e,t),t);var k=typeof GM_getValue<"u"?GM_getValue:void 0,$=typeof GM_info<"u"?GM_info:void 0,Ee=typeof GM_registerMenuCommand<"u"?GM_registerMenuCommand:void 0,P=typeof GM_setValue<"u"?GM_setValue:void 0,Ie=typeof GM_unregisterMenuCommand<"u"?GM_unregisterMenuCommand:void 0,Re=typeof GM_xmlhttpRequest<"u"?GM_xmlhttpRequest:void 0,M=typeof unsafeWindow<"u"?unsafeWindow:void 0,_e=window;const I="GM_Panel",O="data-key",F="data-default-value",H=function(e,i,t,n,r,a){let h=[];typeof n=="function"?h=n():h=n;let d={text:e,type:"select",description:a,attributes:{},getValue(){return l.getValue(i,t)},callback(u,f,v){l.setValue(i,f),typeof r=="function"&&r(u,f,v);},data:h};return d.attributes&&(d.attributes[O]=i,d.attributes[F]=t),d},s=function(e,i,t,n,r){let a={text:e,type:"switch",description:r,attributes:{},getValue(){return !!l.getValue(i,t)},callback(h,d){o.success(`${d?"开启":"关闭"} ${e}`),l.setValue(i,!!d);},afterAddToUListCallBack:void 0};return a.attributes&&(a.attributes[O]=i,a.attributes[F]=!!t),a},De={id:"panel-config-common",title:"通用",forms:[{text:"功能",type:"forms",forms:[s("debug模式","debug",!0,void 0,"移除抖音的开发者模式检测"),s("伪装登录","disguiseLogin",!1,void 0,"使用随机UID进行伪装"),s("initial-scale=1","dy-initialScale",!1,void 0,"可配合手机模式放大页面"),s("移除 apple-itunes-app","dy-apple-removeMetaAppleItunesApp",!0,void 0,"Safari使用,移除顶部横幅【Open in the 抖音 app】")]},{text:"Url重定向",type:"forms",forms:[s("重定向/home","douyin-redirect-url-home-to-root",!1,void 0,"/home => /")]},{text:"屏蔽",type:"forms",forms:[s("【屏蔽】登录弹窗","watchLoginDialogToClose",!0,void 0,"屏蔽元素且自动等待元素出现并关闭登录弹窗"),s("【屏蔽】底部?按钮","shieldBottomQuestionButton",!0,void 0,"屏蔽元素")]},{text:"主框架-屏蔽",type:"forms",forms:[s("【屏蔽】客户端提示","shieldClientTip",!0,void 0,"屏蔽元素"),s("【屏蔽】充砖石","shieldFillingBricksAndStones",!0,void 0,"屏蔽元素"),s("【屏蔽】客户端","shieldClient",!0,void 0,"屏蔽元素"),s("【屏蔽】快捷访问","shieldQuickAccess",!1,void 0,"屏蔽元素"),s("【屏蔽】通知","shieldNotifitation",!1,void 0,"屏蔽元素"),s("【屏蔽】私信","shieldPrivateMessage",!1,void 0,"屏蔽元素"),s("【屏蔽】投稿","shieldSubmission",!1,void 0,"屏蔽元素"),s("【屏蔽】壁纸","shieldWallpaper",!1,void 0,"屏蔽元素"),s("【屏蔽】左侧导航栏","shieldLeftNavigator",!1,void 0,"屏蔽元素"),s("【屏蔽】顶部导航栏","shieldTopNavigator",!1,void 0,"屏蔽元素")]},{text:"搜索-屏蔽",type:"forms",forms:[s("【屏蔽】搜索框","shieldSearch",!1,void 0,"屏蔽元素"),s("【屏蔽】搜索框的提示","shieldSearchPlaceholder",!1,void 0,"屏蔽元素"),s("【屏蔽】猜你想搜","shieldSearchGuessYouWantToSearch",!1,void 0,"屏蔽元素"),s("【屏蔽】抖音热点","shieldSearchTiktokHotspot",!1,void 0,"屏蔽元素")]},{text:"Toast配置",type:"forms",forms:[H("Toast位置","qmsg-config-position","bottom",[{value:"topleft",text:"左上角"},{value:"top",text:"顶部"},{value:"topright",text:"右上角"},{value:"left",text:"左边"},{value:"center",text:"中间"},{value:"right",text:"右边"},{value:"bottomleft",text:"左下角"},{value:"bottom",text:"底部"},{value:"bottomright",text:"右下角"}],(e,i,t)=>{o.info("设置当前Qmsg弹出位置"+t);},"Toast显示在页面九宫格的位置"),H("最多显示的数量","qmsg-config-maxnums",3,[{value:1,text:"1"},{value:2,text:"2"},{value:3,text:"3"},{value:4,text:"4"},{value:5,text:"5"}],void 0,"限制Toast显示的数量"),s("逆序弹出","qmsg-config-showreverse",!1,void 0,"修改Toast弹出的顺序")]}]},m={isVerticalScreen(){return !window.screen.orientation.type.includes("landscape")},addBlockCSS(...e){let i=[];e.length!==0&&(e.length===1&&typeof e[0]=="string"&&e[0].trim()===""||(e.forEach(t=>{Array.isArray(t)?i=i.concat(t):i.push(t);}),c.addStyle(`${i.join(`, + var ye=e=>{throw TypeError(e)};var Ce=(e,i,t)=>i.has(e)||ye("Cannot "+t);var E=(e,i,t)=>(Ce(e,i,"read from private field"),t?t.call(e):i.get(e)),z=(e,i,t)=>i.has(e)?ye("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,t),$=(e,i,t,n)=>(Ce(e,i,"write to private field"),i.set(e,t),t);var k=typeof GM_getValue<"u"?GM_getValue:void 0,U=typeof GM_info<"u"?GM_info:void 0,Ee=typeof GM_registerMenuCommand<"u"?GM_registerMenuCommand:void 0,D=typeof GM_setValue<"u"?GM_setValue:void 0,Ie=typeof GM_unregisterMenuCommand<"u"?GM_unregisterMenuCommand:void 0,Re=typeof GM_xmlhttpRequest<"u"?GM_xmlhttpRequest:void 0,M=typeof unsafeWindow<"u"?unsafeWindow:void 0,_e=window;const I="GM_Panel",O="data-key",F="data-default-value",Y=function(e,i,t,n,a,l){let h=[];typeof n=="function"?h=n():h=n;let d={text:e,type:"select",description:l,attributes:{},getValue(){return r.getValue(i,t)},callback(u,p,v){r.setValue(i,p),typeof a=="function"&&a(u,p,v);},data:h};return d.attributes&&(d.attributes[O]=i,d.attributes[F]=t),d},s=function(e,i,t,n,a){let l={text:e,type:"switch",description:a,attributes:{},getValue(){return !!r.getValue(i,t)},callback(h,d){o.success(`${d?"开启":"关闭"} ${e}`),r.setValue(i,!!d);},afterAddToUListCallBack:void 0};return l.attributes&&(l.attributes[O]=i,l.attributes[F]=!!t),l},Le={id:"panel-config-common",title:"通用",forms:[{text:"功能",type:"forms",forms:[s("debug模式","debug",!0,void 0,"移除抖音的开发者模式检测"),s("伪装登录","disguiseLogin",!1,void 0,"使用随机UID进行伪装"),s("initial-scale=1","dy-initialScale",!1,void 0,"可配合手机模式放大页面"),s("移除 apple-itunes-app","dy-apple-removeMetaAppleItunesApp",!0,void 0,"Safari使用,移除顶部横幅【Open in the 抖音 app】")]},{text:"Url重定向",type:"forms",forms:[s("重定向/home","douyin-redirect-url-home-to-root",!1,void 0,"/home => /")]},{text:"屏蔽",type:"forms",forms:[s("【屏蔽】登录弹窗","watchLoginDialogToClose",!0,void 0,"屏蔽元素且自动等待元素出现并关闭登录弹窗"),s("【屏蔽】底部?按钮","shieldBottomQuestionButton",!0,void 0,"屏蔽元素")]},{text:"主框架-屏蔽",type:"forms",forms:[s("【屏蔽】客户端提示","shieldClientTip",!0,void 0,"屏蔽元素"),s("【屏蔽】充砖石","shieldFillingBricksAndStones",!0,void 0,"屏蔽元素"),s("【屏蔽】客户端","shieldClient",!0,void 0,"屏蔽元素"),s("【屏蔽】快捷访问","shieldQuickAccess",!1,void 0,"屏蔽元素"),s("【屏蔽】通知","shieldNotifitation",!1,void 0,"屏蔽元素"),s("【屏蔽】私信","shieldPrivateMessage",!1,void 0,"屏蔽元素"),s("【屏蔽】投稿","shieldSubmission",!1,void 0,"屏蔽元素"),s("【屏蔽】壁纸","shieldWallpaper",!1,void 0,"屏蔽元素"),s("【屏蔽】左侧导航栏","shieldLeftNavigator",!1,void 0,"屏蔽元素"),s("【屏蔽】顶部导航栏","shieldTopNavigator",!1,void 0,"屏蔽元素")]},{text:"搜索-屏蔽",type:"forms",forms:[s("【屏蔽】搜索框","shieldSearch",!1,void 0,"屏蔽元素"),s("【屏蔽】搜索框的提示","shieldSearchPlaceholder",!1,void 0,"屏蔽元素"),s("【屏蔽】猜你想搜","shieldSearchGuessYouWantToSearch",!1,void 0,"屏蔽元素"),s("【屏蔽】抖音热点","shieldSearchTiktokHotspot",!1,void 0,"屏蔽元素")]},{text:"Toast配置",type:"forms",forms:[Y("Toast位置","qmsg-config-position","bottom",[{value:"topleft",text:"左上角"},{value:"top",text:"顶部"},{value:"topright",text:"右上角"},{value:"left",text:"左边"},{value:"center",text:"中间"},{value:"right",text:"右边"},{value:"bottomleft",text:"左下角"},{value:"bottom",text:"底部"},{value:"bottomright",text:"右下角"}],(e,i,t)=>{o.info("设置当前Qmsg弹出位置"+t);},"Toast显示在页面九宫格的位置"),Y("最多显示的数量","qmsg-config-maxnums",3,[{value:1,text:"1"},{value:2,text:"2"},{value:3,text:"3"},{value:4,text:"4"},{value:5,text:"5"}],void 0,"限制Toast显示的数量"),s("逆序弹出","qmsg-config-showreverse",!1,void 0,"修改Toast弹出的顺序")]}]},m={isVerticalScreen(){return !window.screen.orientation.type.includes("landscape")},addBlockCSS(...e){let i=[];e.length!==0&&(e.length===1&&typeof e[0]=="string"&&e[0].trim()===""||(e.forEach(t=>{Array.isArray(t)?i=i.concat(t):i.push(t);}),c.addStyle(`${i.join(`, `)}{display: none !important;}`)));}},N={key:"douyin-live-danmu-rule",$data:{rule:[],isFilterAttrName:"data-is-filter"},init(){this.parseRule();},parseRule(){this.get().trim().split(` -`).forEach(t=>{if(t.trim()=="")return;t=t.trim();let n=new RegExp(t.trim());this.$data.rule.push(n);});},change(){var i,t,n,r,a,h,d;let e=Array.from(document.querySelectorAll("xg-danmu.xgplayer-danmu > div > div"));if(e.length)for(let u=0;u{if(!e){o.error("xg-danmu.xgplayer-danmu获取失败");return}o.success("弹幕过滤"),N.init(),c.mutationObserver(e,{config:{childList:!0,subtree:!0},callback:()=>{N.change();}});});}},Pe={id:"panel-config-live",title:"直播",forms:[{text:"功能",type:"forms",forms:[s("自动进入网页全屏","live-autoEnterElementFullScreen",!1,void 0,"网页加载完毕后自动点击网页全屏按钮进入全屏"),s("解锁画质选择","live-unlockImageQuality",!0,void 0,"未登录的情况下选择原画实际上是未登录的情况下最高选择的画质"),s("监听并关闭【长时间无操作,已暂停播放】弹窗","live-waitToRemovePauseDialog",!0,void 0,"自动监听并检测弹窗"),s("禁止自动播放","live-pauseVideo",!1,void 0,"暂停直播播放")]},{text:"视频区域内-屏蔽",type:"forms",forms:[s("【屏蔽】顶栏信息","live-shieldTopToolBarInfo",!1,void 0,"屏蔽元素,包括直播作者、右侧的礼物展馆"),s("【屏蔽】底部的礼物栏","live-shieldGiftColumn",!1,void 0,"屏蔽元素"),s("【屏蔽】礼物特效","live-shieldGiftEffects",!1,void 0,"屏蔽元素"),s("【屏蔽】弹幕","live-shieldDanmuku",!1,void 0,"屏蔽元素"),s("【屏蔽】小黄车","live-shielYellowCar",!1,void 0,"屏蔽元素")]},{text:"聊天室-屏蔽",type:"forms",forms:[s("【屏蔽】聊天室","live-shieldChatRoom",!1,void 0,"屏蔽元素"),s("【屏蔽】贵宾席","live-shielChatRoomVipSeats",!1,void 0,"屏蔽元素"),s("【屏蔽】用户等级图标","dy-live-shieldUserLevelIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】VIP图标","dy-live-shieldUserVIPIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】粉丝牌","dy-live-shieldUserFansIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】信息播报","dy-live-shieldMessage",!1,void 0,"底部滚动播报的的xxx来了,xxx给主播点赞")]},{text:"弹幕屏蔽规则(可正则)",type:"forms",forms:[s("启用","live-danmu-shield-rule-enable",!1,void 0,"启用弹幕屏蔽规则"),{type:"own",getLiElementCallBack(e){let i=p.createElement("div",{className:"pops-panel-textarea",innerHTML:''},{style:"width: 100%;"}),t=i.querySelector("textarea");return t.value=N.get(),p.on(t,["input","propertychange"],c.debounce(function(){N.set(t.value);},200)),e.appendChild(i),e}}]}]},q={watchVideDataListChange(e){let i=null;p.ready(()=>{c.waitNode("#slidelist").then(t=>{c.mutationObserver(t,{config:{childList:!0,subtree:!0},callback:()=>{if(i||(i=this.getOSElement()),!i){o.error("watchVideDataListChange:获取osElement失败");return}e(i);}});});});},getOSElement(){return document.querySelector("#root div[class*='-os']")||document.querySelector("#douyin-right-container")}},G={rule:null},j={key:"douyin-shield-rule",$data:{get rule(){return G.rule==null&&(G.rule=new c.Dictionary),G.rule},isFirstLoad:!0},init(){this.parseRule(),o.info(["当前自定义视频拦截规则: ",this.$data.rule.getItems()]);let e=null;q.watchVideDataListChange(c.debounce(i=>{var a;let t=document.querySelector('#slidelist div[data-e2e="slideList"]');if(!t){o.error("未获取到视频列表元素");return}let n=(a=c.getReactObj(t))==null?void 0:a.reactFiber;if(n==null){o.error(["元素上不存在reactFiber属性",t]);return}let r=n==null?void 0:n.return.memoizedProps.data;if(r.length){if(this.$data.isFirstLoad){let h=r[r.length-1];if(e==null&&(e=h.awemeId),e===h.awemeId)return;this.$data.isFirstLoad=!1;}for(let h=0;h!!T.match(y))){f=!0,o.success(["自定义屏蔽: "+v+" "+y,u]);break}}}f&&(r.splice(h,1),h--);}}},150));},getVideoInfoTagMap(e){var h,d,u,f,v,y;let i=(d=(h=e==null?void 0:e.authorInfo)==null?void 0:h.nickname)==null?void 0:d.toString(),t=(f=(u=e==null?void 0:e.authorInfo)==null?void 0:u.uid)==null?void 0:f.toString(),n=(v=e==null?void 0:e.desc)==null?void 0:v.toString(),r=[];typeof(e==null?void 0:e.textExtra)=="object"&&Array.isArray(e==null?void 0:e.textExtra)&&((y=e==null?void 0:e.textExtra)==null||y.forEach(g=>{r.push(g.hashtagName);}));let a=[];return typeof(e==null?void 0:e.videoTag)=="object"&&Array.isArray(e==null?void 0:e.videoTag)&&(e==null||e.videoTag.forEach(g=>{a.push(g.tagName);})),{nickname:i,uid:t,desc:n,textExtra:r,videoTag:a}},parseRule(){this.get().trim().split(` -`).forEach(t=>{if(c.isNull(t))return;let r=t.trim().split("##");if(r.length<2)return;let a=r[0];r.shift();let h=r.join("");try{let d=new RegExp(h,"g");this.$data.rule.set(a,d);}catch(d){o.error(["自定义视频过滤规则-正则解析错误:"+d]),o.error("错误的规则:"+t);}});},set(e){P(this.key,e);},get(){return k(this.key,"")}},be=function(e,i,t,n,r,a,h,d){return {text:e,type:"button",description:i,buttonIcon:n,buttonIsRightIcon:r,buttonIconIsLoading:a,buttonType:h,buttonText:t,callback(f){typeof d=="function"&&d(f);},afterAddToUListCallBack:void 0}};var _,D;class Le{constructor(i){z(this,_,"short-cut");z(this,D,!1);typeof i=="string"&&U(this,_,i);}getValue(i,t){let n=k(E(this,_),[]);return i?n.find(a=>a.key===i)??t:n}setValue(i,t,n,r){let a=k(E(this,_),[]);a.push({key:i,value:{keyName:t,keyValue:n,ohterCodeList:r}}),P(E(this,_),a);}deleteValue(i){let t=!1,n=k(E(this,_),[]),r=n.findIndex(a=>a.key===i);return r!==-1&&(n.splice(r,1),t=!0),P(E(this,_),n),t}getShowText(i,t){let n=this.getValue(i);if(n){let r="";return n.value.ohterCodeList.forEach(a=>{n.key===i&&(r+=c.stringTitleToUpperCase(a,!0)+" + ");}),r+=n.value.keyName,r}else return t}inputShortCut(i,t,n){if((this.getValue(i)??t)===t){let a=S.loading("请按下快捷键...",{showClose:!0,onClose(){h.removeListen();}});U(this,D,!0);let h=c.listenKeyboard(window,"keyup",(d,u,f)=>{let v=JSON.stringify({keyName:d,keyValue:u,ohterCodeList:f}),y=this.getValue();for(let g=0;g{if(E(this,D))return;t=this.getValue();let h=t.findIndex(d=>{let u=d.value,f={keyName:n,keyValue:r,ohterCodeList:a};if(JSON.stringify(u)===JSON.stringify(f))return d});if(h!=-1){let d=t[h];o.info(["调用快捷键",d]),d.key in i&&i[d.key].callback();}});}}_=new WeakMap,D=new WeakMap;const Ae=`/* 去除顶部的padding距离 */\r +`).forEach(t=>{if(t.trim()=="")return;t=t.trim();let n=new RegExp(t.trim());this.$data.rule.push(n);});},change(){var i,t,n,a,l,h,d;let e=Array.from(document.querySelectorAll("xg-danmu.xgplayer-danmu > div > div"));if(e.length)for(let u=0;u{if(!e){o.error("xg-danmu.xgplayer-danmu获取失败");return}o.success("弹幕过滤"),N.init(),c.mutationObserver(e,{config:{childList:!0,subtree:!0},callback:()=>{N.change();}});});}},De={id:"panel-config-live",title:"直播",forms:[{text:"功能",type:"forms",forms:[s("自动进入网页全屏","live-autoEnterElementFullScreen",!1,void 0,"网页加载完毕后自动点击网页全屏按钮进入全屏"),s("解锁画质选择","live-unlockImageQuality",!0,void 0,"未登录的情况下选择原画实际上是未登录的情况下最高选择的画质"),s("监听并关闭【长时间无操作,已暂停播放】弹窗","live-waitToRemovePauseDialog",!0,void 0,"自动监听并检测弹窗"),s("禁止自动播放","live-pauseVideo",!1,void 0,"暂停直播播放")]},{text:"视频区域背景色",type:"forms",forms:[s("启用","live-bgColor-enable",!1,void 0,"自定义视频背景色"),{type:"own",attributes:{"data-key":"live-changeBackgroundColor","data-default-value":"#000000"},getLiElementCallBack(e){let i=f.createElement("div",{className:"pops-panel-item-left-text",innerHTML:` +

视频背景颜色

+

自定义视频背景颜色,包括评论区

+ `}),t=f.createElement("div",{className:"pops-panel-item-right",innerHTML:` + + `}),n=t.querySelector(".pops-color-choose");n.value=r.getValue("live-changeBackgroundColor");let a=f.createElement("style");return f.append(document.head,a),f.on(n,["input","propertychange"],l=>{o.info("选择颜色:"+n.value),a.innerHTML=` + #living_room_player_container > div, + #chatroom > div{ + background: ${n.value}; + } + `,r.setValue("live-changeBackgroundColor",n.value);}),e.appendChild(i),e.appendChild(t),e}}]},{text:"视频区域内-屏蔽",type:"forms",forms:[s("【屏蔽】顶栏信息","live-shieldTopToolBarInfo",!1,void 0,"屏蔽元素,包括直播作者、右侧的礼物展馆"),s("【屏蔽】底部的礼物栏","live-shieldGiftColumn",!1,void 0,"屏蔽元素"),s("【屏蔽】礼物特效","live-shieldGiftEffects",!1,void 0,"屏蔽元素"),s("【屏蔽】弹幕","live-shieldDanmuku",!1,void 0,"屏蔽元素"),s("【屏蔽】小黄车","live-shielYellowCar",!1,void 0,"屏蔽元素")]},{text:"聊天室-屏蔽",type:"forms",forms:[s("【屏蔽】聊天室","live-shieldChatRoom",!1,void 0,"屏蔽元素"),s("【屏蔽】贵宾席","live-shielChatRoomVipSeats",!1,void 0,"屏蔽元素"),s("【屏蔽】用户等级图标","dy-live-shieldUserLevelIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】VIP图标","dy-live-shieldUserVIPIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】粉丝牌","dy-live-shieldUserFansIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】信息播报","dy-live-shieldMessage",!1,void 0,"底部滚动播报的的xxx来了,xxx给主播点赞")]},{text:"弹幕屏蔽规则(可正则)",type:"forms",forms:[s("启用","live-danmu-shield-rule-enable",!1,void 0,"启用弹幕屏蔽规则"),{type:"own",getLiElementCallBack(e){let i=f.createElement("div",{className:"pops-panel-textarea",innerHTML:''},{style:"width: 100%;"}),t=i.querySelector("textarea");return t.value=N.get(),f.on(t,["input","propertychange"],c.debounce(function(){N.set(t.value);},200)),e.appendChild(i),e}}]}]},q={watchVideDataListChange(e){let i=null;f.ready(()=>{c.waitNode("#slidelist").then(t=>{c.mutationObserver(t,{config:{childList:!0,subtree:!0},callback:()=>{if(i||(i=this.getOSElement()),!i){o.error("watchVideDataListChange:获取osElement失败");return}e(i);}});});});},getOSElement(){return document.querySelector("#root div[class*='-os']")||document.querySelector("#douyin-right-container")}},H={rule:null},j={key:"douyin-shield-rule",$data:{get rule(){return H.rule==null&&(H.rule=new c.Dictionary),H.rule},isFirstLoad:!0},init(){this.parseRule(),o.info(["当前自定义视频拦截规则: ",this.$data.rule.getItems()]);let e=null;q.watchVideDataListChange(c.debounce(i=>{var l;let t=document.querySelector('#slidelist div[data-e2e="slideList"]');if(!t){o.error("未获取到视频列表元素");return}let n=(l=c.getReactObj(t))==null?void 0:l.reactFiber;if(n==null){o.error(["元素上不存在reactFiber属性",t]);return}let a=n==null?void 0:n.return.memoizedProps.data;if(a.length){if(this.$data.isFirstLoad){let h=a[a.length-1];if(e==null&&(e=h.awemeId),e===h.awemeId)return;this.$data.isFirstLoad=!1;}for(let h=0;h!!T.match(y))){p=!0,o.success(["自定义屏蔽: "+v+" "+y,u]);break}}}p&&(a.splice(h,1),h--);}}},150));},getVideoInfoTagMap(e){var h,d,u,p,v,y;let i=(d=(h=e==null?void 0:e.authorInfo)==null?void 0:h.nickname)==null?void 0:d.toString(),t=(p=(u=e==null?void 0:e.authorInfo)==null?void 0:u.uid)==null?void 0:p.toString(),n=(v=e==null?void 0:e.desc)==null?void 0:v.toString(),a=[];typeof(e==null?void 0:e.textExtra)=="object"&&Array.isArray(e==null?void 0:e.textExtra)&&((y=e==null?void 0:e.textExtra)==null||y.forEach(g=>{a.push(g.hashtagName);}));let l=[];return typeof(e==null?void 0:e.videoTag)=="object"&&Array.isArray(e==null?void 0:e.videoTag)&&(e==null||e.videoTag.forEach(g=>{l.push(g.tagName);})),{nickname:i,uid:t,desc:n,textExtra:a,videoTag:l}},parseRule(){this.get().trim().split(` +`).forEach(t=>{if(c.isNull(t))return;let a=t.trim().split("##");if(a.length<2)return;let l=a[0];a.shift();let h=a.join("");try{let d=new RegExp(h,"g");this.$data.rule.set(l,d);}catch(d){o.error(["自定义视频过滤规则-正则解析错误:"+d]),o.error("错误的规则:"+t);}});},set(e){D(this.key,e);},get(){return k(this.key,"")}},be=function(e,i,t,n,a,l,h,d){return {text:e,type:"button",description:i,buttonIcon:n,buttonIsRightIcon:a,buttonIconIsLoading:l,buttonType:h,buttonText:t,callback(p){typeof d=="function"&&d(p);},afterAddToUListCallBack:void 0}};var _,L;class Pe{constructor(i){z(this,_,"short-cut");z(this,L,!1);typeof i=="string"&&$(this,_,i);}getValue(i,t){let n=k(E(this,_),[]);return i?n.find(l=>l.key===i)??t:n}setValue(i,t,n,a){let l=k(E(this,_),[]);l.push({key:i,value:{keyName:t,keyValue:n,ohterCodeList:a}}),D(E(this,_),l);}deleteValue(i){let t=!1,n=k(E(this,_),[]),a=n.findIndex(l=>l.key===i);return a!==-1&&(n.splice(a,1),t=!0),D(E(this,_),n),t}getShowText(i,t){let n=this.getValue(i);if(n){let a="";return n.value.ohterCodeList.forEach(l=>{n.key===i&&(a+=c.stringTitleToUpperCase(l,!0)+" + ");}),a+=n.value.keyName,a}else return t}inputShortCut(i,t,n){if((this.getValue(i)??t)===t){let l=C.loading("请按下快捷键...",{showClose:!0,onClose(){h.removeListen();}});$(this,L,!0);let h=c.listenKeyboard(window,"keyup",(d,u,p)=>{let v=JSON.stringify({keyName:d,keyValue:u,ohterCodeList:p}),y=this.getValue();for(let g=0;g{if(E(this,L))return;t=this.getValue();let h=t.findIndex(d=>{let u=d.value,p={keyName:n,keyValue:a,ohterCodeList:l};if(JSON.stringify(u)===JSON.stringify(p))return d});if(h!=-1){let d=t[h];o.info(["调用快捷键",d]),d.key in i&&i[d.key].callback();}});}}_=new WeakMap,L=new WeakMap;const Ae=`/* 去除顶部的padding距离 */\r #douyin-right-container {\r padding-top: 0;\r }\r @@ -69,16 +79,16 @@ ul[data-e2e="scroll-list"] {\r }\r }\r \r -`,Ue={init(){l.execMenuOnce("douyin-search-shieldReleatedSearches",()=>{this.shieldReleatedSearches();});},shieldReleatedSearches(){o.info("【屏蔽】相关搜索"),m.addBlockCSS("#search-content-area > div > div:nth-child(2)"),C(` +`,$e={init(){r.execMenuOnce("douyin-search-shieldReleatedSearches",()=>{this.shieldReleatedSearches();});},shieldReleatedSearches(){o.info("【屏蔽】相关搜索"),m.addBlockCSS("#search-content-area > div > div:nth-child(2)"),S(` #search-content-area > div > div:nth-child(1) > div:nth-child(1){ width: 100dvw; } - `);}},Be={init(){Ue.init();},mobileMode(){o.info("搜索-手机模式"),C(Ae),c.waitNode("#relatedVideoCard").then(e=>{o.info("评论区展开的className:"+e.className),C(` + `);}},Be={init(){$e.init();},mobileMode(){o.info("搜索-手机模式"),S(Ae),c.waitNode("#relatedVideoCard").then(e=>{o.info("评论区展开的className:"+e.className),S(` html[data-vertical-screen] #sliderVideo[data-e2e="feed-active-video"] #videoSideBar:has(#relatedVideoCard[class="${e.className}"]) { width: 100dvw !important; - }`);});}},b={isLive(){return window.location.hostname==="live.douyin.com"},isVideo(){return window.location.hostname==="www.douyin.com"},isSearch(){return window.location.hostname==="www.douyin.com"&&window.location.pathname.startsWith("/search")}},$e=`/* 右侧工具栏放大 */\r + }`);});}},b={isLive(){return window.location.hostname==="live.douyin.com"},isVideo(){return window.location.hostname==="www.douyin.com"},isSearch(){return window.location.hostname==="www.douyin.com"&&window.location.pathname.startsWith("/search")}},Ue=`/* 右侧工具栏放大 */\r .basePlayerContainer .positionBox {\r scale: unset !important;\r bottom: 80px !important;\r @@ -170,27 +180,27 @@ ul[data-e2e="scroll-list"] {\r min-width: 100%;\r }\r }\r -`,xe={init(){l.execMenu("shieldRightExpandCommentButton",()=>{this.shieldRightExpandCommentButton();}),l.execMenu("shieldSearchFloatingBar",()=>{this.shieldSearchFloatingBar();}),l.execMenu("shieldCloseFullScreenButton",()=>{this.shieldCloseFullScreenButton();}),l.execMenu("shieldPlaySwitchButton",()=>{this.shieldPlaySwitchButton();}),l.execMenu("shieldAuthorAvatar",()=>{this.shieldAuthorAvatar();}),l.execMenu("shieldLikeButton",()=>{this.shieldLikeButton();}),l.execMenu("shieldCommentButton",()=>{this.shieldCommentButton();}),l.execMenu("shieldCollectionButton",()=>{this.shieldCollectionButton();}),l.execMenu("shieldSharenButton",()=>{this.shieldSharenButton();}),l.execMenu("shieldRelatedRecommendationsButton",()=>{this.shieldRelatedRecommendationsButton();}),l.execMenu("shieldMoreButton",()=>{this.shieldMoreButton();}),l.execMenu("shieldBottomVideoToolBar",()=>{this.shieldBottomVideoToolBar();}),l.execMenu("shieldBottomVideoToolbarDanmuContainer",()=>{this.shieldBottomVideoToolbarDanmuContainer();});},shieldRightExpandCommentButton(){o.info("【屏蔽】右侧的展开评论按钮"),m.addBlockCSS('#sliderVideo[data-e2e="feed-active-video"] > div > div > button[type="button"]','.playerContainer button[type=button] svg > g[filter] > path[d="M21.316 29.73a1.393 1.393 0 01-1.97 0l-5.056-5.055a1.393 1.393 0 010-1.97l.012-.011 5.044-5.045a1.393 1.393 0 011.97 1.97l-4.07 4.071 4.07 4.071a1.393 1.393 0 010 1.97z"]'),C(` +`,xe={init(){r.execMenu("shieldRightExpandCommentButton",()=>{this.shieldRightExpandCommentButton();}),r.execMenu("shieldSearchFloatingBar",()=>{this.shieldSearchFloatingBar();}),r.execMenu("shieldCloseFullScreenButton",()=>{this.shieldCloseFullScreenButton();}),r.execMenu("shieldPlaySwitchButton",()=>{this.shieldPlaySwitchButton();}),r.execMenu("shieldAuthorAvatar",()=>{this.shieldAuthorAvatar();}),r.execMenu("shieldLikeButton",()=>{this.shieldLikeButton();}),r.execMenu("shieldCommentButton",()=>{this.shieldCommentButton();}),r.execMenu("shieldCollectionButton",()=>{this.shieldCollectionButton();}),r.execMenu("shieldSharenButton",()=>{this.shieldSharenButton();}),r.execMenu("shieldRelatedRecommendationsButton",()=>{this.shieldRelatedRecommendationsButton();}),r.execMenu("shieldMoreButton",()=>{this.shieldMoreButton();}),r.execMenu("shieldBottomVideoToolBar",()=>{this.shieldBottomVideoToolBar();}),r.execMenu("shieldBottomVideoToolbarDanmuContainer",()=>{this.shieldBottomVideoToolbarDanmuContainer();});},shieldRightExpandCommentButton(){o.info("【屏蔽】右侧的展开评论按钮"),m.addBlockCSS('#sliderVideo[data-e2e="feed-active-video"] > div > div > button[type="button"]','.playerContainer button[type=button] svg > g[filter] > path[d="M21.316 29.73a1.393 1.393 0 01-1.97 0l-5.056-5.055a1.393 1.393 0 010-1.97l.012-.011 5.044-5.045a1.393 1.393 0 011.97 1.97l-4.07 4.071 4.07 4.071a1.393 1.393 0 010 1.97z"]'),S(` .basePlayerContainer .positionBox{ padding-right: 20px !important; } - `);},shieldSearchFloatingBar(){o.info("【屏蔽】搜索悬浮栏"),m.addBlockCSS('.slider-video div:has([data-e2e="searchbar-button"])','div:has(>div > svg[class] > defs [d="M0 0h24v24H0z"]','div[data-e2e="feed-active-video"] + div:has(>div>div>div > input[data-e2e="searchbar-input"])',"#slideMode + div",'div:has(>div>div+input[data-e2e="searchbar-input"])');},shieldCloseFullScreenButton(){o.info("【屏蔽】网页全屏关闭按钮"),m.addBlockCSS('#sliderVideo[data-e2e="feed-active-video"] div.slider-video > div:has(path[d="M17.448 17.448a1.886 1.886 0 01-2.668 0L9 11.668l-5.78 5.78A1.886 1.886 0 11.552 14.78L6.332 9 .552 3.22A1.886 1.886 0 113.22.552L9 6.332l5.78-5.78a1.886 1.886 0 112.668 2.668L11.668 9l5.78 5.78a1.886 1.886 0 010 2.668z"])');},shieldPlaySwitchButton(){o.info("【屏蔽】切换播放"),m.addBlockCSS('.positionBox .xgplayer-playswitch[data-state="normal"]',"div.xgplayer-playswitch",".xgplayer-playswitch"),C(` + `);},shieldSearchFloatingBar(){o.info("【屏蔽】搜索悬浮栏"),m.addBlockCSS('.slider-video div:has([data-e2e="searchbar-button"])','div:has(>div > svg[class] > defs [d="M0 0h24v24H0z"]','div[data-e2e="feed-active-video"] + div:has(>div>div>div > input[data-e2e="searchbar-input"])',"#slideMode + div",'div:has(>div>div+input[data-e2e="searchbar-input"])');},shieldCloseFullScreenButton(){o.info("【屏蔽】网页全屏关闭按钮"),m.addBlockCSS('#sliderVideo[data-e2e="feed-active-video"] div.slider-video > div:has(path[d="M17.448 17.448a1.886 1.886 0 01-2.668 0L9 11.668l-5.78 5.78A1.886 1.886 0 11.552 14.78L6.332 9 .552 3.22A1.886 1.886 0 113.22.552L9 6.332l5.78-5.78a1.886 1.886 0 112.668 2.668L11.668 9l5.78 5.78a1.886 1.886 0 010 2.668z"])');},shieldPlaySwitchButton(){o.info("【屏蔽】切换播放"),m.addBlockCSS('.positionBox .xgplayer-playswitch[data-state="normal"]',"div.xgplayer-playswitch",".xgplayer-playswitch"),S(` div[data-e2e="slideList"]{ /* 修复屏蔽后的视频宽度占据 */ padding: 0px !important; } - `);},shieldAuthorAvatar(){o.info("【屏蔽】作者头像"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="video-avatar"])');},shieldLikeButton(){o.info("【屏蔽】点赞"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="video-player-digg"])');},shieldCommentButton(){o.info("【屏蔽】评论"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="feed-comment-icon"])');},shieldCollectionButton(){o.info("【屏蔽】收藏"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="video-player-collect"])');},shieldSharenButton(){o.info("【屏蔽】分享"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="video-player-share"])');},shieldRelatedRecommendationsButton(){o.info("【屏蔽】看相关"),m.addBlockCSS('div.dy-tip-container:has(path[d="M14 8a8 8 0 00-8 8v4a8 8 0 008 8h8a8 8 0 008-8v-4a8 8 0 00-8-8h-8zm8.5 10.866a1 1 0 000-1.732l-6-3.464a1 1 0 00-1.5.866v6.928a1 1 0 001.5.866l6-3.464z"])','div.dy-tip-container:has(path[d=" M-4,-10 C-4,-10 4,-10 4,-10 C8.418000221252441,-10 12,-6.418000221252441 12,-2 C12,-2 12,2 12,2 C12,6.418000221252441 8.418000221252441,10 4,10 C4,10 -4,10 -4,10 C-8.418000221252441,10 -12,6.418000221252441 -12,2 C-12,2 -12,-2 -12,-2 C-12,-6.418000221252441 -8.418000221252441,-10 -4,-10z M4.5,0.8659999966621399 C5.166999816894531,0.48100000619888306 5.166999816894531,-0.48100000619888306 4.5,-0.8659999966621399 C4.5,-0.8659999966621399 -1.5,-4.329999923706055 -1.5,-4.329999923706055 C-2.1670000553131104,-4.715000152587891 -3,-4.234000205993652 -3,-3.4639999866485596 C-3,-3.4639999866485596 -3,3.4639999866485596 -3,3.4639999866485596 C-3,4.234000205993652 -2.1670000553131104,4.715000152587891 -1.5,4.329999923706055 C-1.5,4.329999923706055 4.5,0.8659999966621399 4.5,0.8659999966621399z"])');},shieldMoreButton(){o.info("【屏蔽】更多"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="video-play-more"])');},shieldBottomVideoToolBar(){o.info("【屏蔽】底部视频工具栏"),m.addBlockCSS("xg-controls.xgplayer-controls"),C(` + `);},shieldAuthorAvatar(){o.info("【屏蔽】作者头像"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="video-avatar"])');},shieldLikeButton(){o.info("【屏蔽】点赞"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="video-player-digg"])');},shieldCommentButton(){o.info("【屏蔽】评论"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="feed-comment-icon"])');},shieldCollectionButton(){o.info("【屏蔽】收藏"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="video-player-collect"])');},shieldSharenButton(){o.info("【屏蔽】分享"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="video-player-share"])');},shieldRelatedRecommendationsButton(){o.info("【屏蔽】看相关"),m.addBlockCSS('div.dy-tip-container:has(path[d="M14 8a8 8 0 00-8 8v4a8 8 0 008 8h8a8 8 0 008-8v-4a8 8 0 00-8-8h-8zm8.5 10.866a1 1 0 000-1.732l-6-3.464a1 1 0 00-1.5.866v6.928a1 1 0 001.5.866l6-3.464z"])','div.dy-tip-container:has(path[d=" M-4,-10 C-4,-10 4,-10 4,-10 C8.418000221252441,-10 12,-6.418000221252441 12,-2 C12,-2 12,2 12,2 C12,6.418000221252441 8.418000221252441,10 4,10 C4,10 -4,10 -4,10 C-8.418000221252441,10 -12,6.418000221252441 -12,2 C-12,2 -12,-2 -12,-2 C-12,-6.418000221252441 -8.418000221252441,-10 -4,-10z M4.5,0.8659999966621399 C5.166999816894531,0.48100000619888306 5.166999816894531,-0.48100000619888306 4.5,-0.8659999966621399 C4.5,-0.8659999966621399 -1.5,-4.329999923706055 -1.5,-4.329999923706055 C-2.1670000553131104,-4.715000152587891 -3,-4.234000205993652 -3,-3.4639999866485596 C-3,-3.4639999866485596 -3,3.4639999866485596 -3,3.4639999866485596 C-3,4.234000205993652 -2.1670000553131104,4.715000152587891 -1.5,4.329999923706055 C-1.5,4.329999923706055 4.5,0.8659999966621399 4.5,0.8659999966621399z"])');},shieldMoreButton(){o.info("【屏蔽】更多"),m.addBlockCSS('div.dy-tip-container:has([data-e2e="video-play-more"])');},shieldBottomVideoToolBar(){o.info("【屏蔽】底部视频工具栏"),m.addBlockCSS("xg-controls.xgplayer-controls"),S(` #sliderVideo[data-e2e="feed-active-video"] div:has( > div > #video-info-wrap), div:has( > div > pace-island > #video-info-wrap ), xg-video-container.xg-video-container{ bottom: 0 !important; } - `);},shieldBottomVideoToolbarDanmuContainer(){o.info("【屏蔽】底部视频工具栏的弹幕容器"),m.addBlockCSS('xg-controls xg-inner-controls .danmakuContainer[data-e2e="danmaku-container"]');}},Oe={init(){l.execMenuOnce("dy-video-shieldUserCommentToolBar",()=>{this.shieldUserCommentToolBar();}),l.execMenuOnce("dy-video-shieldUserCommentEveryOneAllSearch",()=>{this.shieldUserCommentEveryOneAllSearch();});},shieldUserCommentToolBar(){o.info("【屏蔽】评论工具栏"),m.addBlockCSS(".comment-input-container");},shieldUserCommentEveryOneAllSearch(){o.info("【屏蔽】大家都在搜"),m.addBlockCSS(".comment-header-with-search");}},R={init(){xe.init(),w.init(),Oe.init(),l.execMenu("shieldVideo",()=>{j.init();}),l.execMenu("changeCommentToBottom",()=>{R.changeCommentToBottom();}),l.execMenu("fullScreen",()=>{this.fullScreen();}),l.execMenu("parseVideo",()=>{R.parseVideo();}),l.execMenu("autoEnterElementFullScreen",()=>{this.autoEnterElementFullScreen();}),l.execMenu("dy-video-doubleClickEnterElementFullScreen",()=>{this.doubleClickEnterElementFullScreen();}),p.ready(()=>{R.chooseVideoDefinition(l.getValue("chooseVideoDefinition")),l.execMenu("mobileMode",()=>{this.mobileMode();});});},fullScreen(){o.info("全屏"),m.addBlockCSS(".slider-video .positionBox","#video-info-wrap","xg-controls.xgplayer-controls"),xe.shieldSearchFloatingBar(),C(` + `);},shieldBottomVideoToolbarDanmuContainer(){o.info("【屏蔽】底部视频工具栏的弹幕容器"),m.addBlockCSS('xg-controls xg-inner-controls .danmakuContainer[data-e2e="danmaku-container"]');}},Oe={init(){r.execMenuOnce("dy-video-shieldUserCommentToolBar",()=>{this.shieldUserCommentToolBar();}),r.execMenuOnce("dy-video-shieldUserCommentEveryOneAllSearch",()=>{this.shieldUserCommentEveryOneAllSearch();});},shieldUserCommentToolBar(){o.info("【屏蔽】评论工具栏"),m.addBlockCSS(".comment-input-container");},shieldUserCommentEveryOneAllSearch(){o.info("【屏蔽】大家都在搜"),m.addBlockCSS(".comment-header-with-search");}},R={init(){xe.init(),w.init(),Oe.init(),r.execMenu("shieldVideo",()=>{j.init();}),r.execMenu("changeCommentToBottom",()=>{R.changeCommentToBottom();}),r.execMenu("fullScreen",()=>{this.fullScreen();}),r.execMenu("parseVideo",()=>{R.parseVideo();}),r.execMenu("autoEnterElementFullScreen",()=>{this.autoEnterElementFullScreen();}),r.execMenu("dy-video-doubleClickEnterElementFullScreen",()=>{this.doubleClickEnterElementFullScreen();}),r.execMenu("dy-video-bgColor-enable",()=>{r.execMenuOnce("dy-video-changeBackgroundColor",e=>{this.changeBackgroundColor(e);});}),f.ready(()=>{R.chooseVideoDefinition(r.getValue("chooseVideoDefinition")),r.execMenu("mobileMode",()=>{this.mobileMode();});});},fullScreen(){o.info("全屏"),m.addBlockCSS(".slider-video .positionBox","#video-info-wrap","xg-controls.xgplayer-controls"),xe.shieldSearchFloatingBar(),S(` /* 视频全屏 */ xg-video-container.xg-video-container{ bottom: 0px !important; } - `);},autoEnterElementFullScreen(){c.waitNode('xg-icon[data-e2e="xgplayer-page-full-screen"] .xgplayer-icon:has([d="M9.75 8.5a2 2 0 00-2 2v11a2 2 0 002 2h12.5a2 2 0 002-2v-11a2 2 0 00-2-2H9.75zM15 11.25h-3.75a1 1 0 00-1 1V16h2v-2.75H15v-2zm5.75 9.5H17v-2h2.75V16h2v3.75a1 1 0 01-1 1z"])').then(e=>{o.success("自动进入网页全屏"),e.click();});},doubleClickEnterElementFullScreen(){let e=!1;o.info("注册双击进入网页全屏事件"),[".newVideoPlayer","#sliderVideo"].forEach(t=>{p.on(document,"click",t,()=>{e?(e=!1,R.autoEnterElementFullScreen()):(e=!0,setTimeout(()=>{e=!1;},250));});});},changeCommentToBottom(){o.info("评论区修改为底部");let e="data-vertical-screen";function i(){m.isVerticalScreen()?(o.success("自动判断: 竖屏"),document.documentElement.setAttribute(e,"true")):(o.success("自动判断: 横屏"),document.documentElement.removeAttribute(e));}i(),C(` + `);},autoEnterElementFullScreen(){c.waitNode('xg-icon[data-e2e="xgplayer-page-full-screen"] .xgplayer-icon:has([d="M9.75 8.5a2 2 0 00-2 2v11a2 2 0 002 2h12.5a2 2 0 002-2v-11a2 2 0 00-2-2H9.75zM15 11.25h-3.75a1 1 0 00-1 1V16h2v-2.75H15v-2zm5.75 9.5H17v-2h2.75V16h2v3.75a1 1 0 01-1 1z"])').then(e=>{o.success("自动进入网页全屏"),e.click();});},doubleClickEnterElementFullScreen(){let e=!1;o.info("注册双击进入网页全屏事件"),[".newVideoPlayer","#sliderVideo"].forEach(t=>{f.on(document,"click",t,()=>{e?(e=!1,R.autoEnterElementFullScreen()):(e=!0,setTimeout(()=>{e=!1;},250));});});},changeCommentToBottom(){o.info("评论区修改为底部");let e="data-vertical-screen";function i(){m.isVerticalScreen()?(o.success("自动判断: 竖屏"),document.documentElement.setAttribute(e,"true")):(o.success("自动判断: 横屏"),document.documentElement.removeAttribute(e));}i(),S(` html[${e}] #sliderVideo[data-e2e="feed-video"] #videoSideBar #relatedVideoCard, html[${e}] #sliderVideo[data-e2e="feed-video"] #videoSideCard #relatedVideoCard{ display: none !important; @@ -214,7 +224,7 @@ ul[data-e2e="scroll-list"] {\r transition: height .15s linear !important; position: absolute; } - `),l.execMenuOnce("douyin-video-autoCheckChangeCommentToBottom",()=>{p.on(window,"resize",i);});},chooseVideoDefinition(e=0){o.info("选择视频清晰度: "+e);let i="MANUAL_SWITCH",n=[{clarityReal:["normal_1080_0","normal_720_0","low_720_0","normal_540_0","low_540_0","adapt_low_540_0","lower_540_0"],done:1,gearClarity:"5",gearName:"高清",gearType:1,qualityType:1},{clarityReal:["normal_1080_0","low_540_0","low_720_0","normal_720_0","normal_540_0","adapt_low_540_0","lower_540_0","adapt_lowest_720_1","adapt_540_1","adapt_lower_540_1"],done:1,gearClarity:"4",gearName:"清晰",gearType:2,qualityType:15},{clarityReal:["normal_1080_0","low_540_0","low_720_0","normal_720_0","normal_540_0","adapt_low_540_0","lower_540_0","adapt_lowest_720_1","adapt_540_1","adapt_lower_540_1"],done:1,gearClarity:"3",gearName:"流畅",gearType:3,qualityType:28},{clarityReal:["normal_1080_0","low_540_0","low_720_0","normal_720_0","normal_540_0","adapt_low_540_0","lower_540_0","adapt_lowest_720_1","adapt_540_1","adapt_lower_540_1"],done:1,gearClarity:"2",gearName:"极速",gearType:4,qualityType:21},{clarityReal:["normal_1080_0","low_540_0","low_720_0","normal_720_0","normal_540_0","adapt_low_540_0","lower_540_0","adapt_lowest_720_1","adapt_540_1","adapt_lower_540_1"],done:1,gearClarity:"0",gearName:"智能",gearType:0}].find(a=>a.gearType===e);function r(a){M.sessionStorage.setItem(i,a);}if(n){let a=0,h=JSON.stringify(n),d=setInterval(()=>{r(h),a++,a>=20&&clearInterval(d);},500);o.success("设置当前视频的清晰度: "+e);}else o.error("该清晰度不存在: "+e);},chooseVideoRate(e="1"){let i="player_playbackratio";function t(n="1"){M.sessionStorage.setItem(i,n),document.querySelectorAll("xg-icon.xgplayer-playback-setting").forEach(r=>{var h,d,u,f;let a=c.getReactObj(r).reactContainer;(f=(u=(d=(h=a==null?void 0:a.memoizedState)==null?void 0:h.element)==null?void 0:d.props)==null?void 0:u.xgCase)==null||f.updatePlayBackRatio();});}t(e);},parseVideo(){o.info("让下载按钮变成解析视频");function e(i){let t="";i.forEach(n=>{t+=` + `),r.execMenuOnce("douyin-video-autoCheckChangeCommentToBottom",()=>{f.on(window,"resize",i);});},chooseVideoDefinition(e=0){o.info("选择视频清晰度: "+e);let i="MANUAL_SWITCH",n=[{clarityReal:["normal_1080_0","normal_720_0","low_720_0","normal_540_0","low_540_0","adapt_low_540_0","lower_540_0"],done:1,gearClarity:"5",gearName:"高清",gearType:1,qualityType:1},{clarityReal:["normal_1080_0","low_540_0","low_720_0","normal_720_0","normal_540_0","adapt_low_540_0","lower_540_0","adapt_lowest_720_1","adapt_540_1","adapt_lower_540_1"],done:1,gearClarity:"4",gearName:"清晰",gearType:2,qualityType:15},{clarityReal:["normal_1080_0","low_540_0","low_720_0","normal_720_0","normal_540_0","adapt_low_540_0","lower_540_0","adapt_lowest_720_1","adapt_540_1","adapt_lower_540_1"],done:1,gearClarity:"3",gearName:"流畅",gearType:3,qualityType:28},{clarityReal:["normal_1080_0","low_540_0","low_720_0","normal_720_0","normal_540_0","adapt_low_540_0","lower_540_0","adapt_lowest_720_1","adapt_540_1","adapt_lower_540_1"],done:1,gearClarity:"2",gearName:"极速",gearType:4,qualityType:21},{clarityReal:["normal_1080_0","low_540_0","low_720_0","normal_720_0","normal_540_0","adapt_low_540_0","lower_540_0","adapt_lowest_720_1","adapt_540_1","adapt_lower_540_1"],done:1,gearClarity:"0",gearName:"智能",gearType:0}].find(l=>l.gearType===e);function a(l){M.sessionStorage.setItem(i,l);}if(n){let l=0,h=JSON.stringify(n),d=setInterval(()=>{a(h),l++,l>=20&&clearInterval(d);},500);o.success("设置当前视频的清晰度: "+e);}else o.error("该清晰度不存在: "+e);},chooseVideoRate(e="1"){let i="player_playbackratio";function t(n="1"){M.sessionStorage.setItem(i,n),document.querySelectorAll("xg-icon.xgplayer-playback-setting").forEach(a=>{var h,d,u,p;let l=c.getReactObj(a).reactContainer;(p=(u=(d=(h=l==null?void 0:l.memoizedState)==null?void 0:h.element)==null?void 0:d.props)==null?void 0:u.xgCase)==null||p.updatePlayBackRatio();});}t(e);},parseVideo(){o.info("让下载按钮变成解析视频");function e(i){let t="";i.forEach(n=>{t+=` `;}),t=``,W.alert({title:{text:"视频解析",position:"center"},content:{text:t,html:!0},mask:{enable:!0,clickEvent:{toClose:!0}},width:"50dvw",height:"50dvh",drag:!0,dragLimit:!0,style:` .douyin-video-link-container{ @@ -229,37 +239,55 @@ ul[data-e2e="scroll-list"] {\r .douyin-video-link-item a{ } - `});}p.on(document,"click",'div[data-e2e="video-share-container"] div[data-inuser="false"] button + div',function(i){var r;let t=i.target,n=(r=c.getReactObj(t.parentElement))==null?void 0:r.reactFiber;if(!n){S.error("获取rectFiber属性失败");return}try{let a=[],h=n.return.memoizedProps.awemeInfo.video.playAddr,d=n.return.memoizedProps.awemeInfo.video.playAddrH265;if(h!=null&&Array.isArray(h)&&(a=a.concat(h)),d!=null&&Array.isArray(d)&&(a=a.concat(d)),!a.length){S.error("未获取到视频的有效链接信息");return}let u=a.map(f=>f.src);e(u);}catch{S.error("解析视频失败");}},{capture:!0});},mobileMode(){o.info("启用手机模式"),Ve.initialScale(),m.addBlockCSS("img#douyin-temp-sidebar"),C($e),b.isSearch()&&l.onceExec("douyin-search-mobileMode",()=>{Be.mobileMode();});}},w={shortCut:new Le("video-short-cut"),$data:{rateMap:["0.75","1","1.25","1.5","1.75","2","3"]},init(){this.shortCut.initGlobalKeyboardListener(this.getShortCutMap());},getShortCutMap(){return {"dy-video-rate-low":{callback(){o.info("调用倍速 => 小");let e=M.sessionStorage.getItem("player_playbackratio")??"1",i=w.$data.rateMap.findIndex(n=>n===e);if(i===0){o.warn("已是最小倍速: "+e);return}let t=w.$data.rateMap[i-1];o.info("设置倍速: "+t),R.chooseVideoRate(t);}},"dy-video-rate-up":{callback(){o.info("调用倍速 => 大");let e=M.sessionStorage.getItem("player_playbackratio")??"1",i=w.$data.rateMap.findIndex(n=>n===e);if(i===w.$data.rateMap.length-1){o.warn("已是最大倍速: "+e);return}let t=w.$data.rateMap[i+1];o.info("设置倍速: "+t),R.chooseVideoRate(t);}}}}},Fe={id:"panel-config-video",title:"视频",forms:[{text:"功能",type:"forms",forms:[s("沉浸模式","fullScreen",!1,void 0,"移除右侧工具栏、底部信息栏等"),s("手机模式","mobileMode",!1,void 0,"放大各种文字和图标")]},{text:"视频",type:"forms",forms:[H("清晰度","chooseVideoDefinition",1,[{text:"智能",value:0},{text:"极速",value:4},{text:"流畅",value:3},{text:"清晰",value:2},{text:"高清",value:1}],void 0,"自行选择清晰度"),s("视频解析","parseVideo",!0,void 0,"分享->下载(灰色的也可点击)"),s("评论区移到中间","changeCommentToBottom",!0,void 0,"修改评论区为中间弹出而非右侧区域"),s("↑自适应评论区位置","douyin-video-autoCheckChangeCommentToBottom",!0,void 0,"根据window.screen.orientation.type自动判断是否开启【评论区移到中间】"),s("自动进入网页全屏","autoEnterElementFullScreen",!1,void 0,"网页加载完毕后自动点击网页全屏按钮进入全屏"),s("双击进入网页全屏","dy-video-doubleClickEnterElementFullScreen",!1,void 0,"双击视频自动进入网页全屏,检测间隔250ms")]},{text:"快捷键",type:"forms",forms:[be("倍速 -> 小","视频倍速变小",()=>w.shortCut.getShowText("dy-video-rate-low","暂无快捷键"),"keyboard",!1,!1,"default",e=>{var n;let t=(n=e.target.closest(".pops-panel-button"))==null?void 0:n.querySelector("span");w.shortCut.inputShortCut("dy-video-rate-low","暂无快捷键",r=>{t.innerHTML=r;});}),be("倍速 -> 大","视频倍速变大",()=>w.shortCut.getShowText("dy-video-rate-up","暂无快捷键"),"keyboard",!1,!1,"default",e=>{var n;let t=(n=e.target.closest(".pops-panel-button"))==null?void 0:n.querySelector("span");w.shortCut.inputShortCut("dy-video-rate-up","暂无快捷键",r=>{t.innerHTML=r;});})]},{text:"视频区域内-屏蔽",type:"forms",forms:[s("【屏蔽】右侧的展开评论按钮","shieldRightExpandCommentButton",!0,void 0,"屏蔽元素"),s("【屏蔽】搜索悬浮栏","shieldSearchFloatingBar",!0,void 0,"屏蔽元素,一般出现在左上角"),s("【屏蔽】网页全屏关闭按钮","shieldCloseFullScreenButton",!0,void 0,"屏蔽元素,一般开启网页全屏后出现在左上角"),s("【屏蔽】切换播放","shieldPlaySwitchButton",!1,void 0,"屏蔽元素,在右侧作者头像上方"),s("【屏蔽】作者头像","shieldAuthorAvatar",!1,void 0,"屏蔽元素"),s("【屏蔽】点赞","shieldLikeButton",!1,void 0,"屏蔽元素"),s("【屏蔽】评论","shieldCommentButton",!1,void 0,"屏蔽元素"),s("【屏蔽】收藏","shieldCollectionButton",!1,void 0,"屏蔽元素"),s("【屏蔽】分享","shieldSharenButton",!1,void 0,"屏蔽元素"),s("【屏蔽】看相关","shieldRelatedRecommendationsButton",!1,void 0,"屏蔽元素"),s("【屏蔽】更多","shieldMoreButton",!1,void 0,"...按钮,屏蔽元素"),s("【屏蔽】底部视频工具栏","shieldBottomVideoToolBar",!1,void 0,"屏蔽元素"),s("【屏蔽】弹幕容器","shieldBottomVideoToolbarDanmuContainer",!1,void 0,"屏蔽元素(不包括屏蔽弹幕)")]},{text:"评论区域内-屏蔽",type:"forms",forms:[s("【屏蔽】评论工具栏","dy-video-shieldUserCommentToolBar",!1,void 0,"屏蔽元素"),s("【屏蔽】大家都在搜","dy-video-shieldUserCommentEveryOneAllSearch",!1,void 0,"在评论区的顶部出现")]},{text:"视频过滤规则(可正则)",type:"forms",forms:[s("启用","shieldVideo",!0,void 0,"开启后可启用下面的屏蔽功能"),s("【屏蔽】直播","shieldVideo-live",!0,void 0,"过滤掉直播"),s("【屏蔽】广告","shieldVideo-ads",!0,void 0,"过滤掉广告"),{type:"own",getLiElementCallBack(e){let i=p.createElement("div",{className:"pops-panel-textarea",innerHTML:''},{style:"width: 100%;"}),t=i.querySelector("textarea");return t.value=j.get(),p.on(t,["input","propertychange"],c.debounce(function(){j.set(t.value);},200)),e.appendChild(i),e}}]}]},Ne={id:"panel-config-search",title:"搜索",forms:[{text:"屏蔽",type:"forms",forms:[s("【屏蔽】相关搜索","douyin-search-shieldReleatedSearches",!1,void 0,"屏蔽右边的相关搜索")]}]},ze={id:"m-panel-config-share-user",title:"主页",headerTitle:"/share/user
主页",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("视频合集","m-dy-share-user-coverPlayletList",!0,void 0,"正确跳转视频合集页面"),s("视频列表","m-dy-share-user-coverPostListContainer",!0,void 0,"正确跳转视频页面")]}]},Ge={id:"m-panel-config-share-video",title:"视频",headerTitle:"/share/video
视频",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("全局点击","m-dy-share-video-coverGlobalClick",!0,void 0,"阻止跳转至下载页")]}]},Ye={id:"m-panel-config-share-note",title:"笔记",headerTitle:"/share/note
笔记",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("精彩图文","m-dy-share-note-coverExcitingGraphicsAndText",!0,void 0,"正确跳转笔记页面"),s("用户","m-dy-share-note-coverUser",!0,void 0,"正确跳转用户主页"),s("话题","m-dy-share-note-coverHashTag",!0,void 0,"正确跳转相关话题"),s("音乐","m-dy-share-note-coverMusic",!0,void 0,"正确跳转相关音乐"),s("相关推荐","m-dy-share-note-coverRecommend",!0,void 0,"正确跳转笔记页面")]},{text:"屏蔽元素",type:"forms",forms:[s("【屏蔽】评论","m-dy-share-note-blockComment",!1,void 0,"屏蔽元素"),s("【屏蔽】相关推荐","m-dy-share-note-blockRecommend",!1,void 0,"屏蔽元素"),s("【屏蔽】底部工具栏","m-dy-share-note-blockFooterToobar",!1,void 0,"屏蔽元素")]}]},He={id:"m-panel-config-share-challenge",title:"话题",headerTitle:"/share/challenge
话题",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("顶部区域","m-dy-share-challenge-coverTopJump",!0,void 0,"阻止跳转至下载页面"),s("视频卡片","m-dy-share-challenge-coverVideoCard",!0,void 0,"正确跳转视频页面")]}]},qe={id:"m-panel-config-share-music",title:"音乐",headerTitle:"/share/music
音乐",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("视频卡片","m-dy-share-music-coverVideoCard",!0,void 0,"正确跳转视频页面")]}]},x={data:null,oneSuccessExecMenu:null,onceExec:null,listenData:null},l={$data:{get data(){return x.data==null&&(x.data=new c.Dictionary),x.data},get oneSuccessExecMenu(){return x.oneSuccessExecMenu==null&&(x.oneSuccessExecMenu=new c.Dictionary),x.oneSuccessExecMenu},get onceExec(){return x.onceExec==null&&(x.onceExec=new c.Dictionary),x.onceExec},get scriptName(){return Y},key:I,attributeKeyName:O,attributeDefaultValueName:F},$listener:{get listenData(){return x.listenData==null&&(x.listenData=new c.Dictionary),x.listenData}},init(){this.initPanelDefaultValue(),this.initExtensionsMenu();},initExtensionsMenu(){M.top===M.self&&Qe.add([{key:"show_pops_panel_setting",text:"⚙ 设置",autoReload:!1,isStoreValue:!1,showText(e){return e},callback:()=>{this.showPanel();}},{key:"show_pops_m_panel_setting",text:"⚙ 移动端设置",autoReload:!1,isStoreValue:!1,showText(e){return e},callback:()=>{this.showMPanel();}}]);},initPanelDefaultValue(){let e=this;function i(n){if(!n.attributes)return;let r=n.attributes[O],a=n.attributes[F];if(r==null){console.warn("请先配置键",n);return}e.$data.data.has(r)&&console.warn("请检查该key(已存在): "+r),e.$data.data.set(r,a);}let t=this.getPanelContentConfig().concat(this.getMPanelContentConfig());for(let n=0;n(o.error(["拦截器-请求错误",e]),e.type==="onabort"?S.warning("请求取消"):e.type==="onerror"?S.error("请求异常"):e.type==="ontimeout"?S.error("请求超时"):S.error("其它错误"),e));const C=c.addStyle,Je={init(){l.execMenu("shieldClientTip",()=>{this.shieldClientTip();}),l.execMenu("shieldFillingBricksAndStones",()=>{this.shieldFillingBricksAndStones();}),l.execMenu("shieldClient",()=>{this.shieldClient();}),l.execMenu("shieldQuickAccess",()=>{this.shieldQuickAccess();}),l.execMenu("shieldNotifitation",()=>{this.shieldNotifitation();}),l.execMenu("shieldPrivateMessage",()=>{this.shieldPrivateMessage();}),l.execMenu("shieldSubmission",()=>{this.shieldSubmission();}),l.execMenu("shieldWallpaper",()=>{this.shieldWallpaper();}),l.execMenu("shieldLeftNavigator",()=>{this.shieldLeftNavigator();}),l.execMenu("shieldTopNavigator",()=>{this.shieldTopNavigator();}),l.execMenuOnce("shieldBottomQuestionButton",()=>{this.shieldBottomQuestionButton();});},shieldFillingBricksAndStones(){o.info("【屏蔽】充砖石"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:not([data-click]):has(div[data-e2e="something-button"]) > :has(path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])','#douyin-header pace-island[id^="island"] > div[class]:not([data-click]):has(div[data-e2e="something-button"]) > :has(path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])'),b.isSearch()&&(o.info("搜索-【屏蔽】充砖石"),m.addBlockCSS('div:has(>div>div>div>div[data-e2e="something-button"] path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])'));},shieldClient(){o.info("【屏蔽】客户端"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) .dy-tip-container','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) .dy-tip-container:has(a)'),b.isSearch()&&(o.info("搜索-【屏蔽】客户端"),m.addBlockCSS('div:has(> div[data-e2e="something-button"] path[d="M18.404 19.018h-12v-1.5h12v1.5zM11.654 13.457v-8.19h1.5v8.19l3.22-3.22 1.06 1.061-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5 1.06-1.06 3.22 3.22z"])'));},shieldQuickAccess(){o.info("【屏蔽】快捷访问"),m.addBlockCSS('header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(.quick-access-nav-icon)'),b.isSearch()&&(o.info("搜索-【屏蔽】快捷访问"),m.addBlockCSS("div:has(>div>div>.quick-access-nav-icon)"));},shieldNotifitation(){o.info("【屏蔽】通知"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(path[d="M9.905 19.407h4.5v-1.5h-4.5v1.5z"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(path[d="M9.905 19.407h4.5v-1.5h-4.5v1.5z"])'),b.isSearch()&&(o.info("搜索-【屏蔽】通知"),m.addBlockCSS('ul:has( div>div[data-e2e="notice-entry"] )'));},shieldPrivateMessage(){o.info("【屏蔽】私信"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > ul:has(div[data-e2e="im-entry"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > ul:has(div[data-e2e="im-entry"])'),b.isSearch()&&(o.info("搜索-【屏蔽】私信"),m.addBlockCSS('ul:has( div>div[data-e2e="im-entry"] )'));},shieldSubmission(){o.info("【屏蔽】投稿"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(ul[data-e2e="cooperate-list"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(ul[data-e2e="cooperate-list"])'),b.isSearch()&&(o.info("搜索-【屏蔽】投稿"),m.addBlockCSS('div:has(>div >div>div[data-e2e="something-button"] path[d="M11.349 5.17h-.033c-1.068 0-1.915 0-2.598.054-.698.056-1.29.172-1.832.441a4.75 4.75 0 00-2.14 2.14c-.269.542-.386 1.134-.441 1.832-.055.683-.055 1.53-.055 2.599v.064c0 1.069 0 1.916.055 2.599.055.698.172 1.29.441 1.831a4.75 4.75 0 002.14 2.14c.542.27 1.134.386 1.832.442.683.055 1.53.055 2.598.055H12.684c1.068 0 1.915 0 2.598-.055.698-.056 1.29-.172 1.832-.442a4.75 4.75 0 002.14-2.14c.269-.541.386-1.133.441-1.831.055-.683.055-1.53.055-2.599v-.064c0-1.069 0-1.916-.055-2.599-.055-.698-.172-1.29-.441-1.832a4.75 4.75 0 00-2.14-2.14c-.542-.269-1.134-.385-1.832-.441-.683-.055-1.53-.055-2.598-.055h-1.335zM7.554 7.008c.299-.149.676-.241 1.284-.29.616-.05 1.403-.05 2.51-.05h1.303c1.108 0 1.895 0 2.511.05.608.049.985.141 1.284.29a3.25 3.25 0 011.464 1.464c.15.3.241.676.29 1.284.05.616.05 1.403.05 2.51 0 1.109 0 1.896-.05 2.512-.049.608-.14.985-.29 1.284a3.25 3.25 0 01-1.464 1.464c-.299.149-.676.241-1.284.29-.616.05-1.403.05-2.51.05h-1.303c-1.108 0-1.895 0-2.511-.05-.608-.049-.985-.141-1.284-.29a3.25 3.25 0 01-1.464-1.464c-.15-.3-.242-.676-.29-1.284-.05-.616-.05-1.403-.05-2.511s0-1.895.05-2.511c.048-.608.14-.985.29-1.284a3.25 3.25 0 011.464-1.464zm3.696 8.259v-2.25H9v-1.5h2.25v-2.25h1.5v2.25H15v1.5h-2.25v2.25h-1.5z"])'));},shieldClientTip(){o.info("【屏蔽】客户端提示"),m.addBlockCSS('ul li div[data-e2e="something-button"] + div div:has(>a[download*="douyin-downloader"])','#douyin-header pace-island[id^="island_"] ul > div:has(>a[class][download])','#douyin-header pace-island[id^="island_"] ul[class] li div[data-e2e="im-entry"] div>div div div:has(a[download][href])','#douyin-header header div[id^="douyin-header-menu"] pace-island[id^="island_"] .dy-tip-container div:has(+ #wallpaper-modal)');},shieldWallpaper(){o.info("【屏蔽】壁纸"),m.addBlockCSS('#douyin-header header div[id^="douyin-header-menu"] pace-island[id^="island_"] .dy-tip-container:has(span.semi-icon)');},shieldLeftNavigator(){o.info("【屏蔽】左侧导航栏"),m.addBlockCSS("#douyin-navigation"),C(` + `});}f.on(document,"click",'div[data-e2e="video-share-container"] div[data-inuser="false"] button + div',function(i){var a;let t=i.target,n=(a=c.getReactObj(t.parentElement))==null?void 0:a.reactFiber;if(!n){C.error("获取rectFiber属性失败");return}try{let l=[],h=n.return.memoizedProps.awemeInfo.video.playAddr,d=n.return.memoizedProps.awemeInfo.video.playAddrH265;if(h!=null&&Array.isArray(h)&&(l=l.concat(h)),d!=null&&Array.isArray(d)&&(l=l.concat(d)),!l.length){C.error("未获取到视频的有效链接信息");return}let u=l.map(p=>p.src);e(u);}catch{C.error("解析视频失败");}},{capture:!0});},mobileMode(){o.info("启用手机模式"),Ve.initialScale(),m.addBlockCSS("img#douyin-temp-sidebar"),S(Ue),b.isSearch()&&r.onceExec("douyin-search-mobileMode",()=>{Be.mobileMode();});},changeBackgroundColor(e){o.info("修改视频背景颜色"),S(` + #sliderVideo > div{ + background: ${e}; + } + `);}},w={shortCut:new Pe("video-short-cut"),$data:{rateMap:["0.75","1","1.25","1.5","1.75","2","3"]},init(){this.shortCut.initGlobalKeyboardListener(this.getShortCutMap());},getShortCutMap(){return {"dy-video-rate-low":{callback(){o.info("调用倍速 => 小");let e=M.sessionStorage.getItem("player_playbackratio")??"1",i=w.$data.rateMap.findIndex(n=>n===e);if(i===0){o.warn("已是最小倍速: "+e);return}let t=w.$data.rateMap[i-1];o.info("设置倍速: "+t),R.chooseVideoRate(t);}},"dy-video-rate-up":{callback(){o.info("调用倍速 => 大");let e=M.sessionStorage.getItem("player_playbackratio")??"1",i=w.$data.rateMap.findIndex(n=>n===e);if(i===w.$data.rateMap.length-1){o.warn("已是最大倍速: "+e);return}let t=w.$data.rateMap[i+1];o.info("设置倍速: "+t),R.chooseVideoRate(t);}}}}},Fe={id:"panel-config-video",title:"视频",forms:[{text:"功能",type:"forms",forms:[s("沉浸模式","fullScreen",!1,void 0,"移除右侧工具栏、底部信息栏等"),s("手机模式","mobileMode",!1,void 0,"放大各种文字和图标")]},{text:"视频",type:"forms",forms:[Y("清晰度","chooseVideoDefinition",1,[{text:"智能",value:0},{text:"极速",value:4},{text:"流畅",value:3},{text:"清晰",value:2},{text:"高清",value:1}],void 0,"自行选择清晰度"),s("视频解析","parseVideo",!0,void 0,"分享->下载(灰色的也可点击)"),s("评论区移到中间","changeCommentToBottom",!0,void 0,"修改评论区为中间弹出而非右侧区域"),s("↑自适应评论区位置","douyin-video-autoCheckChangeCommentToBottom",!0,void 0,"根据window.screen.orientation.type自动判断是否开启【评论区移到中间】"),s("自动进入网页全屏","autoEnterElementFullScreen",!1,void 0,"网页加载完毕后自动点击网页全屏按钮进入全屏"),s("双击进入网页全屏","dy-video-doubleClickEnterElementFullScreen",!1,void 0,"双击视频自动进入网页全屏,检测间隔250ms")]},{text:"视频区域背景色",type:"forms",forms:[s("启用","dy-video-bgColor-enable",!1,void 0,"自定义视频背景色"),{type:"own",attributes:{"data-key":"dy-video-changeBackgroundColor","data-default-value":"#000000"},getLiElementCallBack(e){let i=f.createElement("div",{className:"pops-panel-item-left-text",innerHTML:` +

视频背景颜色

+

自定义视频背景颜色,包括评论区

+ `}),t=f.createElement("div",{className:"pops-panel-item-right",innerHTML:` + + `}),n=t.querySelector(".pops-color-choose");n.value=r.getValue("dy-video-changeBackgroundColor");let a=f.createElement("style");return f.append(document.head,a),f.on(n,["input","propertychange"],l=>{o.info("选择颜色:"+n.value),a.innerHTML=` + #sliderVideo > div{ + background: ${n.value}; + } + `,r.setValue("dy-video-changeBackgroundColor",n.value);}),e.appendChild(i),e.appendChild(t),e}}]},{text:"快捷键",type:"forms",forms:[be("倍速 -> 小","视频倍速变小",()=>w.shortCut.getShowText("dy-video-rate-low","暂无快捷键"),"keyboard",!1,!1,"default",e=>{var n;let t=(n=e.target.closest(".pops-panel-button"))==null?void 0:n.querySelector("span");w.shortCut.inputShortCut("dy-video-rate-low","暂无快捷键",a=>{t.innerHTML=a;});}),be("倍速 -> 大","视频倍速变大",()=>w.shortCut.getShowText("dy-video-rate-up","暂无快捷键"),"keyboard",!1,!1,"default",e=>{var n;let t=(n=e.target.closest(".pops-panel-button"))==null?void 0:n.querySelector("span");w.shortCut.inputShortCut("dy-video-rate-up","暂无快捷键",a=>{t.innerHTML=a;});})]},{text:"视频区域内-屏蔽",type:"forms",forms:[s("【屏蔽】右侧的展开评论按钮","shieldRightExpandCommentButton",!0,void 0,"屏蔽元素"),s("【屏蔽】搜索悬浮栏","shieldSearchFloatingBar",!0,void 0,"屏蔽元素,一般出现在左上角"),s("【屏蔽】网页全屏关闭按钮","shieldCloseFullScreenButton",!0,void 0,"屏蔽元素,一般开启网页全屏后出现在左上角"),s("【屏蔽】切换播放","shieldPlaySwitchButton",!1,void 0,"屏蔽元素,在右侧作者头像上方"),s("【屏蔽】作者头像","shieldAuthorAvatar",!1,void 0,"屏蔽元素"),s("【屏蔽】点赞","shieldLikeButton",!1,void 0,"屏蔽元素"),s("【屏蔽】评论","shieldCommentButton",!1,void 0,"屏蔽元素"),s("【屏蔽】收藏","shieldCollectionButton",!1,void 0,"屏蔽元素"),s("【屏蔽】分享","shieldSharenButton",!1,void 0,"屏蔽元素"),s("【屏蔽】看相关","shieldRelatedRecommendationsButton",!1,void 0,"屏蔽元素"),s("【屏蔽】更多","shieldMoreButton",!1,void 0,"...按钮,屏蔽元素"),s("【屏蔽】底部视频工具栏","shieldBottomVideoToolBar",!1,void 0,"屏蔽元素"),s("【屏蔽】弹幕容器","shieldBottomVideoToolbarDanmuContainer",!1,void 0,"屏蔽元素(不包括屏蔽弹幕)")]},{text:"评论区域内-屏蔽",type:"forms",forms:[s("【屏蔽】评论工具栏","dy-video-shieldUserCommentToolBar",!1,void 0,"屏蔽元素"),s("【屏蔽】大家都在搜","dy-video-shieldUserCommentEveryOneAllSearch",!1,void 0,"在评论区的顶部出现")]},{text:"视频过滤规则(可正则)",type:"forms",forms:[s("启用","shieldVideo",!0,void 0,"开启后可启用下面的屏蔽功能"),s("【屏蔽】直播","shieldVideo-live",!0,void 0,"过滤掉直播"),s("【屏蔽】广告","shieldVideo-ads",!0,void 0,"过滤掉广告"),{type:"own",getLiElementCallBack(e){let i=f.createElement("div",{className:"pops-panel-textarea",innerHTML:''},{style:"width: 100%;"}),t=i.querySelector("textarea");return t.value=j.get(),f.on(t,["input","propertychange"],c.debounce(function(){j.set(t.value);},200)),e.appendChild(i),e}}]}]},Ne={id:"panel-config-search",title:"搜索",forms:[{text:"屏蔽",type:"forms",forms:[s("【屏蔽】相关搜索","douyin-search-shieldReleatedSearches",!1,void 0,"屏蔽右边的相关搜索")]}]},ze={id:"m-panel-config-share-user",title:"主页",headerTitle:"/share/user
主页",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("视频合集","m-dy-share-user-coverPlayletList",!0,void 0,"正确跳转视频合集页面"),s("视频列表","m-dy-share-user-coverPostListContainer",!0,void 0,"正确跳转视频页面")]}]},He={id:"m-panel-config-share-video",title:"视频",headerTitle:"/share/video
视频",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("全局点击","m-dy-share-video-coverGlobalClick",!0,void 0,"阻止跳转至下载页")]}]},Ge={id:"m-panel-config-share-note",title:"笔记",headerTitle:"/share/note
笔记",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("精彩图文","m-dy-share-note-coverExcitingGraphicsAndText",!0,void 0,"正确跳转笔记页面"),s("用户","m-dy-share-note-coverUser",!0,void 0,"正确跳转用户主页"),s("话题","m-dy-share-note-coverHashTag",!0,void 0,"正确跳转相关话题"),s("音乐","m-dy-share-note-coverMusic",!0,void 0,"正确跳转相关音乐"),s("相关推荐","m-dy-share-note-coverRecommend",!0,void 0,"正确跳转笔记页面")]},{text:"屏蔽元素",type:"forms",forms:[s("【屏蔽】评论","m-dy-share-note-blockComment",!1,void 0,"屏蔽元素"),s("【屏蔽】相关推荐","m-dy-share-note-blockRecommend",!1,void 0,"屏蔽元素"),s("【屏蔽】底部工具栏","m-dy-share-note-blockFooterToobar",!1,void 0,"屏蔽元素")]}]},Ye={id:"m-panel-config-share-challenge",title:"话题",headerTitle:"/share/challenge
话题",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("顶部区域","m-dy-share-challenge-coverTopJump",!0,void 0,"阻止跳转至下载页面"),s("视频卡片","m-dy-share-challenge-coverVideoCard",!0,void 0,"正确跳转视频页面")]}]},qe={id:"m-panel-config-share-music",title:"音乐",headerTitle:"/share/music
音乐",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("视频卡片","m-dy-share-music-coverVideoCard",!0,void 0,"正确跳转视频页面")]}]},x={data:null,oneSuccessExecMenu:null,onceExec:null,listenData:null},r={$data:{get data(){return x.data==null&&(x.data=new c.Dictionary),x.data},get oneSuccessExecMenu(){return x.oneSuccessExecMenu==null&&(x.oneSuccessExecMenu=new c.Dictionary),x.oneSuccessExecMenu},get onceExec(){return x.onceExec==null&&(x.onceExec=new c.Dictionary),x.onceExec},get scriptName(){return G},key:I,attributeKeyName:O,attributeDefaultValueName:F},$listener:{get listenData(){return x.listenData==null&&(x.listenData=new c.Dictionary),x.listenData}},init(){this.initPanelDefaultValue(),this.initExtensionsMenu();},initExtensionsMenu(){M.top===M.self&&Qe.add([{key:"show_pops_panel_setting",text:"⚙ 设置",autoReload:!1,isStoreValue:!1,showText(e){return e},callback:()=>{this.showPanel();}},{key:"show_pops_m_panel_setting",text:"⚙ 移动端设置",autoReload:!1,isStoreValue:!1,showText(e){return e},callback:()=>{this.showMPanel();}}]);},initPanelDefaultValue(){let e=this;function i(n){if(!n.attributes)return;let a=n.attributes[O],l=n.attributes[F];if(a==null){console.warn("请先配置键",n);return}e.$data.data.has(a)&&console.warn("请检查该key(已存在): "+a),e.$data.data.set(a,l);}let t=this.getPanelContentConfig().concat(this.getMPanelContentConfig());for(let n=0;n(o.error(["拦截器-请求错误",e]),e.type==="onabort"?C.warning("请求取消"):e.type==="onerror"?C.error("请求异常"):e.type==="ontimeout"?C.error("请求超时"):C.error("其它错误"),e));const S=c.addStyle,Je={init(){r.execMenu("shieldClientTip",()=>{this.shieldClientTip();}),r.execMenu("shieldFillingBricksAndStones",()=>{this.shieldFillingBricksAndStones();}),r.execMenu("shieldClient",()=>{this.shieldClient();}),r.execMenu("shieldQuickAccess",()=>{this.shieldQuickAccess();}),r.execMenu("shieldNotifitation",()=>{this.shieldNotifitation();}),r.execMenu("shieldPrivateMessage",()=>{this.shieldPrivateMessage();}),r.execMenu("shieldSubmission",()=>{this.shieldSubmission();}),r.execMenu("shieldWallpaper",()=>{this.shieldWallpaper();}),r.execMenu("shieldLeftNavigator",()=>{this.shieldLeftNavigator();}),r.execMenu("shieldTopNavigator",()=>{this.shieldTopNavigator();}),r.execMenuOnce("shieldBottomQuestionButton",()=>{this.shieldBottomQuestionButton();});},shieldFillingBricksAndStones(){o.info("【屏蔽】充砖石"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:not([data-click]):has(div[data-e2e="something-button"]) > :has(path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])','#douyin-header pace-island[id^="island"] > div[class]:not([data-click]):has(div[data-e2e="something-button"]) > :has(path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])'),b.isSearch()&&(o.info("搜索-【屏蔽】充砖石"),m.addBlockCSS('div:has(>div>div>div>div[data-e2e="something-button"] path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])'));},shieldClient(){o.info("【屏蔽】客户端"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) .dy-tip-container','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) .dy-tip-container:has(a)'),b.isSearch()&&(o.info("搜索-【屏蔽】客户端"),m.addBlockCSS('div:has(> div[data-e2e="something-button"] path[d="M18.404 19.018h-12v-1.5h12v1.5zM11.654 13.457v-8.19h1.5v8.19l3.22-3.22 1.06 1.061-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5 1.06-1.06 3.22 3.22z"])'));},shieldQuickAccess(){o.info("【屏蔽】快捷访问"),m.addBlockCSS('header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(.quick-access-nav-icon)'),b.isSearch()&&(o.info("搜索-【屏蔽】快捷访问"),m.addBlockCSS("div:has(>div>div>.quick-access-nav-icon)"));},shieldNotifitation(){o.info("【屏蔽】通知"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(path[d="M9.905 19.407h4.5v-1.5h-4.5v1.5z"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(path[d="M9.905 19.407h4.5v-1.5h-4.5v1.5z"])'),b.isSearch()&&(o.info("搜索-【屏蔽】通知"),m.addBlockCSS('ul:has( div>div[data-e2e="notice-entry"] )'));},shieldPrivateMessage(){o.info("【屏蔽】私信"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > ul:has(div[data-e2e="im-entry"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > ul:has(div[data-e2e="im-entry"])'),b.isSearch()&&(o.info("搜索-【屏蔽】私信"),m.addBlockCSS('ul:has( div>div[data-e2e="im-entry"] )'));},shieldSubmission(){o.info("【屏蔽】投稿"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(ul[data-e2e="cooperate-list"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(ul[data-e2e="cooperate-list"])'),b.isSearch()&&(o.info("搜索-【屏蔽】投稿"),m.addBlockCSS('div:has(>div >div>div[data-e2e="something-button"] path[d="M11.349 5.17h-.033c-1.068 0-1.915 0-2.598.054-.698.056-1.29.172-1.832.441a4.75 4.75 0 00-2.14 2.14c-.269.542-.386 1.134-.441 1.832-.055.683-.055 1.53-.055 2.599v.064c0 1.069 0 1.916.055 2.599.055.698.172 1.29.441 1.831a4.75 4.75 0 002.14 2.14c.542.27 1.134.386 1.832.442.683.055 1.53.055 2.598.055H12.684c1.068 0 1.915 0 2.598-.055.698-.056 1.29-.172 1.832-.442a4.75 4.75 0 002.14-2.14c.269-.541.386-1.133.441-1.831.055-.683.055-1.53.055-2.599v-.064c0-1.069 0-1.916-.055-2.599-.055-.698-.172-1.29-.441-1.832a4.75 4.75 0 00-2.14-2.14c-.542-.269-1.134-.385-1.832-.441-.683-.055-1.53-.055-2.598-.055h-1.335zM7.554 7.008c.299-.149.676-.241 1.284-.29.616-.05 1.403-.05 2.51-.05h1.303c1.108 0 1.895 0 2.511.05.608.049.985.141 1.284.29a3.25 3.25 0 011.464 1.464c.15.3.241.676.29 1.284.05.616.05 1.403.05 2.51 0 1.109 0 1.896-.05 2.512-.049.608-.14.985-.29 1.284a3.25 3.25 0 01-1.464 1.464c-.299.149-.676.241-1.284.29-.616.05-1.403.05-2.51.05h-1.303c-1.108 0-1.895 0-2.511-.05-.608-.049-.985-.141-1.284-.29a3.25 3.25 0 01-1.464-1.464c-.15-.3-.242-.676-.29-1.284-.05-.616-.05-1.403-.05-2.511s0-1.895.05-2.511c.048-.608.14-.985.29-1.284a3.25 3.25 0 011.464-1.464zm3.696 8.259v-2.25H9v-1.5h2.25v-2.25h1.5v2.25H15v1.5h-2.25v2.25h-1.5z"])'));},shieldClientTip(){o.info("【屏蔽】客户端提示"),m.addBlockCSS('ul li div[data-e2e="something-button"] + div div:has(>a[download*="douyin-downloader"])','#douyin-header pace-island[id^="island_"] ul > div:has(>a[class][download])','#douyin-header pace-island[id^="island_"] ul[class] li div[data-e2e="im-entry"] div>div div div:has(a[download][href])','#douyin-header header div[id^="douyin-header-menu"] pace-island[id^="island_"] .dy-tip-container div:has(+ #wallpaper-modal)');},shieldWallpaper(){o.info("【屏蔽】壁纸"),m.addBlockCSS('#douyin-header header div[id^="douyin-header-menu"] pace-island[id^="island_"] .dy-tip-container:has(span.semi-icon)');},shieldLeftNavigator(){o.info("【屏蔽】左侧导航栏"),m.addBlockCSS("#douyin-navigation"),S(` /* 修复顶部导航栏的宽度 */ #douyin-header{ width: 100%; } - `);},shieldTopNavigator(){o.info("【屏蔽】顶部导航栏"),m.addBlockCSS("#douyin-header"),b.isSearch()&&C(` + `);},shieldTopNavigator(){o.info("【屏蔽】顶部导航栏"),m.addBlockCSS("#douyin-header"),b.isSearch()&&S(` /* 把搜索顶部的工具栏置顶 */ #search-content-area > div > div:nth-child(1) > div:nth-child(1){ top: 0; } - `);},shieldBottomQuestionButton(){o.info("屏蔽底部问题按钮"),m.addBlockCSS(["#douyin-sidebar","#douyin-temp-sidebar"]);}},Xe={init(){l.execMenu("shieldSearch",()=>{this.shieldSearch();}),l.execMenu("shieldSearchPlaceholder",()=>{this.shieldSearchPlaceholder();}),l.execMenu("shieldSearchGuessYouWantToSearch",()=>{this.shieldSearchGuessYouWantToSearch();}),l.execMenu("shieldSearchTiktokHotspot",()=>{this.shieldSearchTiktokHotspot();});},shieldSearch(){o.info("【屏蔽】搜索框"),m.addBlockCSS('#douyin-header div[data-click="doubleClick"] > div[data-click="doubleClick"] > div:has(input[data-e2e="searchbar-input"])');},shieldSearchPlaceholder(){o.info("【屏蔽】搜索框的提示"),m.addBlockCSS('#douyin-header div[data-click="doubleClick"] > div[data-click="doubleClick"] > div div:has( + input[data-e2e="searchbar-input"])'),C(` + `);},shieldBottomQuestionButton(){o.info("屏蔽底部问题按钮"),m.addBlockCSS(["#douyin-sidebar","#douyin-temp-sidebar"]);}},Xe={init(){r.execMenu("shieldSearch",()=>{this.shieldSearch();}),r.execMenu("shieldSearchPlaceholder",()=>{this.shieldSearchPlaceholder();}),r.execMenu("shieldSearchGuessYouWantToSearch",()=>{this.shieldSearchGuessYouWantToSearch();}),r.execMenu("shieldSearchTiktokHotspot",()=>{this.shieldSearchTiktokHotspot();});},shieldSearch(){o.info("【屏蔽】搜索框"),m.addBlockCSS('#douyin-header div[data-click="doubleClick"] > div[data-click="doubleClick"] > div:has(input[data-e2e="searchbar-input"])');},shieldSearchPlaceholder(){o.info("【屏蔽】搜索框的提示"),m.addBlockCSS('#douyin-header div[data-click="doubleClick"] > div[data-click="doubleClick"] > div div:has( + input[data-e2e="searchbar-input"])'),S(` #douyin-header div[data-click="doubleClick"] > div[data-click="doubleClick"] > div input[data-e2e="searchbar-input"]::placeholder{ color: transparent; } - `);},shieldSearchGuessYouWantToSearch(){o.info("【屏蔽】搜索-猜你想搜"),m.addBlockCSS('button[data-e2e="searchbar-button"] + div div:has( + div[data-e2e="search-guess-container"])','button[data-e2e="searchbar-button"] + div div[data-e2e="search-guess-container"]');},shieldSearchTiktokHotspot(){o.info("【屏蔽】搜索-抖音热点"),m.addBlockCSS('button[data-e2e="searchbar-button"] + div div:has( + div[data-e2e="search-hot-container"])','button[data-e2e="searchbar-button"] + div div[data-e2e="search-hot-container"]');}},Ze={removeEnvCheck(){o.info("移除环境检测");let e=M.setInterval;M.setInterval=function(i,t){let n=i.toString().trim();if(n.includes("debugger")){o.success(["拦截→",[n]]);return}if(n.includes("checkEXp")){o.success(["拦截→",[n]]);return}return e.call(this,i,t)};}},we={disguiseLogin(){o.info("伪装登录");const e=2e4;let i=parseInt((Math.random()*1e6).toString()),t=Object.defineProperty({},"uid",{value:i,writable:!1});function n(a){var f,v,y,g,B,T,A,Q,K,J,X,Z,ee,te,ie,oe,ne,ae,re,le,se,de,ce,ue,he,me,fe,ve,pe,ge;let h=[],d=c.getReactObj(a),u=d==null?void 0:d.reactFiber;return d==null||d.reactProps,(y=(v=(f=u==null?void 0:u.alternate)==null?void 0:f.return)==null?void 0:v.memoizedProps)!=null&&y.userInfo&&h.push((T=(B=(g=u==null?void 0:u.alternate)==null?void 0:g.return)==null?void 0:B.memoizedProps)==null?void 0:T.userInfo),(J=(K=(Q=(A=u==null?void 0:u.alternate)==null?void 0:A.return)==null?void 0:Q.memoizedProps)==null?void 0:K.userInfo)!=null&&J.userInfo&&h.push((ee=(Z=(X=u==null?void 0:u.alternate)==null?void 0:X.return)==null?void 0:Z.memoizedProps)==null?void 0:ee.userInfo.userInfo),(ne=(oe=(ie=(te=u==null?void 0:u.alternate)==null?void 0:te.return)==null?void 0:ie.return)==null?void 0:oe.memoizedProps)!=null&&ne.userInfo&&h.push((se=(le=(re=(ae=u==null?void 0:u.alternate)==null?void 0:ae.return)==null?void 0:re.return)==null?void 0:le.memoizedProps)==null?void 0:se.userInfo),(me=(he=(ue=(ce=(de=u==null?void 0:u.alternate)==null?void 0:de.return)==null?void 0:ce.return)==null?void 0:ue.memoizedProps)==null?void 0:he.userInfo)!=null&&me.userInfo&&h.push((ge=(pe=(ve=(fe=u==null?void 0:u.alternate)==null?void 0:fe.return)==null?void 0:ve.return)==null?void 0:pe.memoizedProps)==null?void 0:ge.userInfo.userInfo),h}function r(a){n(a).forEach(h=>{Object.defineProperties(h,{info:{value:t,writable:!1},isLogin:{value:!0,writable:!1}});});}if(q.watchVideDataListChange(a=>{r(a);}),c.waitNode("#root div[class*='-os']",e).then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce(()=>{let a=q.getOSElement();a&&r(a);},70)});}).catch(a=>{}),b.isLive())o.info("伪装登录:live"),c.waitNode("#douyin-header div:has(.dy-tip-container)",e).then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce(()=>{r(document.querySelector("#douyin-header"));},70)});});else if(b.isSearch()){let a=function(h){var f,v,y,g,B,T,A;let d=c.getReactObj(h);d==null||d.reactFiber;let u=d==null?void 0:d.reactProps;typeof((g=(y=(v=(f=u==null?void 0:u.children)==null?void 0:f[1])==null?void 0:v.props)==null?void 0:y.userInfo)==null?void 0:g.isLogin)=="boolean"&&(u.children[1].props.userInfo.isLogin=!0),typeof((A=(T=(B=u==null?void 0:u.children)==null?void 0:B[1])==null?void 0:T.props)==null?void 0:A.isClient)=="boolean"&&(u.children[1].props.isClient=!0);};o.info("伪装登录:search"),c.waitNode("#root > div",e).then(h=>{if(!h){o.error("#root > div获取失败");return}c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce((d,u)=>{a(h);},70)});});}},watchLoginDialogToClose(){o.info("监听登录弹窗并关闭"),m.addBlockCSS('div[id^="login-full-panel-"]'),c.waitNode("body").then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback(){var i,t;let e=document.querySelector('body > div[id^="login-full-panel-"] .dy-account-close');e&&((t=(i=c.getReactObj(e))==null?void 0:i.reactProps)==null||t.onClick(new Event("click")));}});});}},et={init(){l.execMenu("live-shieldChatRoom",()=>{this.shieldChatRoom();}),l.execMenu("live-shielChatRoomVipSeats",()=>{this.shielChatRoomVipSeats();}),l.execMenu("dy-live-shieldUserLevelIcon",()=>{this.shieldUserLevelIcon();}),l.execMenu("dy-live-shieldUserVIPIcon",()=>{this.shieldUserVIPIcon();}),l.execMenu("dy-live-shieldUserFansIcon",()=>{this.shieldUserFansIcon();}),l.execMenu("dy-live-shieldMessage",()=>{this.shieldMessage();});},shieldChatRoom(){o.info("【屏蔽】评论区"),m.addBlockCSS("#chatroom"),C(` + `);},shieldSearchGuessYouWantToSearch(){o.info("【屏蔽】搜索-猜你想搜"),m.addBlockCSS('button[data-e2e="searchbar-button"] + div div:has( + div[data-e2e="search-guess-container"])','button[data-e2e="searchbar-button"] + div div[data-e2e="search-guess-container"]');},shieldSearchTiktokHotspot(){o.info("【屏蔽】搜索-抖音热点"),m.addBlockCSS('button[data-e2e="searchbar-button"] + div div:has( + div[data-e2e="search-hot-container"])','button[data-e2e="searchbar-button"] + div div[data-e2e="search-hot-container"]');}},Ze={removeEnvCheck(){o.info("移除环境检测");let e=M.setInterval;M.setInterval=function(i,t){let n=i.toString().trim();if(n.includes("debugger")){o.success(["拦截→",[n]]);return}if(n.includes("checkEXp")){o.success(["拦截→",[n]]);return}return e.call(this,i,t)};}},we={disguiseLogin(){o.info("伪装登录");const e=2e4;let i=parseInt((Math.random()*1e6).toString()),t=Object.defineProperty({},"uid",{value:i,writable:!1});function n(l){var p,v,y,g,B,T,A,Q,K,J,X,Z,ee,te,ie,oe,ne,ae,re,le,se,de,ce,ue,he,me,pe,fe,ve,ge;let h=[],d=c.getReactObj(l),u=d==null?void 0:d.reactFiber;return d==null||d.reactProps,(y=(v=(p=u==null?void 0:u.alternate)==null?void 0:p.return)==null?void 0:v.memoizedProps)!=null&&y.userInfo&&h.push((T=(B=(g=u==null?void 0:u.alternate)==null?void 0:g.return)==null?void 0:B.memoizedProps)==null?void 0:T.userInfo),(J=(K=(Q=(A=u==null?void 0:u.alternate)==null?void 0:A.return)==null?void 0:Q.memoizedProps)==null?void 0:K.userInfo)!=null&&J.userInfo&&h.push((ee=(Z=(X=u==null?void 0:u.alternate)==null?void 0:X.return)==null?void 0:Z.memoizedProps)==null?void 0:ee.userInfo.userInfo),(ne=(oe=(ie=(te=u==null?void 0:u.alternate)==null?void 0:te.return)==null?void 0:ie.return)==null?void 0:oe.memoizedProps)!=null&&ne.userInfo&&h.push((se=(le=(re=(ae=u==null?void 0:u.alternate)==null?void 0:ae.return)==null?void 0:re.return)==null?void 0:le.memoizedProps)==null?void 0:se.userInfo),(me=(he=(ue=(ce=(de=u==null?void 0:u.alternate)==null?void 0:de.return)==null?void 0:ce.return)==null?void 0:ue.memoizedProps)==null?void 0:he.userInfo)!=null&&me.userInfo&&h.push((ge=(ve=(fe=(pe=u==null?void 0:u.alternate)==null?void 0:pe.return)==null?void 0:fe.return)==null?void 0:ve.memoizedProps)==null?void 0:ge.userInfo.userInfo),h}function a(l){n(l).forEach(h=>{Object.defineProperties(h,{info:{value:t,writable:!1},isLogin:{value:!0,writable:!1}});});}if(q.watchVideDataListChange(l=>{a(l);}),c.waitNode("#root div[class*='-os']",e).then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce(()=>{let l=q.getOSElement();l&&a(l);},70)});}).catch(l=>{}),b.isLive())o.info("伪装登录:live"),c.waitNode("#douyin-header div:has(.dy-tip-container)",e).then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce(()=>{a(document.querySelector("#douyin-header"));},70)});});else if(b.isSearch()){let l=function(h){var p,v,y,g,B,T,A;let d=c.getReactObj(h);d==null||d.reactFiber;let u=d==null?void 0:d.reactProps;typeof((g=(y=(v=(p=u==null?void 0:u.children)==null?void 0:p[1])==null?void 0:v.props)==null?void 0:y.userInfo)==null?void 0:g.isLogin)=="boolean"&&(u.children[1].props.userInfo.isLogin=!0),typeof((A=(T=(B=u==null?void 0:u.children)==null?void 0:B[1])==null?void 0:T.props)==null?void 0:A.isClient)=="boolean"&&(u.children[1].props.isClient=!0);};o.info("伪装登录:search"),c.waitNode("#root > div",e).then(h=>{if(!h){o.error("#root > div获取失败");return}c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce((d,u)=>{l(h);},70)});});}},watchLoginDialogToClose(){o.info("监听登录弹窗并关闭"),m.addBlockCSS('div[id^="login-full-panel-"]'),c.waitNode("body").then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback(){var i,t;let e=document.querySelector('body > div[id^="login-full-panel-"] .dy-account-close');e&&((t=(i=c.getReactObj(e))==null?void 0:i.reactProps)==null||t.onClick(new Event("click")));}});});}},et={init(){r.execMenu("live-shieldChatRoom",()=>{this.shieldChatRoom();}),r.execMenu("live-shielChatRoomVipSeats",()=>{this.shielChatRoomVipSeats();}),r.execMenu("dy-live-shieldUserLevelIcon",()=>{this.shieldUserLevelIcon();}),r.execMenu("dy-live-shieldUserVIPIcon",()=>{this.shieldUserVIPIcon();}),r.execMenu("dy-live-shieldUserFansIcon",()=>{this.shieldUserFansIcon();}),r.execMenu("dy-live-shieldMessage",()=>{this.shieldMessage();});},shieldChatRoom(){o.info("【屏蔽】评论区"),m.addBlockCSS("#chatroom"),S(` div[data-e2e="living-container"], div[data-e2e="living-container"] > div{ margin-bottom: 0px !important; - }`);},shielChatRoomVipSeats(){o.info("【屏蔽】评论区的贵宾席"),m.addBlockCSS("#chatroom > div > div:has(#audiencePanelScrollId)");},shieldUserLevelIcon(){o.info("【屏蔽】用户等级图标"),m.addBlockCSS('.webcast-chatroom___item span:has(>img[src*="level"])');},shieldUserVIPIcon(){o.info("【屏蔽】VIP图标"),m.addBlockCSS('.webcast-chatroom___item span:has(>img[src*="subscribe"])');},shieldUserFansIcon(){o.info("【屏蔽】粉丝牌"),m.addBlockCSS('.webcast-chatroom___item span:has(>div[style*="fansclub"])');},shieldMessage(){o.info("【屏蔽】信息播报"),m.addBlockCSS(".webcast-chatroom___bottom-message");}},tt={init(){l.execMenu("live-autoEnterElementFullScreen",()=>{this.autoEnterElementFullScreen();}),l.execMenu("live-shieldGiftColumn",()=>{this.shieldGiftColumn();}),l.execMenu("live-shieldTopToolBarInfo",()=>{this.shieldTopToolBarInfo();}),l.execMenu("live-shieldGiftEffects",()=>{this.shieldGiftEffects();}),l.execMenu("live-shielYellowCar",()=>{this.shieldYellowCar();}),l.execMenu("live-shieldDanmuku",()=>{Ce.shieldDanmu();}),l.execMenu("live-danmu-shield-rule-enable",()=>{Ce.filterDanmu();}),l.execMenu("live-unlockImageQuality",()=>{this.unlockImageQuality();}),l.execMenuOnce("live-waitToRemovePauseDialog",()=>{this.waitToRemovePauseDialog();}),l.execMenu("live-pauseVideo",()=>{this.pauseVideo();}),et.init();},autoEnterElementFullScreen(){o.info("自动进入网页全屏"),c.waitNode('xg-icon[classname] > div > div:has(path[d="M9.75 8.5a2 2 0 00-2 2v11a2 2 0 002 2h12.5a2 2 0 002-2v-11a2 2 0 00-2-2H9.75zM15 11.25h-3.75a1 1 0 00-1 1V16h2v-2.75H15v-2zm5.75 9.5H17v-2h2.75V16h2v3.75a1 1 0 01-1 1z"])').then(e=>{e.click();});},shieldGiftColumn(){o.info("屏蔽底部的礼物栏"),m.addBlockCSS('div[data-e2e="living-container"] >div> :last-child','div[data-e2e="living-container"] xg-controls > div:has(div[data-e2e="gifts-container"])'),C(` + }`);},shielChatRoomVipSeats(){o.info("【屏蔽】评论区的贵宾席"),m.addBlockCSS("#chatroom > div > div:has(#audiencePanelScrollId)");},shieldUserLevelIcon(){o.info("【屏蔽】用户等级图标"),m.addBlockCSS('.webcast-chatroom___item span:has(>img[src*="level"])');},shieldUserVIPIcon(){o.info("【屏蔽】VIP图标"),m.addBlockCSS('.webcast-chatroom___item span:has(>img[src*="subscribe"])');},shieldUserFansIcon(){o.info("【屏蔽】粉丝牌"),m.addBlockCSS('.webcast-chatroom___item span:has(>div[style*="fansclub"])');},shieldMessage(){o.info("【屏蔽】信息播报"),m.addBlockCSS(".webcast-chatroom___bottom-message",'#chatroom >div>div>div:has(>div[elementtiming="element-timing"])');}},tt={init(){r.execMenu("live-autoEnterElementFullScreen",()=>{this.autoEnterElementFullScreen();}),r.execMenu("live-shieldGiftColumn",()=>{this.shieldGiftColumn();}),r.execMenu("live-shieldTopToolBarInfo",()=>{this.shieldTopToolBarInfo();}),r.execMenu("live-shieldGiftEffects",()=>{this.shieldGiftEffects();}),r.execMenu("live-shielYellowCar",()=>{this.shieldYellowCar();}),r.execMenu("live-shieldDanmuku",()=>{Se.shieldDanmu();}),r.execMenu("live-danmu-shield-rule-enable",()=>{Se.filterDanmu();}),r.execMenu("live-unlockImageQuality",()=>{this.unlockImageQuality();}),r.execMenuOnce("live-waitToRemovePauseDialog",()=>{this.waitToRemovePauseDialog();}),r.execMenu("live-pauseVideo",()=>{this.pauseVideo();}),r.execMenu("live-bgColor-enable",()=>{r.execMenuOnce("live-changeBackgroundColor",e=>{this.changeBackgroundColor(e);});}),et.init();},autoEnterElementFullScreen(){o.info("自动进入网页全屏"),c.waitNode('xg-icon[classname] > div > div:has(path[d="M9.75 8.5a2 2 0 00-2 2v11a2 2 0 002 2h12.5a2 2 0 002-2v-11a2 2 0 00-2-2H9.75zM15 11.25h-3.75a1 1 0 00-1 1V16h2v-2.75H15v-2zm5.75 9.5H17v-2h2.75V16h2v3.75a1 1 0 01-1 1z"])').then(e=>{e.click();});},shieldGiftColumn(){o.info("屏蔽底部的礼物栏"),m.addBlockCSS('div[data-e2e="living-container"] >div> :last-child','div[data-e2e="living-container"] xg-controls > div:has(div[data-e2e="gifts-container"])'),S(` /* 去除全屏状态下的礼物栏后,上面的工具栏bottom也去除 */ div[data-e2e="living-container"] xg-controls xg-inner-controls:has(+div div[data-e2e="gifts-container"]){ bottom: 0 !important; } - `);},shieldTopToolBarInfo(){o.info("【屏蔽】顶栏信息"),m.addBlockCSS('div[data-e2e="living-container"] > div > pace-island[id^="island_"]');},shieldGiftEffects(){o.info("【屏蔽】礼物特效"),m.addBlockCSS('.basicPlayer[data-e2e="basicPlayer"] pace-island[id^="island_"]:has(>div>div:not([class*="video_layout_container"])>div)');},shieldYellowCar(){o.info("【屏蔽】小黄车"),m.addBlockCSS('#living_room_player_container .basicPlayer > div:has(div[data-e2e="yellowCart-container"])');},unlockImageQuality(){o.info("解锁画质选择"),p.on(document,"click",'div[data-e2e="quality-selector"] > div',function(e){var t,n;c.preventEvent(e);let i=e.target;try{let r=c.getReactObj(i),a=(t=r==null?void 0:r.reactFiber)==null?void 0:t.key,h=i.closest("div[data-index]"),d=c.getReactObj(h),u=(n=d==null?void 0:d.reactProps)==null?void 0:n.children.ref.current;o.info("当前选择的画质: "+a),o.info(["所有的画质: ",u.getCurrentQualityList()]),u.setCurrentQuality(a);}catch(r){o.error(r),S.error("切换画质失败");}},{capture:!0});},waitToRemovePauseDialog(){o.info("监听【长时间无操作,已暂停播放】弹窗");function e(t,n,r){let a=t[n];if(typeof a=="object")return typeof a[r]=="function"?a[r]:e(a,n,r)}function i(t,n){if(t.innerText.includes("长时间无操作")&&t.innerText.includes("暂停播放")){o.info(`检测${n}:出现【长时间无操作,已暂停播放】弹窗`),S.info(`检测${n}:出现【长时间无操作,已暂停播放】弹窗`);let r=c.getReactObj(t);if(typeof r.reactContainer=="object"){let a=e(r.reactContainer,"child","onClose");typeof a=="function"&&(o.success(`检测${n}:调用onClose关闭弹窗`),S.success("调用onClose关闭弹窗"),a());}}}p.ready(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback(){document.querySelectorAll("body > div[elementtiming='element-timing']").forEach(t=>{i(t,"1");}),document.querySelectorAll('body > div:not([id="root"])').forEach(t=>{i(t,"2");});}});});},pauseVideo(){o.info("禁止自动播放视频(直播)"),c.waitNode('.basicPlayer[data-e2e="basicPlayer"] video').then(e=>{p.on(e,"play",()=>{e.pause();},{capture:!0,once:!0}),e.autoplay=!1,e.pause();});}},it={init(){l.execMenu("douyin-redirect-url-home-to-root",()=>{this.redirectUrlHomeToRoot();});},redirectUrlHomeToRoot(){window.location.pathname==="/home"&&(o.info("从首页跳转到根目录"),window.location.href=window.location.origin+"/?is_from_mobile_home=1&recommend=1");}},Ve={init(){it.init(),l.execMenuOnce("debug",()=>{Ze.removeEnvCheck();}),l.execMenuOnce("watchLoginDialogToClose",()=>{we.watchLoginDialogToClose();}),l.execMenuOnce("disguiseLogin",()=>{we.disguiseLogin();}),l.execMenuOnce("dy-initialScale",()=>{this.initialScale();}),l.execMenu("dy-apple-removeMetaAppleItunesApp",()=>{this.removeMetaAppleItunesApp();}),Je.init(),Xe.init(),b.isLive()?(o.info("Router: 直播"),tt.init()):b.isVideo()?(o.info("Router: 推荐视频"),R.init(),b.isSearch()&&(o.info("Router: 搜索"),Be.init())):o.error("未知router: "+window.location.hostname);},initialScale(){o.info("设置的viewport固定缩放倍率为1并移除页面原有的");let e=p.createElement("meta",{},{name:"viewport",content:"width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover"});p.remove("meta[name='viewport']"),c.waitNode("head").then(()=>{document.head.appendChild(e);});},removeMetaAppleItunesApp(){c.waitNodeList(['meta[name="apple-itunes-app"]'],1e4).then(e=>{e&&e.forEach(i=>{i.remove();});});}},L={isMDouYin(){return window.location.host==="m.douyin.com"},isShareUser(){return this.isMDouYin()&&window.location.pathname.startsWith("/share/user/")},isShareVideo(){return this.isMDouYin()&&window.location.pathname.startsWith("/share/video/")},isShareNote(){return this.isMDouYin()&&window.location.pathname.startsWith("/share/note/")},isShareMusic(){return this.isMDouYin()&&window.location.pathname.startsWith("/share/music/")},isShareChallenge(){return this.isMDouYin()&&window.location.pathname.startsWith("/share/challenge/")}},ot=`/* 顶部 打开看看 登录 */\r + `);},shieldTopToolBarInfo(){o.info("【屏蔽】顶栏信息"),m.addBlockCSS('div[data-e2e="living-container"] > div > pace-island[id^="island_"]');},shieldGiftEffects(){o.info("【屏蔽】礼物特效"),m.addBlockCSS('.basicPlayer[data-e2e="basicPlayer"] pace-island[id^="island_"]:has(>div>div:not([class*="video_layout_container"])>div)');},shieldYellowCar(){o.info("【屏蔽】小黄车"),m.addBlockCSS('#living_room_player_container .basicPlayer > div:has(div[data-e2e="yellowCart-container"])');},unlockImageQuality(){o.info("解锁画质选择"),f.on(document,"click",'div[data-e2e="quality-selector"] > div',function(e){var t,n;c.preventEvent(e);let i=e.target;try{let a=c.getReactObj(i),l=(t=a==null?void 0:a.reactFiber)==null?void 0:t.key,h=i.closest("div[data-index]"),d=c.getReactObj(h),u=(n=d==null?void 0:d.reactProps)==null?void 0:n.children.ref.current;o.info("当前选择的画质: "+l),o.info(["所有的画质: ",u.getCurrentQualityList()]),u.setCurrentQuality(l);}catch(a){o.error(a),C.error("切换画质失败");}},{capture:!0});},waitToRemovePauseDialog(){o.info("监听【长时间无操作,已暂停播放】弹窗");function e(t,n,a){let l=t[n];if(typeof l=="object")return typeof l[a]=="function"?l[a]:e(l,n,a)}function i(t,n){if(t.innerText.includes("长时间无操作")&&t.innerText.includes("暂停播放")){o.info(`检测${n}:出现【长时间无操作,已暂停播放】弹窗`),C.info(`检测${n}:出现【长时间无操作,已暂停播放】弹窗`);let a=c.getReactObj(t);if(typeof a.reactContainer=="object"){let l=e(a.reactContainer,"child","onClose");typeof l=="function"&&(o.success(`检测${n}:调用onClose关闭弹窗`),C.success("调用onClose关闭弹窗"),l());}}}f.ready(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback(){document.querySelectorAll("body > div[elementtiming='element-timing']").forEach(t=>{i(t,"1");}),document.querySelectorAll('body > div:not([id="root"])').forEach(t=>{i(t,"2");});}});});},pauseVideo(){o.info("禁止自动播放视频(直播)"),c.waitNode('.basicPlayer[data-e2e="basicPlayer"] video').then(e=>{f.on(e,"play",()=>{e.pause();},{capture:!0,once:!0}),e.autoplay=!1,e.pause();});},changeBackgroundColor(e){o.info("修改视频背景颜色"),S(` + #living_room_player_container > div, + #chatroom > div{ + background: ${e}; + } + `);}},it={init(){r.execMenu("douyin-redirect-url-home-to-root",()=>{this.redirectUrlHomeToRoot();});},redirectUrlHomeToRoot(){window.location.pathname==="/home"&&(o.info("从首页跳转到根目录"),window.location.href=window.location.origin+"/?is_from_mobile_home=1&recommend=1");}},Ve={init(){it.init(),r.execMenuOnce("debug",()=>{Ze.removeEnvCheck();}),r.execMenuOnce("watchLoginDialogToClose",()=>{we.watchLoginDialogToClose();}),r.execMenuOnce("disguiseLogin",()=>{we.disguiseLogin();}),r.execMenuOnce("dy-initialScale",()=>{this.initialScale();}),r.execMenu("dy-apple-removeMetaAppleItunesApp",()=>{this.removeMetaAppleItunesApp();}),Je.init(),Xe.init(),b.isLive()?(o.info("Router: 直播"),tt.init()):b.isVideo()?(o.info("Router: 推荐视频"),R.init(),b.isSearch()&&(o.info("Router: 推荐视频-搜索"),Be.init())):o.error("未知router: "+window.location.hostname);},initialScale(){o.info("设置的viewport固定缩放倍率为1并移除页面原有的"),f.ready(()=>{let e=f.createElement("meta",{},{name:"viewport",content:"width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover"});f.remove("meta[name='viewport']"),c.waitNode("head").then(()=>{document.head.appendChild(e);});});},removeMetaAppleItunesApp(){c.waitNodeList(['meta[name="apple-itunes-app"]'],1e4).then(e=>{e&&e.forEach(i=>{i.remove();});});}},P={isMDouYin(){return window.location.host==="m.douyin.com"},isShareUser(){return this.isMDouYin()&&window.location.pathname.startsWith("/share/user/")},isShareVideo(){return this.isMDouYin()&&window.location.pathname.startsWith("/share/video/")},isShareNote(){return this.isMDouYin()&&window.location.pathname.startsWith("/share/note/")},isShareMusic(){return this.isMDouYin()&&window.location.pathname.startsWith("/share/music/")},isShareChallenge(){return this.isMDouYin()&&window.location.pathname.startsWith("/share/challenge/")}},ot=`/* 顶部 打开看看 登录 */\r .adapt-login-header,\r /* 上面屏蔽后的空白区域 */\r .user-card .nav-bar-placeholder,\r /* 视频区域底部的【打开抖音App看更多内容】 */\r .select-list .img-button{\r display: none !important;\r -}`,V={getVideoUrl(e){return "https://www.douyin.com/video/"+e},getCollectionUrl(e){return "https://www.douyin.com/collection/"+e},getNoteUrl(e){return "https://www.douyin.com/note/"+e},getHashTagUrl(e){return "https://www.douyin.com/hashtag/"+e},getUserHomeUrl(e){return "https://www.douyin.com/user/"+e},getMusicUrl(e){return "https://www.douyin.com/music/"+e}},nt={init(){C(ot),l.execMenuOnce("m-dy-share-user-coverPlayletList",()=>{this.coverPlayletList();}),l.execMenuOnce("m-dy-share-user-coverPostListContainer",()=>{this.coverPostListContainer();});},coverPlayletList(){p.on(document,"click",".user-playlet-list .playlet-item",e=>{var u,f,v,y;c.preventEvent(e);let i=e.target,t=(u=c.getReactObj(i))==null?void 0:u.reactFiber;if(console.log(t),(t==null?void 0:t.key)==null){S.error("获取视频合集key失败");return}let r=t==null?void 0:t.index;if(r==null){S.error("获取视频合集index失败");return}let a=(y=(v=(f=t==null?void 0:t.return)==null?void 0:f.return)==null?void 0:v.pendingProps)==null?void 0:y.playletList;if(a==null){S.error("获取视频合集playletList失败");return}let h=a[r],d=V.getCollectionUrl(h.mix_id);window.open(d,"_blank");},{capture:!0});},coverPostListContainer(){p.on(document,"click",".post-list-container .user-post-cover",e=>{var n,r,a,h,d;c.preventEvent(e);let i=e.target,t=(n=c.getReactObj(i))==null?void 0:n.reactFiber;if((a=(r=t==null?void 0:t.return)==null?void 0:r.memoizedProps)!=null&&a.productionUrl){let u=(d=(h=t==null?void 0:t.return)==null?void 0:h.memoizedProps)==null?void 0:d.productionUrl;window.open(u,"_blank");}else S.error("获取视频链接失败");},{capture:!0});}},at=`/* 顶部 打开看看 登录 */\r +}`,V={getVideoUrl(e){return "https://www.douyin.com/video/"+e},getCollectionUrl(e){return "https://www.douyin.com/collection/"+e},getNoteUrl(e){return "https://www.douyin.com/note/"+e},getHashTagUrl(e){return "https://www.douyin.com/hashtag/"+e},getUserHomeUrl(e){return "https://www.douyin.com/user/"+e},getMusicUrl(e){return "https://www.douyin.com/music/"+e}},nt={init(){S(ot),r.execMenuOnce("m-dy-share-user-coverPlayletList",()=>{this.coverPlayletList();}),r.execMenuOnce("m-dy-share-user-coverPostListContainer",()=>{this.coverPostListContainer();});},coverPlayletList(){f.on(document,"click",".user-playlet-list .playlet-item",e=>{var u,p,v,y;c.preventEvent(e);let i=e.target,t=(u=c.getReactObj(i))==null?void 0:u.reactFiber;if(console.log(t),(t==null?void 0:t.key)==null){C.error("获取视频合集key失败");return}let a=t==null?void 0:t.index;if(a==null){C.error("获取视频合集index失败");return}let l=(y=(v=(p=t==null?void 0:t.return)==null?void 0:p.return)==null?void 0:v.pendingProps)==null?void 0:y.playletList;if(l==null){C.error("获取视频合集playletList失败");return}let h=l[a],d=V.getCollectionUrl(h.mix_id);window.open(d,"_blank");},{capture:!0});},coverPostListContainer(){f.on(document,"click",".post-list-container .user-post-cover",e=>{var n,a,l,h,d;c.preventEvent(e);let i=e.target,t=(n=c.getReactObj(i))==null?void 0:n.reactFiber;if((l=(a=t==null?void 0:t.return)==null?void 0:a.memoizedProps)!=null&&l.productionUrl){let u=(d=(h=t==null?void 0:t.return)==null?void 0:h.memoizedProps)==null?void 0:d.productionUrl;window.open(u,"_blank");}else C.error("获取视频链接失败");},{capture:!0});}},at=`/* 顶部 打开看看 登录 */\r .adapt-login-header,\r /* 视频描述信息区域中的 打开抖音看精彩视频 */\r .footer .img-button,\r @@ -277,7 +305,7 @@ ul[data-e2e="scroll-list"] {\r .mix-info {\r bottom: 0px !important;\r }\r -`,lt={init(){C(at),C(rt),l.execMenuOnce("m-dy-share-video-coverGlobalClick",()=>{this.coverGlobalClick();});},coverGlobalClick(){[".right-con",".footer",".mix-info"].forEach(i=>{Me.on(document,"click",i,t=>c.preventEvent(t),{capture:!0});});}},st=`/* 顶部 打开看看 登录 */\r +`,lt={init(){S(at),S(rt),r.execMenuOnce("m-dy-share-video-coverGlobalClick",()=>{this.coverGlobalClick();});},coverGlobalClick(){[".right-con",".footer",".mix-info"].forEach(i=>{Me.on(document,"click",i,t=>c.preventEvent(t),{capture:!0});});}},st=`/* 顶部 打开看看 登录 */\r .container .adapt-login-header,\r /* 底部中间的 App内打开 */\r .container .float-button-con {\r @@ -287,7 +315,7 @@ ul[data-e2e="scroll-list"] {\r .gallery-container {\r margin-top: 10px !important;\r }\r -`,dt={init(){C(st),l.execMenuOnce("m-dy-share-note-blockRecommend",()=>{this.blockRecommend();}),l.execMenuOnce("m-dy-share-note-blockComment",()=>{this.blockComment();}),l.execMenuOnce("m-dy-share-note-blockFooterToobar",()=>{this.blockFooterToobar();}),l.execMenuOnce("m-dy-share-note-coverUser",()=>{this.coverUser();}),l.execMenuOnce("m-dy-share-note-coverHashTag",()=>{this.coverHashTag();}),l.execMenuOnce("m-dy-share-note-coverMusic",()=>{this.coverMusic();}),l.execMenuOnce("m-dy-share-note-coverRecommend",()=>{this.coverRecommend();}),l.execMenuOnce("m-dy-share-note-coverExcitingGraphicsAndText",()=>{this.coverExcitingGraphicsAndText();});},blockRecommend(){o.info("【屏蔽】相关推荐"),m.addBlockCSS(".recommend-con");},blockComment(){o.info("【屏蔽】评论"),m.addBlockCSS(".comment-con");},blockFooterToobar(){o.info("【屏蔽】底部工具栏"),m.addBlockCSS(".footer-con");},coverRecommend(){o.info("覆盖相关推荐的点击事件"),p.on(document,"click","#masonry .card",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),S.error("获取reactFiber失败");return}let n=t.return.memoizedProps.awemeId,r=V.getNoteUrl(n);window.open(r,"_blank");},{capture:!0});},coverUser(){o.info("覆盖用户点击事件"),p.on(document,"click",".message-con__top",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),S.error("获取reactFiber失败");return}let n=t.return.return.memoizedProps.video.authorInfo.sec_uid,r=V.getUserHomeUrl(n);window.open(r,"_blank");},{capture:!0});},coverHashTag(){o.info("覆盖话题点击事件"),p.on(document,"click",".message-con__content__body .message-con__content__body-text",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),S.error("获取reactFiber失败");return}let n=t.index,h=t.return.return.return.return.memoizedProps.video.splitStrArr[n].hashtagId,d=V.getHashTagUrl(h);window.open(d,"_blank");},{capture:!0});},coverMusic(){o.info("覆盖音乐点击事件"),p.on(document,"click",".message-con__footer",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),S.error("获取reactFiber失败");return}let n=t.return.return.memoizedProps.video.musicId,r=V.getMusicUrl(n);window.open(r,"_blank");},{capture:!0});},coverExcitingGraphicsAndText(){o.info("覆盖精彩图文点击事件"),p.on(document,"click",".container .related-list-con .related-note-item",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),S.error("获取reactFiber失败");return}let r=t.return.memoizedProps.itemData.awemeId,a=V.getNoteUrl(r);window.open(a,"_blank");},{capture:!0}),p.on(document,"click",".related-title-con",e=>c.preventEvent(e),{capture:!0});}},ct=`/* 顶部 打开看看 登录 */\r +`,dt={init(){S(st),r.execMenuOnce("m-dy-share-note-blockRecommend",()=>{this.blockRecommend();}),r.execMenuOnce("m-dy-share-note-blockComment",()=>{this.blockComment();}),r.execMenuOnce("m-dy-share-note-blockFooterToobar",()=>{this.blockFooterToobar();}),r.execMenuOnce("m-dy-share-note-coverUser",()=>{this.coverUser();}),r.execMenuOnce("m-dy-share-note-coverHashTag",()=>{this.coverHashTag();}),r.execMenuOnce("m-dy-share-note-coverMusic",()=>{this.coverMusic();}),r.execMenuOnce("m-dy-share-note-coverRecommend",()=>{this.coverRecommend();}),r.execMenuOnce("m-dy-share-note-coverExcitingGraphicsAndText",()=>{this.coverExcitingGraphicsAndText();});},blockRecommend(){o.info("【屏蔽】相关推荐"),m.addBlockCSS(".recommend-con");},blockComment(){o.info("【屏蔽】评论"),m.addBlockCSS(".comment-con");},blockFooterToobar(){o.info("【屏蔽】底部工具栏"),m.addBlockCSS(".footer-con");},coverRecommend(){o.info("覆盖相关推荐的点击事件"),f.on(document,"click","#masonry .card",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),C.error("获取reactFiber失败");return}let n=t.return.memoizedProps.awemeId,a=V.getNoteUrl(n);window.open(a,"_blank");},{capture:!0});},coverUser(){o.info("覆盖用户点击事件"),f.on(document,"click",".message-con__top",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),C.error("获取reactFiber失败");return}let n=t.return.return.memoizedProps.video.authorInfo.sec_uid,a=V.getUserHomeUrl(n);window.open(a,"_blank");},{capture:!0});},coverHashTag(){o.info("覆盖话题点击事件"),f.on(document,"click",".message-con__content__body .message-con__content__body-text",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),C.error("获取reactFiber失败");return}let n=t.index,h=t.return.return.return.return.memoizedProps.video.splitStrArr[n].hashtagId,d=V.getHashTagUrl(h);window.open(d,"_blank");},{capture:!0});},coverMusic(){o.info("覆盖音乐点击事件"),f.on(document,"click",".message-con__footer",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),C.error("获取reactFiber失败");return}let n=t.return.return.memoizedProps.video.musicId,a=V.getMusicUrl(n);window.open(a,"_blank");},{capture:!0});},coverExcitingGraphicsAndText(){o.info("覆盖精彩图文点击事件"),f.on(document,"click",".container .related-list-con .related-note-item",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),C.error("获取reactFiber失败");return}let a=t.return.memoizedProps.itemData.awemeId,l=V.getNoteUrl(a);window.open(l,"_blank");},{capture:!0}),f.on(document,"click",".related-title-con",e=>c.preventEvent(e),{capture:!0});}},ct=`/* 顶部 打开看看 登录 */\r .page-reflow-challenge .header,\r /* 底部的 打开抖音App看更多内容 */\r .page-reflow-challenge .bottom-btn__con {\r @@ -297,7 +325,7 @@ ul[data-e2e="scroll-list"] {\r .page-reflow-challenge {\r padding-top: 0 !important;\r }\r -`,ut={init(){C(ct),l.onceExec("m-dy-share-challenge-coverTopJump",()=>{this.coverTopJump();}),l.execMenuOnce("m-dy-share-challenge-coverVideoCard",()=>{this.coverVideoCard();});},coverTopJump(){o.info("阻止上面区域点击跳转至下载页面"),p.on(document,"click",".challenge-body",e=>{c.preventEvent(e);},{capture:!0});},coverVideoCard(){o.info("覆盖视频卡片点击事件"),p.on(document,"click","#pagelet-worklist li.item",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),S.error("获取reactFiber失败");return}let n=t.return.return.return.memoizedProps.listData,r=t.index,a=n[r],h=V.getVideoUrl(a.aweme_id);window.open(h,"_blank");},{capture:!0});}},ht=`/* 顶部 打开App,发现更多内容 */\r +`,ut={init(){S(ct),r.onceExec("m-dy-share-challenge-coverTopJump",()=>{this.coverTopJump();}),r.execMenuOnce("m-dy-share-challenge-coverVideoCard",()=>{this.coverVideoCard();});},coverTopJump(){o.info("阻止上面区域点击跳转至下载页面"),f.on(document,"click",".challenge-body",e=>{c.preventEvent(e);},{capture:!0});},coverVideoCard(){o.info("覆盖视频卡片点击事件"),f.on(document,"click","#pagelet-worklist li.item",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),C.error("获取reactFiber失败");return}let n=t.return.return.return.memoizedProps.listData,a=t.index,l=n[a],h=V.getVideoUrl(l.aweme_id);window.open(h,"_blank");},{capture:!0});}},ht=`/* 顶部 打开App,发现更多内容 */\r .page-reflow-music .header,\r /* ↑屏蔽后的 顶部空白区域 */\r .page-reflow-music .banner-placeholder ,\r @@ -305,6 +333,6 @@ ul[data-e2e="scroll-list"] {\r .page-reflow-music .bottom-btn__con {\r display: none !important;\r }\r -`,mt={init(){C(ht),l.execMenuOnce("m-dy-share-music-coverVideoCard",()=>{this.coverVideoCard();});},coverVideoCard(){o.info("覆盖视频卡片点击事件"),p.on(document,"click","#pagelet-worklist li.item",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),S.error("获取reactFiber失败");return}let n=t.return.return.return.memoizedProps.listData,r=t.index,a=n[r],h=V.getVideoUrl(a.aweme_id);window.open(h,"_blank");},{capture:!0});}},ft={init(){L.isShareUser()?(o.info("M-Router: 分享用户"),nt.init()):L.isShareVideo()?(o.info("M-Router: 分享视频"),lt.init()):L.isShareNote()?(o.info("M-Router: 分享笔记"),dt.init()):L.isShareChallenge()?(o.info("M-Router: 分享话题"),ut.init()):L.isShareMusic()?(o.info("M-Router: 分享音乐"),mt.init()):o.error("未知M-router: "+window.location.hostname);}};l.init();L.isMDouYin()?ft.init():Ve.init(); +`,mt={init(){S(ht),r.execMenuOnce("m-dy-share-music-coverVideoCard",()=>{this.coverVideoCard();});},coverVideoCard(){o.info("覆盖视频卡片点击事件"),f.on(document,"click","#pagelet-worklist li.item",e=>{c.preventEvent(e);let i=e.target,t=c.getReactObj(i).reactFiber;if(!t){o.error("获取reactFiber失败"),C.error("获取reactFiber失败");return}let n=t.return.return.return.memoizedProps.listData,a=t.index,l=n[a],h=V.getVideoUrl(l.aweme_id);window.open(h,"_blank");},{capture:!0});}},pt={init(){P.isShareUser()?(o.info("M-Router: 分享用户"),nt.init()):P.isShareVideo()?(o.info("M-Router: 分享视频"),lt.init()):P.isShareNote()?(o.info("M-Router: 分享笔记"),dt.init()):P.isShareChallenge()?(o.info("M-Router: 分享话题"),ut.init()):P.isShareMusic()?(o.info("M-Router: 分享音乐"),mt.init()):o.error("未知M-router: "+window.location.hostname);}};r.init();P.isMDouYin()?pt.init():Ve.init(); })(Qmsg, Utils, DOMUtils); \ No newline at end of file diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.user.js" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.user.js" index 2eb44cc35..dff7a7836 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.user.js" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.user.js" @@ -1,7 +1,7 @@ // ==UserScript== // @name 抖音优化 // @namespace https://github.com/WhiteSevs/TamperMonkeyScript -// @version 2024.6.26 +// @version 2024.6.29 // @author WhiteSevs // @description 过滤广告、过滤直播、可自定义过滤视频的屏蔽关键字、伪装登录、直播屏蔽弹幕、礼物特效等 // @license GPL-3.0-only @@ -11,7 +11,7 @@ // @require https://update.greasyfork.org/scripts/494167/1376186/CoverUMD.js // @require https://update.greasyfork.org/scripts/456485/1398647/pops.js // @require https://fastly.jsdelivr.net/npm/qmsg@1.1.2/dist/index.umd.js -// @require https://fastly.jsdelivr.net/npm/@whitesev/utils@1.5.8/dist/index.umd.js +// @require https://fastly.jsdelivr.net/npm/@whitesev/utils@1.5.9/dist/index.umd.js // @require https://fastly.jsdelivr.net/npm/@whitesev/domutils@1.1.2/dist/index.umd.js // @grant GM_addStyle // @grant GM_deleteValue @@ -511,6 +511,58 @@ ) ] }, + { + text: "视频区域背景色", + type: "forms", + forms: [ + UISwitch( + "启用", + "live-bgColor-enable", + false, + void 0, + "自定义视频背景色" + ), + { + type: "own", + attributes: { + "data-key": "live-changeBackgroundColor", + "data-default-value": "#000000" + }, + getLiElementCallBack(liElement) { + let $left = domUtils.createElement("div", { + className: "pops-panel-item-left-text", + innerHTML: ` +

视频背景颜色

+

自定义视频背景颜色,包括评论区

+ ` + }); + let $right = domUtils.createElement("div", { + className: "pops-panel-item-right", + innerHTML: ` + + ` + }); + let $color = $right.querySelector(".pops-color-choose"); + $color.value = PopsPanel.getValue("live-changeBackgroundColor"); + let $style = domUtils.createElement("style"); + domUtils.append(document.head, $style); + domUtils.on($color, ["input", "propertychange"], (event) => { + log.info("选择颜色:" + $color.value); + $style.innerHTML = ` + #living_room_player_container > div, + #chatroom > div{ + background: ${$color.value}; + } + `; + PopsPanel.setValue("live-changeBackgroundColor", $color.value); + }); + liElement.appendChild($left); + liElement.appendChild($right); + return liElement; + } + } + ] + }, { text: "视频区域内-屏蔽", type: "forms", @@ -1322,6 +1374,14 @@ PopsPanel.execMenu("dy-video-doubleClickEnterElementFullScreen", () => { this.doubleClickEnterElementFullScreen(); }); + PopsPanel.execMenu("dy-video-bgColor-enable", () => { + PopsPanel.execMenuOnce( + "dy-video-changeBackgroundColor", + (value) => { + this.changeBackgroundColor(value); + } + ); + }); domUtils.ready(() => { DouYinVideo.chooseVideoDefinition( PopsPanel.getValue("chooseVideoDefinition") @@ -1672,6 +1732,18 @@ DouYinSearch.mobileMode(); }); } + }, + /** + * 修改视频背景颜色 + * @param color 颜色 + */ + changeBackgroundColor(color) { + log.info("修改视频背景颜色"); + addStyle(` + #sliderVideo > div{ + background: ${color}; + } + `); } }; const DouYinVideoShortcut = { @@ -1811,6 +1883,60 @@ ) ] }, + { + text: "视频区域背景色", + type: "forms", + forms: [ + UISwitch( + "启用", + "dy-video-bgColor-enable", + false, + void 0, + "自定义视频背景色" + ), + { + type: "own", + attributes: { + "data-key": "dy-video-changeBackgroundColor", + "data-default-value": "#000000" + }, + getLiElementCallBack(liElement) { + let $left = domUtils.createElement("div", { + className: "pops-panel-item-left-text", + innerHTML: ` +

视频背景颜色

+

自定义视频背景颜色,包括评论区

+ ` + }); + let $right = domUtils.createElement("div", { + className: "pops-panel-item-right", + innerHTML: ` + + ` + }); + let $color = $right.querySelector(".pops-color-choose"); + $color.value = PopsPanel.getValue("dy-video-changeBackgroundColor"); + let $style = domUtils.createElement("style"); + domUtils.append(document.head, $style); + domUtils.on($color, ["input", "propertychange"], (event) => { + log.info("选择颜色:" + $color.value); + $style.innerHTML = ` + #sliderVideo > div{ + background: ${$color.value}; + } + `; + PopsPanel.setValue( + "dy-video-changeBackgroundColor", + $color.value + ); + }); + liElement.appendChild($left); + liElement.appendChild($right); + return liElement; + } + } + ] + }, { text: "快捷键", type: "forms", @@ -3146,7 +3272,11 @@ */ shieldMessage() { log.info("【屏蔽】信息播报"); - DouYinUtils.addBlockCSS(".webcast-chatroom___bottom-message"); + DouYinUtils.addBlockCSS( + ".webcast-chatroom___bottom-message", + // 上面的滚动播报,xxx加入了直播间 + '#chatroom >div>div>div:has(>div[elementtiming="element-timing"])' + ); } }; const DouYinLive = { @@ -3181,6 +3311,11 @@ PopsPanel.execMenu("live-pauseVideo", () => { this.pauseVideo(); }); + PopsPanel.execMenu("live-bgColor-enable", () => { + PopsPanel.execMenuOnce("live-changeBackgroundColor", (value) => { + this.changeBackgroundColor(value); + }); + }); DouYinLiveChatRoom.init(); }, /** @@ -3349,6 +3484,19 @@ $video.autoplay = false; $video.pause(); }); + }, + /** + * 修改视频背景颜色 + * @param color 颜色 + */ + changeBackgroundColor(color) { + log.info("修改视频背景颜色"); + addStyle(` + #living_room_player_container > div, + #chatroom > div{ + background: ${color}; + } + `); } }; const DouYinRedirect = { @@ -3394,7 +3542,7 @@ log.info("Router: 推荐视频"); DouYinVideo.init(); if (DouYinRouter.isSearch()) { - log.info("Router: 搜索"); + log.info("Router: 推荐视频-搜索"); DouYinSearch.init(); } } else { @@ -3406,17 +3554,19 @@ */ initialScale() { log.info("设置的viewport固定缩放倍率为1并移除页面原有的"); - let meta = domUtils.createElement( - "meta", - {}, - { - name: "viewport", - content: "width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover" - } - ); - domUtils.remove("meta[name='viewport']"); - utils.waitNode("head").then(() => { - document.head.appendChild(meta); + domUtils.ready(() => { + let meta = domUtils.createElement( + "meta", + {}, + { + name: "viewport", + content: "width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover" + } + ); + domUtils.remove("meta[name='viewport']"); + utils.waitNode("head").then(() => { + document.head.appendChild(meta); + }); }); }, /** diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/package.json" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/package.json" index 7f072c9ce..166c35a31 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/package.json" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/package.json" @@ -17,16 +17,16 @@ }, "dependencies": { "@whitesev/domutils": "^1.1.2", - "@whitesev/utils": "^1.5.8", + "@whitesev/utils": "^1.5.9", "qmsg": "^1.1.2", - "vue": "^3.4.30" + "vue": "^3.4.31" }, "devDependencies": { - "@types/node": "^20.14.8", + "@types/node": "^20.14.9", "@vitejs/plugin-vue": "^5.0.5", "typescript": "^5.5.2", - "vite": "^5.3.1", - "vite-plugin-monkey": "4.0.3", + "vite": "^5.3.2", + "vite-plugin-monkey": "4.0.4", "vue-tsc": "^2.0.22" } } diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/DouYin.ts" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/DouYin.ts" index 5b9acf533..1d73c4dd9 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/DouYin.ts" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/DouYin.ts" @@ -37,7 +37,7 @@ export const DouYin = { log.info("Router: 推荐视频"); DouYinVideo.init(); if (DouYinRouter.isSearch()) { - log.info("Router: 搜索"); + log.info("Router: 推荐视频-搜索"); DouYinSearch.init(); } } else { @@ -49,18 +49,20 @@ export const DouYin = { */ initialScale() { log.info("设置的viewport固定缩放倍率为1并移除页面原有的"); - let meta = DOMUtils.createElement( - "meta", - {}, - { - name: "viewport", - content: - "width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover", - } - ); - DOMUtils.remove("meta[name='viewport']"); - utils.waitNode("head").then(() => { - document.head.appendChild(meta); + DOMUtils.ready(() => { + let meta = DOMUtils.createElement( + "meta", + {}, + { + name: "viewport", + content: + "width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover", + } + ); + DOMUtils.remove("meta[name='viewport']"); + utils.waitNode("head").then(() => { + document.head.appendChild(meta); + }); }); }, /** diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/Live/DouYinLive.ts" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/Live/DouYinLive.ts" index ff57bc395..f31885d75 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/Live/DouYinLive.ts" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/Live/DouYinLive.ts" @@ -55,6 +55,11 @@ export const DouYinLive = { PopsPanel.execMenu("live-pauseVideo", () => { this.pauseVideo(); }); + PopsPanel.execMenu("live-bgColor-enable", () => { + PopsPanel.execMenuOnce("live-changeBackgroundColor", (value: string) => { + this.changeBackgroundColor(value); + }); + }); DouYinLiveChatRoom.init(); }, /** @@ -238,4 +243,17 @@ export const DouYinLive = { $video.pause(); }); }, + /** + * 修改视频背景颜色 + * @param color 颜色 + */ + changeBackgroundColor(color: string) { + log.info("修改视频背景颜色"); + addStyle(` + #living_room_player_container > div, + #chatroom > div{ + background: ${color}; + } + `); + }, }; diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/Live/DouYinLiveChatRoom.ts" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/Live/DouYinLiveChatRoom.ts" index 046c8441e..1d6c6465a 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/Live/DouYinLiveChatRoom.ts" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/Live/DouYinLiveChatRoom.ts" @@ -76,6 +76,10 @@ export const DouYinLiveChatRoom = { */ shieldMessage() { log.info("【屏蔽】信息播报"); - DouYinUtils.addBlockCSS(".webcast-chatroom___bottom-message"); + DouYinUtils.addBlockCSS( + ".webcast-chatroom___bottom-message", + // 上面的滚动播报,xxx加入了直播间 + '#chatroom >div>div>div:has(>div[elementtiming="element-timing"])' + ); }, }; diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/video/DouYinVideo.ts" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/video/DouYinVideo.ts" index d1391c432..3649c386e 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/video/DouYinVideo.ts" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/video/DouYinVideo.ts" @@ -37,6 +37,14 @@ export const DouYinVideo = { PopsPanel.execMenu("dy-video-doubleClickEnterElementFullScreen", () => { this.doubleClickEnterElementFullScreen(); }); + PopsPanel.execMenu("dy-video-bgColor-enable", () => { + PopsPanel.execMenuOnce( + "dy-video-changeBackgroundColor", + (value: string) => { + this.changeBackgroundColor(value); + } + ); + }); DOMUtils.ready(() => { DouYinVideo.chooseVideoDefinition( PopsPanel.getValue("chooseVideoDefinition") @@ -396,4 +404,16 @@ export const DouYinVideo = { }); } }, + /** + * 修改视频背景颜色 + * @param color 颜色 + */ + changeBackgroundColor(color: string) { + log.info("修改视频背景颜色"); + addStyle(` + #sliderVideo > div{ + background: ${color}; + } + `); + }, }; diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/live.ts" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/live.ts" index 5ff2db873..3f1a78f6b 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/live.ts" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/live.ts" @@ -1,6 +1,7 @@ -import { DOMUtils, utils } from "@/env"; +import { DOMUtils, log, utils } from "@/env"; import { UISwitch } from "../common-components/ui-switch"; import { DouYinDanmuFilter } from "@/main/Live/DouYinLiveDanmuku"; +import { PopsPanel } from "../setting"; const PanelLiveConfig: PopsPanelContentConfig = { id: "panel-config-live", @@ -40,6 +41,61 @@ const PanelLiveConfig: PopsPanelContentConfig = { ), ], }, + + { + text: "视频区域背景色", + type: "forms", + forms: [ + UISwitch( + "启用", + "live-bgColor-enable", + false, + void 0, + "自定义视频背景色" + ), + { + type: "own", + attributes: { + "data-key": "live-changeBackgroundColor", + "data-default-value": "#000000", + }, + getLiElementCallBack(liElement) { + let $left = DOMUtils.createElement("div", { + className: "pops-panel-item-left-text", + innerHTML: ` +

视频背景颜色

+

自定义视频背景颜色,包括评论区

+ `, + }); + let $right = DOMUtils.createElement("div", { + className: "pops-panel-item-right", + innerHTML: ` + + `, + }); + let $color = + $right.querySelector(".pops-color-choose")!; + $color.value = PopsPanel.getValue("live-changeBackgroundColor"); + let $style = DOMUtils.createElement("style"); + DOMUtils.append(document.head, $style); + DOMUtils.on($color, ["input", "propertychange"], (event) => { + log.info("选择颜色:" + $color.value); + $style.innerHTML = ` + #living_room_player_container > div, + #chatroom > div{ + background: ${$color.value}; + } + `; + PopsPanel.setValue("live-changeBackgroundColor", $color.value); + }); + + liElement.appendChild($left); + liElement.appendChild($right); + return liElement; + }, + }, + ], + }, { text: "视频区域内-屏蔽", type: "forms", diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/video.ts" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/video.ts" index 0588aa0d3..89dce5412 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/video.ts" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/video.ts" @@ -1,9 +1,10 @@ -import { DOMUtils, utils } from "@/env"; +import { DOMUtils, log, utils } from "@/env"; import { UISelect } from "../common-components/ui-select"; import { UISwitch } from "../common-components/ui-switch"; import { DouYinVideoFilter } from "@/main/video/DouYinVideoFilter"; import { UIButton } from "../common-components/ui-button"; import { DouYinVideoShortcut } from "@/main/video/DouYinVideoShortCut"; +import { PopsPanel } from "../setting"; const PanelVideoConfig: PopsPanelContentConfig = { id: "panel-config-video", @@ -93,6 +94,62 @@ const PanelVideoConfig: PopsPanelContentConfig = { ), ], }, + { + text: "视频区域背景色", + type: "forms", + forms: [ + UISwitch( + "启用", + "dy-video-bgColor-enable", + false, + void 0, + "自定义视频背景色" + ), + { + type: "own", + attributes: { + "data-key": "dy-video-changeBackgroundColor", + "data-default-value": "#000000", + }, + getLiElementCallBack(liElement) { + let $left = DOMUtils.createElement("div", { + className: "pops-panel-item-left-text", + innerHTML: ` +

视频背景颜色

+

自定义视频背景颜色,包括评论区

+ `, + }); + let $right = DOMUtils.createElement("div", { + className: "pops-panel-item-right", + innerHTML: ` + + `, + }); + let $color = + $right.querySelector(".pops-color-choose")!; + $color.value = PopsPanel.getValue("dy-video-changeBackgroundColor"); + let $style = DOMUtils.createElement("style"); + DOMUtils.append(document.head, $style); + DOMUtils.on($color, ["input", "propertychange"], (event) => { + log.info("选择颜色:" + $color.value); + $style.innerHTML = ` + #sliderVideo > div{ + background: ${$color.value}; + } + `; + PopsPanel.setValue( + "dy-video-changeBackgroundColor", + $color.value + ); + }); + + liElement.appendChild($left); + liElement.appendChild($right); + return liElement; + }, + }, + ], + }, { text: "快捷键", type: "forms",