Greasy Fork 支持简体中文。

DotDB PLUS

Add links and icons to TLDs in DotDB search results

  1. // ==UserScript==
  2. // @name DotDB PLUS
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Add links and icons to TLDs in DotDB search results
  6. // @author AtoZDomains@x.com
  7. // @match https://dotdb.com/search*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. function addLinksAndIconsToTLDs() {
  15. const tableBody = document.querySelector('#result-table tbody');
  16. if (!tableBody) {
  17. return;
  18. }
  19.  
  20. const rows = tableBody.querySelectorAll('tr');
  21.  
  22. rows.forEach(row => {
  23. const keywordCell = row.querySelectorAll('td')[0]; // Get keyword column (first td)
  24. if (!keywordCell) {
  25. return;
  26. }
  27. let sld = keywordCell.textContent.trim();
  28.  
  29. const tldCell = row.querySelectorAll('td')[3];
  30. if (!tldCell) {
  31. return;
  32. }
  33.  
  34. const tldDiv = tldCell.querySelector('.collapse-content .tw-w-\\[90\\%\\]');
  35. if (!tldDiv) {
  36. return;
  37. }
  38.  
  39. let tldText = tldDiv.textContent.trim();
  40. if (!tldText) {
  41. return;
  42. }
  43.  
  44. const tlds = tldText.split(',').map(tld => tld.trim());
  45.  
  46. let newHTML = '';
  47. tlds.forEach(tld => {
  48. const domain = `${sld}${tld}`;
  49. const link = `https://${domain}`;
  50. const iconUrl = `https://www.google.com/s2/favicons?domain=${domain}`;
  51.  
  52. const tldLinkHTML = `
  53. <a href="${link}" target="_blank" rel="noopener noreferrer" style="display: inline-flex; align-items: center; margin-right: 5px;">
  54. <img src="${iconUrl}" style="width: 16px; height: 16px; margin-right: 3px; vertical-align: middle;">
  55. ${tld}
  56. </a>`;
  57. newHTML += tldLinkHTML;
  58. });
  59.  
  60. tldDiv.innerHTML = newHTML;
  61. });
  62. }
  63.  
  64. window.addEventListener('load', addLinksAndIconsToTLDs);
  65.  
  66. })();