3 March 2009 - 9:34Weave Intro & UI (Weekly 2009/9-1)

I’m now a full-time software developer in Mozilla Labs working primarily on Weave [labs.mozilla.com]. I suppose that means I’ll have to pay income taxes again.. ;) but that’s insignificant compared to helping Weave redefine web clients where users can interact with websites and friends in whole new ways. I’ll have less time to write about the EdBrowser, but being in Labs, I might get to build some of this as a bunch of ideas for that web client was built around Weave. :)

Most of what I worked on during the week was getting familiar with the Weave codebase and some initial debugging/hacking. I also did a little bit on optimizing the Location Bar for Firefox 3.1+.

Is 4 > 20? Yes! ?

My first task was figuring out why 4 is larger than 20 [bugzilla.mozilla.org]. This was causing problems with Weave history sync on Fennec when we set the Places sorting mode to get a number of recent pages. So to try figuring out what went wrong, I started with my Unibody Macbook and installed VMWare Fusion [vmware.com] to run Ubuntu 8.10 [ubuntu.com] for a cross-compiling scratchbox [wiki.mozilla.org] to build Fennec [wiki.mozilla.org] for the Nokia N810. (Side note: don’t run hg from the scratchbox. It’s old. Like 0.9.1 old.)

That’s just to build Fennec. Getting it to run on the Nokia N810 is just as fun. The default package is bzipped, but that doesn’t work on the device by default, so I have to repackage it as gzip. Even before then, you’ll need to jump through hoops to get Fennec onto the device, but the easiest way seems to be putting stuff on a web server and downloading it wirelessly to the device.

Long story short, I used my x86 asm experience from doing computer architecture/compiler research at UIUC, and noticed the compiled code for SetSortingMode [hg.mozilla.org] was doing a plain comparison of the input argument to the value 20.

cmp r1, #20

While the value 4 was getting passed into the unsigned short argument, the compiler was expecting a 4-byte sign extended value. Vlad gave me a quick patch that made the XPTCall magic handle smaller-than-4-byte types correctly, and all was good. 4 is now less than 20.

Initial Weave Hacking

I got a Weave account and used it for the first time. (And so can you!) [services.mozilla.org] I kept track of various small UI issues as I used the Firefox client and pushed fixes for them — small localized changes are a great way to get into the bigger project. But I eventually messed up my account by typing different passphrases from different computers.

Lucky for me, I’m working on a way for users to reset the data on their client/server [bugzilla.mozilla.org]. The general idea here is to allow the user to “start over” incase something went wrong. 1) Clean sync with the server, 2) Restart the client from server state, 3) Make other clients like the current one, 4) Have clients repopulate the server.

Before I dove too deep into coding, I got a whole look at the Weave architecture to better understand what pieces od what: A bird’s-eye view [toolness.com] and Client APIs [wiki.mozilla.org]. Also, Weave is written with a pattern called Trampolining Generators [neilmix.com]. This basically lets you use asynchronous calls synchronously and get something more like traditional threading.

Color-coded log files for easier tracking of Weave behavior

Color-coded log files for easier tracking of Weave behavior

I also figured I would be looking at debug logs a bunch, so I decided to spice up the plain black/white log file [bugzilla.mozilla.org] and color code the text by the type of message (warning, info, debug, etc.) and the background by the component generating the message. Hopefully now I’ll be able to get deep into Weave hacking.

AwesomeBar Speedup

I posted about speeding up the location bar, and it’s made it into Firefox 3.2 already. On the way there, I used Andrew Sutherland’s SQLite explain parser to better understand why things were slower and faster. Basically, a query becomes a set of opcodes like how javascript code becomes an intermediate bytecode, and the engine executes this stream of instructions.

Andrew first made this tool to analyze his own query optimizations [visophyte.org], and now he’s made the code available for everyone to use and contribute [hg.mozilla.org]. Thanks!

2 Comments | Tags: AwesomeBar, Labs, Mercurial, Mozilla, Status, UIUC, Weave

25 February 2009 - 10:44Looking for Location Bar Perf. Testers

I’ve got a change that should speed up the Location Bar in Firefox 3.1 and 3.2, but I just want to make sure it’s not only me and my computers that are seeing this benefit.

For you to take the test, you’ll need to be running a Shiretoko (Firefox 3.1) build or Minefield (Firefox 3.2) build [ftp.mozilla.org].

What you then need to do is type something that will search through all your history, such as “this page isn’t in my history yay”. Just copy/paste that into your location bar, but keep track of the time you pasted and the time the activity throbber stops spinning in the location bar. (If you do get results, it’ll still be okay, as long as the location bar didn’t find 12 results.)

Depending on how much history you keep and how long you’ve been using Firefox 3, this could take over a minute or two before the throbber stops spinning.

Once you record how many seconds it takes for the throbber to stop, repeat the same thing with the Firefox 3.2 build that includes my optimization [build.mozilla.org].

CPU Usage (1 bar/sec): Old Firefox 3.1 takes 2 minutes; New takes 20 seconds

CPU Usage (1 bar/sec): Old Firefox 3.1 takes 2 minutes; New takes 20 seconds

I’ve tested this on a few Places databases with my current unibody MacBook and my old iBook, and both times it runs much faster. Some times it goes 6 times faster. With one test on a database with over 100,000 places, the location bar throbber stop spinning in 20 seconds instead of 120 seconds.

Please report back your results as comments, and if you’d like, go ahead and vote for the bug, Make location bar autocomplete even faster [bugzilla.mozilla.org], to follow its progress.

30 Comments | Tags: AwesomeBar, Mozilla

20 February 2009 - 8:09Who Are You? Stop Asking Me!

Are you asked to sign-in to websites often? “Remember me” doesn’t seem to always work..
Do you have many user names? At least sites let you use your email address nowadays..
Have you forgotten your password? Saved by password manager..?
Is your password hard to hack? But I’m too lazy to make/remember a stronger password…

Google's account troubleshooter

Google's account troubleshooter

Why do websites have sign-in forms anyway?

I suppose the site just wants to ask “who are You?” Signing in lets you personalize your experience on the site. Let You get to the stuff You want. That’s just some of the benefits for the user.

For the website, it wants to make sure it only gives your stuff to you and not some random person that’s also using the site. One way to ensure that is to “challenge” you by making you answer something that hopefully only you know.. like your username and password.

But what if the browser you’re using already knows that you are You?

Instead of challenging You to see if you happen to remember your username and password, the website could challenge your browser to prove that it’s You. Now you don’t need to worry about forgetting your password or username. You don’t need to worry about having a weak password either because computers are good at remembering and calculating complex stuff.

But that’s not all! One very useful aspect is that you wouldn’t even need to sign in to websites anymore!

The challenges that site asks to prove that you’re You can be made in a way that only your web client can answer them. So when you go back to the website, it already knows who you are, and nobody else can pretend to be you. And this is only if you let your client tell the site.

Even better is that you don’t even need to create an account on the website! :)

You can start using and personalizing your experience on a site without first going through the user creation process. Because the site knows that only you can be You, you can focus on getting a better experience now and later go through the nitty gritty details of providing a name, contact information, etc. if necessary.

Use the site first, create an account later

Use the site first, create an account later

For example, if you’re using a site to purchase items, e.g., stuff for a house or even a house, you could make notes on items without first creating an account. Next time you visit, the site already knows it’s You, and this is without being required to put any personal information. The site might eventually want your email address to send you notification that this item just got cheaper by 50%, but that’s up to you.

But what about privacy?

Just because one site knows you’re You doesn’t mean another site can know that. You could choose which sites your browser accepts these identification challenges, and if it doesn’t respond, the site can’t figure out who you are any better than how things are now.

Additionally, because computers are good at doing menial things like tracking lots of numbers, the way it answers challenges can be different for each site. So if you took a bad approach to this problem by just having the web client make some identification number, the web client could give a different identification number to each site instead of sharing the same number. That’s just to get a crude feel of how a client can maintain your privacy across sites, but real implementations would have much more complex challenges.

Go Phish?

If you happen to stumble upon a phishing site that didn’t automatically get blocked, there’s a lot more red flags that will be going off for the user. “Why do I need to all of a sudden sign into this site?” “Uhh.. how do I even sign in.. my client handles all that for me..” ;)

Just one of the tasks for the Identity Center

Just one of the tasks for the Identity Center

If all this was part of a cloud-based web client like EdBrowser, you can get this great experience no matter where you go. As long as you first get your information from the cloud to the client you’re using, your client will have enough information to answer the challenges to prove that you’re You, even if you’re at another computer like a mobile device.

The EdBrowser first simplifies Going Places by getting you there in a single click, and now you can make use of websites without needing to type in a username/email and password! There’s fewer and fewer reasons to touch the keyboard just to get to your actual goal — to use the site!

10 Comments | Tags: EdBrowser, Mozilla

18 February 2009 - 9:47Going Places: All the Different Ways

If you use Firefox 3, how do you get to the site you want?

How would you go to a website from this screen?

How would you go to a website from this screen?

Hopefully if you’ve been using Firefox for a while, you’ve found out that it is smart enough to show the site you want after typing just a single letter in the location bar. Firefox remembers which sites you go to frequently and what you’ve typed before, so it can better suggest the page you want — one reason why people say it’s so awesome. And if you’ve installed Enter Selects [addons.mozilla.org], you can just hit [enter] to go to the first result.

There’s 3 or 4 steps involved here:

  1. Getting to the location bar (click it or use the keyboard shortcut)
  2. Typing what you want (a single letter or more)
  3. Finding the result from the list (optional presses of [down] or [tab])
  4. Selecting the page (hit [enter] or click)

There are plenty more ways to get to the page you want:

  • Click the search icon in the top-right box and then search — ~6 steps
  • Search from the default home page — ~5 steps
  • Search from the top-right search box — ~5 steps
  • Search from bookmarks sidebar — ~4 steps *
  • Open from a new tab (with a smart new tab page) — ~3 steps
  • Select from the smart bookmarks drop-down — ~2 steps
  • Select a page from the location bar drop-down — ~2 steps
  • Open from bookmarks sidebar — ~1 step *
  • Click a bookmark from bookmarks toolbar — ~1 step *

I put a * next to the ones using bookmarks as you have to first bookmark a site and organize it into folders or put them onto the toolbar. So there’s some initial cost for setting them up, but it can pay off in the long run — just a single step to get to the site in the common case.

There are many ways to get to a site with varying number of steps

There are many ways to get to a site with varying number of steps

It’s not bad that there are many different ways to get at the same goal. Each way has its own benefits and drawbacks. For example, going to a bookmark is very simple (assuming it’s visible and clickable), but you need to have bookmarked a page beforehand, and going to a new site from a bookmark could be tricky. Additionally, you need to sacrifice screen space for the sidebar or the toolbar.

The main metric I’m looking at for these different ways is the number of user actions required to get back to a site. Just think about how many times you go to the same site over and over again. You might go to a number of sites frequently and others not as frequently, but you still revisit them more than a random site you’ve never heard of.

And don’t forget that others might have more difficulty than you when using a mouse or keyboard. Even if you only need to type a single letter to find the site you want, finding the right one key to press on the keyboard can be an ordeal in itself.

So ideally we make this common behavior very easy to do. At most one click is needed as we’ve seen with bookmarks. But bookmarks are “difficult” to work with as it requires extra effort from the user.

The idea behind EdBrowser’s Site Launcher comes from this goal of streamlining the interface to allow the user do what s/he wants — interact with the site – not the browser.

Get to where you want to be with a single click

Get to where you want to be with a single click

Instead of having to manually bookmark sites and organize them to be accessible, the Site Launcher automatically figures out which pages you’ve been going to frequently — you kept typing them in over and over again. You can even drag the current site from the “temporary” right side and pin it somewhere on the left because you want to go back to it.

As you get more and more sites on the Site Launcher, there’s less and less need to type in the site you want. This means all that space currently used for some text input like the location bar isn’t as necessary any more.

But just because this text input gets smaller doesn’t mean you can’t type-to-get-to-the-site. In fact, having sites on the Site Launcher can streamline the keyboard interface even more. Searching from that input box can first prefer pages contained in the Site Launcher. This includes your open tabs, main pages of the websites, as well as pages you frequently visit; it would even include recently closed tabs.

7 Comments | Tags: Add-on, EdBrowser, Mozilla