Archive for Mozilla

Embedding the Error Console in Fennec

Trying to debug problems in Fennec while running on a mobile device can be a pain. Using the JavaScript Error Console is one way you can track down problems, especially JS coding errors. Some applications, like Firefox, have a UI to launch the Error Console. Other applications don’t. You might not know this, but any Mozilla-based application automatically supports displaying and using the Error Console. Simply launch the application using the -jsconsole command line flag, and the Error Console will open.

This is all well and good on desktop devices, but some mobile devices don’t do a good job of handling multiple open windows – I’m looking at you Windows Mobile. To make it easier to view errors, we added the Error Console as a browser panel in Fennec. It’s hidden by default – you need to use about:config to display it.

  • Navigate to “about:config”
  • Set “browser.console.showInPanel” to “true”
  • Restart Fennec
  • Go to the Browser Panels to display the Error Console

It should resemble the standard Error Console. The list can be panned vertically and horizontally. The code evaluator is functional. In fact, Gavin Sharp found an easy way to mimic device window sizes when running a desktop version of Fennec. For example, enter top.resizeTo(480, 800) into the code evaluator to resize the window to match portrait mode.

Comments

Fennec Linux Desktop Builds

Fennec nightly builds for Windows Mobile and Maemo have been available for some time now. Recently, we decided to make nightly desktop builds of Fennec available as well. The desktop builds can be used to test add-ons and localizations with the most up-to-date code changes.

You can find the Linux desktop builds, along with the other nightly builds, here:
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mobile-trunk/

Localized versions of the Maemo and Linux desktop builds can be found here:
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mobile-trunk-l10n/

Thank you L10N & Build Teams!

Comments (7)

Mobile Firefox DevCamp in Tokyo

Mozilla Japan and Clear Code held a mobile developer camp (translated) over the weekend. Fennec has been lucky to have several Japanese coders helping out for a while now. The DevCamp added even more contributors!

The DevCamp was active on IRC Friday. Bugzilla, on the other hand, was active all weekend. Many new patches were attached to bugs, including a potential fix for a crasher. A big “thanks” to everyone who attended the DevCamp.

Comments

Fennec – Performance is the Theme

Performance is very critical in Fennec, the mobile version of Firefox. Every feature, every aspect of appearance, every piece of code… is all judged by the impact on performance. We’re lucky to have automated performance tests for Maemo and we’re close to getting the same tests working for Windows Mobile.

A few weeks ago we were making a big push toward a full CSS-based theme for Fennec. CSS means we could use physical dimensions, instead of pixels, and updating the theme for devices with different screen resolutions would be easier. Sean Martell was creating some really cool prototypes using CSS3 functionality. We landed the changes in Fennec only to discover a significant negative impact on startup (~200ms) and panning.

The CSS3 border-color styles were just too slow to render on the devices. We were actually hoping to use box-shadow because it looked much better, but the performance was a little worse. Since we were close to a Windows Mobile release, we needed to replace the new theme with something faster. We changed to a basic, flat CSS-based theme. It more than made up for the startup and panning speed problems, but didn’t look very good.

In order to make a good looking (and fast) theme we decided to switch back to images for buttons in the main browser UI. That part of the UI affects startup and panning performance more than anything else. We could still use CSS-based theme for other parts of the UI, as long as those parts do not affect startup and panning. The current theme is mostly complete and achieves the performance goals. It will be more work for us when switching between device screen resolutions, but extra work for us is better than a slower user experience.

The current theme uses a mix of pixel-based images and millimeter dimensions for everything else. It looks pretty good too.

We have some other, non-theme related, performance nuggets I’ll post about soon too.

Comments (2)

XULRunner 1.9.0.11

The newest official XULRunner has been released. XULRunner 1.9.0.11 matches the Firefox 3.0.11 release. For XULRunner developers, most of the changes in 1.9.0.11 are related to security and stability fixes. SQLite was upgraded to version 3.6.7.

Runtimes
SDKs
Source tarball

The coolest thing about this XULRunner release is how it was done. Mozilla’s Release Engineering group is now doing official XULRunner releases at the same time as Firefox releases. Previously, someone would manually file a bug, make a patch, spin the builds and push the bits. A big thank you to the release crew for adding this to their release process.

Want to get started building XULRunner applications? We have an article for that. It’s way better than the crappy XML UI framework you’re currently using :)

Comments (2)

Extension Developers – News For You

It was recently brought to our attention that a change to the context menu handling code has broken some extensions that built on the context menu. Davide Ficano found one of his extensions was broken when we replaced a property on the gContextMenu object, a helper object used to manage the context menu. The change was made in bug 449522 to accommodate new video element support.

I saw Davide’s blog post, but it sat in my many open tabs. Thankfully, Mike Kaply got my attention this morning on IRC. We filed bug 497098 and got a patch up and reviewed. Hopefully, this minimal fix will make it into the next Firefox 3.5 release candidate. SeaMonkey has a similar bug open.

This change has been in Firefox 3.5 (nee 3.1) since beta 2. We got a fix ready to go in around two days after the initial blog post mention. What could we have done to have seen this breakage months ago, when it initially landed?

UPDATE: The patch landed on trunk and the 3.5 branch. Thanks to everyone involved.

Comments (7)

Resources for Fennec Add-on Developers

We have added more information to the small, but growing collection of Fennec-specific add-on developer resources. If you’re interested in building add-ons for Fennec, here’s a list of resources you might find helpful:

The Code Snippets and Best Practices documents are new. Feel free to give feedback on any of the documents. What information or snippets are missing? Use comments, IRC channels (#mobile) or even file some bugs.

We also plan to have a few tutorials for building Fennec-specific add-ons. Fennec for Maemo and Fennec for Windows Mobile both support add-ons. In fact, the same add-on could be used on both platforms. So get out there are start building.

Comments (3)

Ready for a Challenge?

Mozdev and Mozilla Europe have teamed up to create a Firefox Mobile (Fennec) Add-ons Challenge. The goal is to create or port add-ons to Fennec. You only need to propose a concept for now, but you’ll need to get the add-on ready for the upcoming Mozilla/Maemo developer weekend in Copenhagen on May 30-31.

See Brian King’s post for more details.

I am interested to see innovative ideas for using the limited UI in Fennec, add-ons that focus on mobile-specific functionality, and code that exposes more of the Maemo device functionality to Mozilla (yes, XPCOM is likely involved).

I also wouldn’t mind some applets (either as add-ons or XUL apps) running on Maemo. Think about mobile-specific Chatzilla or FireFTP for example. By mobile-specific, I mean dramatically different UIs, not just porting the existing desktop UI. If many little focused applets work for the iPhone, why not for other mobile platforms? And with XUL/JS, it’s pretty easy to build them. Anyone got a XUL-based Twitter app? :)

As always, we love to hear feedback from anyone building add-ons or apps on our mobile stack. Post comments, file bug reports, visit the IRC channels (#mobile & #extdev).

Comments (3)

Day Dreaming about Web Storage

Recently, we have seen good discussion on the W3C Web Storage specification. There has been some recent push back on the use SQL, in particular “SQL as SQLite defines it”, in the specification. Counter proposals have been popping up using JavaScript-ish APIs, many using JSON. Some of the APIs store the data as a JSON document or blob, even using the HTML5 localStorage/globalStorage system to persist the data. BrowserCouch and TaffyDB are two nice examples. Both are very JavaScript-oriented, client-side and offer some very nice functionality.

I think the functionality of a good JavaScript storage API will always be the most productive approach to storage, in much the same way we see JavaScript DOM libraries used everywhere. At the same time, I don’t think we should standardize functionality that should be in a JavaScript library, just as jQuery, dojo, YUI or any other DOM library is not the HTML DOM standard. I like having the flexibility of using different libraries.

We already have document-style (blob) storage in a specification and we have JavaScript libraries to make using document storage easy and convenient. The question I see is whether we want relational (tables/records) style storage. Many new JavaScript libraries would blossom from such a storage system and developers would have more choice.

Document and relational storage each has it’s own pros & cons. I’d like to see more discussion about the pros & cons, about performance and about what parts of the storage mechanism browser vendors should be focusing on to make JavaScript storage libraries performant. I’d like to see less bikeshedding on JavaScript storage APIs. I’d really love to see less talk of putting features in a specification that should be in a JavaScript library.

Update: Chris Blizzard’s post discussing Google’s O3D & Mozilla’s Canvas3D is great comparison of high-level vs. low-level APIs. Just replace “3D Canvas” with “Web Storage”.

Comments (3)

Fennec 1.0 Beta 1 – New and Notable

We released Fennec 1.0 Beta 1 for Maemo! Go read Stuart’s announcement for a good overview of the release. Be sure to watch Madhava’s video walkthrough too. Like Stuart, I am now using Fennec as the default browser on my N810 tablet. We have reached a solid milestone for performance and stability.

What’s New

Most of the work for this release was not visible UI features. Getting the Flash plugin to render onto Fennec’s canvas display surface was a big step. We also added the ability to pan any scrollable list in the chrome UI. So the bookmark list, add-on list, download list, preference list – and so on – now support scrolling/panning just like the main web content. We still need to add support for iframes and web content lists, which are trickier since they kind of conflict with panning the content itself.

Another area that has seen a lot of work is the rendering mechanism – the code that takes the content of the hidden browser element and renders it to the visible canvas display surface. Fennec Beta 1 has better pageload times and much better panning performance because of this work. For more background on what I’m talking about, read this post and the referenced article.

We did add some visible UI features. A big one is the new bookmark list. Fennec now supports bookmark folders and has capabilities for managing your bookmarks and folders. We still have some polish work to do, but the basics are all functional.

The default font size is a bit larger too, making it easier to read text content when Fennec auto-zooms web pages.

I almost forgot – JavaScript JIT is on by default for web content. It makes a big difference. The ARM related fixes to the JIT code made that possible.

What’s Notable

Our never ending struggle to make Fennec (and the Mozilla platform in general) as fast as possible on mobile devices has yielded a few more nuggets. Vlad and Taras have been hammering away on the rendering mechanism. Some parts of the process we can control better than others. The actual drawWindow call still dominates the time to render. We still try to improve the drawWindow performance, but there is only so much we can do. Instead, we try to limit the calls to drawWindow and limit the size of area we need to render.

Another area we can make improvements is overhead of XPConnect – the bridge between JavaScript and C++. On mobile devices, the overhead from XPConnect is non-trivial so we are reducing the XPConnect-able calls. We might also try adding more “quickstubs” – code that short circuits the XPConnect bridge, making the call faster.

Finally, we are noticing slowdowns related to the Places (bookmarks and history) system. Likely to be SQLite file I/O related. Two examples are: during startup the Places system is initialized, and when Fennec loads the bookmark list. I’ll note that neither of these examples is noticeable at all on desktop machines.

The startup issue is caused by a XPCOM component being initialized and in turn, initializes the Places core system. It results in a 250 ms speed bump during startup. We are currently working on a fix for this issue. The bookmark list load time is slowed by accessing the bookmark system for information used to display in the list, for each bookmark. In a simple test using just 10 bookmarks, it can take almost 3 seconds to load the list. Luckily, we were able to avoid some of the calls to the bookmark system and have improved load time by almost 40%.

We already have several performance related patches ready to land for the next release. Also, just about all the performance improvements we make for Fennec on Maemo are directly applicable to Fennec on Windows Mobile – win/win!

Comments (4)

« Previous entries Next Page » Next Page »