Dexscreener Hide Rows in Screener

When in Dexscreener and you have are browsing coins that match your favorite set of filters, isn't it annoying to see the same coins you have deemed of no value? Use this extension to hide those away.

目前为 2025-01-28 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Dexscreener Hide Rows in Screener
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description When in Dexscreener and you have are browsing coins that match your favorite set of filters, isn't it annoying to see the same coins you have deemed of no value? Use this extension to hide those away.
  6. // @match https://dexscreener.com/*
  7. // @grant none
  8. // @author @pseudo_echoo
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function addXButtons() {
  16. const rows = document.querySelectorAll('.ds-dex-table-row.ds-dex-table-row-top');
  17. rows.forEach((row) => {
  18. if (!row.querySelector('.hide-row-button')) {
  19. const buttonContainer = document.createElement('div');
  20. buttonContainer.style.display = 'flex';
  21. buttonContainer.style.alignItems = 'center';
  22. buttonContainer.style.marginRight = '10px';
  23. buttonContainer.style.position = 'relative';
  24. buttonContainer.style.zIndex = '9999';
  25.  
  26. const button = document.createElement('button');
  27. button.textContent = 'X';
  28. button.className = 'hide-row-button';
  29. button.style.cursor = 'pointer';
  30. button.style.padding = '2px 6px';
  31. button.style.backgroundColor = '#ff4444';
  32. button.style.color = 'white';
  33. button.style.border = 'none';
  34. button.style.borderRadius = '3px';
  35. button.style.position = 'relative';
  36. button.style.zIndex = '9999';
  37.  
  38. button.onclick = function(e) {
  39. e.preventDefault();
  40. e.stopPropagation();
  41. row.style.display = 'none';
  42. const href = row.getAttribute('href');
  43. localStorage.setItem(`hiddenRow_${href}`, 'true');
  44. };
  45.  
  46. buttonContainer.appendChild(button);
  47. const firstCell = row.querySelector('div');
  48. if (firstCell) {
  49. firstCell.style.display = 'flex';
  50. firstCell.style.alignItems = 'center';
  51. firstCell.insertBefore(buttonContainer, firstCell.firstChild);
  52. }
  53. }
  54.  
  55. const href = row.getAttribute('href');
  56. if (localStorage.getItem(`hiddenRow_${href}`) === 'true') {
  57. row.style.display = 'none';
  58. }
  59. });
  60. }
  61.  
  62. // Run the function initially
  63. setTimeout(addXButtons, 1000);
  64.  
  65. // Use a MutationObserver to handle dynamically loaded content
  66. const observer = new MutationObserver((mutations) => {
  67. setTimeout(addXButtons, 500);
  68. });
  69. observer.observe(document.body, { childList: true, subtree: true });
  70. })();