hover.com - Sort domains by regular price.

Lets you sort domains on hover.com by their regular price.

目前为 2019-07-02 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name hover.com - Sort domains by regular price.
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.5
  5. // @description Lets you sort domains on hover.com by their regular price.
  6. // @author You
  7. // @match https://www.hover.com/*
  8. // @grant GM_registerMenuCommand
  9. // ==/UserScript==
  10.  
  11. function sortByRegularPrice(){
  12.  
  13. var getLiItemPrice = (element) => Number(element.textContent.split('$')[1])
  14. var priceItems = document.querySelectorAll('.table tbody tr td:nth-of-type(3)')
  15.  
  16. Array.from(priceItems)
  17. .sort((prevElem, nextElem) => getLiItemPrice(prevElem) - getLiItemPrice(nextElem))
  18. .forEach(elem => {
  19. var parentContainer = elem.parentNode
  20. document.querySelector('.table tbody').appendChild(parentContainer)
  21. })
  22.  
  23.  
  24. }
  25.  
  26. GM_registerMenuCommand('Sort Domains By Regular Price', sortByRegularPrice)