您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
8/17/2023, 1:51:20 AM
当前为
- // ==UserScript==
- // @name YouTube: Force Single Column Mode
- // @namespace UserScripts
- // @match https://www.youtube.com/*
- // @grant none
- // @unwrap
- // @inject-into page
- // @version 1.0.1
- // @author CY Fung
- // @description 8/17/2023, 1:51:20 AM
- // @license MIT
- // ==/UserScript==
- (() => {
- const Promise = (async () => { })().constructor;
- const { setInterval, clearInterval } = window;
- if (location.pathname.indexOf('live_chat') >= 0) return;
- let cid = setInterval.call(window, () => {
- let ywf = document.querySelector('ytd-watch-flexy[is-two-columns_]:not([hidden])');
- if (ywf) {
- ywf.removeAttribute('is-two-columns_');
- const ywb = ywf.ytdWatchBehavior
- if (typeof ywf.updateIsTwoColumnsFromBinding === 'function' && ywb && ('isTwoColumns_' in ywb)) {
- ywf.updateIsTwoColumnsFromBinding = function () {
- };
- }
- Promise.resolve(ywf).then((ytdWatchFlexy) => {
- ytdWatchFlexy.ytdWatchBehavior.isTwoColumns_ = false;
- })
- clearInterval.call(window, cid);
- }
- }, 1);
- })();