Skip to content
Snippets Groups Projects
Commit cc13f792 authored by Kevin Abel's avatar Kevin Abel
Browse files

Added a hack that works around a bug in the google API that prevents the use...

Added a hack that works around a bug in the google API that prevents the use of linked CSE's via the {crefUrl: ""} in the CustomSearchControl constructor. The hack uses API calls that are part of the depricated search API, but it appears to restore functionality.
parent a0f751f3
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,11 @@ function searchInit() {
if (UNL_Search.do_local_search) {
var local_search = new google.search.CustomSearchControl(UNL_Search.local_search_context);
// WARNING: The following code is an undocumented method of the Google API
// and appears to be on the deprication list, but it fixes a MAJOR bug in
// that prevents the use of linked CSE's
local_search.getWebSearcher().setSiteRestriction(UNL_Search.local_search_context);
// end hack
local_search.setResultSetSize('small');
local_search.setSearchCompleteCallback(UNL_Search, UNL_Search.onSearchComplete);
local_search.draw('local_results', drawOp);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment