您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Unmute video by default
// ==UserScript== // @name Unmute Frigate Live View // @namespace http://tampermonkey.net/ // @version 0.2 // @description Unmute video by default // @match https://frigate.domain.com/* // @match http://192.168.0.225/* // @match http://192.168.0.226/* // @grant none // @license MIT // ==/UserScript== // Script created by ChatGPT, OpenAI (function() { 'use strict'; function unmuteWithDelays(videoElement, attempts) { if (attempts > 0) { setTimeout(() => { videoElement.muted = false; videoElement.volume = 1.0; unmuteWithDelays(videoElement, attempts - 1); }, 2000); // Delay of 2 seconds between attempts } } function unmuteVideo() { const videoElement = document.querySelector('video'); if (videoElement) { unmuteWithDelays(videoElement, 1); // Unmute 1 time with delays } } function setupObserver() { const observer = new MutationObserver(mutations => { for (const mutation of mutations) { if (mutation.addedNodes.length) { for (const node of mutation.addedNodes) { if (node.nodeName === 'VIDEO') { unmuteVideo(); } } } } }); observer.observe(document.body, { childList: true, subtree: true }); } window.addEventListener('load', function() { unmuteVideo(); setupObserver(); // Setup observer to detect new video elements }); })();