Greasy Fork is available in English.
Manipulate video elements and remove modal on web pages
当前为
// ==UserScript==
// @name Video Manipulator and Modal Remover
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Manipulate video elements and remove modal on web pages
// @author Alcex
// @match *://*/*
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
function manipulateVideo() {
var v = document.querySelector("video");
if (v) {
v.dispatchEvent(new Event("ended"));
v.muted = true;
v.currentTime = Math.floor(v.duration);
v.play();
}
// 1秒后再次调用自身
setTimeout(manipulateVideo, 1000);
}
function removeModal() {
var modal = document.querySelector(".fish-modal-root");
if (modal) {
modal.remove();
}
}
// 开始循环
manipulateVideo();
// 移除模态框
removeModal();
})();