Bilibili wide screen

full screen to wide monitor, Alt+v

目前為 2024-10-17 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Bilibili wide screen
// @namespace    http://tampermonkey.net/
// @version      2024-10-17
// @description  full screen to wide monitor, Alt+v
// @author       subZJ
// @license MIT
// @match         https://www.bilibili.com/video/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org
// @grant        none
// ==/UserScript==


(function () {
    'use strict';

    document.addEventListener('keydown', (event) => {

        if (event.altKey) {
            if (event.key == 'v')
            {
                zoom();
            }
        }
    });

    function zoom() {
        //创建视频位置数组
        var videoBoxSite = new Array("bpx-player-video-wrap","bilibili-player-video-wrap");
        var videoBox;

        //匹配正确位置
        for (var i = 0; i < videoBoxSite.length; i++) {
            if (document.getElementsByClassName(videoBoxSite[i]).length == 1) {
                videoBox = document.getElementsByClassName(videoBoxSite[i])[0];
            }
        }
        //wide
        videoBox.setAttribute("style","transform: scale(1.34);");
        //full screen
        document.querySelector('.bpx-player-ctrl-full').click();

    }
})();