mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
5.5 KiB
JavaScript
1 line
5.5 KiB
JavaScript
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["utils/remove-promotions"]=n():e["utils/remove-promotions"]=n()}(self,(function(){return function(){"use strict";var e,n,t={155:function(e,n,t){t.r(n),n.default='// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require("../../../../../node_modules/css-loader/dist/runtime/api.js");\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]});\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, "#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.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 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 {\\n width: 440px;\\n height: 220px;\\n display: flex;\\n color: #888;\\n background-color: rgba(136,136,136,0.13333);\\n font-size: 24pt;\\n font-weight: bold;\\n align-items: center;\\n justify-content: space-evenly;\\n}\\n\\n.blocked-ads.new {\\n width: 100%;\\n height: 100%;\\n background-color: #eee;\\n}\\n\\nbody.dark .blocked-ads.new {\\n background-color: #333;\\n}", ""]);\n// Exports\nmodule.exports = ___CSS_LOADER_EXPORT___;\n'},407:function(e){e.exports=coreApis.settings},569:function(e){e.exports=coreApis.spinQuery}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,r),i.exports}n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},r.t=function(t,o){if(1&o&&(t=this(t)),8&o)return t;if("object"==typeof t&&t){if(4&o&&t.__esModule)return t;if(16&o&&"function"==typeof t.then)return t}var i=Object.create(null);r.r(i);var a={};e=e||[null,n({}),n([]),n(n)];for(var l=2&o&&t;"object"==typeof l&&!~e.indexOf(l);l=n(l))Object.getOwnPropertyNames(l).forEach((function(e){a[e]=function(){return t[e]}}));return a.default=function(){return t},r.d(i,a),i},r.d=function(e,n){for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){r.d(i,{component:function(){return e}});const e={name:"removePromotions",displayName:"删除广告",entry:async({settings:e,metadata:n})=>{const{addComponentListener:t}=await Promise.resolve().then(r.t.bind(r,407,23));if("https://www.bilibili.com/"===document.URL.replace(window.location.search,"")){const{selectAll:n,select:t}=await Promise.resolve().then(r.t.bind(r,569,23));t(".eva-extension-area").then((e=>{e&&(e.parentElement.style.margin="12px")})),n(".gg-pic").then((n=>{0!==n.length&&n.forEach((n=>{const t=n.parentElement;t.style.display="none";const o=[...t.parentElement.childNodes].indexOf(t)+1,r=t.parentElement.parentElement.querySelector(`.pic li:nth-child(${o})`);if(r){r.style.display="flex";const n=r.querySelector("a:not(.more-text)");n.insertAdjacentHTML("afterend",`\n <div class="blocked-ads">${e.options.showPlaceholder?"🚫已屏蔽广告":""}</div>\n `),n.style.visibility="hidden";[r.querySelector("a.more-text"),r.querySelector("img")].forEach((e=>e.style.display="none"))}}))})),t(".focus-carousel.home-slide").then((n=>{n&&dqa(n,".gg-icon,.bypb-icon").map((e=>e.parentElement.parentElement)).forEach((n=>{n.style.display="none",n.insertAdjacentHTML("afterend",`\n <div class="blocked-ads new">${e.options.showPlaceholder?"🚫已屏蔽广告":""}</div>\n `)}))}))}t(`${n.name}.preserveEventBanner`,(e=>{document.body.classList.toggle("preserve-event-banner",e)}),!0)},instantStyles:[{name:"removePromotions",style:()=>Promise.resolve().then(r.bind(r,155))}],tags:[componentsTags.utils],description:{"zh-CN":'\n删除站内的各种广告. 包括首页的推广模块, 手机 app 推荐, 视频页面右侧的广告等. 注意: 首页推广模块删除后留下空白区域是正常现象, 如果觉得怪可以开启 `占位文本` 选项.\n\n- `占位文本`: 删除首页推广模块的广告后显示"🚫已屏蔽广告"来替代空白区域.\n- `保留活动横幅`: 保留视频页面的活动横幅.\n'.trim()},options:{showPlaceholder:{displayName:"占位文本",defaultValue:!0},preserveEventBanner:{displayName:"保留活动横幅",defaultValue:!1}},commitHash:"0a2ab779aac2af6f58d15cee16533dd18200bb62"}}(),i=i.component}()})); |