学堂在线助手

自动切换1.25倍速,高清

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
})();