Ebay for "according to description"

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

  1. // ==UserScript==
  2. // @name Ebay for "according to description"
  3. // @description Tries to view the item description valid at the date of purchase
  4. // @author Werve
  5. // @match https://order.ebay.it/ord/*
  6. // @icon https://icons.duckduckgo.com/ip2/ebay.it.ico
  7. // @grant none
  8. // @create 2022-01-13
  9. // @lastmodified 2022-11-04
  10. // @version 0.2
  11. // @namespace https://greasyfork.org/users/669237
  12. // @require https://code.jquery.com/jquery-3.6.0.min.js
  13. // @license CC BY 4.0
  14. // @copyright 2022 Werve
  15. // @run-at document-end
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20.  
  21. $.noConflict(true);
  22. $(".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>");
  23. $("button#old_desc").click(URL_desc);
  24. })();
  25.  
  26. function URL_desc(){
  27. let URL = $(this).parent().parent().find(".card-content-actions").find(".eui-textual-display.eui-textual-display--action").attr("href");
  28. let productId = URL.match(/.*item.?id=(\d+)/)[1];
  29. let transactionId = URL.match(/.*transId=(\d+)/)[1];
  30. let URL2 = "https://ebay.it/ipp/"+ productId +"?transactionId="+ transactionId;
  31. window.open(URL2, '_blank').focus();
  32. }