Force Double-Click to Close (No Exceptions)

Closes tab on ANY double-click, overriding all selection and input behaviors

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 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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Force Double-Click to Close (No Exceptions)
// @namespace    http://tampermonkey.net/
// @version      1.5
// @description  Closes tab on ANY double-click, overriding all selection and input behaviors
// @author       Jerry
// @match        *://*/*
// @exclude     http://192.168.1.2:1030/*
// @grant        window.close
// @run-at       document-start
// @homepage    https://greasyfork.org/en/scripts/560949

// ==/UserScript==

(function() {
    'use strict';

    window.addEventListener('dblclick', function(e) {
        // 1. BLOCK EVERYTHING ELSE
        // Stop the browser from selecting text, zooming, or triggering button actions
        e.preventDefault();
        e.stopPropagation();
        e.stopImmediatePropagation();

        // 2. CLOSE IMMEDIATELY
        console.log("Force Close Triggered");
        window.close();
        
    }, true); // Capture phase (true) ensures we catch it before the page does

})();