MissAV Disable Auto Pause

Stop MissAV pause video when page blur

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         MissAV Disable Auto Pause
// @namespace    coolrice.scripts
// @description  Stop MissAV pause video when page blur
// @version      0.2
// @author       CoolRice
// @match        https://missav.ws/*
// @grant        none
// @run-at       document-start
// @license      MIT
// ==/UserScript==
(function() {
    'use strict';

    // 备份原始的事件监听器方法
    const originalAddEventListener = document.addEventListener;
    const originalRemoveEventListener = document.removeEventListener;
    const originalWindowRemoveEventListener = window.removeEventListener;

    // 创建新的 addEventListener,屏蔽 visibilitychange 和 blur 事件
    document.addEventListener = function(event, callback, options) {
        if (event === 'visibilitychange' || event === 'blur') {
            // 直接不添加监听器,避免触发
            return;
        }
        else {
            originalAddEventListener.call(document, event, callback, options);
        }
    };

    // 创建新的 addEventListener,屏蔽 visibilitychange 和 blur 事件
    window.addEventListener = function(event, callback, options) {
        if (event === 'visibilitychange' || event === 'blur') {

            // 直接不添加监听器,避免触发
            return;
        }
        else {
            originalAddEventListener.call(window, event, callback, options);
        }
    };
})();