Greasy Fork

来自缓存

Greasy Fork is available in English.

tv.cctv.com_auto_720p

tv.cctv.com auto set 720p and max volume

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        tv.cctv.com_auto_720p
// @name:zh-CN        tv.cctv.com_auto_720p
// @namespace   tv.cctv.com_auto_720p
// @supportURL  https://github.com/zhuzemin
// @description tv.cctv.com auto set 720p and max volume
// @description:zh-CN tv.cctv.com auto set 720p and max volume
// @include     https://tv.cctv.com/live/*
// @version     1.0
// @run-at      document-end
// @author      zhuzemin
// @license     Mozilla Public License 2.0; http://www.mozilla.org/MPL/2.0/
// @license     CC Attribution-ShareAlike 4.0 International; http://creativecommons.org/licenses/by-sa/4.0/
// ==/UserScript==


var config = {
    'debug': false,
}
var debug = config.debug ? console.log.bind(console)  : function () {
};
let interval=setInterval(function(){
    let elem=document.querySelector('#resolution_item_720_player');
    debug('elem: '+elem);
    if(elem!=null){
        elem.click();
        let btn=document.querySelector('#player_sound_btn_player');
        btn.setAttribute('volume',100);
        btn.click();
        btn.click();
        btn.click();
        clearInterval(interval);
    }
}, 1000);