您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
To learn more faster and efficiently
当前为
This script is designed for use with Tampermonkey and is intended to automatically play videos on https://iedu.foxconn.com/*
. It ensures that the video stays in focus and replays if paused, aiding in learning more efficiently.
The script includes functionality to keep the window always in focus. This is achieved by:
window.onblur
to null
to prevent loss of focus.window.blurred
flag to false
.document.hasFocus
to always return true
.hidden
, mozHidden
, msHidden
, webkitHidden
) to always report the document as visible.document.visibilityState
and document.webkitVisibilityState
to return "visible"
.document.onvisibilitychange
to undefined
.The script prevents specific events from triggering their default behavior, specifically for blur, mouseleave, and mouseout events, except when they are on input, anchor, or span elements.
updateVideoProgress
Function: Checks if the video is playing every 30 seconds. If not, it starts playing the video.setupVideoCheck
Function: Sets an interval to check video playback status.isVideoPlaying
Function: Checks if the video element (with id 'realvideo_html5_api') is playing.startPlayingVideo
Function: Starts playing the video if it is found and is not currently playing.To use this script, it needs to be added to Tampermonkey or a similar userscript manager. The script will run automatically on pages matching https://iedu.foxconn.com/*
.
startPlayingVideo
function to log any issues encountered during video playback.