Aliexpress easy order confirmation

Adding a functionality to open the confirm order pages in a new tab with a middle click on the buttons and check all check boxes automatically

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.

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         Aliexpress easy order confirmation
// @namespace    http://tampermonkey.net/
// @version      0.11
// @description  Adding a functionality to open the confirm order pages in a new tab with a middle click on the buttons and check all check boxes automatically 
// @author       Sela Oren
// @match        https://trade.aliexpress.com/orderList.htm*
// @match        https://trade.aliexpress.com/order_list.htm*
// @match        https://trade.aliexpress.com/order_detail.htm*
// @grant        unsafeWindow
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';
    document.body.onmousedown = function(e) { if (e.button === 1) return false; };

    $(".button-confirmOrderReceived").attr("onmouseup", "whichButton(event);").attr("oncontextmenu", "event.preventDefault();"); // add middke click event to buttons
	unsafeWindow.whichButton = function (e) {
		let btnCode = e.button;
		if (btnCode == 1) {
			window.open('https://trade.aliexpress.com/order_detail.htm?orderId='+e.path[0].getAttribute("orderid"),'_blank');
		return false;
		}
	};

    $(':checkbox').prop('checked', true); // check all check boxes, it's for the confirm order page
})();