学堂在线助手

自动切换1.25倍速,高清

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         学堂在线助手
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  自动切换1.25倍速,高清
// @author       You
// @match        https://*.xuetangx.com/*
// @grant        none
// ==/UserScript==

(function() {
    function fun(className, selector)
    {
        var mousemove = document.createEvent("MouseEvent");
        mousemove.initMouseEvent("mousemove", true, true, window, 0, 10, 10, 10, 10, 0, 0, 0, 0, 0, null);
        document.getElementsByClassName(className)[0].dispatchEvent(mousemove);
        document.querySelector(selector).click();
    }
    setInterval(function() {
        if (document.querySelector("xt-quality").innerText !== "高清") {
            fun("xt_video_player_quality", "[keyt=高清]");
            fun("xt_video_player_speed", "[keyt='1.25']");
        }
    }, 500);
})();