roachfiend.com

  • firefox extensions
  • tutorials
  • faq
  • December 8, 2004

    How to create Firefox extensions

    Filed under: tutorials — Eric @ 6:47 pm

    Everyone has a good idea at one time or another to implement a new feature in a web browser. Well, with the goodness that is Mozilla Firefox, now you can do just that. You need to have a vague understanding of XUL and Javascript, but you certainly don’t need to be a master of either. When I started, I knew nothing about either one, really. I had seen some bookmarklets here and there, and tried to figure out just how they worked. Well, that’s how I made my first extension, BugMeNot.

    Contents

    1. Learn By Example
    2. Hello, world!
    3. Looking inside the XPI
    4. Re-configuring your extension’s installation
    5. Chrome is more than a shiny bumper
    6. Skin that cat
    7. Pack it up and try it out
    8. An easier way to re-build
    9. My Firefox got completely hosed up
    10. Ensure server compatibility
    11. Additonal help and information
    12. Comments / Feedback

    Learn by example

    Everyone has a good idea at one time or another to implement a new feature in a web browser. Well, with the goodness that is Mozilla Firefox, now you can do just that. You need to have a vague understanding of XUL and Javascript, but you certainly don’t need to be a master of either. When I started, I knew nothing about either one, really. I had seen some bookmarklets here and there, and tried to figure out just how they worked. Well, that’s how I made my first extension, BugMeNot.

    Basically, this tutorial will show you how to create your first extension from scratch. Since every programmer always learns from the famous “Hello, world!” example, I figured that would be a good way to introduce you to developing extensions.

    Xul Planet has a nice little tutorial which will show you the basics of creating a menu. Mozilla also has a very handy DOM Window Interface reference if you’d like to take a look through that. They’re both geared toward an audience that has a good feel for programming, though, so it’s not necessary to understand everything going on to follow this tutorial.



    Hello, world!

    Our extension will be a nice simple one that will pop up a window proclaiming “Hello, world!” after we select it either in a right-click menu, or under the Tools menu. Both of these places are very popular positions, and it’s relatively easy to stick something in there.

    Let’s see what the end result looks like, so you know what to expect. First, here are the two ways to access our extension:

    Right-clicking will get us this:

    Right-click screenshot

    The tools menu looks like this:

    Tools menu screenshot

    The end result of our extension’s efforts:

    Alert screenshot

    What it looks like in the extension manager:

    Extension manager screenshot

    Clicking on the “About…” in the extension manager will get us this:

    About... screenshot

    Looking inside the XPI

    Here’s how the extension breaks down in a nutshell, using a pre-made Hello, world! extension as an example:

    (You can download it here, just right-click and save, then you can follow along.)

    helloworld.xpi is the packaged extension. XPI is just an file format that your browser will recognize as a browser extension. In reality, it’s just a zipped up file. So you can rename the XPI to ZIP or even JAR if you want, then open it up using an archive program, like 7-Zip or WinRAR. So, once that’s opened up, you’ll see:

    • chrome
    • install.js
    • install.rdf

    A folder and two files. install.js was all you used to need for the installation, but now that the extension manager has changed (since Firefox 0.9), the install.rdf is used instead. Now, the install.js is used purely for earlier versions of Firefox/bird, Mozilla, and Netscape. If you want to make this extension solely for 0.9+ versions of Firefox, then you can omit this file if you’d like. I tend to keep it in because it only take a second to make, and assures a wide audience compatibility. Some extensions simply aren’t backwards-compatible, though, for example my ListZilla extension, since it gathers all information from 0.9’s extensions manager. A nice simple “Hello, world!” prompt shouldn’t present any problems, though.

    If you open up install.js, you’ll see that it’s very basic, in terms of what you need to modify to make your own install script:

    // --- Editable items begin ---
    extFullName: 'Hello, world!', // The name displayed to the user
    extShortName: 'helloworld', // The leafname of the JAR file 
    extVersion: '0.1',
    extAuthor: 'Eric Hamiter',
    extLocaleNames: null, // e.g. ['en-US', 'en-GB']
    extSkinNames: null, // e.g. ['classic', 'modern']
    extPostInstallMessage: 'Success! Please restart your browser to finish the 
    installation.'
    // Set to null for no post-install message
    // --- Editable items end ---
    

    So all the hard work is done for you. I’m not going post the rest of the code, but you’ll see quite a lengthy amount of work that is fully automated.

    Now if you open install.rdf. you’ll see this:

    <?xml version="1.0"?>
    
    <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:em="http://www.mozilla.org/2004/em-rdf#">
    
        <Description about="urn:mozilla:install-manifest">
    
            <em:id>{9AA46F4F-4DC7-4c06-97AF-5035170633FE}</em:id>
            <em:name>Hello, world!</em:name>
            <em:version>0.1</em:version>
            <em:description>Displays an alert message via right-click
            or Tools menu.</em:description>
            <em:creator>Eric Hamiter</em:creator>
            <em:homepageURL>http://extensions.roachfiend.com</em:homepageURL>
            <em:iconURL>chrome://helloworld/skin/helloworld.png</em:iconURL>
            <em:aboutURL>chrome://helloworld/content/about.xul</em:aboutURL>
            <em:file>
                <Description about="urn:mozilla:extension:file:helloworld.jar">
                    <em:package>content/helloworld/</em:package>
                    <em:skin>skin/classic/helloworld/</em:skin>
                </Description>
            </em:file>
    
            <em:targetApplication>
                <Description>
                    <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                    <em:minVersion>0.7</em:minVersion>
                    <em:maxVersion>9.9</em:maxVersion>
                </Description>
            </em:targetApplication>
    
        </Description>
    
    </RDF>
    



    Re-configuring your extension’s installation

    Ok, whoa.. what is all this crap? The first thing you’ll see is the <em:id> tag. This is your very own generated id that will separate your extension from anyone else’s. There are a few ways to make it. You can either use an online perl script to randomly generate one, or if you use Windows, you can use a program called guidgen, brought to us by Microsoft. How deliciously ironic. Or am I misuing the term irony here? Whatever. So if you download that, then you’ll see this when you run it:

    GUIID Screenshot

    So choose 4. Registry Format, then hit New GUID a few times for good measure, then Copy. That’s it, now your new spiffy id is in your clipboard. Replace the old one with this, and you’re set.

    Name, version, description, creator, and homepageURL are all self-explanatory. The iconURL and aboutURL are what shows up if someone right-clicks your extension and chooses “About Extension…”. You can leave these blank, it’s not mandatory, but it’s nice to have a little flash every now and then.

    Underneath file, this is standard stuff. Just replace all instances of “helloworld” with your extension name. This is where the installation will try and find your files and folders. If you have any icons, you’ll include the skin folder. Again, it’s not mandatory.

    Target application is what you’re gearing this for. The ec8030f7… is unique to Firefox, so leave that alone. The minversion and maxversion is what versions of Firefox it will be compatible with. There was a big stink about this recently, since the developers introduced 0.9.1, shortly after telling us to make sure and only put a maxVersion of 0.9. This does not compute. So I recently modified mine to go to 9.9, which will ensure compatibility through the next few versions of Firefox. This isn’t the type of thing that mozilla will support, since they can only recommend keeping the maxVersion to the current release, but it’s the best way to keep you sane, so you don’t have to update your extensions every few weeeks.



    Chrome is more than a shiny bumper

    Ok, now open up the chrome folder. In there you’ll find another archived file, helloworld.jar. Open it up and extract the files. You’ll now have content and skin folders. Let’s explore content first. In there, we have a helloworld folder, and under that, these files:

    • about.xul
    • contents.rdf
    • helloworldOverlay.js
    • helloworldOverlay.xul

    about.xul is the file you see when you click “About Hello, world!…” in the extensions menu. It’s pretty self-explanatory, and you’ll see that a nice man named Jed Brown wrote the template for it, so all the hard work has been done for you. Again. So just fill out the info, and that’s it.

    helloworldOverlay.xul and helloworldOverlay.js are what make things happen. They’re the brains behind the outfit, so to speak. And you’ll be amazed at how simple they are. Here’s helloworldOverlay.xul:

    <?xml version="1.0"?>
    
    <overlay id="helloworldOverlay"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    
    <!-- This imports our javascript. -->
    
    <script type="application/x-javascript" 
    src="chrome://helloworld/content/helloworldOverlay.js">
    
    </script>
    
    
    <!-- This is for the right click menu. -->
    
    <popup id="contentAreaContextMenu">
      <menuitem id="helloworld" label="Hello, world!" accesskey="H"
      insertafter="context-stop" oncommand="hello();"/>
    </popup>
    
    
    <!-- This is for the Tools menu. -->
    
    <menupopup id="menu_ToolsPopup">
        <menuitem insertafter="devToolsSeparator" label="Hello, world!"
        accesskey="H" oncommand="hello();" />
    </menupopup>
    
    
    </overlay>
    

    So all it says to do is to insert the javascript file, helloworldOverlay.js, and to create a context menu entry called Hello, world! accesskey=”H” underlines the “H”, since it’s the first letter that wasn’t taken by any other options. insertafter=”context-stop” places the option directly underneath the Stop label. oncommand makes it launch the window with the function hello, which is located in the javascript file we imported earlier. The second part of the overlay tells it we also want to place an option in the Tools menu. Same logic as the context menu, just a different place to stick it. Here’s what helloworldOverlay.js looks like:

    // This is our javascript, which will pop up our message
    // in an alert box.
    
    function hello(){
        alert("Hello, world!");
    }
    

    Now for contents.rdf. This is the file that tells the browser where to store this overlay information. Here’s what it looks like:

    <?xml version="1.0"?>
    
    <RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
    
        <RDF:Seq RDF:about="urn:mozilla:package:root">
            <RDF:li RDF:resource="urn:mozilla:package:helloworld"/>
        </RDF:Seq>
    
        <RDF:Seq RDF:about="urn:mozilla:overlays">
            <RDF:li RDF:resource="chrome://browser/content/browser.xul"/>
            <RDF:li RDF:resource="chrome://navigator/content/navigator.xul"/>
        </RDF:Seq>
    
        <RDF:Seq RDF:about="chrome://browser/content/browser.xul">
            <RDF:li>chrome://helloworld/content/helloworldOverlay.xul</RDF:li>
        </RDF:Seq>
    
        <RDF:Seq about="chrome://navigator/content/navigator.xul">
            <RDF:li>chrome://helloworld/content/helloworldOverlay.xul</RDF:li>
        </RDF:Seq>
    
        <RDF:Description RDF:about="urn:mozilla:package:helloworld"
            chrome:displayName="Hello, world! 0.1"
            chrome:author="Eric Hamiter"
            chrome:authorURL="mailto:ehamiter@gmail.com"
            chrome:name="helloworld"
            chrome:extension="true"
            chrome:description="Displays an alert message via right-click
            or Tools menu.">
        </RDF:Description>
    
    </RDF:RDF>
    

    You’ll notice the address chrome://browser/content/browser.xul up there. This is mozilla’s internal frame of reference. browser is the actual browser, and navigator works for non-Firefox builds, like Netscape or Mozilla. The only part you’d need to modify is the descriptions. The rest of it just implements the extension into the browsers.



    Skin that cat

    Now let’s backtrack to the skin folder. In it, we’ll find a few more folders: classic and helloworld. This is just the traditional layout, and if it ain’t broke, then hey, don’t fix it. In helloworld, we find three files: helloworld.png, helloworldb.png, and a contents.rdf file.

    helloworld.png:

    Hello, world! small icon

    helloworldb.png:

    Hello, world! large icon

    These are called from about.xul mentioned previously, for use in the extension menu and the about menu. contents.rdf simply maps out the paths to the skin files, so the only modification you need to change for your own extension is in the last line, which points to the folder helloworld.



    Pack it up and try it out

    So now that you see how the files work, and where they’re packaged, you can modify them to your whims, and try out new things. Once you modify them, just pack them up in reverse order. Using your archive program, you would navigate back up to the chrome folder, and add content and skin into a zipped archive, then rename it to extension.jar. After that, navigate up another folder, and add chrome, install.rdf, and install.js into another zipped archive, then rename it to extension.xpi.

    You’re ready to test it out in your browser now. Open up Firefox, and hit CTRL-O, or Open File. Load up your xpi file, and say yes to the installation. Restart Firefox, and hopefully you’ll see your new extension in the menu, and it does whatever you had hoped it would do.



    An easier way to re-build

    After a while, it gets tiresome to select your files, your folder, archive them, rename them, move them, delete them, rename them… you get my point. If you have 7-Zip installed, you can use the command line feature, so you can have this all fully automated. Here’s what you need to do:

    Copy C:\Program Files\7-Zip\7z.exe to C:\WINDOWS\system32 (This will put 7z.exe in your system’s path, which will make it accessible from the command prompt).

    It’s a good practice to build your extensions somewhere far away from random scripts and clutter, so create a new folder somewhere and call it whatever your extension is named. Make sure it matches the internal .jar file that you previously referenced in your install.rdf file. You can always rename the final xpi to something more intricate afterward, but for packaging, it’s best to keep it simple.

    Copy the following script and paste it in a text editor and save it as build.bat in your newly-made folder:

    set x=%cd%
    md build\chrome
    cd chrome
    7z a -tzip "%x%.jar" * -r -mx=0
    move "%x%.jar" ..\build\chrome
    cd ..
    copy install.* build
    cd build
    7z a -tzip "%x%.xpi" * -r -mx=9
    move "%x%.xpi" ..\
    cd ..
    rd build /s/q
    

    Now, you can build or modify your extensions easily. Just use the new folder as your base of creation, so that would contain the install files and chrome folder. Whenever you want to create your new file, just double-click build.bat, and your new extension will pop out in the same folder. Each time you use the build.bat script, it will delete your old file and create a new one.



    My Firefox just got completely hosed up

    Worst case scenario: upon restarting Firefox, it hangs with a “Firefox is still installing an extension, this may take a minute…”. This means you borked it up somehow. Don’t panic! A super easy way of uninstalling it without hosing the rest of your shit up is as follows:

    Start » Program Files » Mozilla Firefox » Mozilla Firefox (Safe Mode)

    Then go to Tools » Extensions » [right-click on your extension] » Uninstall

    Restart Firefox, and it’ll be gone. Then modify your files and try again.



    Ensure server compatibility

    If it works, and you want to put it on your web server, but find out that it won’t install directly, and your browser is treating it as “Save File As..” then you need to modify your .htaccess file. You can learn more about it here, but for brevity’s sake, you need your server to run on Apache for it to work. If you have no problem modifying the file, here’s the information you need to add:

    Add this to your .htaccess file:

    AddType application/x-xpinstall xpi

    And you should be set.



    Additional help and information

    If you want to take a look at any other files I’ve created, they’re on my main extensions page, and I’ll list them directly here for convenience as well:

    If you’d like to put a certain snippet of Javascript on every page, Allow Right-Click or Always Remember Password is the way to go. Alt-Text for Links uses javascript to control tooltips. If you’d like to create your own links menu, then Goon Menu is good to learn from. BugMeNot uses complex regular expressions, ListZilla deals with setting options and using the extension manager, and WordCount is a good way to learn how to take a bookmarklet and use it as an extension.

    The Mozillazine extensions forum is a great place to learn more about creating extensions. They’re under heavy loads from time to time, so they might be down when you read this, but try back again if they are, because they have a lot of useful information there.

    Loads of other useful extensions can also be found at Mozilla Update, and there’s another place called My Extensions Mirror that has forums as well as tons of extensions.

    Well, that’s it. Hopefully this has been helpful to at least a few ambitious people, as well as a look into what goes into making one for the non-technical types. So get off your ass and make something useful!




    -->

    263 Responses to “How to create Firefox extensions”

    1. creaza Says:

      Hi!

      you are inspiring others to write tutorials. way to go! and i quote

      ‘Heavily inspired by roachfiend.com’

      http://www.gmacker.com/web/content/tutorial/firefox/firefoxtutorial.htm

    2. Ilan Says:

      Hi,
      Thanks for a great tutorial. Helped me a lot.

      Can you re-post you tutorial about updating extensions, or point to where I can find info about it?

      Thanks.

    3. Eric Says:


      Ilan, I’ll probably end up re-writing that tutorial today, so check back soon.

      Edit: it’s up now.


    4. Ilan Says:

      Thanks for the quick response :)

    5. Chad L Says:

      Thanks for the great tutorial!

    6. Raik Says:

      hi!
      i have advanced the build.bat :
      http://kb.mozillazine.org/Talk:Dev:Extensions:Windowscmdbuild_script
      now it works too in subdirectories with the pure foldername, stripped from path (%CD%).

    7. iacchi Says:

      You shouldn’t write such a kind of guides if you can’t even add a locale to your extensions.

    8. Eric Says:


      Feel free not to read it, then.


    9. trainee Says:

      Nice guide man. Just give me a bit to think of what I want to write an extension for, :).

    10. trevelyan Says:

      Thank you for taking the time to write this. I found it useful.

    11. alexvir Says:

      Hello!

      I need to write a FireFox extension.
      The extension must have an access to DOM of each opened document (am I wright, that each opened document must have one copy of my extension “object”?).
      I’ll try to describe my problem:

      I have standalone application, which keeps the logins & passwords in it’s database. The purpose of FireFox extension is autofill the web-form with specified login & password.

      So when user select any login & password, my application fill the file-mapping structure with selected login & password & send the certain message to FireFox window (for example WM_USER + 13).

      The FireFox window must get login & password from file-mapping stucture & autofill the web-form of current document.

      On initialization extension must set hook to current FireFox window. If certain message will be received by hook, extension must fill the web-form with login and password (wich it get from file-mapping from standalone application).

      How can I realize this functionality in extension for FireFox? May be you have any samples or code?

      I will very appritiate for any help!!!

    12. Raghu Says:

      Awesome man! This guide is crisp and clear and is a good start for beginners who want to implement their own extensions to FF. Thanks for writing this up.

    13. Josh Says:

      Great tutorial! I want to make a plugin for something at work but I’ll need to put 2 input boxes into the toolbar, do you know of any examples I could follow? I guess it would be similiar to the google toolbar because it will be posting to an internal app.

    14. eg. » Blog Archive » Firefox Extensions Says:

      […] fox Extensions Want to learn how to make your own Firefox extensions. Here is a cool tutorial from RoachFiend.com. T […]

    15. Alan Beaman Says:

      I’m interested in extending Mozilla more than Firefox, but still this tutorial really is great. I thank you very much for sharing it. I second what Raghu said. I’m well on my way to making an extension of my own thanks to you.

    16. Leo Kent » Creating Firefox Extension Says:

      […] iter has written a tutorial showing you how to write a simple “Hello World” extension. http://roachfiend.com/archives/2004/12/08/how-to-create-firefox-extensions/ Comments » The URI to Tra […]

    17. Muhammad Ali Says:

      Hi,

      Great tutorial…
      The last time ( an year ago ) when i tried following a tutorial for making a simple extension, it took me a couple of days, doing everything by hand. It was hell, really.

      This time, it was 15 minutes…
      Thanks again :)

    18. Manish G Says:

      Excellent tutorial! I’m wondering if you can write extensions for firefox running on linux/bsd, as well. Any thought?

      thanks for sharing the tutorials :)

    19. TechSmoke » » How to create Firefox extensions Says:

      […] ow to create Firefox extensions
      Filed under: ramblings — mike @ 4:46 pm
      roachfiend.com » How to create Firefox extensions Thought this migh […]

    20. Jennifer Says:

      Could you post (or direct me to) newb directions on using the command line feature to zip everything up?

    21. Chris Says:

      Thank you! You rock.

    22. Zaeem Says:

      Cool tutorial! Thanks for making it easy. I just want to do a few extensions for my own use and this is sufficient to get me going.

    23. 925 » Create a FF extension yourself Says:

      […] Create a FF extension yourself
      How to create Firefox extensions
      …this tutorial is just so cool, […]

    24. Ali (Saudi Arabia) Says:

      Many Many Thanks for the toturial …
      It was easy to follow and clear enough..
      I started to think about making an extension after I read it ..

      Thank you again ..

    25. Nobo Says:

      Great tutorial! But I’ve a problem, when I open the xpi file in firefox and on install now click:

      Firefox could no download the file at [uri] because: Install script not found

      I use linux, this is the reason. Firefox can’t read the zip file correctly. I don’t know how I should create the zip file Can someone help me?

    26. someuser77 Says:

      why do i get a update available notice after i remove all update urls from this extansion?

    27. EgoBurp » Web Annotation II – The Hacking Says:

      […] 7;t too painful, though. Then it came time to modify the wikalong extension. I found the roachfiend site on Firefox extension development. I don’t blam […]

    28. Tearfang Says:

      Cool tutorial, but I have this one problem with it, you mention that “Clicking on the “About…? in the extension manager will get us this” I’m looking at your picture of the extention manager above… (and the window that pops up when I got tools->extensions) and I don’t see an about button… perhaps I’m just stupid, but I don’t seem to be able to figure out how to get the about window you show to pop up.

    29. Eric Says:


      Tearfang, try right-clicking on an extension in the extension manager. Then you’ll see the about option.


    30. Dirk Says:

      Cool tutorial!
      Can you recpmmend some pages handling JS for firefox plugins?

    31. kinan al jajeh Says:

      Thanks a lot.

    32. Gavin Says:

      Thanks for the excellent tutorial, it has been extremely informative, not to mention concise.

      Thanks again!

    33. Harmen van Rossum Says:

      If you plan to make the extension available for linux don’t use the guid provided by the perl-script, it won’t work! (It took me some hours to figure that out). I think the reason is that your GUID does not contain any capital characters.

    34. Harmen van Rossum Says:

      Sorry I think something else went wrong. Thank you for this excellent guide.

    35. Jason Harms Says:

      Is this tutorial similar to what you would need to create a Thunderbird extension as well? Great tutorial. Thanks.

    36. Jennifer Says:

      Hi,

      thanks for this!

      It would be EXTREMELY helpful to extension newbs like myself if you would include that package names(in chrome/contents/extension_name/contents.rdf) MUST be lowercase. NO MIXED CASE!

      Spent way too much time trying to figure out why my extension wouldn’t install, and worse, why it would disable my browser - until I came accross this juicy little tidbit.

    37. jr Says:

      you made bugMeNot?

      omg - you rock!
      thanks!

    38. leaf Says:

      that great thanks

    39. Ed Says:

      Excellent Tutorial! Many thanks. Think I now get an idea what the hell is going on with extensions.

    40. Brendan Says:

      Great Tutorial and nice extensions. VERY helpful.

    41. jIm Says:

      Could you write a tutorial on how to make your extension’s command show up in the “This Frame” sub menu?

    42. tireetoo Says:

      I never knew about that thing either! That tells me a lot.

    43. David Grice Says:

      SPOCK - “Captain! We should identify the species first then select a language to communicate!”

      CAPTAIN KIRK - “Mr. Spock. Are you saying that this is a new species?”

      SPOCK - “No Captain! Just unidentified.”

      ……………………………..

      I enjoyed the tutorial. It was not on my list of goals. This was a delightful distraction from my endeavors. Upon the conclusion, I pondered the thought of how I surfed over to the other side of CYBERSPACE UNIVERSE and confronted by this alien topic.

      I for unknown reason I will probably always remember this tutorial when all my other memories become mush!

      I blew the time in this tutorial in nothing flat. I glanced at the time and warped 1.5 hours into the future without a good excuse for the lost time. It was then I recalled a comparative anomally from a forgotten TV episode space exploration series.
      WITHOUT HESITATION I ADMIT THAT A GOOD TRAINING PROGRAM/INSTRUCTOR AND OR TUTORIAL THAT CONSUMS THE STUDENT’S/READER’S/AUDIENCE’S THOUGHT, TIME, FOCUS, AND ATTENTION, IS WRITTEN WELL. WHATEVER THE SUBJECT MATTER/LANGUAGE MIGHT BE!!!!!

      David Grice Orlando

    44. Eric Says:


      Well thanks, David… I think.


    45. Eduardo Says:

      I didn´t work here. Firefox 1.0.4 won´t install it here. It says: “install-ibf.rdl” and other files are malformed !

    46. NSK Says:

      What a great tutorial! You are really good at writing tutorials! Keep up your good work!

    47. Mark Maclane Says:

      Hello,

      This tutorial is very helpfull. Thanks for that.

      Where can we find other tutorials about firefox extensions ?

    48. Pete Says:

      What is the date on this tutorial? According to “Writing Firefox/Thunderbird Extensions” by Ben Goodger (05/02/2004), the installation file should be “.rdf”, not “install.rdf”.

      Which is correct (or are they both acceptable)?

      Thanks for a great tutorial!

    49. Robert Says:

      I had the same problem ‘NOBO’ reported on Linux.

      Firefox could no download the file at [uri] because: Install script not found

      The solution is to re-zip the file correctly.

      In my broken zipfile, items listed out with a preceding period. e.g “./chrome”. This was created by ‘jar’ In the fixed version, they are not: “chrome/”. This fixed zip was from ‘zip’

    50. Kryptech Says:

      Its great that people like you are supporting open source and free coding like this. Good job.

    51. Same Old Shit :: Link of the day :: June :: 2005 Says:

      […] ybe I’ll make up for it and you’ll get two links today. For now you can learn roachfiend.com » how to create Firefox extensions. Enjoy.
      Brad 2: […]

    52. Rob Says:

      This tutorial rocks!

    53. Mark Berman Says:

      Thanks a lot for the tutorial. I love firefox.

    54. pile0nades Says:

      Thanks for the tutorial. I am trying to write a firefox extension and this is a big help.

    55. ELIJAH Says:

      Hey.. Great tutorial!

      How do you make a dialog come up when the user presses the “Options” button from the Extensions window?

    56. voidmachine Says:

      I’ve modified and rewrittend some parts of the example to get it to work with Thunderbird (1.0.2).

      Hello Thunderbird - Extension: http://voidmachine.org

    57. Leo Dopson Says:

      Nice tutorial…
      something weird happend to my build.bat “\par” was pasted on every line, not sure how that happened…

      Keep an eye out for that.

    58. crimsonlink.com . Says:

      Hey If you study my logs, I’ve been getting random requests from Googlebot, It’s always in the root or in relevant subdirectories (usually /blog and forum or similar). All of these sites are with Word Press, and I can promise there is no mention of or links or anywhere. This means Googlebot is guessing that these files will be there. Now I’ve come to expect random flailing for syndication files from Feedster and Kinja, but Google? Et tu, Googlebot? Google pr updation is neer by in this month, so get your way……..

    59. tz Says:

      Grat Tutorial!!
      Thanks a lot!

    60. Devsyn Web Crafting Services » Blog Archive » How to Create Firefox Extensions Says:

      […] te Firefox Extensions
      Eric of roachfiend.com has two helpful tutorials up on How to Create Firefox Extensions and Enabling Extension Updates. These […]

    61. Miksago Says:

      G’day i followed the tutorial but just a it was installing it said”sorry Extension not compatible”
      Whats wrong?

    62. MaaSTaaR Says:

      Great information ! :-)

    63. auto transport Says:

      Realy great tutorial.

    64. thoughtsignals - a blog about media, technology, productivity, etc. Says:

      […] fox extensions. Maybe if I can find some free time I’ll take a crack at making one. Link. […]

    65. TheSnyda Says:

      Thank you for taking the time to make this tutorial. I however, cannot open the “helloworld.jar” file under the “chrome” subfolder.

      Please help if you can. Thanks.

    66. Peter Barratt Says:

      How do I read/write to/from local files?

      Thanks

    67. Ramiz Says:

      Hey Eric! Mind emailing me :P? I had a question about a small thing related to your tutorial which I can’t seem to work out.. I am totally stuck at a step. Thanks :)

    68. ... Says:

      nice words… very helpful!

    69. Robert Baillie Says:

      Excellent guide. I wish I’d read this before I started on my own extension travels about a week ago!

      I also produced a batch file packager, which you can find
      here

    70. Alex Says:

      Thanks for all the help.
      It helped me to achive writting my own extenstions.

    71. Alex Says:

      Nice tutorial
      Thank you for help

    72. NAME Says:

      It says “Invald XPI install” or something of that sort.

    73. Jacky Kong Says:

      Wonderful. Now I have a better understanding of how an extension is built. Thanks.

    74. Whittnet » Blog Archive » How to create Firefox extensions Says:

      […] ing at a serious level. Thought some people might like to have a look at this article. read more | digg story This entry […]

    75. Eric Says:


      I updated the maxVersion number on this so the latest Firefox release will work.


    76. Kingwood Says:

      Excellent tutorial! Thanks you very much!

    77. Rayor Says:

      Where could I find an API for Firefox extensions?

    78. Rodrigues Says:

      Good article, could the author or someone point out to some article that halps me write a Java extension in Firefox? Basically I want the extension to invoke my java code and execute something.

      Thanks,

      • Rodrigues
    79. Aníbal Says:

      Hi,
      first thank’s by the tutorial and i asking your help if you can.
      I can’t install the extension, it ask to restart the firefox, and to be sure i have restart the pc and cannot see the option Tools->HelloWorld and it says thath i have to restart firefox.
      I have to make a extension for project at university and it’s a good idea if I can do a hello world.
      Thanks,
      Aníbal (Portugal)

    80. Philippe C. Martin Says:

      I just found your tutorial (thank you).

      I have not been thorough yet and might have missed the answer but …

      My question is: can a plugin access a local hardware device, get information from it and return it to the server ?

    81. TD Says:

      Awesome. This is just what people like myself need to create their own extensions for Firefox. Thanks!

    82. XerBlade Says:

      Yo, I was wondering if you could tell me, how do you get a context menu item in an extension to only show up when right-clicking on a link?

    83. Kristina Says:

      Thanks for the tutorial! Very useful.

    84. Eric Says:


      XerBlade:

      function OnlyShowOnLink() {
      var cm = gContextMenu;
      document.getElementById("object") = cm.onLink;
      }


    85. Gerzean Says:

      Hi, hope someone replies to this.

      I wanna make a Quicktime plug-in for Firefox.

      Yes, I know about Quicktime Alternative. But I think I
      could put together an app that leaves an even SMALLER
      footprint than that.

      The Quicktime standalone is 19.2 MB (over 60MB installed). Quicktime ALternative is 10.5MB, but still over 30MB installed.

      I got Media Player Classic and a codec installed on my system. Together, they only take up 6MB!

      Only problem is… NO plug-in.
      Any ideas?

      Please e-mail me at gerzean@gmail.com

    86. Scorpie Says:

      Nice tutorial, i’ve looked at some more tutorials but have run into a problem now: this tutorial explains how you can have an ‘about’ with your extension but it doesn’t cover the ‘options’ form.
      Can anyone link me to a page that explains how to make an options menu for my extension in a way the options will be saved and reloaded next time the extension needs the settings.

      Thanks in advance,

      Scorpie

    87. mstrblstrprdctns Says:

      nice! One question though:
      what are the .DSStore files, and the _MACOSX folder?
      some files mac’s need? how do you create them?

    88. Haider Ali Says:

      Can we Call ANY FIREFOX EXTENSION from Linux Command Line

      I tried SCREENGRAB Extension to Run from Command Line i dont know…ANY Body would like to Share ideas??

    89. saurabh Says:

      I will now write extension in my sem brek

    90. Nando Vieira Says:

      Hello Eric! Great tutorial!

      I did a bat file to automatic create the .xpi extension. You just need to create the directory structure as:

      basedir/packager.bat
      basedir/extensionname
      basedir/extension
      name/chrome
      basedir/extensionname/chrome/extensionname/.

      To create package, run packager.bat and provide the name of your extension.
      It will create all the structure on Windows TMP folder and move the .xpi to the basedir.

      You can download this example and the packager.bat on http://simplesideias.com.br/extension/extension.zip

    91. KC Says:

      Can you make an extension for firefox that can show nfl scores of certain teams of your choice that will be seen either in a tool bar above or down by the status bar?

    92. Muychingon Says:

      Excellent tutorial. even for beginners like me. :)

    93. Abbeey Says:

      Thanks a lot, this tutorial was very useful.

    94. Yuppie Says:

      Very interesting tutorial. Very useful.

    95. Jeff Says:

      Is there a way to make money off writing extensions?

    96. sebastian salas Says:

      I need help for “how to create FireFox Extension” in spanish please, sombody helpme?

    97. Louis Says:

      First of all, thanks for the excellent tutorial!

      My question is, is there any way for an extension to directly edit the preferences of firefox? For example, changing the network settings (pipelining, etc).

      I don’t think directly editing the preferences file will work, because firefox rewrites it when it closes.

      Any help you can give me will be much appreciated.

    98. Nathan Says:

      Greetings one and all,

      And thanks for the tutorial!

      I am not a developer (yet) (unfortunately).

      However, I have a great idea for the aspiring info-preneur (ie firefox extension developer).

      Go check out the (brand new) website:

      http://www.unifiedroot.com/registrars/

      (and No! I don’t work for them; I actually have some gripes).

      The solution/app. should be obvious from that point (go visit the link).

      Someone needs to build a Firefox patch/extension that does this…resolution (and ones like ti) automatically.

      There could eventually be several competing unifiedroots and the one that is the most fair, just and equitable…should/will/can win…

      That is the future of the Web!

      THEN: Firefox users need to develop a “coop” version of what is going on here…. UnifiedRoot has basically just made an unjustified and unfair GRAB of internet real estate that will likely be a) successful (!?)-ish and b) widely (if not wildly) imitated and copied….

      We need to make a forum about this and develop alternatives… UNFORTUNATELY, I don’t have the SKILLS to do this (yet), but I know some of you out there, have both the SKILLS and INTEREST to help sort out this huge profitable (if UNFAIR!) new phenomenon.

      One of my favorite quotes, I think it’s in William Gibson’s “The Princess Bride”:
      “Life isn’t fair. It’s just fairer than death, that’s all.”

      Ain’t it true?

    99. paul Says:

      Instead of using a batch file to recompile the xpi try 7-zip. Its freeware and lets you drill down directly through the xpi and compressed jar, recompiling any changes you make on the fly.

    100. Chadha Software Technologies Says:

      http://www.chadhaajay.net

    101. Bjössi Says:

      Thanks for a great tutorial!

    102. Marko Petkovic Says:

      Good info, thanks. I don’t have time now but I will definetly try to make one, at least Hello world :)

    103. jamestcs Says:

      good info. your tutorial is very clear.

    104. phentermine Says:

      Hi! Nice site. Check site about phentermine - http://phentermine.home.ph

    105. viagra Says:

      Hi! Nice site. Check site about viagra - http://best-meds.test.punkt.pl/viagra/

    106. Ronald Says:

      I think that i easily get this extensions from official & fan’s sites.
      But, i respect thing, what you did!

    107. Shane Says:

      Hey there. I know this is maybe an old thread, but it is still getting lots of attention. I have my extensions development files in a SVN directory. Is there a way for 7z.exe to ignore the “.svn” folder when running the bat files. This adds an extra meg to the .xpi in the end. Thanks in advance. :)

    108. Joshua Says:

      I am just learning how to do this, and I think that I may take up to a week for me to be able to get one right.
      Anyway, my question is - is it possible to extract data from websites? Let’s say I want to extract data or something from a webpage and utilize it in my extension, how would I go about this?

    109. Untold Says:

      Hi, the packaging script you included in this tutorial works great and very fast,
      however i came to the conclusion it does not implement
      directory’s you add under the root directory of the extension directory.
      Like in my case i was in need to add a defaults folder in my .xpi file,
      so i added the following line to make it work.

      “xcopy defaults* builddefaults /s /i”
      

      This includes the default directory and it’s underlying directory’s into the .xpi

      Here’s my version:

      ==================================
      set x=%cd%
      md buildchrome
      cd chrome
      7z a -tzip "%x%.jar" * -r -mx=0
      move "%x%.jar" ..buildchrome
      cd ..
      copy install.* build
      
      REM
      xcopy defaults* builddefaults /s /i
      
      cd build
      7z a -tzip "%x%.xpi" * -r -mx=9
      move "%x%.xpi" ..
      cd ..
      rd build /s/q
      ========================================
      

      Hope this is a help to all you out there facing the same needs :-)

    110. lee Says:

      Great site and you are the only site that told me to change the .htaccess file to:

      AddType application/x-xpinstall xpi

      Thank YOU!

    111. malaysia travel Says:

      Thanks , i am searching for this tutorial long time ago… thanks for sharing

    112. dedenf Says:

      thanks alot men, this tutorial help me alot. Thanx again

    113. AtariBoy Says:

      Thanks very much for the tutorial, i made good use of it, except that i dont know enough javascript yet :)

      I put a link to it on my blog, hope u dont mind

      http://atariboy.wordpress.com/

    114. Tom Says:

      Nice tutorial. I’ve started writing an extension based on what I’ve learned here.

    115. Josh Says:

      Thanks Eric, this looks extremely helpful. But since i’m popping the proverbial cherry here, i’ve got a question. Can i write an extension to open up other program windows into a firefox tab? kind of like the pdf viewer extension?

      What i want to do is write an extension for Isilo document reader so i can have access in firefox

      is that possible at all? for a novice?

      thanks, josh

    116. Rick Says:

      iacchi said,

      “You shouldn’t write such a kind of guides if you can’t even add a locale to your extensions.”

      You shouldn’t post comments like that if you can’t even use proper grammar, you retarded troll.

    117. Josh Says:

      Thats funny . . .i didn’t realize that this was an english paper . . . maybe you’re right, maybe i am a retarded troll . . . .maybe i should drop out of medical school. . . .or maybe i’ll stick with it and keep the 6 figure income. . ..

      thanks though

    118. Paul Says:

      Eric has clearly put time and effort into producing a tutorial for those of us who have a genuine interest in creating FireFox extensions.

      If you really are as intelligent as you claim to be then you could perhaps put your time to better use.

      As you can see from the comments posted so far, most people have been helped and inspired by the tutorial.

      If you believe you can create a more superior tutorial then contribute something useful to the community and do so.

    119. Josh Says:

      Hey Paul,
      My apologies, I honestly didn’t mean to offend anyone. My sole purpose was to mock Rick’s comments about grammar. In no way did I intend to insult anyone else.

      I was thrilled when I saw this tutorial because I would like to learn more about programming.

      If I offended anyone, I apologize. Except for Rick - he’s still a douche

    120. phpkb Knowledge Base Software Says:

      phpkb Knowledge Base Software Script

    121. Josh Says:

      Oh man, I just finished my first extension! I know its just a simple extension but its a neat feeling. I can see thought that i’m a long ways from the extension i want to right!

    122. Phred Says:

      I have an updated helloworld.xpi for firefox 1.5.
      It is more of an application than the original.
      - command line handling
      - chrome.manifest rather than contents.rdf
      - includes locale
      - includes default preferences

      Probably time this tutorial was updated ;-)

    123. Australia Migration Agent Says:

      Good tutorial , thanks for info

      Regards,


      Jam

    124. Kate Says:

      was thrilled when I saw this tutorial because I would like to learn more about programming.

    125. Viper Says:

      Hallo evrybody.. nice place here :) Feel free to visit my website
      http://home.arcor.de/ativan/ativan.html

    126. kltsin Says:

      I have a navigation menu extension but dont know how to add a link in menu.xul that contains the “&” symbol.
      For instance
      &t=33258′);” oncommand=”tsg_ope

      Any help for this?

    127. kltsin Says:

      oopss here it is
      onclick=”mboopen(event, ‘http:// folding.extremeoverclocking.com/userlist.php?s=andsrt=1&t=33258′);” oncomma … etc

    128. bob Says:

      i am making an extenion that is a dropdown menu. i have it all working and fine. but does anyone know how to get it to use an RSS bookmark?

      like a standard live bookmark. i know it can be done. hell, firefoxes ‘go’ dropdown can have those.

      but does anyone know how to define them in an extention? (used as a news update for my site that broadcasts rss)

    129. bob Says:

      and to add links with a & in it. replace the & with this & that will make it work

    130. kltsin Says:

      lol doesnt show up

    131. Catalin Says:

      Awesome!
      Thank you for information!

      Best Regards,

      Catalin

    132. spatiu Says:

      You may use this tool to create a Firefox extension.
      http://www.arantius.com/misc/greasemonkey/script-compiler.php

    133. Malaysia car security Says:

      thanks for your info :)

    134. Alexander Says:

      Hi,
      Nice tutorial.

      Does anyone know if it’s possible to install xpi without user interaction? I’m willing to include my extension to external installation.

    135. Johannes Buchner Says:

      Hey, i released Anti-Paranoia:
      https://addons.mozilla.org/extensions/moreinfo.php?id=2001

      It bases very much on this Hello world example and could be the next step for starters. You can look at the code at http://johbuc6.coconia.net/doku.php/anti-paranoia

      Enjoy!

    136. Someone Says:

      sweet tutorial, too bad it sucks
      -impossible to follow
      -partial codes cause ur a lazy fuck
      -doesnt teach u anything about creating extensions, just tells u how to make the ever so usefull “hello world”

    137. Malaysia pallet manufacturer Says:

      nice tutorial, thanks for info

      jimmy

    138. bulk domain for web hosting reseller Says:

      cool tutorial, thanks for helping.

    139. A Llama Says:

      Someone wrote how the tutorial sucks because it’s…

      “-impossible to follow
      -partial codes…
      - doesn’t teach you about creating…”

      First off the tutorial is one of the best and easiest to follow I’ve found on the net thus far.

      Well since the code is downloadable, it provides all the information.

      It DOES teach you how to create a “Hello World” extension; however, you have to know how to program to make something that you want to make. If you want to make an extension that utilizes javascript-rpc or ajax in order to do some form of database transactions with in your extension, you’ll need to know how to do the javascript for that.

      This was a tutorial for how to make a general extension, and not a tutorial on how to write xul files for chrome. It succeeds very well in it’s purpose.

      Again, a VERY good guide.

    140. penis enlargement Says:

      I agree with you the way you view the issue. I remember Jack London once said everything positive has a negative side; everything negative has positive side. It is also interesting to see different viewpoints & learn useful things in the discussion.

    141. Kris Says:

      This tutorial seems great, but I really want to hone in on creating extensions for Thunderbird.

      Does anyone know of a Thunderbird version of this or a similar tutorial that works on 1.5?

    142. Mase Says:

      Man I got tired scrolling to the last line! HOOOOOF!

    143. Brian Ray Says:

      the roach keeps following me.

    144. singapore car dealer Says:

      cool tutorial, thanks for helping.

    145. Singapore online gift store Says:

      thanks for your info :)

    146. Dusty Wilson Says:

      “Copy C:\Program Files\7-Zip\7z.exe to C:\WINDOWS\system32 (This will put 7z.exe in your system’s path, which will make it accessible from the command prompt).”

      A better way do to this is to add “C:\Program Files\7-Zip\” to your Environment Path. Go to your system control panel or press WIN+BREAK. Click the Advanced tab. Click the Environment Variables button. Under System Variables, find “PATH”, click it, and click Edit. Add it to the end of the path. It should look something like “C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\7-Zip”. Notice the semicolons.

      That way when you update 7-Zip, you don’t have to recopy that binary each time.

    147. chkuya Says:

      Could I translate this page to Chinese, and post it in Mozilla Taiwan Wiki?

    148. singapore cars Says:

      i don’t think the webmaster will answer us… it is in archieves folder

    149. Steve Says:

      Fantastic tutorial! I was looking for a way to add an external language translator (English Spanish) to firefox and this goes a long way to answering the firefox mechanics!

    150. penis enlargement pills Says:

      enlargement pills for penis….This site is about penis enlargement methods:pills,exercises,device,patch,information and news.All for a bigger penis.

    151. sizegenetics Says:

      Finally I got out of sizegenetics, and ambled downstairs to the bathroom. After relieving myself, I turned around to see a sizegenetics hamper. The roommate’s clothing hamper.

    152. penis enlargement Says:

      I immediately began jerking off, thinking of her penis enlargement lovely pussy, and how it’s dry yet heady juices were rubbing against my nose, knowing from experience that penis enlargement the scent would somehow remain there on my face all day.

    153. Replication Guide Says:

      This is amazing! I wish there was an easy way to get this to also work in IE. Oh well, I will keep searching.

    154. Poker Guide Says:

      Does anyone know why this will not register in Firefox 1.5.0.1? I tried changing the install.rdf but still seems to be a problem.

    155. KGC Says:

      Google has an extension that will enable one to type a US cell phone number chose from about 10 major service providers and type a brief message, this message will then be sent as an SMS message to the cell phone. (See http://www.google.com/tools/firefox/sendtophone/index.html)

      It would be great if I could create a simple calendar that will just store some basic dates (something like ReminderFox https://addons.mozilla.org/extensions/moreinfo.php?id=1191&application=firefox), but rather than remind me through a browser message have it send a SMS message to my cell phone using the google-sendtophone extension. (This supposes that I leave my computer on and my browser running, but am not necessarily at my computer.)

      Both extensions exist, how do I take two installed extensions and open them up to learn enough to integrate them and then install them as a single integrated extension?

      Thanks for any ideas.

    156. Term Says:

      I know all it. But big thanks ;)
      Added in bookmark

    157. Sith Says:

      May The Force Be With You!

    158. Malaysia funiture bedroom set Says:

      thanks for the info.
      :P

    159. roger Says:

      great site, thanks

    160. North West Enterpise Sdn Bhd Says:

      great tutorial !

    161. Term Says:

      Repol PHP
      nothing more [url=http://webobzor.h12.ru]php[/url]
      Term asked

    162. china apparel manufacturer Says:

      This is amazing! I wish there was an easy way to get this to also work in IE. :)

    163. Homo-Adminus Says:

      Thanks for your article! Now I am able to write FF pugin of my dream!

    164. Reliable hosting in Hong Kong Says:

      But big thanks ;)
      Added in my bookmark

    165. cigarettes Says:

      Nice article. Thanks for it.

    166. Arthur Benevicci Says:

      Well that seems easy.

    167. Question: Says:

      The knowledge base article “Getting started with extension development” seems to say to insert a fake e-mail address for the tag, whereas your article indicates that a GUID should be used. Are both methods correct? Good article otherwise.

    168. CRM software solution and tool Says:

      Nice article , thanks you.

    169. ERP software for manufacturing Says:

      thanks for the info, it is a useful tips

    170. Image consultancy , Image branding dining and business etiquette Says:

      it is a good article :)

    171. dixon Says:

      :)

    172. World of Warcraft Gold Says:

      Nasty, Did you see this: in KUALA LUMPUR, Malaysia - A 33-year-old man in northern Malaysia has married a 104-year-old woman, saying mutual respect and friendship had turned to love, a news report said Tuesday.

    173. WoW Gold Says:

      Finally, Blizzard Entertainment last week said it would upgrade its World of Warcraft Gold servers to solve log-in and availability problems that have dogged the company’s online multi-player “World of Warcraft” game.
      But as you know, farming in Warcraft is loose change… why waste precious time and items.. Buy gold today Utilizing tools such as bots, harvesters, macros, and scripts is what the elite gamer uses and there is no reason why you should not be buying gold… Strategy…!! How to generate perpetual flood Of GOLD… No Matter What Level You Are At Or How Much Experience You Have… And If You’re Sick And Tired Of All The farming you have to do …. Buy Wow Gold from us today. “Any man who has to ask about the cost of an epic mount can’t afford one.” – The only solution… Buy some!

    174. Free Email Tutorials Says:

      Wow! Thanks for the tutorial - creating extensions never sounded so easy, and safe.

    175. Mohammed Says:

      This is a great tutorial! I needed an extension to do word counts based on the page and a word I enter — this is just what I needed to get going!

    176. Image consultancy Says:

      A great tutorial that is highly recommended to all the beginner !

    177. Office chair manufacturer Says:

      Great tutorial, i am waiting you for the expisod 2 :P

    178. Unclosed Tag? Says:

      On the bottom half of the page, in firefox, everywhere I click I am brought to www.yi-hosting.com (including this comment box and the submit button!), what happened? IE is not exhibiting this problem.
      I found this to be a very nice intro. I happen to be looking for a bit more, but I wonder if anyone here would be able to answer my questions:
      I’d like to create an extension that saves the source of all my open tabs. Is it possible for an extension to access the harddisk and can an extension access multiple tabs?

    179. dining and business etiquette Says:

      It is a nice article, thanks !

    180. Jesus Estrada Says:

      Hello … i’d like to know if you have any way to run C++ executable files in Mozilla Firefox, that’s why I need a help to do it. I’m trying to show an application which allows to read a 3DS file from C++, but I need to run it in Firefox with a plugin. Thanks for helping me.

      I think your article is very useful.

      Jesus Estrada D.
      Barranquilla, Colombia.

    181. IV Catheter disposable medical product Says:

      Good tutorial, it benefits me a lot

      thanks

    182. Web Design Texas Says:

      Excellent tutorial, thank you!

    183. Rangi Robinson Says:

      Excellent, thanks for taking the time to write up your finding and share with everyone.

    184. tzachi Says:

      thanks !!

    185. emitter Says:

      Thanks! Very useful tutor :)

      But I’ve a little bug with it: when I try to install, it says “Extension cannot be installed because of incompatibility with FF 1.5.0.4. It works only with FF 0.7 - 1.5″…
      What to do? :S

    186. emitter Says:

      Oh, I just didn’t read again :(

      “Does anyone know why this will not register in Firefox 1.5.0.1? I tried changing the install.rdf but still seems to be a problem.”

      I changed maxversion to 1.6, now it works!

    187. enjoy15 Says:

      Excellent tutorial - thanks for sharing it.

      I’m going to try this stuff out!!

    188. hari Says:

      Just two words
      Simply amazing :)

    189. Sam Says:

      I can’t make it work! its not compatible with the newest version of Firefox…

    190. Harsh Says:

      The new version of firefoxi.e 1.5.0.4 does not support thhis script. It says it is compatible only with .7 to 1.5 versions.

      Moreover i have a question, how can i query the database. I suppose everything was being written in JS file and JS canot query database.

    191. Trevor Says:

      So, when i restart Firefox, it says that there is a Chrome Registration Error and i should contact the author. What does this mean? I tried a new GUID, and that did not help. I do not know what to do!!!

    192. Trevor Says:

      I tried looking over everything, I found 2 mistakes, but it still has the same error. I do not understand!

    193. Trevor Says:

      Come on, ANSWER!!

    194. Watskeburt Says:

      This is a very nice tutorial. Good work!
      PS: Take it easy Trevor….

    195. Car Rentals Says:

      Thanks for the ‘hullo werld’

    196. Nilesh Patil Says:

      Thanks a lot for this nice Tutorial.
      I was searching for it from long time.

      Regards
      Nilesh

    197. Stainless steel fabricator Says:

      i think this is a good tutorial so far i read. good job !

    198. Singapore web hosting Says:

      it is useful for my web hosting business. Good article ! cheers !

    199. Xavier Says:

      Very helpful article - got me started on my first extension. If you’re interested, I wrote up an article explaining how to set up a proper build file for extensions using Ruby Rant. The URL is http://rhnh.net/articles/building-firefox-extensions

    200. Steffen Rilk Says:

      T H A N K Y O U !

    201. Rabble Says:

      Cool intro to get your feet wet working with developing firefox extensions. Thanks.

    202. Toyota Vios Says:

      thank you so much for the article !

    203. Malaysia new websites Says:

      cool tutorial and great jobs !

    204. Furniture manufacturer Says:

      This is a great tutorial! I was searching for it from long time.

      Regards

    205. toyota car Says:

      Just two words
      Simply amazing :)

    206. online flowers Says:

      Spread a little joy and happiness around the world by sending a beautiful bouquet of flowers. You can send flowers online and we have a huge resource of online florists who can arrange to deliver anywhere in the world.

    207. Jason Says:

      I my name is Jason I am a VB Developer and i have decided to make a program for easy recompiling and extracting of XPI files using the 7z.exe. I would love for someone to test this program and tell me how can i improve it and make it better. Tell me of any bugs and stuff. This is virus scanned using aVast antivirus. Its clean. If anyone would like to try it you can email me at AtomSoft@gmail.com. Also if you know of a forum i can upload this to to share it that would be awsome. Thanks for your time and this was a great tutorial . Thank You

    208. Earn money calling! Says:

      Do you want to eran money? Telextreme offers you this excellent chance to grow professionally having your own business! Visit: http://tel-extreme.blogspot.com

    209. Hans Says:

      Hello,

      I’ve written an application in VB which integrates with IE toolbar by writing to the registry. I would like to be able to call the exe file from firefox as well. I’m fairly new to XML. Any ideas how to implement this by using this great tutorial? If I could right click or go to the tools menu in firefox and by clicking the name of the app launch the .exe file in the program files directory it would be great. Thanks. Hans. zion4ever@wanadoo.nl

    210. uttam Says:

      i need an example code to display html page or image in tooltip. eg as in forecastfox extension u can c radar image and forecast

    211. adem mavili Says:

      great tutorial,
      thank u very much.

    212. David Shin Says:

      Nice tutorial!

      Some feedback:

      As of FF 1.5, the extension GUID can be replaced with the format “myextension@myorganization” (preferred for readability). This means you don’t need a GUID generator.

      There’s also an alternative way of rebuilding. Firefox 1.5 looks for the chrome/locale/etc files based on what’s in the manifest file. If you unzip the extension in the correct directory in the user profile, you can remove the “jar” from the manifest paths and test any changes on the fly.

      There’s a couple other tutorials on the web that show the details on how to set this up.

    213. david bowman Says:

      First let me say that I didn’t just walk in off the street. I’ve done systems programming for 20 years and now mainly I do technical writing.

      1) this is the best tutorial I could find

      2) this tutorial is unusable, at least as a guide for someone who wants to know how to create a firefox extension and has no idea how to.

      You can tell it’s written by someone who really cares about showing how to do something he (justifiably) thinks is really fun and cool.

      in fact, it starts off really great, with pictures of what the extension will do.

      Though not GROTESQUELY horrible like the others, the common problem with all is that they assume the reader already has a vast background in 99% of the topic.

      Again, this one is not the worst. In fact, it’s the best tutorial I could find. A different one starts off like this:

      “As you should already know, extensions usually modify an application’s UI (”chrome”) and behavior by providing overlays to already existent windows/documents. Those overlays are a part of the extension’s content package (content provider).”

      No, it is NOT the case that beginners “should already know” that. Intermediate users should already know it.

      By definition, a beginner does NOT know what a “chrome” is, or what “extension’s content provider” means, or DOM, or registration, or XUL.

      But I will not find out by reading these “beginners tutorials”.

      And I’m willing to forgive the fact that “how to reconfigure the installation file” comes before any information at all about what an extension does and how it works.

      The problem is that such information is never provided. Nothing is explained. The whole “tutorial” is essentially, a dump of various configuration and installation files.

      Problems start with the downloadable example; it contains no “chome” folder as described, just three source files.

      But I probably wouldn’t have needed to open the chrome folder. The background for understanding it is just not given here. For instance:

      “This file tells the browser where to store this overlay information. Here’s what it looks like…”

      But what is an “overlay”? What is it overlaid on? What data structures are we manupulating? What’s the big picture?

      How do I write a firefox entension?

      Virtually all the code provided consists of obscure abbreviations and UNC links to other files. None of this is explained.

      I was hoping that a firefox extension would be a single file containing statements in a programming language. No. Apparantly it’s many files containg virtually nothing but the names of other files, and lines like:

      Without an explination, “” means nothing to a beginner who wants to write firefox extensions.

      There is no description of what is going on or how to do anything. For example, two pictures are presented, followed by:

      “contents.rdf simply maps out the paths to the skin files, so the only modification you need to change for your own extension is in the last line, which points to the folder helloworld.”

      Apparantly this is more information about configuring the location of more configuration files.

      But I’m not interested in teh location of skin files. I want to know how to make firefox DO something.

      I was hoping to eventually bump into something resembling a computer program, but when I hit this, it was the end of the tutorial:

      “So now that you see how the files work, and where they’re packaged, you can modify them to your whims, and try out new things”

      No, don’t see how the files work, I don’t really care where they’re packaged, and I have no idea what to modify or how, and if I want to wriye a firefox extenion, I haven’t the vaguest idea of what to do first.

      In particular, I still don’t know know how an extension interfaces with the browser, or where I can insert program statements like IF/THEN and WHILE to make the browser behave differently.

      Nor is there a development environment resembling, say, visual basic or Java. Just an undocumented nest of folders filled with unexplained acronyms and UNC paths.

      This is not a tutorial on how to DO anything. It is a listing of files containing names of more files containing boilerplate configuration information, intended for people who already know how to write browser extensions and need no further information than the location of the extension’s installation files.


      Sure, the information is out there, somewhere. If I read everything on the web about XML and chrome and manifest files, then I could probably write a browser extension.

      But that’s not the same thing as a “beginer’s tutotial”.

      I expect this post to either be ignored, or to be insulted by smug high-school kids who write browser extensions instead of going out with girls.

      Nor is it sufficent to invoke the ignornace of the beginner as a defense for not teaching him anything.

      Thus, “you idiot, it’s ASSUMED that you already know [how to do it]” is not a legitimate smart-ass answer for supposed “teacher”.

      Nor is any other smart-ass answer.

      ==[ dave

    214. florist malaysia Says:

      This is amazing! I wish there was an easy way to get this to also work in IE. :)

    215. John Samuels Says:

      Its all good

    216. Josie X Says:

      Great tutorial! I definately needed this.

      By the way, I’ve read many tutorials (for other things) and none of them explained as clearly as you did!

    217. Escorts in Sydney Says:

      creating extensions never sounded so easy, and safe. thanks for the information

    218. Mark Says:

      Yep, tutorial is cool, th’x!

    219. Boron Says:

      Very nice site. It`s a pleasure to surf in. 8-)

    220. Paranid Says:

      WOW! %-) very interesting! I did know about this …

    221. Kent Says:

      looking for information and found it at this great site.

    222. Voron Says:

      I love this website! It really makes me Happy!

    223. Abo Saleem Says:

      Thanks ,,,

    224. العاب فلاش Says:

      Very nice site. It`s a pleasure to surf in. 8-)

    225. Cherry Says:

      Nice article, some very useful bits of information.

    226. Bilal Says:

      Very helpful tutorial.

      I have a question though, i am trying to write an extension that will change the content of the text shown in any link opened through firefox. I.e. changing all phone #s into links automatically. I don’t know how to do that. Could you help me with that.

    227. Malaysia florist Says:

      Great tutorial! I definately needed this.

      By the way, I’ve read many tutorials (for other things) and none of them explained as clearly as you did!

    228. Anon Says:

      Nice guide… but the insect at the bottom right corner of the screen distracts me though :( It looks so disgusting !

    229. SaiK Says:

      Amazing that a tutorial from 2004 is still getting so many hits. Eric, awesome job.

      Also, to the person who posted comment #228, you can use Adblock to remove the background image of the roach. That’s what I did, because admittedly, I was worried it might start running across the screen.

    230. Swimming pool equipment Says:

      i don’t understand…why you want to keep a cockroach on the bottom right corner ?

    231. pratiksha Says:

      hi,
      very nice article. U have make it so easy to create any extension.

      But it is giving me error like
      “firefox can not install the file at
      % path %
      because: Not a valid install package.”

      can u tell me why it is giving such error?

      i have copied all ur code, so i think it should not be error of code.

    232. language Says:

      good site
      http://www.info-language.com/

    233. UPVC conduit manufacturer Says:

      you have a good tutorial. Creating extensions never sounded so easy, and safe. thanks for the information

    234. Marble manufacturer Says:

      the cockroach on the right bottom make me feel uncofortable.

    235. Dan Says:

      hello there, i was wondering is there like a GUI that I can use that will help in the creation of a xpi? Im a bit of a newbie to this but thanks for the guide its great!

    236. Bargains Says:

      i like the cockroach! very ominous :)

    237. Christmas Bestsellers Says:

      I am trying to create an XPI for firefox to help people use my website - i did want it to work for christmas gifts but i dont think ill manage it this year! maybe next year. great article though :)

    238. paulhiles Says:

      Googling “create a firefox extension” brought me here. The key points are enthusiastically presented in this tutorial and (more importantly) this has given me the impetus to start work on my own extensions! :o)

      Two other useful sources are: WebMonkey: Your First Firefox Extension and the Extension Developers Extension. Hope that helps anyone else searching for similar resources.

    239. ProgMania Says:

      I got a problem it says:

      Installationsscript not found
      -204

      any thoughts?

    240. TheBeastKing Says:

      I found this extremely helpful, but whenever I try to install this extension it says “Cannot install extension: not a valid install package” or something like that, even when all I did was change maxversion from 1.9 to 2.0. Please help me here.

    241. TheBeastKing Says:

      And the GUID

    242. TheBeastKing Says:

      Last time you commented was in October 05… what happened?

    243. Myip Says:

      Great tutorial! I definately needed this.

    244. sandesh Says:

      Hey need help…
      NOw i know to add menu item to a context menu when right clicked,
      please could you help me how to add a selected link from
      UI to my menu item for example,i have a link in a page by right click and selected ‘hello world’,link should save in ‘hello world’
      Please help me
      Thanks and regards
      Sandesh

    245. marcus Says:

      Thanks for the great doc.

      But, I got Chrome registration failed, contac t ..

      I have changed MaxVersion to 2.0.0.*
      I am using FireFox 2.0.0.4

      Pls HELP !!
      Thanks

    246. asafbenm Says:

      need help
      i need to make extensions that whene i use it, he replace the current url the word ‘text’ to ‘dev’
      example :www…text.com/..text/.. to
      www…dev.com/..dev/…

      and the page change to the new url and revers
      Please help!!
      thanks asaf

    247. maexx Says:

      Yes, thanks. I was looking for this tutorials! It’s great to create extra traffic to your website aslong your plugin is useful.

    248. kggmvmv Says:

      It looks good so far, but when I right-click on “download it here” (helloworld.xpi), Firefox insists on installing it rather than giving me the option of saving it. Any idea what I’m doing wrong?

    249. bugmenot Says:

      sorry for bugmenot, but is only a little question. It’s possible to create an extension that work with files, eg. rigth click on an image from a galley (usually 01.jpg, 02.jpg, …) and save it with a random name, like as0df2as.jpg ou something similar?

      Thanks in advance, and thanks again for this tut ;)

    250. radelcom Says:

      Hi!

      need help on how to create plugin for firefox. I tried downloading this sample helloworld.xpi but it doesnt work on newer version of firefox.

      can u please send me a new way that works on newer version of firefox.

      Radelcom

    251. d07RiV Says:

      –> radelcom
      open the install.rdf in the archive and set maxVersion field to 9.9, don’t forget to update the archive

      nice introduction, thanx

    252. keioGirl Says:

      Hi!
      It’s really useful for me as a newbie.. but i tried to download this sample to test as you described but it doesn’t work .. it said that it can’t work on my firefox version 2.0.0.11… can u give me some advice to test it… i think it’s the same problem with Radelcom

    253. yenibirforum Says:

      that great thanks

    254. google pagerank Says:

      Its realy nice tutorial….looking for new one..keep going

    255. NinjaNife Says:

      I am trying to make a extension that when activated will find any links on the webpages you are browsing and put check boxes next to them. When you check the boxes and turn it on, the extension will click on each of the selected links and wait for a preset amount of time before clicking on the next. I am not sure how to do this, or even if it is possible, but I am hoping to get it to work. If you have any ideas please email me at extremeskateboarding@juno.com. Thanks for making this tutorial, and I hope you can help me out.

    256. Jibe Says:

      I am trying to write a firefox plugin which could translate words very easely, with a simple right click.

      I am totaly novice in programing.

      If someone could help me, I would be very gratefull !!
      jbdemontety@hotmail.com

    257. AnonymousIsLegion Says:

      Just wanted to say that the install.rdf from the downloadable xpi file is a bit different than the source in the article.
      The downloadable xpi doesn’t work with firefox 3.
      To make it work you just have to remove the

    258. ruddin_hd Says:

      hey i tried making an extension tht will display a random string..but i m unable to save the final zip archive as extension.xpi n firefox 3 doesnt recognise the zip file as .xpi file
      any suggestions??

    259. ruddin_hd Says:

      hey it works but now firefox says tht it cannot find some .rdf file for installation(one file already exists..this is some other file named”install-edd..rdf”)…wht do i do??

    260. ruddin_hd Says:

      and this is the error i m getting for ur add on
      Hello, world!” will not be installed because it does not provide secure updates

    261. ralst Says:

      I found this link for a how-to on disabling the “does not provide secure updates” error:

      http://www.ideashower.com/learned/how-to-disable-will-not-be-installed-because-it-does-not-provide-secure-updates-warning-in-firefox-3/

      Works a charm, though I did have to change install.rdf’s MaxVersion to 9.9 (as it says to do in the tutorial) in order to get Firefox 3 to load the extension.

      Thanks for this great tutorial, Mr. Eric. :-)

    262. walker6o9 Says:

      Hi, I think you’re firefox ext tutorial is awesome, but I’m having some trouble creating the actual .xpi file. When I run buildbat, it doesn’t create an xpi file (or any other file) for me, and I get the following readout error:

      C:\>c:\firefoxdev\build.bat thatshot

      C:\cd C:\thatshot

      C:\>cd C:\thatshot\chrome

      C:\thatshot\chrome>7z a -tzip thatshot.jar * -r

      7-Zip 4.57 Copyright 1999-2007 Igor Pavlov 2007-12-06

      Scanning

      Updating archive thatshot.jar

      Compressing content\thatshot\about.xml
      Compressing content\thatshot\contents.rdf
      Compressing content\thatshot\thatshotOverlay.js
      Compressing content\thatshot\thatshotOverlay.xul
      Compressing skin\classic\contents.rdf
      Compressing skin\classic\gmapit.png
      Compressing skin\classic\gmapitb.png
      Compressing thatshot.jar

      Everything is Ok

      C:\thatshot\chrome>cd ..

      C:\thatshot>7z a -tzip thatshot.xpi * -ir!.jr -x!.zip -x!*.xpi

      7-Zip 4.57 Copyright 1999-2007 Igor Pavlov 2007-12-06
      Scanning

      Creating archive thatshot.xpi

      Compressing content\thatshot\about.xml
      Compressing content\thatshot\contents.rdf
      Compressing content\thatshot\thatshotOverlay.js
      Compressing content\thatshot\thatshotOverlay.xul
      Compressing skin\classic\contents.rdf
      Compressing skin\classic\gmapit.png
      Compressing skin\classic\gmapitb.png
      Compressing thatshot.jar

      Everything is Ok

      C:\thatshot>del C:\thatshot\chrome\thatshot.jar
      The network path was not found

    263. nikolay Says:

      Hello, Thank you for this tutorial, it has helped me in getting started. I am still having a problem trying to get the update to install. I am getting the firefox message after I restart firefox.

      ‘Firefox could not install this item because of a failure in Chrome Registration. Please contact the author about this problem.’

      Has anyone had this problem before?

    Leave a Reply

    You must be logged in to post a comment.