您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button at the right of the video title that makes the video take up the entire window space.
// ==UserScript== // @name Fit video on Browser Window // @namespace http://tampermonkey.net/ // @version 1.0 // @description Adds a button at the right of the video title that makes the video take up the entire window space. // @author Matías Pierdoménico // @match https://www.youtube.com/* // @grant none // @require http://code.jquery.com/jquery-latest.js // @run-at document-end // ==/UserScript== window.addEventListener("spfdone", run); window.addEventListener("yt-navigate-start", run); (function() { 'use strict'; if (document.readyState == "complete" || document.readyState == "loaded" || document.readyState == "interactive") { run(); } else { document.addEventListener("DOMContentLoaded", function(event) { run(); }); } })(); function run() { var popupUrl = window.location.href.replace(/watch/, "watch_popup"); $("#watch-headline-title").append("<div><a href='".concat(popupUrl).concat("'><button id='fill-win-btn'>Fill window</button></a></div>")); //css styling $("#fill-win-btn").css({ "color": "#fefefe", "background-color": "#e62117", "padding": "8px", "float":"right", "cursor":"pointer" }); $("#watch-headline-title .watch-title-container").css({ "float":"left" }); }