1

How can I make Startpage's search results page automatically highlight query keywords used in the search without changing the browser's search tools?

For example, DuckDuckGo automatically highlight almost all query keywords in the search results.

screenshot of startpage, duckduckgo

migrated from superuser.com Nov 23 '18 at 2:55

This question came from our site for computer enthusiasts and power users.

2

That feature was removed. Per Startpage support:

As of November 2018, the highlighting feature is no longer supported, as it is available in all major browsers.

Just because the browser can do it, doesn't make it convenient to do it as an additional, separate step, so maybe not a great decision on their part. But there it is.

1

You can try to use this userscript, it basically does exactly what you want. You'll need an extension to run custom userscripts though, like violentmonkey

Edit 1: Here is the content of this userscript in case the link will expire:

// ==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.6
// @author         SecT0uch <pro.ernst@gmail.com>
// @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").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 searchTerms = query.split(' ');                                 // Splitting request string in array
    var searchTerms = searchTerms.filter(String);                       // Remove empty values (fix begin/end/double white spaces)

    var results =  document.querySelectorAll("p.search-item__body");             // 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
        }
    }
}
  • 1
    It would be better if you can add useful contents of the link into answer itself. Link only answers will become invalid if link get change. – serenesat Nov 23 '18 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.