// ==UserScript== // @name ✔✔✔【华医网助手】完全免费|视频自动播放|自动静音|屏蔽答题|调整视频质量为最低 // @namespace http://tampermonkey.net/ // @version 0.2.2 // @description 功能只在播放界面生效 // @author 华医网助手 // @license AGPL License // @match *://*.91huayi.com/course_ware/course_ware_polyv.aspx?* // @match *://*.91huayi.com/pages/exam.aspx?* // @match *://*.91huayi.com/pages/exam_result.aspx?* // @match *//*.wsglw.net/train/courseware/cc?* // @match *://*.91huayi.com/* // @grant none // @downloadURL none // ==/UserScript== (() => { // 非播放界面直接返回 var urlInfos = window.location.href.split("/"); var urlTip = urlInfos[urlInfos.length - 1].split("?")[0]; if (urlTip != "course_ware_polyv.aspx") { return } document.querySelector("button[onclick='closeBangZhu()']").click();//关闭温馨提醒 killQuestion(); let video = document.querySelector('video'); setInterval(() => { if (video.paused) { video.play(); } if (window.player && window.player.getCurrentLevel() != 1) { window.player.changeLevel(1) } video.volume = 0; video.muted = true; }, 1000); let tip = document.createElement('p'); tip.style.fontSize = '50px'; tip.style.color = 'red'; tip.style.textAlign = 'center'; tip.textContent = '有合作需求可加v: idpx1995'; document.body.appendChild(tip); function killQuestion() { (async function () { while (!window.player || !window.player.sendQuestion) { await sleep(20); }; //console.log("课堂问答跳过插入"); window.player.sendQuestion = function () { //console.log("播放器尝试弹出课堂问答,已屏蔽。"); }; })(); setInterval(async function () { try { if ($('.pv-ask-head').length && $('.pv-ask-head').length > 0) { console.log("检测到问题对话框,尝试跳过"); $(".pv-ask-skip").click(); }; } catch (err) { console.log(err); }; try { if ($('.signBtn').length && $('.signBtn').length > 0) { console.log("检测到签到对话框,尝试跳过"); $(".signBtn").click(); }; } catch (err) { console.log(err); }; try { if ($("button[onclick='closeBangZhu()']").length && $("button[onclick='closeBangZhu()']").length > 0 && $("div[id='div_processbar_tip']").css("display") == "block") { console.log("检测到温馨提示对话框(不能拖拽),尝试跳过");// $("button[onclick='closeBangZhu()']").click(); }; } catch (err) { console.log(err); }; try { if ($("button[class='btn_sign']").length && $("button[class='btn_sign']").length > 0) { console.log("检测到温馨提示对话框(疲劳提醒),尝试跳过"); $("button[class='btn_sign']").click(); }; } catch (err) { console.log(err); }; try { if ($('video').prop('paused') == true) { console.log("视频意外暂停,恢复播放"); $('video').get(0).play(); }; } catch (err) { console.log(err); }; }, 2000); }; })()