Skip to Content

showSuggestedGCSEPage()

Show the suggested Google Custom Search Engine page when applicable.

JavaScript February 7, 2021

Usage

JavaScript
nebula.showSuggestedGCSEPage(title, url)

Parameters

title
(Required) (String) The title of the search result
Default: None

url
(Required) (String) The URL of the search result
Default: None

Request or provide clarification »

Source File

Located in /assets/js/modules/search.js on line 424.

No Hooks

This function does not have any filters or actions available. Request one?
JavaScript
nebula.showSuggestedGCSEPage = function(title, url){
    const hostname = new RegExp(location.host);
    if ( hostname.test(url) ){ //Only show results for this same website
        jQuery('.gcse-suggestion').attr('href', url).text(title);
        jQuery('#nebula-drawer.suggestedpage').slideDown();
        nebula.prefetch(url);
    }
};

Override

To override or disable this JavaScript function, simply redeclare it with the exact same function name.

JavaScript
nebula.showSuggestedGCSEPage = function(title, url){
    //Write your own code here, leave it blank, or return false.
}