您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add shortcut to enable fullscreen mode of several streaming-media websites
当前为
- // ==UserScript==
- // @name Fullscreen Shortcut
- // @version 0.4
- // @description Add shortcut to enable fullscreen mode of several streaming-media websites
- // @author Fingalzzz
- // @namespace https://greasyfork.org/users/673298
- // @match https://www.bilibili.com/video/*
- // @match https://www.bilibili.com/bangumi/play/*
- // @match https://www.iqiyi.com/*
- // @match https://v.qq.com/x/*
- // @grant none
- // ==/UserScript==
- (function () {
- 'use strict';
- const shortcut = '\\';
- // var selector = null;
- // var btn = null;
- // var link = window.location.href;
- // if (link.includes("bilibili.com")) {
- // selector = ".bilibili-player-iconfont-fullscreen-on";
- // } else if (link.includes('iqiyi.com')) {
- // selector = ".iqp-btn.iqp-btn-fullscreen";
- // } else if (link.includes('v.qq.com')) {
- // selector = ".txp_btn.txp_btn_fullscreen";
- // }
- // (new MutationObserver(check)).observe(document, { childList: true, subtree: true });
- // function check(changes, observer) {
- // if (document.querySelector(selector)) {
- // observer.disconnect();
- // btn = document.querySelector(selector);
- // }
- // }
- document.addEventListener('keydown', (e) => {
- //if (e.ctrlKey && e.key === shortcut) {
- if (e.key === shortcut) {
- var selector = null;
- var btn = null;
- var link = window.location.href;
- if (link.includes("bilibili.com")) {
- selector = ".bilibili-player-iconfont-fullscreen-on";
- } else if (link.includes('iqiyi.com')) {
- selector = ".iqp-btn.iqp-btn-fullscreen";
- } else if (link.includes('v.qq.com')) {
- selector = ".txp_btn.txp_btn_fullscreen";
- }
- btn = document.querySelector(selector);
- btn.click();
- }
- })
- })();