WPF is the coolest thing an MFC programmer has ever seen. Of course, developers who have been working with declarative markups (HTML, SVG, XUL or Laszlo) and RAD form builders (Delphi and VB) are not hyperventilating. Sure, its nice that Microsoft has introduced a development platform that is actually easy to use, but such platforms have been around a while. Now, WPF/E is ready to take rich internet application (RIA) development by storm. Its not the first (XUL, Flash, Flex and Laszlo are not betas), but Microsoft’s entry is not to be taken lightly.
The WPF/E hype and the quest for a non-Adobe SVG viewer in Internet Explorer (IE) made me to start to wonder what it would take to get Mozilla’s platform running in IE. Turns out, it’s easier than I thought:
- Get XULRunner on your Windows machine.
(From Mozilla or as part of my XUL Explorer) - Register the Mozilla ActiveX control
- Mark control “Safe” or Tweak IE’s security.
(You can register and mark the control safe using this patch) - Done!
This could even be made easier (zero steps) by creating a CAB file for XULRunner and adding code to the Mozilla ActiveX control to mark itself “safe”.
Control Setup using Patch
- Unzip the patch files to wherever you installed XULRunner. If you just installed XUL Explorer, XULRunner is in a subfolder.
- Execute “mozactivex-reg.bat”
For those of you wondering about the “patch”. It simply registers the Mozilla ActiveX control and then adds 2 registry keys to the control that tell Windows that the Mozilla control is “Safe for initialization” and “Safe for scripting”. See this Microsoft page for more information.
XUL/E Samples
These samples can be run in Firefox (any platform) and IE (windows). Make sure you have installed and configured the Mozilla ActiveX control. The difference between these links and the ones on a previous post is that these are displayed using a special “viewer” HTML page.
- Entry form using a grid for layout: entryform-using-grid.xul
- Tabbox with groupboxes and other controls: tabbox-with-groups.xul
- Tree an popup menu: simple-tree-with-popupmenu.xul
- Simple text editor application: notepad-app.xul
- Ted Mielczarek’s XUL editor: http://ted.mielczarek.org/code/mozilla/xuledit/xuledit.xul
- SVG in XUL (lion): svg-in-xul-lion.xul
- SVG in XUL (parrot): svg-in-xul-parrot.xul
- Simple clock: canvas-in-xul-clock.xul
- Basic “drawing” canvas. Use the mouse to scribble lines: canvas-in-xul-scribbler.xul
Note: If using IE7, the yellow information bar will prompt you to let the Mozilla ActiveX control run. In IE6, you will see a dialog prompt.
Not only can you create rich clients in IE using XUL, but you can also view SVG in IE! As always, feedback, comments and new ideas are welcome.