您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
If 1080p video exists, set video quality to 1080p automatically.
当前为
// ==UserScript== // @name Nicovideo:GINZA-HTML5 autoset 1080p // @namespace https://twitter.com/tigerauge0 // @version 1.01 // @description If 1080p video exists, set video quality to 1080p automatically. // @author HAC // @match http://www.nicovideo.jp/watch/* // @grant none // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js // ==/UserScript== (function() { 'use strict'; let observer = new MutationObserver(function (MutationRecords, MutationObserver) { //console.log('Obserbing'); for(let MutationRecord of MutationRecords) { if(MutationRecord.target === $('.PlayerOptionDropdown-menu')[0]) { if(MutationRecord.previousSibling === null) { let resolutionListTopDomObj = $(MutationRecord.target).find('.PlayerOptionDropdownItem:first-child > .PlayerOptionDropdownItem-inner')[0]; if(/1080p/.test(resolutionListTopDomObj.textContent)) { console.log('1080p is available.'); resolutionListTopDomObj.click(); if($('#AutoPlayMenuItem-on').val() === 'true'){ $('.PlayerPlayButton > .ControllerButton-inner')[0].click(); } } else { console.log('1080p is not available.'); } // 問題点: .PlayerOptionDropdownItem[0]が検出できなかった場合、Observeし続ける MutationObserver.disconnect(); break; } } } }); observer.observe(document, { childList: true, subtree: true}); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址