bypass rule34 video context menu

bypass rule34 video context menu and show default browser context menu

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         bypass rule34 video context menu
// @namespace    https://github.com/mistaairline/rule34xxx-rightclick-preventer/tree/v.1.00
// @version      1.0.1
// @description  bypass rule34 video context menu and show default browser context menu
// @match        https://rule34.xxx/*
// @run-at       document-start
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function isVideoTarget(e) {
        return e.target instanceof HTMLVideoElement ||
                e.target.closest && e.target.closest('video');
    }


    ['mousedown', 'pointerdown', 'contextmenu'].forEach(type => {
        document.addEventListener(type, function(e) {
            if (e.button !== 2) return;
            if (!isVideoTarget(e)) return;

            e.stopImmediatePropagation();

        }, true);
    });
    
})();