hover.com - Sort domains by regular price.

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

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

// ==UserScript==
// @name         hover.com - Sort domains by regular price.
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  Lets you sort domains on hover.com by their regular price.
// @author       You
// @match        https://www.hover.com/*
// @grant        GM_registerMenuCommand
// ==/UserScript==

function sortByRegularPrice(){

var getLiItemPrice = (element) => Number(element.textContent.split('$')[1])
var priceItems = document.querySelectorAll('.table tbody tr td:nth-of-type(3)')

Array.from(priceItems)
.sort((prevElem, nextElem) => getLiItemPrice(prevElem) - getLiItemPrice(nextElem))
.forEach(elem => {
    var parentContainer = elem.parentNode
	document.querySelector('.table tbody').appendChild(parentContainer)
})


}

GM_registerMenuCommand('Sort Domains By Regular Price', sortByRegularPrice)