Firefox Metro development begins, status update

News and other things I find interesting


RSS Feed


Mar
9
2012

Firefox Metro development begins, status update

Last modified: Saturday, March 17, 2012

As of Monday of this week, development work began on Firefox for Metro.


A bit of background on Windows 8 Metro and Firefox

It turns out that on Windows 8 there are 3 types of applications:

  1. Classic desktop applications
  2. Metro applications
  3. Metro style enabled desktop browsers

Firefox will fall into the third category, meaning you can run Firefox as a desktop application, and you can run it as a Metro application. Supporting the Metro side of things will require a lot of new code, so this is a very large project.

Unlike Metro applications, Metro style enabled desktop browsers have the ability to run outside of the Metro sandbox. Meaning not only can we build a browser, but we can build a powerful browser which gives an experience equal to that of a classic Desktop browser.

Metro style enabled desktop browsers have access to most Win32 API and the entire new WinRT API.

Unfortunately a browser can only participate in Metro mode if it is the default browser. So if Firefox is not the default browser on a system, you can't use it in Metro mode. This is a decision made by Microsoft.

The Firefox Metro enabled desktop browser can be, and will be included and packaged in the traditional way. I'm not certain if it will be allowed on the Windows store or not since it is not of Metro application type.


Languages we'll be programming in

We will be using the Windows Runtime C++ Template Library (WRL) which is similar to C++ / ATL.

We may also be using C++/CX which does compile down to native code but has some non-standard C++ extensions that allow for code to be about 1/10 the size.

Our hesitation in using any C++/CX code is that it will definitely require a new build environment. Personally I think it would be worth using C++/CX in the long run. WRL and C++/CX code can freely be mixed even in the same source file.

The GUI will be made mostly by painting to DirectX. XAML may be used in a very limited fashion. XAML is the main presentation layer in Windows 8 Metro if you are using a .NET enabled language or native C++. XAML is a declarative XML-based language similar to Mozilla's own XUL. XAML is familiar to WPF and Silverlight developers. XUL will most likely still be rendered to the DirectX surface.

Windows 8 has a minimum requirement of hardware that supports Direct X 9 and I'm not aware of any alternative like GDI available. So the Direct X blacklist of graphic cards we currently maintain may not be applicable in Metro mode.


Development milestones

Our first major goal is to get an experimental build of Fennec or Firefox running in Metro. This work is mainly being tracked in Bug 732518.

To get started we read the MSDN whitepaper entitled Developing a Metro style enabled Desktop Browser. This document lacked quite a bit of information though so a lot of registry hacking was needed to get things working. Jim and I documented a lot of this missing information here and here.

Most of our week was spent with registry exports, diffs, Process Monitor logs, and other tools. The first couple minor goals were to get a recognized Metro tile showing up, getting it to launch our process, and then finally displaying a Metro app.

Jim and I hit those first milestones and made a basic application which launches in Metro mode as a medium integrity process. The application doesn't do anything exciting except display a DirectX surface and draw some text to the surface that tracks mouse movement.

As a developer, your job gets pretty hard when you do a Google search for topics surrounding this barely supported third Metro application type and consistently get zero, one, or if you are lucky, two search results. All results being only slightly on topic.


Next development steps

We have several smaller goals that we want to tackle next week:

  • Figure out how to make our own PRI files with our own resources.
  • Get a C++/XAML application working
  • Get our app launching through a delegate DLL instead of an EXE
  • Figure out how to interop XAML / DirectX.
  • Start to figure out how we will paint content to our DirectX surface with the graphics layer
  • Figure out how to implement other contracts
  • Look into native theme rendering
  • Probably others

Meetings

We had our first weekly developer meeting half way through the week with attendees: Robert Strong, Tim Abraldes, Jim Mathies and myself (Brian R. Bondy).


Helping out

We're still extremely early in development so we're not ready for help with things like how the UI should look yet.

If you want to help with the development effort to get Firefox up and running in Metro, we'd love to hear from you. Please sync up with us in #windev on IRC or email me directly at netzen at gmail.com.

Tags:

Add a new comment | 11 comment(s)

Gravatar image Florian Quèze on Friday, March 09, 2012 (09:03:18) says:

Do you have to use XAML for the UI, or would it be possible to paint a XUL UI inside a direct X surface? I'm wondering if implementing the UI with XAML is a choice or a technical constraint here.

Gravatar image Robert O'Callahan on Friday, March 09, 2012 (09:03:19) says:

Why do we have to use XAML for the UI?

Are we able to use XAML just for the Metro UI, and retain the existing XUL interface for the desktop UI?

Gravatar image Brian R. Bondy on Friday, March 09, 2012 (09:03:17) says:

So XAML UI was a bit misleading. If we use XAML it'll be very minimal and mostly just a frame that Direct X sits in. We'll still paint to Direct X and probably still use XUL as well.

Gravatar image nimatra on Saturday, March 10, 2012 (07:03:43) says:

"I'm not certain if it will be allowed on the Windows store or not since it is not of Metro application type."
You are FireFox they are Windows (both are well known), can't you talk about it to be sure?

Gravatar image Henri Sivonen on Saturday, March 10, 2012 (08:03:29) says:

The whitepaper says "on the x86/64 architecture". So are we blocked from shipping the same code for ARM? Is Windows 8 for ARM going to emulate Apple-style lock-down?

Gravatar image Henri Sivonen on Saturday, March 10, 2012 (08:03:11) says:

Out of curiosity: Which of the 3 categories will Microsoft Office belong to? Or is the a fourth MS-only category.

And thanks for doing the Firefox porting work!

Gravatar image pretzer on Saturday, March 10, 2012 (12:03:31) says:

Are there also plans to support the ARM version of Windows 8, or does your work target the x86 version only, at the moment?

Gravatar image Brian R. Bondy on Saturday, March 10, 2012 (01:03:25) says:

> Re windows store:
> You are FireFox they are Windows (both are well known),
> can't you talk about it to be sure?

Sure it is possible, but I wouldn't be the one doing that discussion with them.

> So are we blocked from shipping the same code for ARM?
> Is Windows 8 for ARM going to emulate Apple-style lock-down

I don't think we have details on this yet.

> Which of the 3 categories will Microsoft Office belong to?
> Or is the a fourth MS-only category.

I haven't heard so not sure, but I can say for sure not the third category I mentioned.
Some of the browser vendors got together last year here: http://goo.gl/kK08k and realized that IE10 was running outside of the Metro sandbox. Personally I think it would have been best to have a more generalized third category.

> Are there also plans to support the ARM version of Windows 8

We would love to, I'm unsure if it will be possible at this time.
I mean that with no positive or negative connotation, I really have no idea.

Gravatar image SEOHint on Saturday, March 10, 2012 (01:03:08) says:

Sorry for a little noob question. Will FF on W8 Metro support Flash? This would be a very nice feature because IE10 will not and some people have to use Flash in special webapps that are not possible in HTML5 right now.

Gravatar image Brian R. Bondy on Saturday, March 10, 2012 (01:03:47) says:

> Will FF on W8 Metro support Flash?

It's too early in development to know
for sure. There may be some technical restrictions and we haven't decided one way or the other if we really want it. I personally do want it even know it comes with a set of problems.

Gravatar image Suny Buffalo on Saturday, March 10, 2012 (08:03:00) says:

Much of what u say is that coding will employ these library interfaces a la metro, however, will the gecko engine also undergo changes or will it be comported to the overall UI?
Given that most businesses will resort to "traditional" desktop rather than metro, is there inter-operable differences in browser behavior?
Lastly, I did say, we should be able to download the FF 4 Metro in Mozilla's website, rather than just the windows marketplace/store or whatever.