[Greasemonkey] GM + Microsummaries in FF2

Joe la Poutre jsixpack at gmail.com
Sun Jul 23 02:24:44 EDT 2006


Hi esquifit,

Wow, a really cool idea to make the generated microsummaries generator
"auto install" - I was thinking that you needed a real XPI type
extension for that, complete with browser/chrome privileges (in order
to write files locally, and register with Firefox somehow).

I have no idea why your approach failed, but I have been unsuccessful
with a test, where I loaded a html file from a local disk (and so
tried installing a microsummary from a file:// url - it silently
failed). I haven't looked any further into this, though...

Still, it would be really cool if this would work from Greasemonkey!

On 7/22/06, esquifit <esquifit at googlemail.com> wrote:
> 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
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>


More information about the Greasemonkey mailing list