Ideally we'd just perform the search ourselves, but as long as
we have to rely on an external provider, at least make it a
somewhat privacy-conscious one.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
docs/js/main.js | 16 +++++++++++-----
docs/page.xsl | 4 ++--
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/docs/js/main.js b/docs/js/main.js
index 57e1faf030..87b817b287 100644
--- a/docs/js/main.js
+++ b/docs/js/main.js
@@ -40,12 +40,13 @@ function advancedsearch(e) {
var form = document.createElement("form");
form.method = "get";
+ var q = document.getElementById("searchq");
var newq = document.createElement("input");
newq.type = "hidden";
newq.name = "q";
+ newq.value = q.value;
form.appendChild(newq);
- var q = document.getElementById("searchq");
var whats = document.getElementsByName("what");
var what = "website";
for (var i = 0; i < whats.length; i++) {
@@ -56,15 +57,20 @@ function advancedsearch(e) {
}
if (what == "website" || what == "wiki") {
- form.action = "https://google.com/search";
+ form.action = "https://duckduckgo.com/";
+
+ var newsite = document.createElement("input");
+ newsite.type = "hidden";
+ newsite.name = "sites";
+ form.appendChild(newsite);
+
if (what == "website") {
- newq.value = "site:libvirt.org " + q.value;
+ newsite.value = "libvirt.org";
} else {
- newq.value = "site:wiki.libvirt.org " + q.value;
+ newsite.value = "wiki.libvirt.org";
}
} else if (what == "devs" || "users") {
form.action = "https://lists.libvirt.org/archives/search";
- newq.value = q.value;
var newl = document.createElement("input");
newl.type = "hidden";
diff --git a/docs/page.xsl b/docs/page.xsl
index 27607e4d92..8a1a77fa99 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -77,9 +77,9 @@
</ul>
</div>
<div id="search">
- <form id="simplesearch"
action="https://www.google.com/search"
enctype="application/x-www-form-urlencoded" method="get">
+ <form id="simplesearch"
action="https://duckduckgo.com/"
enctype="application/x-www-form-urlencoded" method="get">
<div>
- <input id="searchsite" name="sitesearch"
type="hidden" value="libvirt.org"/>
+ <input id="searchsite" name="sites"
type="hidden" value="libvirt.org"/>
<input id="searchq" name="q" type="text"
size="12" value=""/>
<input name="submit" type="submit"
value="Go"/>
</div>
--
2.43.0