-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.html
More file actions
26 lines (26 loc) · 753 Bytes
/
search.html
File metadata and controls
26 lines (26 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Search</title>
<link rel="search" href="search.xml" title="schroederc.github.io Search"
type="application/opensearchdescription+xml" />
</head>
<body>
<script type="text/javascript">
const q = new URLSearchParams(window.location.search).get('q');
if (q && q.length !== 0) {
const p = encodeURIComponent(q);
if (q.indexOf('!') < 0) {
window.location.replace('https://google.com/search?q=' + p);
} else {
window.location.replace('https://duckduckgo.com/?q=' + p);
}
}
</script>
<form>
<input type="search" id="q" name="q" />
<input type="submit" value="Submit" />
</form>
</body>
</html>