eBay Remove Variation Listings

Removes variation listings (multiple prices, $X to $Y) from eBay

当前为 2019-02-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name eBay Remove Variation Listings
  3. // @description Removes variation listings (multiple prices, $X to $Y) from eBay
  4. // @namespace https://jacobbundgaard.dk
  5. // @version 1.0
  6. // @match https://www.ebay.at/sch/i.html
  7. // @match https://www.ebay.be/sch/i.html
  8. // @match https://www.ebay.ca/sch/i.html
  9. // @match https://www.ebay.ch/sch/i.html
  10. // @match https://www.ebay.cn/sch/i.html
  11. // @match https://www.ebay.co.th/sch/i.html
  12. // @match https://www.ebay.co.uk/sch/i.html
  13. // @match https://www.ebay.com.au/sch/i.html
  14. // @match https://www.ebay.com.hk/sch/i.html
  15. // @match https://www.ebay.com.my/sch/i.html
  16. // @match https://www.ebay.com.sg/sch/i.html
  17. // @match https://www.ebay.com.tw/sch/i.html
  18. // @match https://www.ebay.com/sch/i.html
  19. // @match https://www.ebay.de/sch/i.html
  20. // @match https://www.ebay.es/sch/i.html
  21. // @match https://www.ebay.fr/sch/i.html
  22. // @match https://www.ebay.ie/sch/i.html
  23. // @match https://www.ebay.it/sch/i.html
  24. // @match https://www.ebay.nl/sch/i.html
  25. // @match https://www.ebay.ph/sch/i.html
  26. // @match https://www.ebay.pl/sch/i.html
  27. // @match https://www.ebay.vn/sch/i.html
  28. // @grant none
  29. // ==/UserScript==
  30.  
  31. (function() {
  32. const items = document.querySelectorAll(".s-item, .sresult");
  33. const variationItems = [].filter.call(items, item => item.querySelector(".s-item__price > .DEFAULT, .prRange"));
  34. for (const item of variationItems) {
  35. item.style.display = "none";
  36. }
  37. var stylesheet = document.createElement("style");
  38. stylesheet.append(document.createTextNode(`
  39. @keyframes fadeout {
  40. from { opacity: 1; }
  41. to { opacity: 0; }
  42. }
  43. `));
  44. document.head.appendChild(stylesheet);
  45.  
  46. var message = document.createElement("div");
  47. message.appendChild(document.createTextNode(variationItems.length + " variation listings removed"));
  48. message.style.position = "absolute";
  49. message.style.top = "40px";
  50. message.style.right = "10px";
  51. message.style.height = "38px";
  52. message.style.boxSizing = "border-box";
  53. message.style.padding = "10px";
  54. message.style.border = "1px solid #ddd";
  55. message.style.borderRadius = "3px";
  56. message.style.backgroundColor = "white";
  57. message.style.color = "#333";
  58. message.style.fontSize = "12px";
  59. message.style.animation = "fadeout 1s ease 9s forwards";
  60. document.body.appendChild(message);
  61. })();