您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Sorts the google search buttons the old way.
// ==UserScript== // @name Desmartify google search buttons // @description Sorts the google search buttons the old way. // @version 1 // @grant none // @include https://www.google.com/search* // @namespace https://greasyfork.org/users/22770 // ==/UserScript== // jshint esversion:6 let seq = ["Images", "Videos", "Maps", "News", "Shopping"]; function arraysEqual(a, b) { if (a === b) return true; if (a == null || b == null) return false; if (a.length != b.length) return false; for (var i = 0; i < a.length; ++i) { if (a[i] !== b[i]) return false; } return true; } function SortButtons() { let tosort = document.querySelector("#hdtb-msb-vis"); let desiredSeq = [...tosort.children].sort((a, b) => seq.indexOf(a.innerText) > seq.indexOf(b.innerText) ? 1 : -1); if (!arraysEqual(tosort.children, desiredSeq)) { console.log("DesmartifyGoogleSearch: Sorting the buttons"); [...tosort.children].sort((a, b) => seq.indexOf(a.innerText) > seq.indexOf(b.innerText) ? 1 : -1).map(node => tosort.appendChild(node)); } } setInterval(SortButtons, 50);