// ==UserScript== // @name 抖音直播优化(自动最高画质,网页全屏,关闭弹幕,打开声音) // @description 自动最高画质,网页全屏,关闭弹幕,打开声音 // @author zzw6776 // @version 1.1 // @match *://live.douyin.com/* // @match *://*.douyin.com/root/live/* // @match *://*.douyin.com/*/live/* // @license MIT // @namespace https://greasyfork.org/users/168189 // @downloadURL none // ==/UserScript== (function() { 'use strict'; setTimeout(() => { document.getElementsByClassName('NsCkThfl')[0].click() document.getElementsByClassName('xgplayer-icon')[2].click() simulateKeyPress('b') var ua = navigator.userAgent; console.log(ua); if(ua.indexOf('Windows')<0){ document.getElementsByClassName('psKR9RS0')[1].getElementsByTagName('div')[3].click(); } },2000) function simulateKeyPress(character) { var evt = new KeyboardEvent('keydown', { key: character, code: 'Key' + character.toUpperCase(), shiftKey: false, ctrlKey: false, metaKey: false }); console.log(evt); document.dispatchEvent(evt); } })();