Greasy Fork is available in English.

哔哩哔哩bilibili默认宽屏

Bilibili默认宽屏(帮助点击宽屏按钮)

// ==UserScript==
// @name         哔哩哔哩bilibili默认宽屏
// @namespace    https://greasyfork.org/scripts/404862-%E5%93%94%E5%93%A9%E5%93%94%E5%93%A9bilibili%E9%BB%98%E8%AE%A4%E5%AE%BD%E5%B1%8F/code/%E5%93%94%E5%93%A9%E5%93%94%E5%93%A9bilibili%E9%BB%98%E8%AE%A4%E5%AE%BD%E5%B1%8F.user.js
// @version      2020.7.16.01
// @icon         https://www.bilibili.com/favicon.ico
// @icon64       https://s1.ax1x.com/2020/06/17/NV4aEq.png
// @description  Bilibili默认宽屏(帮助点击宽屏按钮)
// @author       原作者 遍智,cngege 优化
// @match        *://*.bilibili.com/video/*
// @match        *://*.bilibili.com/watchlater/*
// @match        *://*.bilibili.com/bangumi/play/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';
    var counter=0;
    let iscensor = true;
    let url = geturl();//获取刚加载脚本时的Url
    setTimeout(censor,1000);

    go();
    function go(){
        counter++;
        if(document.querySelector(".bilibili-player-video-btn.bilibili-player-video-btn-widescreen")&&document.querySelector(".bilibili-player-video-btn.bilibili-player-video-btn-widescreen").offsetHeight>0){
            if(document.querySelector("#bangumi_player")){
              scrollTo(0,document.querySelector("#bangumi_player").offsetTop);
              if(document.querySelector(".bilibili-player-video-btn.bilibili-player-video-btn-widescreen").innerHTML.indexOf("退出宽屏")!=-1 ||
                 document.querySelector(".bilibili-player-video-btn.bilibili-player-video-web-fullscreen").innerHTML.indexOf("退出网页全屏")!=-1 ||
                 document.querySelector(".bilibili-player-video-btn.bilibili-player-video-btn-fullscreen").innerHTML.indexOf("退出全屏")!=-1
                ){iscensor = true; return;}
              setTimeout(function(){document.querySelector(".bilibili-player-video-btn.bilibili-player-video-btn-widescreen").click();iscensor = false;},500);
            }
            else{
               if(document.querySelector(".bilibili-player-video-btn.bilibili-player-video-btn-widescreen:not(.closed)")!=null)
               setTimeout(function(){document.querySelector(".bilibili-player-video-btn.bilibili-player-video-btn-widescreen:not(.closed)").click();iscensor = false;},500);
            }
        }
        else{
            if(counter>30){
                iscensor = false;
                return;
            }
            setTimeout(go,300);
        }
    }

    function censor(){
        if(!iscensor&&url!=geturl()){
           counter=0;
           go();
           url = geturl();
        }
        setTimeout(censor,2000);
    }

    function geturl(){
        return window.location.href;
    }

})();