您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Prevent HTML5 videos or music from autoplaying. Move mouse over player to start playing.
- // ==UserScript==
- // @name HTML5 stop autoplay
- // @namespace https://infovikol.ch/
- // @version 0.1
- // @description Prevent HTML5 videos or music from autoplaying. Move mouse over player to start playing.
- // @author Alex
- // @match http*://*/*
- // @grant none
- // ==/UserScript==
- function stop() {
- this.pause();
- //this.currentTime=0;
- this.removeEventListener("timeupdate", stop, false);
- }
- function mv() {
- this.removeEventListener("timeupdate", stop, false);
- this.removeEventListener("mouseover", mv,true);
- this.play();
- }
- function loop() {
- tag = document.querySelectorAll('video,audio');
- for(i = 0; i < tag.length; i++){
- if(tag[i].getAttribute("paused")!=1){
- tag[i].autoplay=false;
- tag[i].controls=true;
- tag[i].addEventListener("timeupdate", stop, false);
- tag[i].addEventListener("mouseover", mv,true);
- tag[i].setAttribute("paused",1);
- }
- }
- setTimeout(function(){
- loop();
- }, 1000);
- }
- loop();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址