Kaz’hack

{ No ducks were harmed in the making of this weblog. }

recherche

To content | To menu | To search

KompoZer Addons Mini How-To

By Kazé on Friday, December 4 2009, 03:14 :: Permalink

There are two items in my long todo-list that I can’t address properly before KompoZer 0.8 is released:

  • design an “Add-ons” page for kompozer.net
  • write an “Add-on development“ how-to for kompozer.sf.net

I won’t be able to work on these items before January 2010, so here’s a very quick how-to for add-on developers. I’ll suppose you’re already familiar with Firefox add-on development, or that you can read the related documentation on MDC.

Install DOM Inspector

I’ve taken the Mozilla 1.8.1 DOM Inspector and adapted it for KompoZer 0.8. You can download it here: inspector-20091201.xpi

I’ve tried to make a quick port of Venkman but I’m not sure it works on KompoZer 0.8 (I confess I don’t use it at all). If you can help me with this, that would be very appreciated.

If you need other developer add-ons for KompoZer 0.8 (Console², Event Spy, Extension Developer…), just let me know. If you can take the time to port these add-ons to KompoZer 0.8, that’d be even better. :-)

Set up a development profile

You should add these two lines in the prefs.js file in your profile directory:

 user_pref("browser.dom.window.dump.enabled", true);
 user_pref("nglayout.debug.disable_xul_cache", true);

The first one will show the output of dump() commands to the console. The second one will save you some significant time if your extension is in a separate window or in the sidebar, as you won't have to restart KompoZer to see your changes: modify your code and reopen your window/sidebar, your changes are reloaded.

You can also use the about:config extension to modify these two settings. This extension will be useful to check the preferences you modify with your extensions…

UUID / install.rdf

As you may know, KompoZer 0.8 now has a specific UUID:
{20aa4150-b5f4-11de-8a39-0800200c9a66}

This new UUID will prevent many compatibility issues we had with Nvu add-ons. If you know some Nvu extensions that should be ported to KompoZer 0.8, just let me know and I’ll port them as soon as possible.

Your install.rdf file should have the following “targetApplication” section:

    <!-- target: KompoZer 0.8.x -->
    <em:targetApplication>
      <Description>
        <em:id>{20aa4150-b5f4-11de-8a39-0800200c9a66}</em:id>
        <em:minVersion>0.7.99</em:minVersion>
        <em:maxVersion>0.8+</em:maxVersion>
      </Description>
    </em:targetApplication>

You can (should) use a readable identifier for your add-on, i.e. something like “myextension@website.tld” instead of a UUID.

Unlike Nvu / KompoZer 0.7.10 extensions, you can use chrome.manifest files instead of contents.rdf ones.

Overlay

If you want to add your extension to the “Tools” menu, I recommend to insert it after the “JavaScript console” item in your overlay file:

<menupopup id="taskPopup">
  <menuitem id="myExtensionID"
                insertafter="javascriptConsole"
                command="cmd_openMyExtension" />
</menupopup>

Warning: the ID “javascriptConsole” is case-sensitive. I realized recently that the ID is “javaScriptConsole” for Thunderbird, but it’s too late to change this ID now that KompoZer 0.8 is shipped in most Linux distros.

Getting started: LoremIpsum

Pascal Chevrel has designed a simple but helpful LoremIpsum extension.

This extension is the simplest I can think of: no locales and 10 lines of JavaScript. As such, playing with LoremIpsum should be the easiest way to get started if you want to develop your own add-on for KompoZer.

Another way to get started would be to adapt a Firefox or Thunderbird extension to KompoZer. Beware, KompoZer 0.8 is still based on Gecko 1.8.1 (= Firefox 2 / Thunderbird 2)…

Getting Help

As usual, the #kompozer channel is the best place to get some help for KompoZer-related issues. I’m usually online from noon to midnight, GMT.

Tags :

  • editor
  • mozilla
  • tutorial
  • xul

Comments

1. On Friday, December 4 2009, 10:04 by Mike5

If you'd find the time to port Console2, Chrome List and QuickRestart, that'd be great....

2. On Friday, December 4 2009, 11:15 by Philip Chee

FYI. Thunderbird 3 switched to "javascriptConsole" to be consistent with the other major toolkit apps (Firefox and SeaMonkey).

Phil

3. On Friday, December 4 2009, 15:31 by Nick

You also should fix the download button on kompozer.net (as I said before).

4. On Saturday, December 5 2009, 02:51 by Kazé

Mike5 > I’m not sure I could port ChromeList easily, as it seems to require Gecko 1.9+. I’ll have a look at Console² and possibly QuickRestart.

Phil > good to know, thanks! That’s a perfect reason not to change anything. :-)

Nick > done, thanks. Unfortunately, we still have some glitches with the downloads: sometimes the download doesn't start. I've filed a bug on SF.net, but we'll probably host the binaries on other mirrors to solve this issue.

5. On Saturday, December 12 2009, 06:26 by klaus

Great tool. If the tabs for multiple pages which are visible in Design mode would be also visble in Source mode would be great. (i.e. switch between page sources).

Keep on the good work.

Cheers, Klaus

6. On Saturday, December 12 2009, 22:25 by Sandro kensan

Off Topic. Ten cups of Italian's coffe for this beautiful project. (via Paypal). Marry Christmas.

7. On Wednesday, December 23 2009, 03:50 by Adrian

Hi, babe in the woods here, I just tried to install Kompozer; an archiver opened it and saved it as a folder titled Mozilla to my desktop. I can't see any setup or install icons in there. A little advice? Sorry if this is the wrong place but I can't find any info elsewhere.

Adrian

8. On Wednesday, December 23 2009, 22:14 by Elmor

I downloaded kompoZer and with this verision I have no split button to use when editing is there a way to bring up that feature, all I have is (general, sourse, preview ) if you can help I would appreceate it, I am having trouble installing my AWeber link

9. On Thursday, January 7 2010, 14:39 by Aldente

The single most important thing for me is website templates.

Anyone can create a web page. Web sites are more complex.
Are there any templates to start using this?

10. On Friday, January 8 2010, 02:06 by Trevor Ambrose

I downloaded KompoZer and am excited to see what features will be of benefit to me.

11. On Friday, January 8 2010, 08:21 by Jeremy

This is to Aldente:

This is not my site I'm giving you, just one that I've found useful for web site templates. Steve has a nice selection of free ones, the only thing he asks is that you like to his page on your main page if you use one of his.

www.steves-templates.com/

I hope that you find it useful!

12. On Monday, January 25 2010, 15:36 by jimbo

I downloaded komposer. I saved a copy of the location on wordpad and now I not only do not have a desktop Icon but cannot access the program on my computer.

13. On Wednesday, January 27 2010, 19:51 by Cédric

@jimbo:
I guess you are running Windows.
Uncompress the .zip file with an archiver utility like 7zip, Winzip, Winrar or whatever and then double-click on the kompozer.exe file in the extracted directory.

They posted on the same topic

1. On Sunday, December 6 2009, 04:06 by prosario2000

prosario2000's status on Sunday, 06-Dec-09 03:06:12 UTC

Design add-ons for KompoZer. I like the idea. 2tu.us/17h8...

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.