Google site search for   http://dmcritchie.mvps.org/firefox/ 

Firefox Keyword Shortcuts


Some suggestions for creating and maintaining keyword shortcuts (bookmark nicknames) for use in Firefox, and particularly for use with bookmarklets.

Keyword shortcuts are one of the very powerful tools in Firefox and are the easiest to create and maintain.  Would suggest putting your keyword shortcuts in their own folder so that they will all be together rather than scattered throughout the bookmarks file.  The foldername I use is identified by a single letter, K, so it doesn't take much space on the Personal Toolbar Folder. 

Keyword shortcuts are also called "custom keywords" as in Mozilla, and also called "smart keywords" and "smart shortcuts" which are used interchangeably and incorrectly for other Firefox features such as tags in Firefox 3 places, and are also incorrectly (limiting usage) called "search" keywords.  And if that isn't enough confusion the places shortcuts have been called "smart folders" and "smart bookmarks".   In Opera a "keyword shortcut" is called "nickname" (for a bookmark) which keeps their naming and usage apart from keyword usage in HTML itself, and would have no naming/usage conflict if tags as in Firefox 3 were implemented in Opera as tags or as what they probably would have called them keywords. 


Location: http://dmcritchie.mvps.org/firefox/kws.htm
Home page: http://dmcritchie.mvps.org/firefox/firefox.htm

(Install my k.html keyword bookmarks, and references, and install the "Add Bookmark Here ²" extension with my options] so you have keyword in bookmark dialog.


Bookmark Shortcuts, Keyword Shortcuts Creation and Keyboard Shortcuts   (#keywords)


Add Bookmark, Ctrl+D, extended by OpenBook with Options.
Can be done in userChrome or my preference with a style (userstyles.org)
see Keyword addition for Add/Change Bookmark.
Description filled in from META data.
Keyword filled in manually [heavily annotated picture]
Drop-down on left latest bookmark folders added to
Drop-down on right ability to select any bookmark folder.
Dialog box widened due to userChrome.css change.
Also see Bookmarks Extensions (on bookmarks page),
and Bookmark properties (also on bookmarks page).
Create keyword shortcuts for your favorite search engines, and for any bookmark. 

You can create a keyword shortcut from a simple site Search form (or any single line form) by right clicking within the form and choosing "Add a Keyword for this Search" (built-in) which will bring up a form similar to this [picture]  The actual location code (url) generated will include fields that you would not normally be aware of within the search form.

With the "Add Bookmark Here ²" extension, you can include a keyword when you create a normal bookmark as in the dialog at the right.  The extension has several features including bookmarking the active tab url from a bookmark folder's context (right-click) menu.  The "OpenBook" extension was an older less featured extension.

You can create a keyword without an extension using a style "Keyword addition for Add/Change Bookmark (Fx3) | userstyles.org (9029), but the extension is better.

Without any of the methods above you will not see the keyword or description field when you create the bookmark, but you can still enter the additional information through the Bookmark Properties to add/change a keyword. 

I have keyword shortcuts set up for such things as a web search, search a few selected sites, dictionary, wiki, stock quotes -- things that can use the substitutions for the %s (with substitution) or %S (substitution without re-substitution), usually placed at the end.  Using the small %s will result in additional substitutions of # replaced by %23, % by %25, and / by %2F.  No additional substitution will occur with capital %S (see Bug: 270703)

Difference between (small s) %s and (Capital S) %S     (#fragmentid)

  1. (small s): %s will have additional substitution replacements: # by %23, % by %25, and / by %2F, @ by %40.
  2. (Capital S): %S will not have substitutions and allow use of C++ in a Google search, allow use of @ in an email substitution, allow use of a fragment-id in a url substitution index.html#example2, and use of a directory as in code/example2.txt.

Where do keyword shortcuts exist: They are regular bookmarks that have been given a keyword name (see picture at right).

How are keyword shortcuts created: The easiest way is to create a bookmark with the bookmark star (Firefox version 3), or the previous methods with "Ctrl+D", or drag the favicon symbol to the left of the location bar to a bookmarks folder in the "Bookmarks Toolbar" (personal bookmarks), the "Bookmarks Menu" or to "Unsorted bookmarks". 

Assigning a keyword shortcut to a bookmark: Bring up the Bookmark Manager ("Ctrl+Shift+B") or the Bookmarks Sidebar ("Ctrl+B"), Right click on the bookmarklet to bring up properties and assign a shortcut to it.  Suggest including a colon as shown on mine to reduce errors.   See Bookmark Properties picture 

Colon within or at end of a keyword is a very good solution that distinguishes from location bar searching and from use of tags.  Opera users may have a problem as colon is not allowed in a nickname.  The beauty of Firefox keywords is that there are no restrictions on use of any character and is based on how used.  Tags was an unwelcome Fx3 feature because it hid usage of pre-existing usage of keyword shortcuts, and has made bookmarking dialogs very unwieldy and confusing to new users and previous Firefox users alike.  While shared tags in sites like delicious.com have proven useful because of the wide range of users it has been a thorn for Firefox users, and made bookmarks with tags less efficient even though it is in a database. 

Besides the shortcut is anything else special:  Use of  %s  (percent-sign lowercase s) will be substituted when invoked by whatever you specify whether it be a filename, words for a search, whatever you include will be included in the invoked url.

Difference between %s and capitalized %S for substitutions.
Originally %s (lowercase) was the only substitution available in keyword shortcuts, but since substitutions occurred it made inclusions of commercial pound sign (#) as used in fragment=id, slash (/) as used in including a directory, and at sign (@) as used in email impractical as they were substituted respectively by %23 for #, %47 for /, and %40 for @.  [references:  bug 270703 (2004-11-18), bug 272359 (2004-11-29), 123006 (2003-03-04)]

The %s (lowercase s) was what was intended by developers, but I'm hard pressed to find many examples where an htmlified version should be used, unless Javascript is involved.
The %S (uppercase S) without additional substitutions appears to be what I need most, if not, all of the time.

Usage:  I would be hard pressed to find anything where that (lowercase s) should even ever be used as much of my usage may involve substitutions like
    ffp: . (directory or default index)
    ffp: kws.htm
    ffp: firefox.htm
    ffp: firefox.htm#ext (use of fragment id)
    ffp: code/ (to show the code directory)
    g: link:dmcritchie.mvps.org/firefox/kws.htm
    gg: dmcritchie.mvps.org/firefox/kws.htm

Null Argument  If we assign google: to http://www.google.com/%s (lowercase s), some examples
google: followed by no spaces generates http://www.google.com/%s
google: followed by one space generates http://www.google.com/%s same as before since there is still no operand
google: followed by two spaces generates http://www.google.com/   since the operand is considered empty
google: followed by a period generates http://www.google.com/   which is the directory appears same a null
google: followed by "maps" generates http://www.google.com/maps
    images, video, news, maps, gmail, etc.; some will be like http://images.google.com

Quick Demonstration   (#quickdemo)
Using the keyword shortcut "w:") bookmarked to http://en.wikipedia.org/wiki/%s  for a quick demonstration of how keyword shortcuts work:  (It takes two spaces to enter with a null argument)

Character Arguments  (#chr):  It is possible to search on "C++" which Google would normally just treat as the letter "C".  Here is a shortcut (source: Hao2lian), I created this with a shortcut of ("g:chr").

javascript:document.location = "http://www.google.com/search?q=" + encodeURIComponent('%s');
Example:
  g:chr pl/i c++ "John W Kennedy"

Folder for shortcuts:  Suggest putting your keyword shortcuts in their own folder.  Anything after the keyword in the location bar will replace  %s  in the shortcut bookmark.  My folder is named K within my Bookmarks Toolbar.  The folder doesn't have to be readily accessible for use but you want to have fairly quick access to add items to it, and to help you “remember” the shortcuts you created.  I choose to put a colon at the end of the word.  The following may be customized for my own use but give you an idea of what you can use.

Example:  Enter http://dictionary.reference.com/search?q=%s  on the location bar, bookmark the resulting url by dragging the favicon picture on the left of the url within the location bar to within your toolbars or preferably to within the K folder on your personal bookmarks bar (if you created one), right click on properties to give it a keyword of "dict:" (with the colon) and a title of "dict: Dictionary Search". Then you can type "dict: spelling" on the location bar and get a definition for "spelling".
 
New Tab:
You should have Tools, Options, Tabs set so that new windows opens in a New Tab
Use Alt+Enter keyboard shortcut to open url on location bar in a new tab, also works for keyword shortcuts
In a Google search link add &newwindow=1
In a JavaScript link include new-window as the link for NT: User keyword shortcuts:
chrome:     userChrome, userContent, launchy 
    [-- file:///C:/Documents%20and%20Settings/Administrator/Application%20Data/Mozilla/Firefox/Profiles/default.NOP/chrome --]
    use about:cache to help you set up this shortcut keyword (keyword use has a space after colon)
config:     about:config  [-- about:config --] documentation can be found at About:config entries - MozillaZine Knowledge Base
g:          Google  [-- http://www.google.com/search?q=%s --]
gg:         Google Groups Advanced Search (*excel*)
            [-- http://groups.google.com/groups?as_ugroup=*excel*&num=100&as_q=%s --]
ggff:         Google Groups Advanced Search (*firefox*)
            [-- http://groups.google.com/groups?as_ugroup=mozilla.support.firefox&num=100&as_q=%s --]
gga:        Google Groups Advanced Search Panel (*excel*)
            [-- http://groups.google.com/advanced_group_search?q=group:*Excel*&num=100 --]
l:          Librarians' Index to the Internet  [-- http://lii.org/pub/htdocs/search?sm=;search=%S;action=show --]
profile:    profile directory (like chrome: must be customized to user's own profile)
                [file:///C:/Documents%20and%20Settings/Administrator/Application%20Data/Mozilla/Firefox/Profiles/default.NOP/]
w:          Wikipedia  [-- http://en.wikipedia.org/wiki/%s --]        
xl:         Excel on local HD  [-- file:///c:/localsite/dmcritchie/excel/%s --]
z:          search dmoz.org Open Directory of webpages  [-- http://www.google.com/search?q=site%3Admoz.org+%s --]

There are some special considerations for Google Advanced Search regarding the keyword shortcuts of gg: and gga: seen above that are covered on an additional page (google.htm) in more detail, and also Remediation for disastrous Google Beta Groups.

about: « builtin keywords for about:about:config, about:cache, about:buildconfig, about:plugins, about:credits, about:blank   More information on about:config preference entries documentation in the MozillaZine Knowledge Base.  This documentation has progressively degenerated since some decision was made to move things into categories, for instance accessibility is no longer in the document (moved 2006-01-03 06:10:10.

bookmarklets which have been also implemented as keyword shortcuts — highlight:(highlight links), href:, id:, int:(int/ext links), titles:(paren tips), reset:(PF5)

bugzilla 272359, 270703 use of a fragment id with %s replacement; (messes up with /, #, @ characters)
Appears to be fixed in Firefox 1.5 -- xlp: join.htm#trimall works as does
archive: http://dmcritchie.mvps.org/excel/join.htm#trimall

Use of fragment-id on a page can mess up bringing up same page in an editor such as with the "Launchy" extension, simply remove the fragment-id, refresh, and try again as this is not a Firefox problem and a fragment-id would be completely meaningless to an application such as an editor.

Directory in a shortcut:  if you have a shortcut such as xx: pointing to http://example.com/directory1/directory2/%s -- you can invoke it as xx: . with the period to bring up the directory instead of a specific file, xx: .. to go back one additional directory, probably more useful on your local site than on most websites.

problem: since slashes cannot customize a search for — g: site:mozilla.org inurl:support inurl:firefox %s

JavaScript
javascript:open("http://mail.google.com/","menubar=yes,toolbar=no,location=yes,directories=yes,status=yes,resizable=yes,scrollbars=yes");

Chrome URLs, Jesse Ruderman, to bring up portions of the options menu — i.e. chrome://browser/content/pref/pref.xul

See Keyboard shortcuts in HELP.  Useful shortcuts include completing a domain name node to enter it as .com use Ctrl+Enter, to enter as .net use Shift+Enter,  to enter as .org use Ctrl+Shift+Enter — you do not want to waste effort creating keyword shortcuts for such sites that you know so well.  Such sites addressed by a single word do not need keyword shortcuts. 

Also see Sorting Bookmarks in Firefox, and an Extension above to sort permanently in your bookmarks.html

Opening a Bookmarked page into a new tab   (#newtab)

Just as you can open any link on a webpage into a new tab(/window) with a keyboard shortcut, you can use the same keyboard shortcuts to open a bookmark in a new tab(/window) after modifying about:config so that they match.

You can Alt+Enter to open search from search bar into a new page, or to open a typed in (pasted in) url from the location bar.

Open Bookmarks in New Tab, After you installed this addon to your Firefox, bookmarks are opened in new tab always, and because they share their codes, all items in "History" sidebar panel and "Library" are also opened with new tabs.  I'm using other means to open a folder of bookmarks.

Making a bookmarked page open automatically in a new page with JavaScript

You can bookmark one of these as "gmail:" to open your GMail inbox.
I bookmarked both and gave the first one a keyword of "gmail:" opens in Basic HTML and the second one opens in Standard and has a color theme (view=pu) and I gave it a keyword of "gmail2:" through bookmark properties. To invoke the first one simply type  gmail:  into the location bar.

https://mail.google.com/mail/?ui=html&zy=s
https://mail.google.com/mail/?ui=2&fs=1&view=pu&st=themes#inbox

Add Javascript to your bookmarklet so your GMail inbox opens automatically in a new tab/window.
javascript:void(window.open(location.href="https://mail.google.com/mail/?ui=html&zy=s"))

For more information on using tabs see Tabbed Browsing in Firefox and Tabs configuration, extracted from About:config entries - MozillaZine Knowledge Base.


Folder K (keywords) on Firefox Personal Toolbar   (#k)


Bookmarks (Bar)       "Personal Toolbar Folder" within your bookmarks.html
*

My current bookmarks toolbar is almost all folders with the exception of a small portion inserted where "gg:fix" would appear alphabetically.  The bookmark separators allow these sections to remain in place while allowing for sorting of the bookmarks toolbar with the "SortPlaces" extension.
     ...  Fx  |  +  <  >  gg:fix  GV  H  L  Pz  Sp  |   K  S    sw  ID  ...  -- Bookmarks Toolbar Blue/Folders, Red/Bookmarks | userstyles.org
Bookmarklets on Bookmarks Toolbar (appear in red) used as buttons for easier access, and so that location bar url will remain undisturbed by not typing a keyword there.

K
Reset (F5)  bookmarklets   paren tips   HREF visible
(I authored the "HREF:" bookmarklet)
To expand all of the links:  use the HREF visible button above
 
<!-- noindex --> *** bookmarks are not to be indexed by robots [unfortunately this method of suppression is no longer recognized]

Keyword Shortcuts

These are just examples, please use the k.html link (found in the #khtml section, below) for a much more complete list, that can be imported into your bookmarks, and is better able to withstand changes by text editors over time.

Many of the shortcuts below do include shortcuturl="...:" but they don't seem to get carried to the link if you drag a link to your K (for keyword shortcuts) folder, so you will have to add the shortcut yourself, See manage bookmarks.  All the more reason to install by importing the k.html file.
:   (quick access to firefox.htm page add #frag-id)
:: - Mozillazine Knowledge Base search
[-- http://www.google.com/search?num=100&hl=en&newwindow=1&q=site%3Akb.mozillazine.org+-intitle%3Atalk+%S&btnG=Search --]
::: SUMO wrestling with Mozilla
[-- http://www.google.com/search?q=site%3Amozilla.com+%S --]
%temp%
aardvark: Aardvark Firefox Extension
addons: Addons search at AMO (site:addons.mozilla.org inurl:en-US/firefox/addon)
[-- http://www.google.com/search?num=100&q=site%3Aaddons.mozilla.org+inurl%3Aen-US%2Ffirefox%2Faddon+%S --]
ans: Answers.com keyword search
archive: Internet Archive Wayback Machine (set up for comparisons)
oooo archive.org ooooo
[-- javascript:location = 'http://web.archive.org/web/*dc_/'+escape(location); void 0 --]
babelfish: AltaVista - Babel Fish Translation
bmk: search bookmarklet OR favelet
bug: Retrieve Bugzilla Bug Report Number
chrome: userChrome, userContent, launchy (user must customize based on about:cache)
config: about:config
dict: dictionary search at reference.com
downloads: My downloads in documents and settings
ext: search extensions -- addons extensionroom
ff: Firefox web pages on local HD
use a period (spaces also work) to access the directory or firefox.htm for that page.
file:///c:/website/dmcritchie/firefox/%S
Improved version below with IF('%S')... [ref]-- also note capitalized %S so can handle fragment-id
javascript:if('%S')location.href='file:///c:/copiedsite/dmcritchie/firefox/%S';else%20location.href='file:///c:/copiedsite/dmcritchie/firefox/firefox.htm';
Unfortunately the improved version is not working, even though it had worked briefly.
ffp: Firefox web pages on website
using a period to access the directory will fail on website, since the index is not available.
javascript:if('%S')location.href='http://dmcritchie.mvps.org/firefox/%S';else%20location.href='http://dmcritchie.mvps.org/firefox/firefox.htm';
Unfortunately the improved version above is not working, even though it had worked briefly. use instead: http://dmcritchie.mvps.org/firefox/%s
ff_temp: Firefox Temporary directory
fm: is for freshmeat
free: Search for free stuff with a Google Search
-buy -for-sale -free-to-try -free-trial -trial -price -purchase -€* -$* %S
g: Google quick search)
gc: Google Cache of current page (see imillylcom/bm.htm)
gg: Google Advanced Groups Search (*excel*)
gga: Google Groups Advanced search Panel
ggff: Google Groups Advanced Search (*firefox*)
search the Firefox newsgrop mozilla.support.firefox, return 100 items at a time, even if not in your Google Groups preferences.
[-- http://groups.google.com/groups?as_ugroup=mozilla.support.firefox&num=100&as_q=%s --]
GGUK: advanced UK Excel groups search
gguk: GoogleGroups Advanced Search
geoLoc:  – geoLoc: obtain lat/long coordinates from Google Map
Center map first by double-clicking on desired map point
[-- javascript:void(prompt('',gApplication.getMap().getCenter())); --]
gm:  – Greasemonkey – gm_scripts/config.xml in your     profile directory (like chrome: must be customized to user's own profile)
GIFL: Google, I'm Feeling Lucky
gov: FirstGov.gov: The U.S. Government's Official Web Portal
gu: Geocities update (file manager)
gsite: Google Search with page's domain ‡‡‡
[--  http://www.google.com/search?num=100&q=site:' + escape(location.hostname) + ' %S' ; void 0 --]
help: firefox support
highlight: highlight links (bookmarklet)
href: HREF visible (bookmarklet)
href: HREF:A visible (bookmarklet for Android space instead of %20)
html40: HTML 4.0 Elements
id: Show Classes and IDs (bookmarklet)
id: Show Classes and IDs (modified bookmarklet)
ie: Internet Explorer and OE
infospace: search for word
int: int/ext links (bookmarklet)
kb: Microsoft Knowledge Base (MSKB) article
[-- http://support.microsoft.com/kb/%s --]
kb_: Mozilla KB title search   ("kb_:")
[-- http://www.google.com/search?num=100&hl=en&newwindow=1&q=site%3Akb.mozillazine.org+-intitle%3Atalk+%S&btnG=Search --]
Kzz: placeholder
l: - Librarians' Index to the Internet (search)
lg: Lockergnome - search Google
lg: Lockergnome's IT Professionals - January 2005 Archives
linkchecker: Validator w3.org (chk current page)
link: Search links to this page using AltaVista
-- javascript:void(location.href='http://www.altavista.com/web/results?itag=ody&q=link%3A'+location.href+'&kgs=1&kls=0') --
linked: Search links to this page using Google
-- javascript:function search_for_links_with_google (){window.open ('http://www.google.com/search?as_lq='+document.location, '','scrollbars,location,toolbar,status,menubar,resizable');}search_for_links_with_google(); --
lists: List of Lists
listzilla: ExtensionsList.html in download_win2000
moz: Search MozillaZine Forums — These are the newsgroups at forums MozillaZine
msgid: message-id into Google Groups (UK)
mvp: search selected MVP excel web sites
oe: Outlook Express
pro: Dictionary - Yahooligans! Reference 9pronunciation)-
profile: profile directory (user must customize based on about:cache)
red: Make visited links an obvious color -- also available to use with Stylish extension in a couple of styles:
quote: stock prices at finance.yahoo
Qzz: placeholder
reset: Reset (F5, bookmarklet)
sumo: wrestling with gators (SUMO:)
[-- https://support.mozilla.org/kb/%S --]
sumo2: Firefox Support Home Page (HELP and Tutorials)
[-- http://www.google.com/search?q=site%3Amozilla.com+%S&newwindow=1 --]
stock: Business Week (symbol)
-- http://host.businessweek.com/businessweek/Corporate_Snapshot.html?Symbol=%s --
t: thesaurus.reference.com
temp: get a file within file:///c:/temp
timer: Timer Wizard
titles: paren tips (bookmarklet)
TV: Listings, Yahoo (User must customize)
tv_can: Television - Entertainment - canada.com network (User must customize)
uptime: Show uptime for site server
validate: HTML at w3.org (this page0
w: is for Wikipedia
wayback: current page
javascript:void(location.href='http://web.archive.org/web/*dc_/'+location.href)
weather: 7-Day Forecast (user must customize based on geographical location)
xl: Excel local files
xlcp: Chip Pearson's Excel Topic Index
xldd: Contextures -- Excel Tips and Techniques
xldm:s search of David McRitchie's site
[-- http://www.google.com/search?q=%28site%3Awww.mvps.org+inurl%3Admcritchie+%s --]
xljw:s j-walk mostly Excel
xlweb: Google Search of Excel w/o newsgroup repeaters
z: Google Search: site:dmoz.org

Resize Window Examples  ☷☷☷☷     (#resize)

The following has been also added to a MozillaZine article "Resizing oversize window.

JavaScript no longer allowed to resize windows

Resizing with JavaScript has been made almost impossible beginning with Firefox 7.0.1 due to Bug 565541 – Web sites shouldn't be allowed to resize main window, which essentially renders the help provided on this page as useless and leaves users with problems without a simple circumvention to regain control so they can work including to work on fixing problems.

Overriding is convoluted because you must make a configuration change (about:config) to change services.sync.prefs.sync.dom.disable_window_move_resize to false.
You must invoke the JavaScript directly from a bookmark while in "about:config" or "about:addons" (i.e. an XUL window) as the active tab, and you can not invoke the bookmarklet as a keyword shortcut from the location bar.

Some idiot told everyone about using about:config, so that convoluted method was made no longer available.  Invoking a simple bookmarklet is now a prolonged 6-8 step process.  The following box has a picture indicating how to resize window using the Web Developer which is built-in to Firefox with Firefox 19 and generally available.

resize
FUBAR
Recovery
Picture with steps necessary to resize window to specific dimensions and/or location, now that your resize bookmarklets have been reduced to a repository catalog of code to be copied and pasted into the Web Developer Web Console [Ctrl+Shift+K].

Examples to Resize or Move windows: (Everything can be invoked from the Location Bar) The extra unforgiving extra steps have been forced ONLY upon Firefox users.

  1. "Ctrl+T" (command+T on a Mac) to open a new Tab in the current window with a keyboard shortcut
  2. "R:"   invoke about:config with a keyword shortcut:  (title begins with (space)R: to sort as the first shortcut in a bookmark folder named "Resize")
    chrome://global/content/config.xul
  3. invoke any Resize or Move keyword shortcut:
    • "1024:   Resize to a width of 1024"
      javascript:self.resizeTo(1024,screen.availHeight);self.moveTo(screen.availWidth-1024,0);
    • "512:L   Resize and move to left side of screen as if 1/2 of 1024"
      javascript:self.resizeTo(512,screen.availHeight);self.moveTo(-1,0);
    • "512:R"
      javascript:self.resizeTo(512,screen.availHeight);self.moveTo(845,0);
    • "center:bottom"
      javascript:self.moveTo((screen.width-window.outerWidth)/2,screen.availHeight-window.outerHeight)
    • "center:center"
      javascript:self.moveTo((screen.availWidth-window.outerWidth)/2,(screen.availHeight-window.outerHeight)/2)
    • "center:max"
      javascript:self.resizeTo(window.outerWidth,screen.availHeight);self.moveTo((screen.width-window.outerWidth)/2,0)
    • "center:top"
      javascript:self.moveTo((screen.width-window.outerWidth)/2,0)
    • "iPOD:   simulate iPOD on larger screen"
      javascript:self.resizeTo(800,480);self.moveTo(0,0);
    • "max:height"
      javascript:self.resizeTo(window.outerWidth,screen.availHeight);self.moveTo(window.screenX,0);
    • "max:width"
      javascript:self.resizeTo(screen.availWidth,window.outerHeight);self.moveTo(0,window.screenY);
    • "netbook:   Simulate 800x400 resolution on a larger screen" -- see http://kb.mozillazine.org/Netbooks"
      javascript:self.resizeTo(800,480);self.moveTo(0,0);
    • "resize:   to specified window width and available height"
      javascript:self.resizeTo(%S,screen.availHeight);self.moveTo((screen.availWidth-%S)/2+1,0)
    • "resize:L   simulate WinKey+left-cursor-key"
      javascript:self.resizeTo(screen.availWidth/2,screen.availHeight);self.moveTo(0,0);
    • "resize:R"  
      javascript:self.resizeTo(screen.availWidth/2,screen.availHeight);self.moveTo(screen.availWidth/2+1,0);
    • "resize:reduce"
      javascript:top.resizeTo(screen.width*0.8,screen.height*0.8);self.moveTo(0,0);
  4. "Ctrl+W" (command+W on a Mac) to close current Tab and hopefully return to the Tab from whence you came.

Additional Resize/Move keyword shortcuts can be found in the "Resize" folder within k.html, use the "href:" keyword shortcut per directions to see the urls and bookmarklet coding. See this posted comment for additional details and comments.

Additional Examples  ☷☷☷☷   - large set of keyword shortcuts   (#khtml)

  
 
☷☷☷☷    
For now the most complete and newest list of my shortcuts can be found in my lessons materials as k.html containing on 2011-03-20 (not recounted for each version) for the k.html bookmarks
  1. 750 Key word shortcuts (keywords:count).
  2. 466 bookmarks w/o keywords, for awesombar reference,
  3. 299 JavaScript bookmarklets (bml:) in K folder,
  4. 1216 bookmarks included in K folder,
  5. 264 substitution %S (href: - then using Find All (Find Bar count) before/after. * *
Instructions to install are in the keyword section of Firefox 4 Introduction
 
☷☷☷☷    
All (almost all), of my keyword shortcuts have colons in them, scroll down in the k.html file until you see them, as I've included some related materials at the top, which will help you find some articles with the location bar autocomplete ("awesomebar") and some tab capacity testing materials. 

You can test these bookmarklets on files exported as bookmarks.html include the k.html file created for lessons pages. "keywords:", "subs:", "bml:", and "href:"

If you do you might notice that the following bookmarklets have both Javascript (by definition bookmarklets) and substitution (%S or %s) --  "echo:"    "ff:"    "gsite:"    "G:chr:"    "here:"    "similar:"    "ss:"    "ssd:"    "subs:"    "tbs:"    "zillow".  You would also see them appear in the AwesomeBar (Location Bar Autocomplete) if you typed  " %S  javascript:  * ". without the quotes and did not hit Enter.

  
<!-- end noindex --> *** bookmarks above are not to be indexed by robots

The shortcuts Kzz: and Qzz: are not really intended for use as bookmarks or as keyword shortcuts, but are to prevent a single shortcut beginning with the letter K or Q from being invoked immediately.  By typing in "Q" (one letter past "P") in the K folder (click to see), I can see a list of the shortcuts (bookmarks) that begin with "P" to refresh my memory as what KWS are available. (#placeholder)

Besides those actually marked as “(User must customize)”, in the above examples, you will certainly need to customize, add, or delete shortcuts to fit your own usage.

Keyword shortcuts and bookmarklets involving tabs   (#tabs)

keyworddescription (suggest including keyword at beginning of description)
NT:-- Open in New Tab (NT:), Links to
javascript:(function(){var%20a=document.getElementsByTagName('a');for(var%20i=0,j=a.length;i<j;i++){a[i].setAttribute('target','_blank');var%20img=document.createElement('img');img.setAttribute('class',%20'new-window');img.setAttribute('src','data:image/gif;base64,'+'R0lGODlhEAAMALMLAL66tBISEjExMdTQyBoaGjs7OyUlJWZmZgAAAMzMzP///////wAAAAAAAAAAAAAA'+'ACH5BAEAAAsALAAAAAAQAAwAAAQ/cMlZqr2Tps13yVJBjOT4gYairqohCTDMsu4iHHgwr7UA/LqdopZS'+'DBBIpGG5lBQH0GgtU9xNJ9XZ1cnsNicRADs=');img.setAttribute('style','width:16px!important;height:12px!important;border:none!important;');a[i].appendChild(img);}})();
ST:-- Open in Same Tab (ST:), Links to
javascript:(function(){var%20a=document.getElementsByTagName('a');for(var%20i=0,j=a.length;i<j;i++){a[i].removeAttribute('target');var%20img=a[i].getElementsByTagName('img');for(var%20k=0,l=img.length;k<l;k++){if%20(img[k].getAttribute('class')=='new-window'){img[k].parentNode.removeChild(img[k]);}}}})();
The "NT" and "ST" bookmarklets are from Fixing a small iPhone annoyance… | Doctyper, New Tab Bookmarklet by Richard Herrera, which were not named, so I gave them short names including, of course, the ending colon.
The following expansion will not work once you invoke "NT:" bookmarklet: more info

Manage Bookmarks   (#managebookmarks)

You can view the keywords in your Bookmarks Manager listing by adding the missing columns to your Bookmarks Manager listing (View, Add columns).  Bookmarks and the Bookmarks Manager are described in more detail below on my bookmarks page, see Manage Bookmarks, where you will see that the Extended Bookmarks Manager is much better than the builtin Bookmarks Manager shown below.

Manage Bookmarks (display)

Library List   (#librarylist)

[(missing properites view)]

Some of the extensions (addons.org) and styles (userstyles.org) that I use and that you may notice in the Library List (below) and bookmark dialog (right) are:


Library List as seen in Firefox 4.0 the example here shows a search on bookmark that contains "cached", but the AwesomeBar search that previously located the bookmark I actually was looking for was "cache javascript".
javascript:location%20='http://webcache.googleusercontent.com/search?q=cache:'+escape(location);%20void%200
[(missing image for annotated Library List)]

List of Keyword Shortcuts   (#list)

If you so desired you could make up a shortcut for every single Firefox bookmark, so it is pointless to compare the size of shortcut lists, because they are strictly an optional property of a bookmark.  As indicated in the previous topic, I keep my short cuts in their own folder on the Personal Toolbar, so that I can find them quickly, but there is another way to keep track of your shortcuts. 

Use the Bookmarks Manager to view your bookmarks and keywords, start from the Bookmarks (menu), manage bookmarks..., then in the Bookmarks Manager, view (menu), show columns you want - Name, Location, Keyword, Description.  Keywords are not shown by default.  Sorting on keywords will sort them within their respective folders.  Right clicking on column headers is another way to indicate which columns are to display.  If you have room you can incluede Added, Last Modified, Last Visited.

KeywordName
gm:gm: GreaseMonkey config xml
gmail:gmail: Gmail - Inbox
gmore:gmore: More Google Products
gov:gov: FirstGov.gov The US Govern...

Use the KeywordBar extension by Cory Schmidt, for a nice list in the sidebar of the keywords [Ctrl+Shift+K] with all bookmarks that contain a defined keyword shortcut [picture|.  Double-clicking on a keyword will insert it into the URLBar ready for you to add an operand and/or hit enter. .  Context menu includes properties, and Bookmark Manager (or EBS) [EBS filter on keyword not equal to "a" is somewhat of an alternative]

Types of Shortcuts shown above   (#types)

The shortcuts are entered on the location bar, some with additional operands.  Since I store all my keyword shortcuts in one folder I can easily find them, and can implement them from the K folder on my personal toolbar folder of bookmarks file.

Bookmarklet Design for use with Keyword Shortcuts   (#design)

Call another URL using the current url as an argument «   (#url)

Not documented in Firefox, but you can create a bookmarklet as in the following example:

If you were to place the following onto the Location Bar (address bar) it would invoke a website that would check the current page and report on download sizes and download time.  (Copy the following line and paste to the location bar to test concept -- you must be in an online page -- http: or https:)

javascript:location = 'http://www.websiteoptimization.com/services/analyze/wso.php?url='+escape(location); void 0

Test of generated url for "Web Page Speed Report", suggested keyword "size:::"
http://www.websiteoptimization.com/services/analyze/wso.php?url=dmcritchie.mvps.org/firefox/kws.htm

So while it might have been nice to have a %u (as described for Web Developer) to include the current urlname, it is not really needed as we can use JavaScript to do that for us in a Key Word Shortcut (kws).

Create a bookmarklet to invoke another web page with the current page as an argument

This is nothing new to people who write Firefox Extensions, and Bookmarklets, but I had to discover for myself the connection to something you can easily do yourself by creating a bookmarklet and kws combination which is stored in your bookmarks file and is basically what you have available in Web Developer, but you have more control and can set up your own directory/bookmark trees with kws involved.  You won't find this on Firefox's keywords page (at least not when I created this topic).

To install as a bookmarklet with a keyword simply create a bookmarklet or bookmark in a folder, and
enter the fields into bookmark properties as follows:   See Bookmark Properties picture 
name:  size: Web Page Speed Report - WebSiteOptimization.com
location:  javascript:location = 'http://www.websiteoptimization.com/services/analyze/wso.php?url='+escape(location); void 0
keyword:  size:

As I said I keep all of these in my K folder, but you could set up a hierarchy like the Web Developer Extension so you can find your shortcuts easier.

The Web Developer Extension (Chris Pederick) has two forms to show document size:
-- Web Developer, Tools, View Speed Report (as above but doesn't work)
-- Web Developer, Information, View Document Size (short summary size list)
If you look at Options, Options, tools in Web Developer you will see the assignments used.

Some JavaScript usage with multiple links usage   (#multiple) and (#javascript)

NAME/KEYWORD: source: view-source:<url> (first two work)
LOCATION: javascript:location = 'view-source:'+location
LOCATION: javascript:location.href="view-source:"+location
LOCATION: javascript:location.href='view-source:'+encodeURIComponent(location);void 0

JavaScript mixed in with keyword search   (#javascript_h4)

As already noted many of the keyword shortcuts are also actually bookmarklets.  If you click on the "HREF visible" bookmarklet (above) you will see that many of the keyword searches on this page include JavaScript. Here is an application of two searches at once which would be implemented as a keyword shortcut.

Search that targets both Google and AltaVista into two separate Tabs(/windows)  (old FatJohn 2005-10-28)

javascript:void(window.open('http://www.google.com/search?q=%s')); 
   void(window.open('http://www.altavista.com/web/results?q=%s'))
MUST be invoked from a tab with content, and will then open two new tabs.  These setting might possibly affect this.
browser.link.open_newwindowdefaultinteger3
browser.link.open_newwindow.restriction  user set  integer0
browser.tabs.loadBookmarksInBackgrounddefaultbooleanfalse
browser.tabs.loadDivertedInBackgrounddefaultbooleanfalse
browser.tabs.loadInBackgrounduser setbooleanfalse
Open Multiple Urls in one link on a web page, also takes an extra step here to show that the link will not work if JavaScript is not active.
Test <a href="javascript:window.open('tabs.htm');
window.open('../ie/bookmarklets.htm');void(0);">open two links</a>
<noscript>(Test will not work because JavaScript is Turned off)</noscript>
Test open two links     [Recommend use of Tab Counter when working with multiple tabs, so you can see the change in the number of open tabs displayed on a toolbar]

Multiple parameters in keyboard shortcuts  (#parameters)

See use of multiple parameters with keyword shortcuts in Multiple parameter keyword searches - MozillaZine Knowledge Base

Restore use of AwesomeBar searching & bookmarks sidebar search of bookmarks that contain javascript not spotty results) Restore use of invoking bookmarklets with javascript, and javascript itself from location bar (and bookmarks sidebar) Restore use of move and resize in bookmarklets, broken by

Check if  "is Not a Number"  (isNaN)  (#isnan)

gi = global, case-insensitive search;   i = case-insensitive search;   (null) = case-sensitive search

name:  addon:  Bring up addon based on number or name
keyword:  addon:
location: javascript:var%20str='%S';str=str.replace(/%20/gi,'');if(isNaN(str)){location.href='https://addons.mozilla.org/firefox/addon/'+str+'/';}else{location.href='https://addons.mozilla.org/firefox/'+str;}
Description:  formerly: https://addons.mozilla.org/firefox/addon/%S -- until 2011-01-15 when addons are now known by hyphenated names instead of numbers.

addon: 1865
addon: adblock-plus

Use selection or prompt for string to initiate a search   (#selection)

This one I use on the Bookmarks Toolbar without a keyword shortcut

name:  G [search Google from a selection]
location: javascript:q%20=%20''%20+%20(window.getSelection%20?%20window.getSelection() %20:%20document.getSelection%20?%20document.getSelection() %20:%20document.selection.createRange().text);%20if%20(!q) %20q%20=%20prompt('Enter%20your%20search%20here',%20'');%20if%20(q!=null) %20location='http://google.com/search?query='%20+%20escape(q).replace(/%20/g,%20'+')+'&num=100';%20void%200
Description:  Search Google from a selection -- http://www.ampercent.com/useful-search-bookmarklets/5269/

Use only prompt for string to initiate a search  nbsp; (#prompt)

The Dolphin browser and Boat browsers on an Android do not have selection, so making the bookmarklet accept a selection or a prompt is wasted on Dolphin. Also there appears to be a length restriction of a bookmarklet size.  Dolphin does not allow % characters such as space(%20) in bookmarks to be shown as the character.  Boat will fill in spaces in url with %20.  Here is an example of what would typically be a keyword bookmark named "gsite:" shortened to just "gs" as something that can be quickly written as a gesture.  (not working in "Boat" browser as gesture and not even as just a bookmarklet.)

name: gs: [gsite:] Google search within current domain (Dolphin version) (there is a space between " ")
address: javascript:s=prompt("Enter arguments:","");if(s!=null) location="http://www.google.com/search?num=100&q=site:"+escape(location.hostname)+" "+escape(s);void 0
folder: bookmarklets
Assign Gesture: gs

Plain vanilla Firefox keyword search within current domain (Firefox version)

name:gsite: search for text within current domain search in Firefox)
address: javascript:location='http://www.google.com/search?num=100&q=site:'+escape(location.hostname)+'%20%S';void%200
keyword:  gsite:

Searches for Multiple Online/Retail Stores (#shopping)

The following is a continuation of the multiple Search described above.  This time bookmarklets for online shopping and retail shopping.  You can see the code using the "href:" bookmarklet near bottom of page but these are just expansions of the following pattern with a search for each store instead of a search engine shown:
javascript:void(window.open('http://www.google.com/search?q=%s'));
   void(window.open('http://images.google.com/images?q=%s'));  
   void(window.open('http://www.altavista.com/web/results?q=%s'))
Create you JavaScript bookmarklet with a text editor (Notepad or Wordpad) and remove the line breaks and spaces between segments.

As long as you installed Keyword addition style, or an extension such as the "Add Bookmark Here ²" extension you can create your bookmarklet in one-shot.

To use the examples, drag the bookmarklet to your bookmarks bar and grab the location properties from there, if you want to change. 

Bookmarklets: Multiple Search as described on Keyword Search, look for javascript_h4 or open multiple pages.  These bookmarklets will search multiple retailers on a search argument, each store opening into its own page so you can refine your search arguments from the generic one you used when invoking the bookmarklet.  Generally for best search urls, right-click in the store's search field, and choose "Add a keyword for this search" then copy the properties into notepad, substituting %S for %s in your pattern. (This will work much better than trying to modify a completed search url, either way it must include substitution.).  Drag the completed bookmarklet to a folder in your bookmarks toolbar, and provide a search name in the bookmarks properties.  Any keyword you want, perhaps "shopping:online" and "shopping:local" might be better names.  These are just examples.

To use type the keyword you assigned, and your search argument. 

    shopping:online -- Tech Bargains, etc, lowest prices  shopping:online GPS

    shopping:local (big box) -- shopping:local GPS

The above two bookmarks are not yet in my k.html file

Note:  Don't forget that Firefox has "Open All in Tabs" at the bottom of all Bookmark folders, which is perfectly suitable for opening several links that you don't have to provide parameters, such as looking a several blogs.  Right-clicking on a bookmasrk folder will produce an "Open All in Tabs" in the context menu.

Create a bookmarklet for a version comparisons page at archive.org   (#archiveorg)

Suppose you don't like the way web archive.org is invoked for a web page and you want the page that gives you ability to compare two archived pages with "*dc_" instead of "*" that you get in their default searches -- simply create another bookmarklet with a keyword shortcut.  Right click within the personal bookmarks folder and use New bookmark then fill in the properties --
name:  archive: Internet Archive Wayback Machine
location:  javascript:location = 'http://web.archive.org/web/*dc_/'+escape(location); void 0
keyword:  archive:
description:  wayback machine at archive.org

Actual generated link would look like: http://web.archive.org/web/*dc_/http%3A//dmcritchie.mvps.org/firefox/firefox.htm

Bookmark to reopen within the current directory (#d)

name:  d: reopen in directory, so Launchy can open with Windows Explorer
location:  javascript:void(location.href=location.href.substring(0,location.href.substring(0,location.href.length-1).lastIndexOf('/')+1))
keyword:  d:
description:  see documentation in http://dmcritchie.mvps.org/kws.htm#directory

Create a bookmarklet to translate the current page to your own language using Google Translate   (#translate)

Use the encodeURIComponent to turn spaces into "+", mask control characters and punctuation, etc.
name:  gt: Google Translate
location:  javascript:location='http://translate.google.com/translate?u='+encodeURIComponent(location);
keyword:  gt:
description:  Translates from another language as found to your own language

The encoded part of the first item below would look like   http%3A%2F%2Fwww.humour.com

gsite: Google Search Current Site %s   (#gsite)

Suppose you want to use Google to search within the domain of the current page for the search words you want to use.

Right click within the personal bookmarks folder and use New bookmark then fill in the properties --
name:  gsite: Google Search within page's domain
location:  javascript:location='http://www.google.com/search?num=100&q=site:' + escape(location.hostname) + ' %S' ; void 0
keyword:  gsite:
description:  based on http://www.squarefree.com/bookmarklets/search.html

name:  ss: Site Search - search within site (domain)
location:  javascript:void(location.href='http://www.google.com/search?&q=site:'+location.href.split(%22/%22)[2]+'+%s&sourceid=firefox')
keyword:  ss:
description:  based on http://lifehacker.com/software/geek-to-live/geek-to-live-fifteen-firefox-quick-searches-129658.php

name:  ss:y Site Search - Yahoo search within site (domain)
location:  javascript:void(location.href='http://search.yahoo.com/search?p=site:'+location.href.split(%22/%22)[2]+'+%s')
keyword:  ss:y
description:  based on http://lifehacker.com/software/geek-to-live/geek-to-live-fifteen-firefox-quick-searches-129658.php

Create a bookmarklet to check domain of current page with McAfee Site Advisor   (#mcafee)

McAfee site advisor only reports on the domain name, convert this bookmarklet: http://www.siteadvisor.com/lookup/?q=%s extracted from it's search form into a bookmark to give results based on current page domain.

Use the encodeURIComponent to turn spaces into "+", mask control characters and punctuation, etc.
name:  advisor: mcafee site advisor
location:  javascript:void(location.href='http://www.siteadvisor.com/lookup/?q='+location.href.split(%22/%22)[2])
keyword:  advisor:
description:  McAfee SiteAdvisor - Protection from adware, spam, viruses, and online scams.

Create a bookmarklet to check high level domain name and TLD of current page with domainfinder   (#domainfinder)

whoisnt.net and nfhost.com have slipped away, but if there is a need to submit a web request from the domainname and the TLD as separate items this bookmarklet show how that can be done, if needed.

whoisnt.net (Domainfinder), required the hostname to be split up between the ?second level? domainname and the TLD {com, net, org, uk, us, biz, info, name, etc.}.  This bookmarklet if used on this webpage will generate the requisite url
    – http://whoisnt.nfshost.com/?show_raw=1&domain=mvps&ext=org
name:  domainfinder: whois search for current url
location:  javascript:void(location.href="http://whoisnt.nfshost.com/?show_raw=1&domain="+location.hostname.split(%22.%22)[1]+"&ext="+location.hostname.split(%22.%22)[2])
keyword:  domainfinder:
description:  -- May rename this bookmarklet to some form of "whois". 

Bookmarklets to search from within the current directory (#directory)

name:  ssd: Site Search - search within current directory
location:  javascript:void(location.href='http://www.google.com/search?&q=site:'+location.href.substring(0,location.href.substring(0,location.href.length-1).lastIndexOf('/')+1)+'+%s&newwindow=1&sourceid=firefox')
keyword:  ssd:
description:  based on techniques worked out in http://dmcritchie.mvps.org/firefox/javascript.txt

Bookmarklets to search based on selection (#selection)

Firefox 3.5 will allow a selection to be extended with use of Ctrl key, be sure include leading space between multiple selections.

name:  g:sel Google Selection(s)
location:  javascript:q=""+(window.getSelection?window.getSelection()%20: %20document.getSelection%20? document.getSelection()%20:%20document.selection.createRange().text); if%20(!q)%20q%20=%20prompt("Enter%20your search%20here",%20"");%20if%20(q!=null)%20location="http://www.google.com/search?q=" +escape(q).replace(/%20/g,%20"+");%20void%200
keyword:  g:sel
description:  http://www.techradar.com/news/internet/web/40-productivity-boosting-search-bookmarklets-609028?artc_pg=4

Document Properties   (#docprops)

Copy and Paste Document Properties and Selections   (#paste)

For creating titled links with a (normally) small selection for web pages, email, and wikis I mainly use "CopyURL Plus" to place information into the clipboard, another extension from a single tab is "QuoteURLText".  Information from multiple tabs can be copied to clipboard with "Copy All Urls, or "Multiple Tab Handler" -- obviously they won't include text selection from multiple web pages.

But keyworded bookmarklets can be used in place of extensions outside of normal profile use such as for testing in any profile that we copy our keyworded bookmarklets to without installing any extensions, and they would run in safe mode.  So for a test profile there would be no impact due to extensions. 

The first problem is that you can't use something simple like document.selection but you have use something like, one of these

  1. (window.getSelection ? window.getSelection().toString() : (document.selection ? document.selection.createRange().text: "") -- from HubLog: Updating "Selected Text" Bookmarklets
  2. (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text) -- from 40 productivity-boosting search bookmarklets | News | TechRadar UK

The problem with putting data to the clipboard in Firefox is that you have to change configuration settings and have to accept a challenge each time about security (or use signed code).  While these bookmarklets do work and you have to copy from the dialogs, you would find the "CopyURL Plus" extension a lot easier/faster to use as you would be only using the mouse.
    user_pref("signed.applets.codebase_principal_support", true);

(selection / into clipboard)

To make interactive you could substitute "**cliptext**" with prompt("Enter%20your search%20here",%20"")

name:  cliptext: test add to clipboard
keyword:  cliptext:
location:  javascript:(function(){var%20copyText="**cliptext**"; netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); var%20str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);if(!str)return%20false;str.data=copyText;var%20trans=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!trans)return%20false;trans.addDataFlavor("text/unicode");trans.setTransferData("text/unicode",str,copyText.length*2);var%20clipid=Components.interfaces.nsIClipboard;var%20clip=Components.classes["@mozilla.org/widget/clipboard;1"].getService(clipid);if(!clip)return%20false;clip.setData(trans,null,clipid.kGlobalClipboard);})();
description:  http://osdir.com/ml/web.wiki.moin.general/2005-02/msg00025.html

name:  copy:wiki create link for a Wiki
keyword:  copy:wiki
location:  javascript:(function(){var%20copyText="["+document.location+"%20"+document.title+"]%20"+(window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); var%20str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);if(!str)return%20false;str.data=copyText;var%20trans=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!trans)return%20false;trans.addDataFlavor("text/unicode");trans.setTransferData("text/unicode",str,copyText.length*2);var%20clipid=Components.interfaces.nsIClipboard;var%20clip=Components.classes["@mozilla.org/widget/clipboard;1"].getService(clipid);if(!clip)return%20false;clip.setData(trans,null,clipid.kGlobalClipboard);})();
description: 
  like CopyURL+ -- (Wiki external) Blog URL Title reference
  http://moinmo.in/BradeyHonsinger/CopyWikiLinkBookmarklet
  http://osdir.com/ml/web.wiki.moin.general/2005-02/msg00025.html
  Modified to include selection - http://dmcritchie.mvps.org/firefox/kws.htm

The next one will put the code into a prompt box that can be copied, just using the JavaScript alert dialog box for you to copy from, so that there are no configuration changes.  To put to the clipboard, you would use the code similar to the copy:wiki
 

name:  copy:title (like CopyURL PLUS)
keyword:  copy:title
location:  javascript:void(alert(document.title+'\n'+document.location));
description:  like CopyURL+ -- Copy URL + Title

In the next example we will replace document.selection which does not work in a Firefox bookmarklet with the selection code seen in copy:wiki, but will leave out the clipboard code, since these are really being created for testing (test profiles) without extensions or configuration changes, and I will use the CopyURL+ extension in my normal profile.

name:  copy:sel [Partially revised] (like CopyURL PLUS)
keyword:  copy:sel
location:  javascript:void(alert(document.title+'\n'+(window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text)+'\n'+document.location));
description:  like CopyURL+ -- Copy URL + Title + Selection

Replacement examples (#replace)

name:  goto:  remove spaces and '>' from %S and open in new tab (longurl)
keyword: goto:
location:  javascript:(function()%20{var%20str="%s";str=str.replace(/%20/gi,"");str=str.replace(/>/gi,"");window.open(str)})();

name:  m:  convert abcdotdefatgmaildotcom to abc.def@gmail.com
- Reloads to location bar will still show the actual file when this finishes.
- Replaces the last "at" with "@" using reverse
- Replaces all "dot" with "."
- Replaces "name:    " with ""
- Replaces "email:   " with "<"
- Inserts ">" at the very end
keyword:  m:
location:  javascript:void(window.location.reload(false));(function()%20{var%20str="%S";String.prototype.reverse%20=%20function%20()%20{%20%20%20%20%20return%20this.split('').reverse().join('');%20}; %20%20String.prototype.replaceLast%20=%20function%20 (what,%20replacement)%20 {%20%20%20%20%20return%20this.reverse().replace(new%20RegExp(what.reverse()), %20replacement.reverse()).reverse();%20}; %20%20str%20=%20str.replaceLast('at',%20'@');%20; str=str.replace(/>%20/gi,""); str=str.replace("Name:%20%20%20%20",""); str=str.replace("Email:%20%20%20","<");str=str.replace(/dot/gi,"."); prompt("Ready%20to%20copy%20to%20clipboard",str+">");})();

Switch from test to production url in location bar
(Not quite working only converts test to production version)

name:  swc:  bring up production version of file:///c:/copiedsite/dmcritchie/
Keyword: swc:
location: javascript:location.href=location.href.replace
("file:///c:/copiedsite/dmcritchie/","http://dmcritchie.mvps.org/")

Reversal of production and test uri in location bar

Actually the following is bi-directional once the change is made is made to settings, but will go with Ralph Fox's changes in the one after this that has some additional tweaks for letter case changes.

name:  sw:  switch production version vs file:///c:/copiedsite/dmcritchie/
Keyword:  sw:
location: javascript:if(location.href==location.href.replace
("file:///c:/copiedsite/dmcritchie/","http://dmcritchie.mvps.org/"))
{location.href=location.href.replace
("http://dmcritchie.mvps.org/","file:///c:/copiedsite/dmcritchie/")}
else
{location.href=location.href.replace
("file:///c:/copiedsite/dmcritchie/","http://dmcritchie.mvps.org/")}

Bi-directional switch between test and production url   (#sw)

name:   sw: [switch current url Test <--> Production]
keyword:   sw:
location:   javascript:(function(){var%20flip='file:///c:/copiedsite/dmcritchie/';var%20flop='http://dmcritchie.mvps.org/';var%20x_xc;try{var%20x_lip=String(flip).length;var%20x_lop=String(flop).length;var%20x_old=String(top.location.href);var%20x_do=0;var%20x_new='';if(x_old%20&&%20x_old.substring(0,x_lip).toLowerCase()==String(flip).toLowerCase()){x_new=flop+x_old.substring(x_lip);x_do=1;}else%20if(x_old%20&&%20x_old.substring(0,x_lop).toLowerCase()==String(flop).toLowerCase()){x_new=flip+x_old.substring(x_lop);x_do=1;}if(x_do){top.location=x_new;}}catch(x_xc){}void(0);})()
description:   sw: switch current url Test <--> Production
Ralph Fox (2010-10-01 mozilla.support.firefox) improved and pointed to fact it gets a security error see http://support.mozilla.com/en-US/kb/Links+to+local+or+network+pages+do+not+work but even with the "testlinks" extension still fails. (more in somnats)
http://kb.mozillazine.org/Links_to_local_pages_don%27t_work

Mailto: Examples (#email)

Email:  Example for emailing a link with the subject containing the title, and the body containing the subject / title / selection(s).  You can include multiple selections with the Ctrl key, just be sure to include some spacing in-between.  "CopyURL Plus" extension would be my usual choice, but this would be better for an email with only one purpose -- to mail one link, and it can be used simply by copying folders of bookmarks and not using any extensions. CRLF (Carriage Return Line-feed required in Email) "%xx" must be escaped with "%25xx", so the CRLF as "%0D%0A" is escaped with "%250D%250D" [ref].

Name: email:  Email Title / URL / Selection
keyword:  email:
location:  javascript:location.href='mailto:?SUBJECT='+document.title+'&BODY='+document.title+"%250D%250A"+escape(location.href) %20+"%250D%250A%250D%250ASelection:%20%20"+(window.getSelection%20?%20%20%20window.getSelection()%20:%20document.getSelection%20? %20document.getSelection() %20:%20document.selection.createRange().text);
description:  Email the url of the current page D.McRitchie in (%xx must be escaped as %25xx) http://dmcritchie.mvps.org/firefox/kws.htm

Name: send:  email link with Title & URL (w/o selection)
keyword:  send:
location:  javascript:location.href='mailto:?SUBJECT='+document.title+'&BODY='+document.title+"%250D%250A%20%20"+escape(location.href)
description:  Also see mailto: which includes the selection as a summary

If you are interested in emailing a number of links from selected tabs that are open I would suggest using the "Multiple Tab Handler" extension.  A lot of my documentation relies on the "Copy URL Plus" extension in many different formats derived from the active tab.
 

   Just a reminder the most complete and newest list of my shortcuts can be found in my lessons materials as k.html with instructions to install in the keyword section of Firefox 4 Introduction  

Rewriting bookmarklets for Android or non Firefox browsers without Substitution(%s)   (#android)

Example code to open a file in a new window(tab): 
javascript:window.open('http://dmcritchie.mvps.org/firefox/firefox.htm','_blank')

From my section above (#replace, and from my newtab page and javascript page you will see examples like (newtab) and JavaScript bookmarklets and tools pages you will find a bookmarklet for dict: coded as:

<a class="bml" shortcuturl="dict:" title="dict:  dictionary.com search" 
href="javascript:s=prompt('Enter word for  Dictionary.com lookup:','');if(s!=null) location='http://dictionary.reference.com/browse/'+escape(s); void 0">dict:</a>

Add a Search Engine, or add a Keyword Shortcut for a search from any search Form   (#addkws)

The Add to Search Bar (formerly Search Engine Ordering) Extension. 
to create a search engine or a keyword shortcut by simply right-clicking within a search form and choosing between:
  Add a Keyword for this Search...  
  Add this search to the Search Bar...  

The Context Search extension enhances the Search web for on the context menu to include a drop down of all of your personalized seach engines.  It will not change the search engine you already have on the search bar.
  Search web for "selected words"  

This area is pretty close but needs a little work since add to search bar replaces search engine ordering extension.

Some additional pictures of the drop-downs and context menu with the searchbar drop-downs – [large drop-down] [Context menu added by Add to Search Bar extension]

It will not include anything already written into the search form, but this is a big help for making searching easier. You can test with the following, copied from http://www.mozilla.org/
 

This one is for my own testing, don't have the hang of forms yet, so it won't work in the normal way:

   Google web search eliminating newsgroup discussions

The actual search generated will be something like this (%s is your words)
http://www.google.com/search?&q%20&rest?sourceid=Mozilla-search&rest=filetype%3A html%20OR%20filetype%3Ahtm%20%0D%0A-hth%20-new.threads%20-next.thread%20-thread. index%20-vbulletin%20-top.results%20-get.paid%20%0D%0A-discussion.groups%20-reply. to.this%20-usenet-archives%0D%0Afiletype%3Ahtm%20filetype%3Ahtml%20%0D%0A-inurl%3A archive%20-inurl%3Athread%20-inurl%3Aforum%20%20-site%3Aozgrid.com&q=%s

Add to Search Bar - context menu for searchbar   (#addtosearchbar_context)

 Add a Keyword for this Search...
 Add a Search Bar

The Add to Search Bar extension adds context items to the main context menu to add search engines with a right click on the main entry area of a (search or other) form. 

Additional Search Related items/extensions   (#searchext)

I have included the actual addresses of the extensions above, but you might really want to look them up from my Firefox page which has additional Short Comment Notes.

Bugzilla   (#bugzilla)

Newsgroups, threads, message-id   (#newsgroups)

msgid:  bring up newsgroup thread based on Message-id in newsgroup headers.
Bring up Google Groups for the indicated message-id
http://groups.google.com/groups?threadm=%s
news:ff  news.mozilla.org
Bring up single message from news server, if still present
news://news.mozilla.org/%S
If anyone has a script to remove "Message-id: <" and ">", when present, would be helpful,

Ctrl+Z to retrieve previously entered kws   (#ctrlz)

If you used a keyword shortcut to invoke a bookmarklet to change the appearance of the page you can place cursor on location bar and hit Ctrl+Z first to bring back the keyword and parameters you entered, next to show the actual url that is for the current page but became hidden. (Splibbilla 2007-07-01)

Web Developer, revealed   (#wd)

The following web page appears to describe how Web Developer items are defined.

Preparation of this data   (#preparation)

Although the examples on this page will be updated manually the initial table was generated by copying a section of bookmarks.htm (within your profile) and pasting into Excel and then using the description and embedded link to generate a string for HTML.

View bookmarks.html with your browser, select the "S" folder (shortcuts, and paste into Excel.  use the following Excel worksheet formula to convert links into hyperllinks for inclusion above.

A1:  aardvark: Aardvark Firefox Extension

Formula as entered in cell B2:
  ="<dt><a href="""&pesonal.xls!url(A2)& """ shortcuturl="""&LEFT(A2,FIND(" ",A2)-1)&"""><b>" &LEFT(A2,FIND(" ",A2)-1)& "</b>" & MID(A2,FIND(" ",A2),250)&"</a></dt>"

formula used to display the above for html
  =pesonal.xls!htmlify(pesonal.xls!GetFormulaD(B2))

To view all of the links included: click on the “HREF visible” at top of page.

Text as seen in HTML source
  <dt><a href="http://karmatics.com/aardvark/" shortcuturl="aardvark:"><b>aardvark:</b> Aardvark Firefox Extension</a></dt>

Was hoping inclusion of shortcuturl would allow one to drag the bookmark from here to a folder on the personal toolbar folder, but didn't work that way you still have enter the shortcut yourself under properties.  If you want to update several or see what is available along with the link, and comments you can right click on the folder on your personal toolbar to bring up the context menu and use Expand just like any other bookmark folder.

Invoking notepad   (#notepad)

Notepad is a good example of a program you want quick accessibility to from HTML if you are using a Windows system, set the string value to c:\winnt\system32\notepad.exe via about:config
extensions.editconfigfiles.config.editor.path, c:\winnt\system32\notepad.exe
greasemonkey.editor, c:\winnt\system32\notepad.exe
menux.editor.path, c:\winnt\system32\notepad.exe
view_source.editor.external, True
view_source.editor.path, c:\winnt\system32\notepad.exe

The MenuX extension provides Alt+X shortcut to open the current HTML file in Notepad.  This is the easiest method I've found.  caution:  MenuX is reading from the location bar rather than the actual filename, though it has been fixed to ignore a fragment-id (firefox.htm#keywords) which is an improvement.  Being able to specify the editor to be used in MenuX makes this work well for Windows as well as Linux users.  Have since dropped MenuX as it creates too many problem such as stepping on the keyboard shortcuts of Firefox itself and of many extensions and very little of it is actually wanted.  For other solutions see invoking Notepad.

The Launchy extension provides access to Notepad by name in it's context menu because Notepad is an editor.  Directly edits a file if the HTML file on your local drive, and uses a temporary file if invoked from HTML on the web, which helps.

The Launchy extension provides access to a link file:///c:/winnt/system32/notepad.exe if you choose Browse Link in Explorer (from within Launchy) and then choose Open.  Some of my webpages indicate a link to installed software as (/\) and you can use launchy as just described to open the link.  IE would put you directly to the dialog for you to choose Open.

I have no Keywords shortcut to launch an executable file directly and this is, I'm sure, specifically by design in Firefox, though there certainly are exceptions.

Another possibility, I am hoping for is a JavaScript keyword shortcut to invoke Notepad for a local file (url).

Firefox Chrome URLs   (#chromeurls)

Dev : Firefox Chrome URLs - MozillaZine Knowledge Base, a list of all standard XUL files contained by Firefox, displayed using their chrome URLs.  Also shown is a description of what that URL does and how it is used.  To run a chrome URL in Firefox, you must copy and paste it into the location bar. If it is type "A", then it will probably work using this method.

so I set up at keyword shortcut  "b:" (to be entered on the location bar)  for the Bookmarks Manager, chrome://browser/content/bookmarks/bookmarksManager.xul -- which is the only item on my View, Sidebar that is missing a keyboard shortcut.

To be added

Try   Alt+T+A   to get to   Tools, Ad-ons
If you have  the MenuX extension you might have suppressed that
menu item..

This should get you to the Extensions list in Firefox 2
  chrome://mozapps/content/extensions/extensions.xul
paste the above line into your location bar
Not finding this in 
  http://kb.mozillazine.org/Dev_:_Firefox_Chrome_URLs
Looked in  about:config  for "chrome"   guess it can be changed

My URL Bar   (#myurlbar)

note: Dumped this extension, myurlbar is too distracting, and has speed issues.

Basically myurlbar brings the Manage Bookmarks search feature right to your location bar showing url and title. Lacks documentation but guess you've got a little more now.  Links to install the myurlbar extension can be found on my Extensions Page.  You can use Manage Bookmarks to find the actual bookmark.  Your bookmarks and history become very handy for anyone who accesses your computer with your profile (just a friendly warning).

[[myurlbar]]

Use of the myurlbar somewhat shows the advantage of including a colon as part of your key word shortcuts. 

[[myurlbar]]

Fx3 (and above) has this builtin and is much better see next topic.

AwesomeBar (Location Bar Autocomplete)   (#awesomebar)

The location bar in Fx3 (and above) shows a filled star on the Location bar, if the page is bookmarked.

The Smart Location Bar Autocomplete (AwesomeBar) in Fx3 (and above) that appears automatically below the location bar, shows a star if the url is bookmarked, a tag if bookmark is tagged, and an unmarked entry if the item was found in History.  The algorithms used by Firefox (frecency tables) work very well in placing your top usages first.

Use of keyword shortcuts together with efficient use of the Smart Location bar (AwesomeBar), you hardly have go to directly to bookmarks or search bookmarks most of the time.  The easiest way to get the Smart Location bar working efficiently for you is to use it.  If you use Keyword Shortcuts, you will notice they don't have much effect on usage so you might increase the importance in the AwesomeBar by pasting the url four times into the location bar which counts as manual entry after that things should continue smoothly with normal usage.  This is a lot better than trying to tweak the results by modifying frecency tables.

For more information on Places and on the AwesomeBar see awesomebar (URL bar autocomplete list).

Some things you can type into the Location Bar Autocomplete (AwesomeBar) to restrict suggestions to particular types, which can be combined, but are typed as single word characters in your location bar autocomplete.  Don't use as the first word or it could be confused with a keyword shortcut.  You will find some of these in about:config entries for browser.urlbar.restrict.* {bookmark | history | tag | typed}.

Unlike tags, the keyword is not a searchable entity, but if you include both '%s' and 'javascript:' when looking for something your restriction will pretty much cover most keyword shortcuts, unless the keyword just uses an unqualified bookmark ("*").  If you include your keyword in the bookmark name they would be included -- all of my keyword shortcuts are included before the rest of the name since it is the keyword I try to remember.

Actually keywords are searchable without the keyword within the title (Bug 392143) but there are severe restrictions, so severe that I never realized anything had been done:

  1. Must include the first letter of the keyword.
  2. Must hit a space after for it to show up
  3. No modified star symbol to show it is/has a keyword.
  4. My method of including keywords in title works best along with the fact that I also include a colon in my keyword names.
I would suggest replacing tag symbol by star with black tips, and keyword by star with red skeletal lines inside. That would make 5 star symbols including the gray outline form, and star-tipped-skeletal.

Tips and Tricks (#tips)

This page is about "Keyword Shortcuts" so the tips will not be about keyword shortcuts themselve.

Comparisons (#comparisons)

How other browsers work with keywords (#browsers)

  1. Firefox 3.0.*,
  2. IE8, Not supported. You can provide a keyboard shortcut, but not a keyword shortcut. Nothing with substitution. IE7PRO allows a search to be done from address bar.
  3. Opera 9.64, limited to a specific url without substitutions. Enter alias on the address bar then hit F2 to go there.  Use Shift+F2 to get to alias mode for GoTo and type in alias and you go there as soon as alias is compte or you hit Enter.
    Location of opera6.adr is in Directory of C:\users\<user>\AppData\Roaming\Opera\Opera\profile\opera6.adr
    Even though Opera can't use bookmarks with substitutions (%S) it will import bookmarks from Firefox and export them back to Firefox without damage.

Solving Most Firefox Problems   (#problemsolving)

The keyword shortcuts mentioned earlier on this page can be very useful in solving Firefox problems.

Most Firefox problems can be solved with some help from one or more of the following:

Problems     (#problems)

Reset (F5)  bookmarklets   paren tips   HREF visible   --  link:    linked:  
Related extensions can be seen in an earlier topic, Search Extensions
Hope to be able to convert these to working bookmarklets within the page, currently you will have to invoke them from your bookmarks, or by clicking within k.html listing.  bml:    subs:  
Bookmarklets;  There are a lot of links on this page.  The following BookMarklets (Favelets) will distinguish between internal or external links.  First click on "highlight links",  and then on "int/ext links".  Your browser's Reset button (F5) will reload the original unmodified web page. 
Questions not directly concerning my web pages are best directed to a traditional newsgroup:  i.e. on the news.mozilla.org server you can subscribe to mozilla.support.firefox using Outlook Express or other newsreaders,
or to forum: MozillaZine ForumsSuggest installing the moz: keyword shortcut to search forums.  My preference is to newsgroups, because web forums should never have been included on web page searches.  The only saving grace is that most Google web searches for Firefox could simply use site:mozilla.org firefox to restrict to Mozilla's web pages.  ( or include site:mozilla.org OR site:mozilla.com instead(Firefox Help - Online Help for the Mozilla Firefox Web Browser)
For bookmarklets and favelets which are javascript code the best newsgroup for asking questions would be comp.lang.javascript and see the FAQ

W3C Validator at w3.org (checks coding) || W3c Link Check of this page. 
This page was introduced on June 6, 2005. 
[My Excel Pages -- home]    [INDEX (Excel) to my site and the off-site pages I reference] 
[Site Search -- Excel]     [Go Back]    [Return to TOP

Please send your comments concerning this web page to: David McRitchie send email comments


Copyright © 2004 - 2014,  F. David McRitchie,  All Rights Reserved