Prevent middle click Javascript void tab

Stops web browser from opening blank javascript:void(0) tabs when middle clicking on Javascipt links.

Pada tanggal 22 Oktober 2020. Lihat %(latest_version_link).

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        Prevent middle click Javascript void tab
// @namespace   https://greasyfork.org/users/697378-reiver
// @match       *://*/*
// @grant       none
// @version     1.0
// @author      Reiver
// @description Stops web browser from opening blank javascript:void(0) tabs when middle clicking on Javascipt links.
// ==/UserScript==

$(document).on('auxclick', 'a[href^="javascript:"]', function (e) {
    if (e.button == 1) {
        e.preventDefault();
    }
});