Right-click BlogThis for Mozilla

A mere three days over a year after the first person asked, here’s a Mozilla and Firebird extension to add a Blogger “BlogThis” item to your right-click context menu. To quote the Blogger API page, its status is experimental and alpha (translation: it works for me, I’m posting to find out if it works for you, so please let me know).

Still to come: an MT It! version for Movable Type (which will require that I learn how to do extension settings) or possibly a generic version where you just give it a URL with placeholders for the URL, title, and selected text. In a while: settings are much harder, plus they require that you have some design sense (or steal from people who do).

Thanks to Ted Mielczarek, from whom I stole most of the code: I finally learned that there is no documentation, so the only way to learn how to do extensions is to find one that does something similar (or find a similar bit of functionality in the browser itself, though that’s harder), and shamelessly steal from it.


Comment by michael #
2003-06-23 22:26:55

Show me your MTits! bwahaha You’re kidding right? I think that acronym needs a little revising. Nice though. heh

Comment by Phil Ringnalda #
2003-06-23 22:30:57

Maybe I should have looked at the original, which turns out to be MT It!, instead of just going on a vague memory. Sometimes, spaces do matter.

Comment by Phil Ringnalda #
2003-06-24 09:46:40

Though actually for the most part the extension name (other than the public name) needs to work as a filename, or as a Javascript variable. So there will be plenty of mtit (including, since you need a way to decide whether or not to display the context-menu item for a particular click in a particular place, an mtit.showHide()).

Comment by Hyakugei #
2003-06-24 08:03:54

You might want to look at Mozblog – a built in blogging tool for ’zilla. It adds a ’blog this’ item to the right click menu…

Comment by Phil Ringnalda #
2003-06-24 14:31:07

Yeah, I do know about Mozblog, but while it’s a cool app, it’s pretty heavyweight for some people (and last I heard, doesn’t yet work with Firebird, which will require both some slightly different UI hooks, and that whoever’s porting Composer to a Firebird extension get finished, if they aren’t). When the Blogger API first came out, I was all excited about the possibilities, but really, unless you are working around things like not pinging weblogs.com or not having an RSS feed, about the best an API app can aspire to is being just as good as the original, since nobody seems to actually expose more through the API than they do through their native web interface. Mike’s done some cool stuff, but if I have to choose between a big app installed in Seamonkey, or a tiny app installed in Firebird, I’ll take the tiny one.

Comment by Eadz #
2003-06-24 10:28:37

Can anyone get this working on Linux? I’m getting stuck with error -239 ( Moz Bug #109044 ), Debian.

Also, say If I didn’t want to use blogger, but some other popup page, how would I change the URL?

Comment by Phil Ringnalda #
2003-06-24 14:37:04

I’m not sure yet whether I can help with error -239 (I just scanned the bug, without really understanding what they were saying about workarounds: I’ll have to either read closer, or steal from someone who has fixed it already), but for an alternate URL, once it’s installed, find the blogthis.jar file (in your profile or the app directory, depending on where you said to install it), unzip it, and in the resulting contentblogthis directory there’ll be a blogthisOverlay.js file: edit that, and change the URL in the bloggerBlogThis function, which gets the selected text in t, the URL in u and the page title in n. Zip everything back up to blogthis.jar and restart, and you should have your own URL. Or, wait for me to figure out extension prefs, and figure a way to do the UI, but I’d say changing it yourself is much more certain and quick.

Comment by vadim kolontsov #
2003-08-25 01:08:51

There is an error in install.js script.

It should use flag ”PROFILE_CHROME” instead of ”DELAYED_CHROME” if extension is installing into profile dir.

As far as I understand, it solves ”-239 error”

Comment by Ted Mielczarek #
2003-06-27 10:01:01

You’re welcome. I got parts of the code for my extensions by looking at other extensions anyway. That’s the only way to go.

Comment by Alan #
2003-06-27 11:14:30

If I recall correctly, one of the things you can do from the MT admin panels is create a ”link” that’s actually a chunk of javascript code to pop up a blog entry form pre-populated with the current page.

By default you have to pick which blog to add the story to, but I suspect you could change that default with trivial changes to the javascript code.

(after looking, it’s the last item on the main admin page: ”Set Up Bookmarklets”)

Comment by Phil Ringnalda #
2003-06-27 12:37:51

Yeah, the bookmarklet that you can drag to your links toolbar is dead simple to do, and the backend code behind the IE-specific right-click ”MT It!” is simple, too: all you have to do to add to IE/Win’s context menu is create a .reg file, four lines of plain text with the proper content-type. Doing it for Mozilla requires that you adjust the URL that’s in a Javascript file, then compress that and a couple of other files in a Zip file, compress that file plus another Javascript file into another Zip file, and deliver that with the right content type. In Perl. My Perl skillz are nearly nonexistent, and I get the impression that support for Zip isn’t in Perl’s core, so you would be adding another module dependency. At which point it starts looking easier to just do the UI to ask ”what’s the URL out to your mt.cgi, and which elements do you want in your popup?” in the Mozilla extension itself.

Comment by Kevin Burton #
2003-07-01 00:55:27

Error -239 is chrome registry. You tried to install this into your system components directory. chmod -R a+w your mozilla system dir and you should be fine.

BTW.. I added blog this support to NewsMonster on Sunday. Strange timing :)


Comment by Marc Rust #
2003-07-02 05:03:44

I’m feel I’m likely asking a stupid question, but I’ve had some bad experiences with extensions before: Is there an easy way to uninstall or remove this extension? If so, I’ll probably start using it today!

Comment by Phil Ringnalda #
2003-07-02 08:31:58

Nope, not a stupd question, just one that there isn’t a good answer for, just yet. Hyatt’s talking about doing an uninstaller for extensions, but it’s just at the thinking stage as far as I know. Doing it manually tends to be harder than just starting over with a new profile (and a new copy of the app if you don’t install extensions in your profile).

Comment by AndyEd #
2003-07-04 07:29:49

Using MozillaFirebird, install/uninstall of extensions is automated. In Mozilla, it’s not a function in the XPInstall library so uninstall is generally scantily implemented in XPIs. The big projects tend to have this, but the small XPIs for Firebird are prolifigating due to the easy install/uninstall.

Comment by chuck kahn #
2004-05-29 20:32:59

When I select another blog in the ”blog select drop down” menu, I get prompted to sign in, but signing in just brings back the sign in prompt.

Is this because of blogger’s configuration change?

Comment by Phil Ringnalda #
2004-06-01 21:38:16