[Greasemonkey] GM + Microsummaries in FF2
esquifit
esquifit at googlemail.com
Sat Jul 22 23:25:21 EDT 2006
Hi,
I've been playing around with GM 0.6.4 + ff2.0b1 (WinXP Home Ed). [1] I
came up with the idea of writing a GM script for generating and adding
microsummaries [2] to arbitrary pages, but then I found Johannes la Poutré's
script [3] which saved me a couple of hours :). In this script, the
microsummary xml is being written into a new tab; then it has to be
downloaded to a local file into the microsummary-generators subdirectory of
your profile folder, and restart FF.
However, the Microsummary API already provides for an install mechanism,
namely the
"window.sidebar.addMicrosummaryGenerator(microsummary_url)" function [4].
So I just replaced GM_openInTab by this function. I then executed the
script and I got the confirmation popup of FF asking me if I wanted to
install the microsummary; I accepted but then nothing happened.
Then I realised that, according to [2], the correct content type was not
"text/plain" but "application/x.microsummary+xml", so I changed the "data:"
url accordingly. It still didn't work. Then I tried removing the
"charset=UTF-8" parameter of the content type, with the same result. In the
error console I got three times the following message:
Error: [Exception... "'<error>' when calling method:
[nsIMicrosummaryService::addGenerator]" nsresult: "0x805303f4 (<unknown>)"
location: "JS frame :: file:///<my FF2 installation
directory>/components/nsSidebar.js :: anonymous :: line 301" data: no]
Fitxer font: file:///<my FF2 installation directory>/components/nsSidebar.js
Línia: 301
I also turned on the debug flag in nsSidebar.js, but anyting else is being
output neither to the console nor to the terminal window from which I
started FF2, apart from the above message.
Any hints?
Thanks and regards,
e.
[1] For instructions on installing GM on FF2.0b1 see
http://www.xs4all.nl/~jlpoutre/BoT/Greasemonkey/gm_for_ff20beta.html
Also note the to install a script you will have to load it in FF and install
*from the Tools menu*; the usual install bar on top of the page is not
working at the moment.
[2] http://wiki.mozilla.org/Microsummaries
[3] http://www.xs4all.nl/~jlpoutre/BoT/Javascript/Microsummaries/
[4] http://developer.mozilla.org/en/docs/Creating_a_Microsummary
More information about the Greasemonkey
mailing list