RFC: Extension Developer Extension

Talk about add-ons and extension development.
Post Reply
Ted Mielczarek
Posts: 1269
Joined: November 5th, 2002, 7:32 am
Location: PA
Contact:

RFC: Extension Developer Extension

Post by Ted Mielczarek »

I've been thinking for a while now that I'd like to make an "Extension Developer Extension." I'd like to get some comments from extension developers on what they think would be useful in such a beast.

Yesterday I took <a href="http://www.squarefree.com/">Jesse</a>'s <a href="http://www.squarefree.com/shell/">Javascript Shell</a> and packaged it up so I could run it from chrome. It's pretty useful, since it lets you interactively test out javascript expressions and toy with the browser DOM. When I mentioned this to him on IRC, he told me that he had already packaged that along with his <a href="http://www.squarefree.com/jsenv/">Javascript Environment</a> and <a href="http://www.squarefree.com/htmledit/">Real-Time HTML Editor</a> while he was developing <a href="http://www.squarefree.com/extensions/adbar/">adbar</a>. When I mentioned my "Extension Developer Extension" idea, he asked what I would include in it, mentioning a XUL-capable version of HTMLedit, and the ability to show XUL parsing errors as possible features.

So here's my list of things I would find useful in such an extension (most of which are already implemented):
  • Javascript Shell: Nothing beats interactive javascript testing
  • Javascript Environment: I'm not sold on the usefulness of this, but I guess it'd help me eatch typos/parsing errors without restarting the browser
  • a toggle for browser.dom.window.dump.enabled, nglayout.debug.disable_xul_cache and javascript.options.showInConsole , since these are all so useful for debugging extensions
  • A button/menuitem for reloading all chrome. I think this works now, this would be really nice for overlay development


I'd appreciate any suggestions or ideas that would make the life of an extension developer easier.

-Ted
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

Maybe you could automate the steps required to piece together an install.rdf and file a bug against UMO with it's contents. Since we'll be doing that for submissions and updates for a while, it'd be quite handy to have the process at least partially automated.
Ted Mielczarek
Posts: 1269
Joined: November 5th, 2002, 7:32 am
Location: PA
Contact:

Post by Ted Mielczarek »

Cusser wrote:Maybe you could automate the steps required to piece together an install.rdf and file a bug against UMO with it's contents. Since we'll be doing that for submissions and updates for a while, it'd be quite handy to have the process at least partially automated.


Have you seen this: http://ted.mielczarek.org/code/mozilla/ ... index.html ?

I'd like to make a full "extension skeleton generator" but I haven't had the time. Would be nice to have a little app that could generate the full layout of an extension for you, and then you can just work from there.
Jesse
Posts: 398
Joined: November 4th, 2002, 7:00 pm
Location: Mountain View, CA
Contact:

Post by Jesse »

Things I want as an extension developer, some of which I already have:

fast testing of code, outside of your extension:
* js shell. [done, but would be nice if you could apply it on a browser window like the bookmarklet version]
* jsenv. [done]
* htmledit. [done]
* xuledit.

fast edit-build-test-repeat cycle:
* sanity script that ensures that all RDF and XUL and JS files parse correctly.
* build script that runs xpidl on any .idl files, packages chrome (if it exists) into extname.jar, and packages extname.jar, components, and defaults (if they exist) into an extension whose filename is the same as the directory name.
* install script so you don't have to open a browser window, drag the xpi to a browser window, wait 2 seconds, and restart.
* ability to test in place instead of using install script.
* reload chrome such as overlays.

take care of busywork for me:
* Tool to create install.rdf.
* Tool to create contents.rdf for each chrome directory.
* For bonus points, these tools should be able to update install.rdf and contents.rdf without blowing away manual edits.
* Script to change the name of an extension globally

other stuff:
* a FAQ for extension developers.
* a library of small routines to be copy-pasted into your extension, under some nice license.
* jslib as a "real" Firefox extension.
* xul/xpidl error reporting.
* xul/xpidl documentation.
User avatar
drakosha
Posts: 37
Joined: August 19th, 2004, 9:19 am
Contact:

Post by drakosha »

btw, is there a xul and javascript mode for emacs? What editors do you use for development?
Jabber me: chesercat@jabber.org

<a href="http://purgecontrol.mozdev.org/">purgecontrol.mozdev.org</a>
<a href="http://linux4all.blogsome.com/">linux4all</a>
Ted Mielczarek
Posts: 1269
Joined: November 5th, 2002, 7:32 am
Location: PA
Contact:

Post by Ted Mielczarek »

I use emacs primarily. There's a crummy javascript mode that came with it, and it does ok for me. I use SGML mode for editing all sorts of XML documents, which is also crummy but it works. I guess I'm just lazy. I looked into Eclipse, but I couldn't get the web development plugin working.
User avatar
roachfiend
Posts: 264
Joined: December 7th, 2002, 11:54 pm
Location: north america

Post by roachfiend »

Ted Mielczarek
Posts: 1269
Joined: November 5th, 2002, 7:32 am
Location: PA
Contact:

Post by Ted Mielczarek »

Looks nice, but doesn't really provide any value for me above my install.rdf generator. Also, I don't do any of my development on windows.
User avatar
drakosha
Posts: 37
Joined: August 19th, 2004, 9:19 am
Contact:

Post by drakosha »

emacs javascript mode
http://cvs.xemacs.org/viewcvs.cgi/*chec ... l?rev=1.11
still looking for xml mode with auto-ident (meta-x indent-region) or xml beautifier....
Jabber me: chesercat@jabber.org

<a href="http://purgecontrol.mozdev.org/">purgecontrol.mozdev.org</a>
<a href="http://linux4all.blogsome.com/">linux4all</a>
Ted Mielczarek
Posts: 1269
Joined: November 5th, 2002, 7:32 am
Location: PA
Contact:

Post by Ted Mielczarek »

That Javascript mode seems to work, I haven't done any heavy coding with it yet.

Also I found (easily):
An XML mode (with validating)
CSS Mode
Ted Mielczarek
Posts: 1269
Joined: November 5th, 2002, 7:32 am
Location: PA
Contact:

Post by Ted Mielczarek »

http://ted.mielczarek.org/code/mozilla/xuledit/

Check it out.

Also I'd like to investigate this and see if I can get it to work in Firefox: http://www.croczilla.com/jssh
StormFX
Posts: 178
Joined: August 12th, 2004, 5:54 pm

Post by StormFX »

Now that's down right kick ass, Ted :)
Ted Mielczarek
Posts: 1269
Joined: November 5th, 2002, 7:32 am
Location: PA
Contact:

Post by Ted Mielczarek »

Okay, I've decided I might as well let everyone play with it. Consider it a beta still, but one that's been pretty well tested.

Extension Developer 0.1.0.20040903
http://ted.mielczarek.org/code/mozilla/ ... iondev.xpi

Features:
  • Toggle debugging prefs
  • Javascript Shell
  • Javascript Environment
  • Live HTML Editor
  • Live XUL Editor
  • Reload all Chrome (except in Thunderbird)

Tested in Firefox, Mozilla Suite, and Thunderbird.

Notes:
  • The extension adds toolbar buttons (for Firefox and Thunderbird), as well as a Tools -> Extension Developer menu.
  • You can shift+click on the toolbar buttons/menu items to open in the current window, ctrl+click to open in a new tab.
  • Reload all Chrome doesn't work in Thunderbird, so it's hidden. I don't know why this is.


Please report bugs/feature requests in this thread.
StormFX
Posts: 178
Joined: August 12th, 2004, 5:54 pm

Post by StormFX »

That's great, Ted! I really like it :)
StormFX
Posts: 178
Joined: August 12th, 2004, 5:54 pm

Post by StormFX »

Hey, I noticed a slight problem. When using the Javascript Environment, some of the copy/paste/cut functions are buggy. I have to switch to other windows and then back. Sometimes it won't let me type, either.
Post Reply