Greasy Fork

Greasy Fork is available in English.

哔哩哔哩(bilibili.com)动态页优化

1.哔哩哔哩动态页导航样式优化。2.默认显示"投稿视频"内容。

当前为 2021-05-04 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name               哔哩哔哩(bilibili.com)动态页优化
// @namespace          http://asifadeaway.com/
// @version            1.04
// @icon               https://static.hdslb.com/images/favicon.ico
// @description        1.哔哩哔哩动态页导航样式优化。2.默认显示"投稿视频"内容。
// @author             QIUZAIYOU
// @match              *://t.bilibili.com/*
// @grant              none
// @require            https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// ==/UserScript==
/*——默认显示"投稿视频"内容开始——*/
$(function () {
    $(".tab-bar").css({"z-index":"19940519","position":"sticky","top": "0"});
    $(".tab-bar .tab a").removeClass("selected");
    $(".tab-bar > div:nth-child(2) > a:nth-child(1)").addClass("selected");
    $(".tab-bar .line").css("transform", "translateX(96px)");
    var url = $(location).attr('href');
    var indexHTML='https://t.bilibili.com/pages/nav/index';
    var indexHTMLNew=/(https:\/\/t.bilibili.com\/pages\/nav\/index_new).*/i;
    var indexVoteHTML=/https:\/\/t.bilibili.com\/vote\/h5\/index\/#\/result\?vote_id=.*/i;
    var webVoteHTML=/t.bilibili.com\/h5\/dynamic\/vote#\/result\?vote_id=.*/i
    var indexLotteryHTML=/https:\/\/t.bilibili.com\/lottery\/h5\/index\/#\/result\?business_id=.*/i;
    var webLotteryHTML=/https:\/\/t.bilibili.com\/lottery\/h5\/dynamic#\/result\?business_id=.*/i;
    var moreDongTai=/https:\/\/t.bilibili.com\/[0-9]+\?tab=[0-9]+/i;
    var DongTaiDetail=/https:\/\/t.bilibili.com\/[0-9]+/i;
    var DongTaiTopicDetail=/https:\/\/t.bilibili.com\/topic\/[0-9]+/i;
    function OpenDongTai() {
        if (url == indexHTML || indexHTMLNew.test(url) ||indexVoteHTML.test(url)||webVoteHTML.test(url)||indexLotteryHTML.test(url)||webLotteryHTML.test(url)||moreDongTai.test(url)||DongTaiDetail.test(url)||DongTaiTopicDetail.test(url)){
            return false; //不影响BiliBili首页导航栏动态悬浮窗、动态页里投票及互动抽奖页等内容显示
            }
            else if (url != 'https://t.bilibili.com/?tab=8') {
            window.location.href = "https://t.bilibili.com/?tab=8";
        }
        else {
            return false;
        }
    }
    OpenDongTai(); 
});