Find file
Fetching contributors…
Cannot retrieve contributors at this time
109 lines (94 sloc) 5.86 KB
$ENV{__EMB_EXTRATITLE}="some scripts for Firefox";
$ENV{__EMB_EXTRAMETA}="load, grep or extract cookies, open tabs and bookmarks";
if (1==$ENV{__EMB_COUNT}) {
} else {
<p>Some firefox command line support scripts addressing usage
deficiencies of firefox. Usable to e.g. load all bookmarks from a
number of bookmarkfolders (have firefox or firefoxstdin invoke
firefoxgrep...) . In a pinch, the scripts below also offer a low level
method to diff/copy a few changed bookmarks.<p>
<p>As I'm using the command line rather than just mouse &amp; GUI,
these scripts are life-safers and necessary to make firefox
<i>properly</i> usable for me at a mere 'works-for-me' level. As such,
this set of scripts is more of a raw concept example for firefox shell
integration rather than a proper finished releasable script. That
said, if you've a shell related firefox pet-peave, I'll gladly have a
look at it :).</p>
<p class=anno>See also: For a better generic approach to control
firefox, consider e.g. perl-javascript bridging code like the <a
href="">Perl Interface to
MozRepl</a> (<a href="">MozRepl
itself</a>), Corion's recent <a
(should allow hacking a javascript-conscious wget-clone), or e.g. <a
<p class=anno>To use a tk-style approach to build a
javascript-DOM-style user interface for a server script, consider e.g.
<p class=anno>Note that the firefox wrapper should be rewritten in
perl with firefoxstdin folded into the code. Currently the two scripts
call each other for a number of functions... . But that's what you get
with works-for-me examples :). </p>
<p>Some remarks:</p>
<li>X11 and pixmap caching: Looks like export MOZ_DISABLE_IMAGE_OPTIMIZE=1 is
still required to avoid firefox placing pixmaps into an ever growing
X11 when e.g. using multiple tabs and autopager.
<li>sqlite3 FILE.SQLIST vacuum can be used to clean a sqlite file when firefox is not running.
<li>a cheap trick to get sqlite content (read-only): ask the user to leave the browser
idle for a few seconds, then just cp the sqlite file of interest. The data should have
been flushed to disk, and copying will break locks and make the contents accessible again.
See e.g. firefoxgrep*sqlite in this section.
<li><b>userChrome.css</b> contains a collection of settings to somewhat reduce the wasted
screen real estate. To further reduce wastage, hide navbar and bookmark bar and configure
the menubar to show the url field and forward/back/stop/reload (small-icons/no-text).
With above Chrome settings, even microfox(sp?) isn't able to reclaim much more space :).
I've placed the file into this section.
<li>My required minimum of addons to get along with firefox:
<li>System: Addblock Plus, Add N Edit Cookies (if necessary modify the jar and
edit the version number to allow installation; I've yet to see a worthwile substitute),
Noscript, Secure Login, User Agent Switcher, ModifyHeaders, JSView.
<li>Usability: AOIS Sidebar, Tabkit (replaced tabmixplus; one pet-peeve: opening a
bookmark folder from the menu also <i>replaces</i> the current tab)
<li>Usability 2: AutoPager.
<li>Usability &amp; nice to have: SplitBrowser, ResurrectPage, GreaseMonkey
<li>Information Overload: NewsFox (though firefoxgrep goes a long way to deal with
periodic weekly or monthly site visits: create a folder like watch/news.weekly, and ask
the wrapper with 'firefox -weekly' to grep for urls and folders ending in weekly.
Alternatively, just open each '*.weekly' folder from the bookmarks menu, selecting
open all)
<li>Information Overload &amp; nice to have: Zotero's local data store's actually quite accessible
using a little bit of sql/sqlite. So that's another nice tool, and it is possible
to extract things from Zotero using the command line.
<li>xul/migemo <i>would be very nice as well</i> if it wouldn't crash on me as soon as
I try to search using regular expressiones.
<p><a href="">Git
View of this section / Download</a></p>
<li><b>firefox</b> is a rather ugly script with grown warts; actually nowadays,
firefox 3.5 finally implements some of the features I'm using this wrapper
for. Note that to directly load a set of urls from a file firefox.-NAME,
you need to add -NAME to the list of shortcuts in the script. If the file for
the shortcut doesn't exist, firefoxstdin is invoked instead with this option.
<li><b>firefoxcookies</b> dumps cookies.sqlite.
<li><b>firefoxdelta</b> is a helper to show differences in bookmarks.
<li><b>firefoxgrep*</b> greps both html and sqlite bookmarks.
<li><b>firefoxstdin</b>: given urls or grep commands on stdin, get the urls, repair
them (e.g. urls pasted from email) and use the firefox wrapper to open them in
the running firefox instance. Some shortcuts
like -weekly are defined, which is translated to the input line "GREP 'weekly ::'",
which is expanded to the output of a firefoxgrep for all bookmarks ending with
weekly or being in folders ending with the string weekly. This implements a way
to open a number of folders straight from the command line.
<li><b>firefoxsessionlist</b> dumps xml-ish files like the firefox sessionstore
in a number of representations, with some grepping added.
[*}*][# MUST BE AT EOF! #]