Ebay for "according to description"

Tries to view the item description valid at the date of purchase

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Ebay for "according to description"
// @description  Tries to view the item description valid at the date of purchase
// @author       Werve
// @match        https://order.ebay.it/ord/*
// @icon         https://icons.duckduckgo.com/ip2/ebay.it.ico
// @grant        none
// @create       2022-01-13
// @lastmodified 2022-11-04
// @version      0.2
// @namespace    https://greasyfork.org/users/669237
// @require      https://code.jquery.com/jquery-3.6.0.min.js
// @license      CC BY 4.0
// @copyright    2022 Werve
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    $.noConflict(true);
    $(".item-card-container").find(".card-content-description-box").append("<div id='try_old_desc'> <button id='old_desc'> View item description valid at the date of purchase </button></div>");
    $("button#old_desc").click(URL_desc);
})();

function URL_desc(){
    let URL = $(this).parent().parent().find(".card-content-actions").find(".eui-textual-display.eui-textual-display--action").attr("href");
    let productId = URL.match(/.*item.?id=(\d+)/)[1];
    let transactionId = URL.match(/.*transId=(\d+)/)[1];
    let URL2 = "https://ebay.it/ipp/"+ productId +"?transactionId="+ transactionId;
    window.open(URL2, '_blank').focus();
}