跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[哔哩哔哩] 写了一个屏蔽 社情/直播/电视剧 油猴插件

发表于

油猴插件:移除 Bilibili 直播/社情/电视剧 等推荐卡片

发现 bilibili 首页所有的卡片元素都是:

<div class="feed-card" />
<div class="bili-video-card is-rcmd enable-no-interest" />
<div class="floor-single-card" />
<div class="bili-video-card is-rcmd" />

其中class="floor-single-card" 对应的卡片都是直播/电视剧/社情等内容,这种元素有个特征,就是内部会多两个 div 层级:

<div class="layer"></div>
<div class="layer tiny"></div>

目前只能根据这个来排除社情/直播等内容,无法再细致化处理。

具体的脚本如下:

(function() {
    'use strict';

    function removeFloorSingleCards() {
        // class='floor-single-card' 的卡片全是直播/社情/电视剧等推荐,统统移除!!!!
        const cards = document.querySelectorAll('.floor-single-card');
        cards.forEach(card => card.remove());
    }

    // 初始调用以移除已有的卡片
    removeFloorSingleCards();

    // 使用 MutationObserver 监视 DOM 变化
    const observer = new MutationObserver(removeFloorSingleCards);
    observer.observe(document.body, { childList: true, subtree: true });
})();

更正确的做法应该是通过卡片封面调用 api 判断是否为社情才对,直接这么处理不够细致,先这么使用吧~

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.