您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
学习通
当前为
// ==UserScript== // @name 学习通阻止暂停播放 // @namespace https://hognbin.xyz/ // @version 0.2 // @description 学习通 // @author 宏斌 // @match https://mooc1.chaoxing.com/mycourse/* // @icon https://www.google.com/s2/favicons?sz=64&domain=chaoxing.com // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; function stopPause() { var video = document.querySelectorAll('iframe')[0].contentWindow.document.querySelectorAll('iframe')[0].contentWindow.document.querySelector('video'); video.pause = () => { console.log('他想暂停播放'); } } const button = document.createElement('button'); button.className = 'h_Bbutton'; button.innerHTML = '阻止暂停播放'; document.body.appendChild(button); Object.assign(button.style, { position: 'fixed', padding: '10px', border: 'none', background: 'linear-gradient(45deg, black, transparent)', color: '#fffae5', 'border-radius': '5px', bottom: '20px', left: '20px', 'box-shadow': '8px 4px 10px 3px #ccc', cursor: 'pointer', }) const style = document.createElement('style'); style.innerHTML = ` .h_Bbutton{ transition: all 0.3s linear; } .h_Bbutton:active{ transform: translateY(2px); } .h_Bbutton:hover{ opacity:0.8; } ` document.head.appendChild(style); button.onclick = () => { try { stopPause(); } catch (e) { console.error('出错!'); alert('确保已经点开视频'); } }; })();