Bilibili-Evolved/registry/dist/components/utils/remove-promotions.js
github-actions[bot] 6df3e60083
Some checks failed
Build / build (push) Has been cancelled
CI build
2025-09-14 01:41:02 +00:00

9 lines
13 KiB
JavaScript

!function(e,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports["utils/remove-promotions"]=i():e["utils/remove-promotions"]=i()}(globalThis,(()=>(()=>{var e,i,o={235:(e,i,o)=>{var n=o(955)((function(e){return e[1]}));n.push([e.id,'@charset "UTF-8";\n#slide_ad,\n.v-wrap .vcd,\n.ad-report,\n#home_popularize .l-con,\n#home_popularize .adpos,\n.gg-floor-module,\n.home-app-download,\n.bilibili-player-promote-wrap,\n.bili-header-m .nav-menu .nav-con .nav-item .text-red,\n.mobile-link-l,\n.video-page-game-card,\n.international-home .banner-card,\n.bypb-window .operate-card,\n.gg-window .operate-card,\n#reportFirst2 .extension,\n.video-page-special-card,\n.mascot,\n.rank-container .cm-module,\nbody:not(.preserve-event-banner) .activity-m,\nbody:not(.preserve-event-banner) .activity-m-v1,\nbody.remove-game-match-module .bili-wrapper > .home-match,\nbody.remove-game-match-module #reportFirst3,\n.home-content .ad-panel,\n.recommend-list .rec-list > :not(.video-page-card),\n.eva-extension-area,\n.eva-banner,\n.video-ad-creative-card,\n.bili-dyn-home--member .bili-dyn-ads,\n.video-page-special-card-small,\n.video-page-game-card-small,\n.video-page-operator-card-small,\n[data-be-promotion-mark],\nbody:not(.preserve-feed-goods) .dyn-goods,\n.desktop-download-tip,\n.adcard,\n.palette-button-adcard,\n.palette-button-wrap .adcard-content,\n.video-card-ad-small,\n.search-all-list .video-list > *:has(.bili-video-card__info--ad) {\n display: none !important;\n}\n\n.recommend-list .rec-list > :not(.video-page-card) + .video-page-card {\n padding-top: 0 !important;\n}\n\n#home_popularize {\n position: relative !important;\n}\n\n.popularize-module .online,\n.gg-window .online {\n position: absolute !important;\n top: 50% !important;\n right: 0.5% !important;\n transform: translateY(-100%) !important;\n}\n\n.gg-window .online {\n right: 0 !important;\n padding: 0 16px !important;\n}\n\n#reportFirst2 {\n position: relative;\n margin-bottom: 4px;\n}\n\n.blocked-ads, .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)) .bili-video-card__image::after,\n.container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])) .bili-video-card__image::after,\n.video-list-item:has(.bili-video-card__info--ad) .bili-video-card__image::after {\n width: 440px;\n height: 220px;\n display: flex;\n color: #888;\n background-color: #8882;\n font-size: 24pt;\n font-weight: 600;\n align-items: center;\n justify-content: space-evenly;\n}\n\n.blocked-ads.new, .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)) .new.bili-video-card__image::after,\n.container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])) .new.bili-video-card__image::after,\n.video-list-item:has(.bili-video-card__info--ad) .new.bili-video-card__image::after {\n width: 100%;\n height: 100%;\n background-color: #eee;\n}\n\nbody.dark .blocked-ads.new, body.dark .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)) .new.bili-video-card__image::after, .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)) body.dark .new.bili-video-card__image::after,\nbody.dark .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])) .new.bili-video-card__image::after,\n.container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])) body.dark .new.bili-video-card__image::after,\nbody.dark .video-list-item:has(.bili-video-card__info--ad) .new.bili-video-card__image::after,\n.video-list-item:has(.bili-video-card__info--ad) body.dark .new.bili-video-card__image::after {\n background-color: #333;\n}\n\n.recommended-container .business-card {\n position: absolute !important;\n pointer-events: none !important;\n opacity: 0 !important;\n}\n\n.recommended-container_floor-aside .container > *,\nbody:not(.preserve-feed-goods) .bili-dyn-content__orig__additional:has(.dyn-goods) {\n margin: 0 !important;\n}\n\n.container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)),\n.container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])),\n.video-list-item:has(.bili-video-card__info--ad) {\n visibility: hidden;\n pointer-events: none !important;\n}\n.container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)) .bili-video-card__image::after,\n.container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])) .bili-video-card__image::after,\n.video-list-item:has(.bili-video-card__info--ad) .bili-video-card__image::after {\n content: "🚫已屏蔽广告";\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n -webkit-user-select: none;\n user-select: none;\n visibility: hidden;\n border-radius: 6px;\n background-color: #eee;\n}\nbody.dark .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)) .bili-video-card__image::after,\nbody.dark .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])) .bili-video-card__image::after,\nbody.dark .video-list-item:has(.bili-video-card__info--ad) .bili-video-card__image::after {\n background-color: #333;\n}\nbody.remove-promotions-show-placeholder .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)) .bili-video-card__image::after,\nbody.remove-promotions-show-placeholder .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])) .bili-video-card__image::after,\nbody.remove-promotions-show-placeholder .video-list-item:has(.bili-video-card__info--ad) .bili-video-card__image::after {\n visibility: visible;\n}\nbody.remove-promotions-debug .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)) .bili-video-card__image::after,\nbody.remove-promotions-debug .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])) .bili-video-card__image::after,\nbody.remove-promotions-debug .video-list-item:has(.bili-video-card__info--ad) .bili-video-card__image::after {\n visibility: hidden !important;\n}\nbody.remove-promotions-hide-container .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)),\nbody.remove-promotions-hide-container .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])),\nbody.remove-promotions-hide-container .video-list-item:has(.bili-video-card__info--ad) {\n display: none;\n}\nbody.remove-promotions-debug .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__stats > :is(.bili-video-card__stats--text, svg)),\nbody.remove-promotions-debug .container > :is(.feed-card, .bili-feed-card):has(.bili-video-card__info--tit > a:not([href])),\nbody.remove-promotions-debug .video-list-item:has(.bili-video-card__info--ad) {\n display: unset;\n visibility: visible;\n border: red 1px solid;\n}',""]),e.exports=n},955:e=>{"use strict";
// eslint-disable-next-line func-names
e.exports=function(e){var i=[];return i.toString=function(){return this.map((function(i){var o=e(i);return i[2]?"@media ".concat(i[2]," {").concat(o,"}"):o})).join("")},
// eslint-disable-next-line func-names
i.i=function(e,o,n){"string"==typeof e&&(
// eslint-disable-next-line no-param-reassign
e=[[null,e,""]]);var t={};if(n)for(var a=0;a<this.length;a++){
// eslint-disable-next-line prefer-destructuring
var d=this[a][0];null!=d&&(t[d]=!0)}for(var r=0;r<e.length;r++){var s=[].concat(e[r]);n&&t[s[0]]||(o&&(s[2]?s[2]="".concat(o," and ").concat(s[2]):s[2]=o),i.push(s))}},i}},769:(e,i,o)=>{var n=o(235);n&&n.__esModule&&(n=n.default),e.exports="string"==typeof n?n:n.toString()},289:e=>{function i(e){var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}i.keys=()=>[],i.resolve=i,i.id=289,e.exports=i},22:e=>{"use strict";e.exports='删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等.\n\n- `保留活动横幅`: 保留视频页面的活动横幅.\n- `广告卡片选项`\n - `完全隐藏`: 广告卡片将完全隐藏,后续的视频卡片会自动补上空缺位置\n - `自定义`\n - `占位文本`: 屏蔽首页推广模块的广告后显示"🚫已屏蔽广告"来替代空白区域.\n - `调试模式`: 用于查看是否正确屏蔽广告,启用时将边框高亮广告卡片,同时其他屏蔽选项会失效\n'},905:e=>{"use strict";e.exports=coreApis.settings},728:e=>{"use strict";e.exports=coreApis.spinQuery},164:e=>{"use strict";e.exports=coreApis.ui}},n={};function t(e){var i=n[e];if(void 0!==i)return i.exports;var a=n[e]={id:e,exports:{}};return o[e](a,a.exports,t),a.exports}i=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t.t=function(o,n){if(1&n&&(o=this(o)),8&n)return o;if("object"==typeof o&&o){if(4&n&&o.__esModule)return o;if(16&n&&"function"==typeof o.then)return o}var a=Object.create(null);t.r(a);var d={};e=e||[null,i({}),i([]),i(i)];for(var r=2&n&&o;"object"==typeof r&&!~e.indexOf(r);r=i(r))Object.getOwnPropertyNames(r).forEach((e=>d[e]=()=>o[e]));return d.default=()=>o,t.d(a,d),a},t.d=(e,i)=>{for(var o in i)t.o(i,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:i[o]})},t.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";t.d(a,{component:()=>d});const e=coreApis.componentApis.define,i=coreApis.utils,o="removePromotions",n={title:"广告卡片选项",groupName:`${o}-promotions-card`,items:{hide:{name:"hideContainer",isOption:!0},custom:{name:"custom",isOption:!0,optionsIncluded:["showPlaceholder"]},debug:{name:"debug",isOption:!0}},componentName:o,icon:"mdi-checkbox-marked-circle-outline"},d=(0,e.defineComponentMetadata)({name:o,displayName:"删除广告",entry:async e=>{let{settings:i,metadata:o}=e;const{addComponentListener:n}=await Promise.resolve().then(t.t.bind(t,905,23));if("https://www.bilibili.com/"===document.URL.replace(window.location.search,"")){const{selectAll:e,select:o}=await Promise.resolve().then(t.t.bind(t,728,23));o(".eva-extension-area").then((e=>{e&&(e.parentElement.style.margin="12px")})),e(".gg-pic").then((e=>{0!==e.length&&e.forEach((e=>{const o=e.parentElement;o.style.display="none";const n=[...o.parentElement.childNodes].indexOf(o)+1,t=o.parentElement.parentElement.querySelector(`.pic li:nth-child(${n})`);if(t){t.style.display="flex";const e=t.querySelector("a:not(.more-text)");e.insertAdjacentHTML("afterend",`\n <div class="blocked-ads">${i.options.showPlaceholder?"🚫已屏蔽广告":""}</div>\n `),e.style.visibility="hidden";[t.querySelector("a.more-text"),t.querySelector("img")].forEach((e=>e.style.display="none"))}}))})),o(".focus-carousel.home-slide").then((e=>{e&&dqa(e,".gg-icon,.bypb-icon").map((e=>e.parentElement.parentElement)).forEach((e=>{e.style.display="none",e.insertAdjacentHTML("afterend",`\n <div class="blocked-ads new">${i.options.showPlaceholder?"🚫已屏蔽广告":""}</div>\n `)}))}))}n(`${o.name}.preserveEventBanner`,(e=>{document.body.classList.toggle("preserve-event-banner",e)}),!0),n(`${o.name}.preserveFeedGoods`,(e=>{document.body.classList.toggle("preserve-feed-goods",e)}),!0),n(`${o.name}.preserveReplyNotice`,(e=>{document.body.classList.toggle("preserve-reply-notice",e)}),!0),n(`${o.name}.hideContainer`,(e=>{document.body.classList.toggle("remove-promotions-hide-container",e)}),!0),n(`${o.name}.showPlaceholder`,(e=>{document.body.classList.toggle("remove-promotions-show-placeholder",e)}),!0),n(`${o.name}.debug`,(e=>{document.body.classList.toggle("remove-promotions-debug",e)}),!0)},instantStyles:[{name:o,style:()=>Promise.resolve().then(t.t.bind(t,769,23))}],tags:[componentsTags.utils],options:{preserveEventBanner:{displayName:"保留活动横幅",defaultValue:!1},preserveFeedGoods:{displayName:"保留动态商品推荐",defaultValue:!1},hideContainer:{displayName:"完全隐藏",defaultValue:!0,hidden:!0},custom:{displayName:"自定义",defaultValue:!1,hidden:!0},showPlaceholder:{displayName:"占位文本",defaultValue:!0,hidden:!0},debug:{displayName:"调试模式",defaultValue:!1,hidden:!0}},extraOptions:()=>Promise.resolve().then(t.t.bind(t,164,23)).then((e=>(0,i.createComponentWithProps)(e.OptionRadioGroup,{...n,isPopup:!1}))),widget:{component:()=>Promise.resolve().then(t.t.bind(t,164,23)).then((e=>(0,i.createComponentWithProps)(e.OptionRadioGroup,{...n,isPopup:!0})))},commitHash:"6f513d77b2ea5ebb8dcc0962e857ffb9a8b32934",coreVersion:"2.10.4",description:(()=>{const e=t(289);return{...Object.fromEntries(e.keys().map((i=>[i.match(/index\.(.+)\.md$/)[1],e(i)]))),"zh-CN":()=>Promise.resolve().then(t.t.bind(t,22,17)).then((e=>e.default))}})()})})(),a=a.component})()));