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.

29 Comments

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 :)

Kevin

 
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

Certainly shouldn’t be a result of that: BlogThis isn’t an API client, it’s just another web page on blogger.com, one that’s designed to fit in a little popup rather than the usual full-screen version. I’d say it’s more likely that in the new redesign, they broke some URL that changing the weblog select menu calls (and, seem to have fixed it, now, near as I can tell).

 
 
Comment by Paul Sammut #
2004-08-03 13:49:47

Using right click blogger in Firefox 0.9.1:

1. When selected text is over x number of characters Blog This simply cuts it – would be nice to end on a word boundary like googlebar’s blogger does.

2. Would like to be able to increase the number of characters for 1.

3. Can’t see the ”blog this” extension in the extension list -> can’t access blog this settings (if there are any) that may deal with the above 2 points.

Other than that blog this works well. I like the small window it opens – less obtrusive than googlebar. Also like right-click invocation.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1

 
Comment by Steve Hall #
2004-08-05 19:27:51

Phil,

Is there a way to manual (force) install right click blog this. Ever since I moved up to Mozilla .8, it simply will not install. I’m up to 0.9.2 now and it still won’t install. I go through the process…answer the question about where ro install (profile or app) then I see the confirmation box and can see that is it listed in the extensions window. But as soon as I click the OK confirmation, it is no longer in the extensions window and is not installed. I see a commenter above has it installed and he is using o.9.1 so maybe it a problem on my end. I’d just like to know if you (or anybody) is aware of this problem. Thanks.

 
Comment by Phil Ringnalda #
2004-08-05 20:34:42

Paul: nope, no settings: back when I did this, adding settings trebled the complications of an extension. Now that they’ve made everything else so complicated, with constantly changing maxVersion and whatnot, options don’t seem so bad. But you’re right, I borrowed less than useful code for selecting text (actually, it’s the built-in Search Web for ”” code), and when I get a chance to redo the installation, I’ll look for better selection code to steal.

Steve: I’d guess you’ve got either a partly corrupted profile, or just some corrupted cruft related to BlogThis: it should do just what you say, disappear from the extension manager since I haven’t rewritten it for 0.9, but it should be installed and working anyway – I just installed it in 0.9.2 and 0.9.3 to be sure, and it works fine for me. Um. Uninstalling an old extension by hand was a pain (and I don’t remember exactly how, though it should be googleable), nuking your profile and starting from scratch is a pain, too. Hard to say which is less of a pain.

 
Comment by Robbie #
2004-08-24 14:35:56

I used right-click BlogThis in I.E. and was happy to fine it for Mozilla 1.7 when I made the switch. However, it behaves oddly for me. The title, URL, and URL description that appear in my Blog are all in a form like this:
Veer%3A%20Ideas%3A%20Stream%20of%20Consciousness
or
The%20Shifted%20Librarian

What are all these characters?

Comment by Phil Ringnalda #
2004-08-24 19:57:53

Bit of strangeness related to something from the code push when they did the fancy WYSIWYG editor: BlogThises used to all aim at new.blogger.com/blog_this.pyra. Now that redirects to http://www.blogger.com/blog_this.pyra, but in such a way (he said, waving his hands because he doesn’t know why) that your link and selected text wind up URL-encoded. All that junk is the way that you pass characters that aren’t (or may not be) legal in URLs through a URL, by encoding spaces as %20 and encoding the colon and the slashes in the URL you’re trying to post about in such a way that your link winds up broken. I can fix it in the extension, but then that would mean that every single person with it installed would need to update it, and since my IE Google Toolbar does the same thing, there must be several tens of thousands of people in the same boat. I filed a support request earlier today, but haven’t heard back from them yet. We’ll see…

Comment by Phil Ringnalda #
2004-08-24 20:27:18

Heh. Well, if I checked the right email account, actually I had. One of the Jasons says they have a fix coded, and hope to have it in place tomorrow.

 
 
 
Trackback by YABBOB DevBlog #
2003-06-27 15:11:42

the bookmarklet

I hacked Phil’s BlogThis extension for Moz to work with YABBOB. Specifically, to work with DoaM. It was remarkably straightforward though and is obviously ripe for automation… You can expect YABBOB to generate XPIs for Moz users in the near future…

 
Trackback by Weblog Tools Collection #
2004-01-23 17:25:49

Mozilla right click ”Blog This!” contextual menu plug in for WordPress

I really wanted to see what was inside those .xpi files that I install as plugins for Mozilla and I hacked the Blog This plugin from Phil Ringnalda to be compatible with WordPress. The installation can be a little confusing, but it sure is worth it for…

 
Trackback by phil ringnalda dot com #
2004-09-17 20:37:13

Updated right-click BlogThis for Firefox (and Mozilla)

My old right-click BlogThis extension, updated for the new Extension Manager at last, and now without the abrupt cutoff of selected text.

 
Trackback by phil ringnalda dot com #
2005-02-13 08:23:00

Right-click Blogger BlogThis 0.3 for Mozilla and Firefox: the ”there’s more than 26 letters?” release

For want of the proper function to escape the title and text, anything but English was being lost. No more.

 
Comment by Craig Carignan #
2006-11-01 06:09:09

How about an update for Blogthis extension for Firefox. It’s just so easy. It isn’t working in Firefox 2.0.

Comment by Rob van den Eijnde #
2006-11-19 09:36:34

Hi Craig,

I found the way to get it to work under FF 2.0. It seems to work without a problem.

In the installation directory of the plugin (for me C:Documents and SettingsreijndeApplication DataMozillaFirefoxProfilesci537wtz.defaultextensions{8F82D6F9-D8F0-4477-8C73-908531D73538})
contains a file called install.rdf.
In this file it should somewhere read ’em:maxVersion=”1.6a1”’.
Change the version number to 2.0 and restart FF.

Have fun.

Rob

 
 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime="" cite=""> <dd> <dl> <dt> <em> <i> <ins datetime="" cite=""> <kbd> <li> <ol> <p> <pre> <q cite=""> <samp> <strong> <sub> <sup> <ul> in your comment.