您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically selects the highest resolution on Megacloud.
当前为
// ==UserScript== // @name HiAnime Auto 1080p // @namespace http://tampermonkey.net/ // @version 1 // @description Automatically selects the highest resolution on Megacloud. // @icon https://hianime.to/images/icons-192.png // @author Ghoste // @match https://megacloud.tv/* // @grant none // @license MIT // ==/UserScript== (async () => { 'use strict'; function waitForElement(selector, baseElement = document.body) { return new Promise(resolve => { if (baseElement.querySelector(selector)) { return resolve(baseElement.querySelector(selector)); } const observer = new MutationObserver(mutations => { if (baseElement.querySelector(selector)) { resolve(baseElement.querySelector(selector)); observer.disconnect(); } }); observer.observe(baseElement, { childList: true, subtree: true }); }); } // Once the settings button is loaded, we know the player is loaded const settingsButtonSelector = 'div.jw-icon.jw-icon-inline.jw-button-color.jw-reset.jw-icon-settings.jw-settings-submenu-button'; await waitForElement(settingsButtonSelector); // Set the quality to the highest with the jwplayer api const player = jwplayer(); // 0 = auto, 1 = highest (1080p), 2 = second highest (720p) and so on player.on('firstFrame', () => player.setCurrentQuality(1)); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址