西瓜视频自动高清

西瓜视频自动选择最高清的分辨率

// ==UserScript==
// @name         西瓜视频自动高清
// @namespace    https://github.com/TheKonka
// @version      0.1.2
// @description  西瓜视频自动选择最高清的分辨率
// @author       konka
// @match        https://www.ixigua.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    let checkInt = setInterval(()=>{
            const resolutions = document.querySelectorAll('.control_definition .xgplayer-control-item__popover li')
          const highest = resolutions[0]
          if(!highest) return
            if(Array.from(highest.classList).includes('isActive') ){
                  clearInterval(checkInt);
            }else{
                highest.dispatchEvent(new Event('click',{bubbles:true}))
            }
    },100);
})();