Created
January 13, 2022 10:29
-
-
Save myfonj/36a2a72a8ac6b6172ee32aae271e7ca3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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>Firefox shell</title> | |
<script type="text/javascript"> | |
/* | |
howto: | |
# place this file somewhere on your disk | |
# open it in Firefox | |
# bookmark it, so it's address is like | |
# file:///c:/web-root/utils/firefox-shell.html | |
# edit new bookmark: append '?%s' to its URL, so it becomes | |
# file:///c:/web-root/utils/firefox-shell.html?%s | |
# set some handy Keyword, eg. '>', '#' or '!' for it | |
# try it. you should see a list of defined 'bookmarks' (testing only) | |
# extend, tweak. | |
# remember that you must use space after the main Keyword: "> command argument1 argument2" | |
*/ | |
var library = | |
{ 'args' : function () | |
{ document.write( Array.prototype.join.call( arguments ) ) | |
} | |
, 'goto' : function ( where ) | |
{ if ( where ) return where | |
} | |
, 'g' : function() | |
{ return 'http://google.com/search?q="'+args+'"' | |
} | |
, 'time' : function() | |
{ document.write( new Date() ) | |
} | |
} | |
var args = decodeURIComponent( document.location.search ).slice(1).split(/\s+/) | |
var fnc = args.shift() | |
if( library[fnc] ) | |
{ var ret = library[fnc].call(library[fnc],args) | |
; if( ret ) document.location.replace( ret ) | |
} | |
else | |
{ var notice = ['Supported commands: <ul>'] , i = 0 , fnc | |
; for( fnc in library ) notice[++i] = fnc | |
; document.write( notice.join('<li>') + '</ul>') | |
} | |
</script> | |
</head> | |
<body></body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment