Created
October 30, 2014 08:11
-
-
Save jpouellet/17f10488161124fd13e8 to your computer and use it in GitHub Desktop.
Allows POSIX documentation to be searched as a "Search Engine" in Chromium / Google Chrome.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>POSIX search wrapper</title> | |
<meta name="description" content="because Chrome search engines can't use POST requests" /> | |
<script type="text/javascript"> | |
window.addEventListener('load', function() { | |
document.getElementsByTagName('span')[0].textContent = window.location + '#%s'; | |
var query = window.location.hash.substr(1); | |
if (query.length > 0) { | |
document.getElementsByTagName('input')[0].value = query; | |
document.getElementsByTagName('form')[0].submit(); | |
} else | |
document.getElementsByTagName('body')[0].style.display = 'block'; | |
}, false); | |
</script> | |
<style type="text/css"> | |
body { | |
display: none; | |
} | |
p { | |
-webkit-user-select: none; | |
user-select: none; | |
} | |
span { | |
font-family: monospace; | |
-webkit-user-select: all; | |
user-select: all; | |
} | |
</style> | |
</head> | |
<body> | |
<form action="http://pubs.opengroup.org/cgi/kman4.cgi" method="POST"> | |
<label>Search <a href="https://en.wikipedia.org/wiki/POSIX">POSIX</a>: <input type="text" name="value" /></label> | |
</form> | |
<p>To add as search engine, use <span></span>.</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment