I'm trying to configure keyword.URL to execute a javscript function
with the contents of the location bar as its argument. However it
appears that Firefox simply appends the location bar string to the end
of the string in keyword.URL.. And the <a href="http://
kb.mozillazine.org/Keyword.URL">kb article on Keyword.URL</a> seems to
confirm this. I'm wondering if there's a way to get a hold of the of
the contents of a the string as a variable, so it can be used within a
string rather than appended to it, much in the same way that keyworded
quicksearches work..
The following is a proof-of-concept. The javascript gets executed but
of course the location bar string is appended to the end as a comment
so it's not of much use...
keyword.enabled = true
keyword.URL = javascript:alert("test");//
Thinking that was probably a dead end, I also tried wrapping the
javascript function around the location bar contents by setting the
following, but it seems that Firefox doesn't evaluate this constructed
string as javascript, but searches for it as a host name...
keyword.enabled = false
browser.fixup.alternate.enabled = true
browser.fixup.alternate.prefix = javascript:alert("
browser.fixup.alternate.suffix = ");
Anybody have any ideas on how to pull this off? Any help would be
greatly appreciated.
Thanks,
Zeke Sikelianos
Have a look at bookmark keywords:
http://kb.mozillazine.org/Using_keyword_searches
you can write a bookmarklet like:
location: javascript: var param = %s; alert(param);
window.locattion.replace('your_URL_with'+param+'in_between');
keyword: [something short, like "go"]
you would enter "go <your param>" in the location bar.
Note: you can do with param in the bookmarklet what you like, like split
it on spaces to call you bookmarklet with more than one parameter.
Patrick
--
Engineers motto: cheap, good, fast: choose any two
Patrick Strasser <patrick dot strasser at tugraz dot at>
Student of Telematik, Techn. University Graz, Austria
Misspelled location
but is there a difference between that and using %S (or %s)
as part of the url in a normal keyword shortcut.
Set that pref to:
data:text/html,<body onload="alert(document.body.textContent)"><plaintext>
--
Rob Marshall [tH]
Awsome! Thanks Rob.
keyword.URL = data:text/html,<body
onload="alert(document.body.textContent)"><plaintext>