MissAV Disable Auto Pause

Stop MissAV pause video when page blur

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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);
        }
    };
})();