您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This greasemonkey UserScript helps the user to focus on the revelant information in the result page. It basically put the search terms in bold.
当前为
// ==UserScript== // @name StartPage Beautifier // @namespace https://framagit.org/SecT0uch/StartPage-Beautifier // @description This greasemonkey UserScript helps the user to focus on the revelant information in the result page. It basically put the search terms in bold. // @version 1.4 // @author SecT0uch <[email protected]> // @homepageURL https://framagit.org/SecT0uch/StartPage-Beautifier // @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/ // @copyright 2018+, Jordan ERNST (https://framagit.org/SecT0uch/StartPage-Beautifier) // @match https://*.startpage.com/do/*search* // ==/UserScript== window.addEventListener ("load", Greasemonkey_main, false); function Greasemonkey_main () { var toClean = ['title:', 'host:', 'url:', 'link:', ' OR', '"']; // Special chars to exclude from being bolded var query = document.getElementById("query_top").value; // Search request for (var x = 0; x < toClean.length; x++) { query = query.replace(new RegExp(toClean[x], 'g'), ''); // Removing special chars from request } var re = /\s+/g; // Matches 1 or mor spaces var searchTerms = query.split(re); // Splitting request string in array var results = document.querySelectorAll("p.desc.clk"); // Description text (under link) // We bold every term in every description : for (var i = 0; i < results.length; i++) { for (var j = 0; j < searchTerms.length; j++) { var term = searchTerms[j]; results[i].innerHTML = results[i].innerHTML.replace(new RegExp(term, 'gi'), "<strong>$&</strong>"); // $& = matched value. <b></b> not supported } } }