Snippets code from my daily experience

September 26, 2010

Firefox 4, packed XPI files and extensions test environments

Filed under: extension,firefox,gecko — dafi @ 8:50 am

My test environment is simple

  1. Create an XPI file with all files unzipped (no jar file inside)
  2. Install the XPI on a separated (and clean) profile, this is applicable to any Gecko application: Firefox, Thunderbird, Komodo, SeaMonkey 2.x
  3. Run unit tests or use the extension
  4. If some test fails I edit code (xul, js, css) directly on installed files
  5. Move edited files on main code build tree
  6. Repeat the process starting from 1.

Any developer uses its own approach, someone prefers to edit the chrome.manifest to point to files on specific directories, someone uses other enterprise-big-team oriented ways.

No matters the approach you use under Gecko 2.0 (ie Firefox 4.0) the XPI file will not unpacked by default, this can complicate your development process but the solution is easy.

em:unpack

Add to your install.rdf the following line and everything comes back (more details here)

<em:unpack>true</em:unpack>

My dev environment has two XPI creation tasks, debug and dist so it’s easy to insert <em:unpack/> only when necessary (debug mode in my case)

RTFM

Please visit often Firefox 4 for developers (better to follow the feed) because FF4 is a little/big awesome revolution and extensions can be affected in many ways.

About these ads

4 Comments

  1. Why don’t you use a ‘pointer’ file and edit the files directly in the source tree? See https://developer.mozilla.org/en/Setting_up_extension_development_environment#Firefox_extension_proxy_file

    Comment by Nickolay Ponomarev — September 26, 2010 @ 6:14 pm

    • The proxy file is useful but for me it’s more quick to pack XPI and install it on a new profile. I use a simple script that creates a new profile, add debug prefs (javascript.options.showInConsole, dom.report_all_js_exceptions and so on) and install the extension.
      As mentioned any developer/team has its own preferred method

      Comment by dafi — September 26, 2010 @ 7:39 pm

      • I’m not saying you shouldn’t do it your way, just wondering why you picked it, since from my point of view you just have two extra steps in your workflow (#1 and #5 from your post). Feel free to ignore me :)

        Comment by Nickolay Ponomarev — September 26, 2010 @ 7:50 pm

      • Why I must ignore you? The idea is fantastic, I simply use a different approach

        Comment by dafi — September 26, 2010 @ 7:53 pm


RSS feed for comments on this post.

The Rubric Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: