您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
치지직 사이트에서 1080p 해상도 고정
当前为
// ==UserScript== // @name 치지직 1080p 해상도 고정 // @namespace http://tampermonkey.net/ // @version 0.5 // @description 치지직 사이트에서 1080p 해상도 고정 // @match *://chzzk.naver.com/* // @grant none // ==/UserScript== (function() { 'use strict'; // 해상도 설정 함수 function setResolution() { const settingsButton = document.querySelector('.pzp-pc-setting-button'); if (settingsButton) { settingsButton.click(); setTimeout(() => { const qualityMenu = document.querySelector('.pzp-pc-setting-intro-quality'); if (qualityMenu) { qualityMenu.click(); setTimeout(() => { const options = document.querySelectorAll('.pzp-pc-ui-setting-quality-item'); const option1080p = Array.from(options).find(option => option.textContent.includes('1080p')); const option720p = Array.from(options).find(option => option.textContent.includes('720p')); if (option1080p && !option1080p.classList.contains('pzp-pc-ui-setting-item--checked')) { option1080p.click(); } else if (option720p && !option720p.classList.contains('pzp-pc-ui-setting-item--checked')) { option720p.click(); } }, 500); } }, 500); } } // 스크롤 오류 수정 함수 function fixScrollIssue() { document.body.style.overflow = 'auto'; document.documentElement.style.overflow = 'auto'; // `position: fixed` 속성 제거 document.body.style.position = ''; document.documentElement.style.position = ''; // `height` 속성 재설정 document.body.style.height = 'auto'; document.documentElement.style.height = 'auto'; } // URL 변화 감지하여 해상도 및 스크롤 재설정 let lastUrl = location.href; setInterval(() => { if (location.href !== lastUrl) { lastUrl = location.href; if (location.href === 'https://chzzk.naver.com/lives') { setTimeout(fixScrollIssue, 500); } else { setTimeout(setResolution, 1000); } } }, 1000); // 페이지 처음 로드 시 해상도 설정 및 스크롤 문제 확인 window.addEventListener('load', () => { if (location.href === 'https://chzzk.naver.com/lives') { fixScrollIssue(); } else { setTimeout(setResolution, 1000); } }); })();