Bunnings Grey Out Marketplace Items

Greys out Bunnings items with "Marketplace" badge

  1. // ==UserScript==
  2. // @name Bunnings Grey Out Marketplace Items
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Greys out Bunnings items with "Marketplace" badge
  6. // @match https://www.bunnings.com.au/*
  7. // @grant none
  8. // @license GNU GPLv2
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. 'use strict';
  13.  
  14. const greyOutItems = () => {
  15. // Select all product tiles
  16. const productTiles = document.querySelectorAll('article.search-product-tile');
  17.  
  18. productTiles.forEach(tile => {
  19. const badge = tile.querySelector('div.badgeText');
  20. if (badge && badge.textContent.trim().toLowerCase() === 'marketplace') {
  21. // Apply grey-out styling
  22. tile.style.opacity = '0.4';
  23. tile.style.filter = 'grayscale(100%)';
  24. tile.style.pointerEvents = 'none'; // optional: disable interaction
  25. tile.style.transition = 'all 0.3s ease-in-out';
  26. console.log('Grayed out a Marketplace item:', tile);
  27. }
  28. });
  29. };
  30.  
  31. // Observe dynamic content loading
  32. const observer = new MutationObserver(greyOutItems);
  33. observer.observe(document.body, { childList: true, subtree: true });
  34.  
  35. // Initial check
  36. window.addEventListener('load', greyOutItems);
  37. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址