Bookmarklets can't control whether they open windows or tabs, but you can. In Firefox 1.0, go to about:config to set browser.tabs.showSingleWindowModePrefs to true, then go to Tools > Options > Advanced > Tabbed Browsing to set "Force links that open new windows to open in: a new tab".
If bug 138198 were fixed, you would be able to middle-click the open all links bookmarklet to make it open in tabs or shift+click it to make it open in windows.
Firefox has a built-in feature for pretty-printing functions. You can use this feature, along with the JavaScript Shell, to pretty-print most bookmarklets. Using Firefox, copy the bookmarklet and paste it into the JavaScript shell. Before pressing Enter, make the small changes necessary so that the code evaluates to a function rather than executing the bookmarklet code:
(function(){ ... })()
, remove the ()
at the end so that the anonymous function is returned rather than called.
(function(){
and })
around the JavaScript code to make it a function.
To convert a pretty-printed bookmarklet back to single-line form, use the Brainjar JavaScript Crunchinator or something similar. Be warned that the JavaScript Crunchinator screws up in some situations, such as when the regular expressions contain spaces or comments contain single-quotes, because it does not attempt to tokenize JavaScript correctly.
Append everything after javascript:
from the second bookmarklet to the first bookmarklet.
Bookmarklets can do what web pages can do, and nothing else. When you click a bookmarklet, the browser executes the JavaScript code as if it's a part of the page.
1. Outlook Express and any browser: Drag the message to the desktop, then drag the message from the desktop to a browser window or to the desktop icon that starts the browser. (This method doesn't work in Firefox.)
2. Outlook Express and Internet Explorer: Copy the message body to the clipboard, paste into an editable page. (This method doesn't work in Firefox.)
3. Any newsgroup message: use Google Groups instead of special newsgroup software.
I'm not aware of extensions for doing any of the following:
Microsoft reduces Internet Explorer's support for bookmarklets with every new version of Internet Explorer. IE5 supported bookmarklets up to 2083 characters. IE6 limits bookmarklets to 508 characters. IE6 SP2 keeps the 508-character limit and also counts each space as multiple characters.
Most pop-up blocking designed to work with Internet Explorer, such as the Google Toolbar, only allows web pages to open windows within milliseconds of a click. Some pop-up blocking software doesn't even count a click on a bookmarklet as a click. The pop-up blocking built into Firefox and Opera get it right: they always allow web pages to open windows in response to a click on a link or button.
I haven't really looked into this, but you might find these pages helpful: 1 2 3
© 2000-2007 Jesse Ruderman (jruderman@gmail.com). Feedback is welcome.
Last modified November 16, 2004.