Allow Right-Click with Tampermonkey Menu Option

Allows right-clicking on websites that prevent it by clicking the menu button in the Tampermonkey extension.

Verze ze dne 12. 11. 2024. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Allow Right-Click with Tampermonkey Menu Option
// @namespace    https://github.com/Nick2bad4u/UserStyles
// @version      1.6
// @description  Allows right-clicking on websites that prevent it by clicking the menu button in the Tampermonkey extension.
// @author       Nick2bad4u
// @match        *://*/*
// @grant        GM_registerMenuCommand
// @icon         https://i.gyazo.com/353b60294e0dc77af7119d58ab0aa1ad.png
// @license      UnLicense
// @tag          all
// ==/UserScript==

(function() {
    'use strict';

    // Function to enable right-click
    function enableRightClick() {
        document.addEventListener('contextmenu', function(event) {
            event.stopPropagation();
        }, true);

        document.addEventListener('mousedown', function(event) {
            if (event.button === 2) {
                event.stopPropagation();
            }
        }, true);

        document.addEventListener('mouseup', function(event) {
            if (event.button === 2) {
                event.stopPropagation();
            }
        }, true);

        alert('Right-click has been enabled!');
    }

    // Register the option in the Tampermonkey menu
    GM_registerMenuCommand("Enable Right-Click", enableRightClick);
})();