Amazon - Hide delivered items from open orders

Hides all delivered items from your open orders.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Amazon - Hide delivered items from open orders
// @description  Hides all delivered items from your open orders.
// @author       Daku ([email protected])
// @namespace    https://github.com/DakuTree/userscripts
// @homepage     https://github.com/DakuTree/userscripts
// @homepageURL  https://github.com/DakuTree/userscripts
// @supportURL   https://github.com/DakuTree/userscripts/issues
// @icon         https://www.amazon.co.uk/favicon.ico
// @match        https://www.amazon.co.uk/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.co.jp/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.com/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.es/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.de/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.it/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.fr/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.ca/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.cn/gp/*/order-history/*orderFilter=open*
// @version      1.0.2

// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js
// ==/UserScript==


// (?:co(?:m|\.(?:uk|jp))|es|de|it|fr|ca|cn)
'use strict';

//Hide delivered items.
$(/* Delivered items */'.shipment-is-delivered').add(
	$(/* Dispatched items */'.a-color-success:contains(Dispatched)').parents('.shipment')
).add(
	$(/* Irregular delivered items, but not marked as such */'.shipment:not(:has(.shipment-top-row))')
).hide();

//Generate link to show hidden items.
$('#controlsContainer').after(
	$('<div/>', {style: 'text-align: center'}).append(
		$('<a/>', {id: 'show-hidden', href: '#', text: 'Click to show delivered items'})
	)
);
$('body').on('click', 'a#show-hidden', function() {
	$('.shipment-is-delivered').add($('.a-color-success:contains(Dispatched)').parents('.shipment')).show();
	$(this).hide();
});