Use the oil monkey script to kill the browser plug-in warning message on the web homepage of station B

Original link: https://hellodk.cn/post/1144

I believe that many people are still using the pure web to view station B like me, because in addition to mobile phones and tablets, there are also official clients for viewing station B on computers. Both win and mac have official clients available. Friends can download from https://app.bilibili.com/ . And like the Microsoft Store, there are also some other third-party clients available.

But I still choose to use pure web browsing on the computer, because the invasion of personal privacy by the client is the easiest and most rampant. Pure web can also use various browser plug-ins.

But once the ad blocking plug-in is enabled in the browser, the following prompt will appear on the homepage of station B, which is very annoying every time I see it.

检测到您的页面展示可能受到浏览器插件影响,建议您将当前页面加入插件白名单,以保障您的浏览体验~ affected my browsing experience

B station plug-in warning.jpg

So let’s use the oil monkey plug-in to write a piece of js code to kill this annoying prompt.

Because the logic is relatively simple, it will not be published to the script central warehouse of Greasy Monkey. o( ̄ヘ ̄o#) The following is the code, which can be picked up by yourself. Create a new script on the Greasy Monkey dashboard page, and then copy the code to open the script That’s it.

 // ==UserScript== // @name removeAdbTipsBili // @namespace https://hellodk.com // @version 0.1 // @description remove adblock-tips in bilibili.com index page // @author hellodk // @match https://*.bilibili.com/ // @icon https://www.google.com/s2/favicons?sz=64&domain=bilibili.com // @grant none // ==/UserScript== (function() { 'use strict'; var domain = document.domain; if(domain === 'bilibili.com') { var adblockTips = document.querySelector('.adblock-tips'); if (adblockTips) { adblockTips.style.display = 'none'; console.log('adblock-tips removed success.') } } })();

Open an anonymous window to check whether it has taken effect. F12 checks the Console console page to print the log, and checks the home page and there is no such warning tips, so I call it a day.

1693112713857.png

This article is transferred from: https://hellodk.cn/post/1144
This site is only for collection, and the copyright belongs to the original author.