Dec 31

window.resize firing frequency in browsers

Ajax, Tech, Web Browsing 11 Comments »

I was playing with a Web application that did interesting redrawing of the layout (e.g. needed to do JavaScript magic in the onresize event).

I noticed that in Firefox the event took a fair time to fire. Joel Webber (of GWT fame) has also found this and said:

“Firefox and Opera do this wierd thing where they only fire resize events when you let go of the mouse button, or every second or so while dragging. It’s really irritating because there’s no way to get a “real” resize event, and it makes your ui look crappy when it goes through intermediate wrong-sized states.

I’ve always assumed this was to cover up layout performance issues. WebKit and IE fire resize events immediately.”

I wonder if the layout issue is correct, and if so, it would be nice to be able to somehow say to the browser “yup, I am in control of layout so please fire faster” or maybe by defining onresize you are saying that.

With decorators/annotations you would say:

@FireFrequency(ms=10) window.onresize = function() {
  // ....
}

Turns out that Ben was being a good citizen and in going to file a bug, found a couple out there.

Dec 31

Not just social history, actual information from Twitter

Security, Tech with tags: 12 Comments »
<html>
<head>
<script>
 
document.write("This page should show you your twitter info if you're logged in. (If you see a login box make sure you're logged into Twitter)<br/><br/>");
 
// forgive the document.write ugliness
function orly(data)
{
document.write("Your username is "+data[0]['user']['screen_name']+"<br>");
document.write("Your real name is "+data[0]['user']['name']);
 
}
</script>
<script src="http://twitter.com/statuses/user_timeline.json?count=1&callback=orly"></script>
 
</head>
<body>
 
</body>
</html>

What is that is all it took to grab your username and even real name out of Twitter? Try it, it works.

Yowser?!

(via Bill Zeller)

Dec 30

F**k That; Love The Tool You’re With

Tech with tags: , 4 Comments »

Dave Thomas gave a great keynote talk at RubyConf this year titled F**k Ruby (where the term was for Fork ;).

Dave is a very enjoyable presenter to listen too. He always has some of the British humour that I am of course partial too.

I loved how he managed to use the Scottish term Tath:

The luxuriant grass growing about the droppings of cattle in a pasture.

His talk is embedded at the end of this post. The Ruby stuff was very interesting and great, but what stuck with me was the early talk about loving the tool that you work with every day.

As programmers (Dave always titles himself as “programmer”) Dave talks about how we get a blank sheet daily, and if we don’t love the tool that we get to use to make the creation that day, then we will not do the best that we can, and it will show in our work.

I can totally relate to that. Sometimes we may think “use any tool as long as you create somethin useful.” Stick with Java even if you fancy doing something with Rails/Django/… because it is the safe choice.

If you are having fun and loving your tools then you will create (or adapt, which could simply be with config, plugins, or whatever) something so much better. Of course, as I now run a developer tools lab with Ben I don’t think of “tool” as just a programming language, but much more. Your entire environment. The items in the box.

As 2009 rolls around, I can’t wait to create some tools that I love. Something that makes me excited to start building something new. And not only for myself, but hopefully for some of the Web community.

Happy new year, and let’s listen to Dave:

Dec 22

Using the crowd to tell us about browser responsiveness

Google, Mozila, Tech 12 Comments »

addons

A lot of people are talking about the interview with John Lilly that discusses the relationship between Mozilla and Google.

People like to paint think black and white. Either Mozilla is Google’s poodle (Mozilla is to Google as Tony Blair was to George Bush) or there is a falling out and they hate each other.

Of course, the answer is grey as John points out. From my standpoint, focusing on the Open Web, I see more areas to collaborate on than to fight over. When I was at Google I knew that the Open Web was very important to the long term future. Now I am at Mozilla, the same is true. At the micro level there will be differences, but at the macro-level there is alignment.

Switching gears a little, I have had some folks talk to me about responsiveness issues with Firefox 3. I have had a fantastic experience, and currently I run Mozilla nightlies / Minefield / Shiretoka (3.1.*) and WebKit nightlies side by side. I am very happy with the shape that Minefield is in.

Of course, the issue with the extension mechanism with Firefox is that you get a window to the entire world (which has also been a reason that lead to amazing add-ons). Since this is the case a bad add-on can do a lot.

Chrome does a good job showing you basic info about a tab (memory etc). What if we did that and more for add-ons. Give me top for the browser.

Now, this is a lot of engineering away, so can we use the crowd to help out?

What if we created an add-on that would track responsiveness information and send it back (anonymously) to the cloud (say, to Weave). We could use math to work out probable culprits and could even ship that information back to the people using the add-on. Thus, you would then find out that FooAddOn seems to be a culprit that slows down the browser. Maybe it could be called Vacinate-addon.

What do you think?

Dec 16

Learning from Tech Luminaries

Tech with tags: No Comments »

techlum

Chatting to smart people at conferences, and in meetings, got Ben and I thinking about doing an interview show that would allow us to take some time to learn from luminaries in our industry.

We have many shows that talk about technical issues, but what about getting to know the people a little more, what makes them tick, and what brought them to this point?

There is an interviewer named Michael Parkinson who is the best in the business. In the US when Brad Pitt comes on Leno, you learn that he has a new movie, and Leno cracks some jokes.

In the UK when Brad Pitt comes on Parky, you actually get to know the guy, and some fun stories. Parky lets the interviewer talk. He makes them at home and they actually talk to you.

This is what I want to see come out of Tech Luminaries. There are a lot of interesting characters in tech, so let’s listen to their stories.

First up is Brendan Eich. We did this interview back in 2007 before we had any idea that we would be joining Mozilla, which gives the interview an interesting lens.

Brendan is incredibly sharp and is a fun guy to let ramble on about many topics. We have a couple more old ones in the can, and will start doing some new ones, including in video form.

Download the MP3 directly, and you can subscribe via iTunes.

Who would you like to see interviewed?

Dec 15

Still sexist in the valley? Marissa shows that to be true

Tech with tags: 4 Comments »

Valleywag writes about how she “married down”.

Why is that? They claim that he “buys and manages apartments for rich people, a business he somewhat brazenly dubs “private equity.” His business is called “Montara Capital Partners,” which makes him sound like a venture capitalist. He is also a lawyer, sort of, which is definitely several rungs down Silicon Valley’s social ladder.”

Doesn’t that sound so terrible? Mothers are known not to be proud of a child becoming a lawyer :/

This is so obviously sexist. If you turn it around, have you even seen the press talking about how Businessman X has married down because his fiance isn’t as successful as him. No. We never see that. No one expects that a mate do the same thing, or match themselves in the amount of money they make.

It is hard enough to find someone to spend your life with. If Marissa found someone flipping burgers at McDonalds, and they loved each other, congrats. Let along this chap who seems pretty successful to me too.

All this being said, you have to say that he has done quite well. Attractive, rich, powerful. Good luck to them!

And, it is much nicer to read these kind of articles on Marissa.

Dec 14

Deja vu: Still wary of Facebook

Facebook, Tech with tags: 8 Comments »

Facebook Uploads

Sorry, we cannot support uploads sent via email. Upload photos from your iPhone with our free application, Facebook for iPhone:

http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284882215&mt=8

This is the message that I now get when I try to use the Facebook feature of emailing photos to my account. For a long time, I have emailed an alias on my domain which forwards on to both Flickr and Facebook, get to get photo into both places at once.

My blog brings in these photos from Facebook using Fotobook. Now I can longer use this workflow. Instead, Facebook wants me to stop using the “open” import mechanism of SMTP, and instead wants to force me into the mobile walled garden of the Facebook app on the iPhone. Now, don’t get me wrong, the Facebook iPhone app is fantastically produced by Joe Hewitt, and I have no beef with it at all. I just don’t like being forced into one workflow which will then only work with that one provider. Facebook, by taking away a feature, changed the entire game.

Open protocols give us the ability to develop our own patterns, and tweak the implementation over time. When blogger (and others) allowed us to abstract the implementation behind DNS records, it felt better (as well as being able to export the data out).

Facebook Connect

There are advantages to the walled garden though. I have been really worried about seeing Facebook Connect buttons shown up around the Web. The UX for FB Connect is very nice indeed, which is why I was so worried. The majority of people won’t choose the Open platform purely because “they should”. Open needs to compete on its own rite.

This is why I was so pleased to see Open Connect:

We need to do this quickly, as people will only put “one” of these on, and it should be the open meta platform.

I think that there is a place for the browser to help out here too, as I have mentioned before. If you login to the browser once, and we agree on the protocols, the browser can do the handshake for us. A great UI….. none at all.

Time to “make the Web better” instead of how Facebook tries to “make a better Web”.

Dec 09

App Discover: An add-on that shows me when apps or user scripts are available for a site

Mozila, Tech, Web Browsing with tags: , 10 Comments »

Greasemonkey and Fluid userscripts. AIR and the new Titanium apps. Browser add-ons. When you go to a website do you know if you are getting the best experience for you? You could search for script on userscripts, or Google for apps, but what if the developers of the sites had a way of pointing out that there were enhanced experiences for you?

This is where App Discover comes in. It is a Firefox add-on that notifies you of these very items. All the developer has to do is add a simple link tag to their page, and the add-on will find it for you.

For example, if Twitter added the following tag, you would be notified of TweetDeck:

<link rel="application" 
  type="application/vnd.adobe.air-application-installer-package+zip" 
  title="TweetDeck Adobe AIR Twitter App" 
  href="http://www.tweetdeck.com/beta/TweetDeck_0_20.air" />

That line would mean you would see this in the browser:

Twitter App Discover Example

The type is a mime-type of course, and these are mapped into custom verbiage, but if you come up with something new… as long as the href is good, you should be golden.

I just added support for Appcelerator Titanium for example:

<link rel="application" 
  type="application/vnd.appcelerator-titanium-app-package+zip" 
  title="Tweetanium Appcelerator Titanium Twitter App" 
  href="http://tweetanium.com/tweetanium.zip" />

This is just a simple beginning of course. Where would we really want to go from here?

  • The current limitation is that it only really works well with one link tag (items get replaced)
  • I want to add preferences so the user can let the add-on know what they want to be alerted about (e.g. yes to Titanium apps and Greasemonkey scripts only!)
  • Be smart based on installation: E.g. if you don’t have Fluid (and especially if not on a Mac), don’t show it
  • Get social: “You have three friends who have installed TweetDeck”. This requires the browser being smarter about your social graph, which I think is a natural progression.
  • It should be smarter and not bug you when you go back to the same page. That can be fixed via the AnnotationService.

That leads me to XUL. I tweeted how it can feel a little strange to look up XUL docs and see dates in the lower 2000s. You have this nagging feeling of “has something really not changed since them? Is there an new better way of doing this?” As @mfinkle pointed out, “XUL is stable.”

I have to say thanks to the Ubiquity team who had done the lifting for me, which meant that this add-on took an hour to write!

Dec 08

Frustration with online games for kids

Games, Tech with tags: , 11 Comments »

Sorry, you must have a Windows PC and Internet Explorer 5.5 or greater to play this game

Excuse me? This is exactly why I joined Mozilla with Ben. I don’t want to access my bank in 2010 and see “You must be running Silverlight on Windows with IE 9″. It sounds crazy, but think back a few years and we were there. And, this message from a Dora the Explorer game reminded me that we still even have that problem today!

Dora Game

This brings me to online games. There are so many (mainly Flash) games for kids online. It is fantastic. I play PBS Kids games such as Curious George with Sam for hours.

The problem I run into is that because they are simple little games, they don’t have the notion of saving a game, or going to a level. I can see why the creators wouldn’t put this in. It is more work, and they probably think “these are quick little games, who needs that?”

The problem is that kids tend to get addicted to a game and want to play it again and again and again. Sam will want to go back to play, and it is so annoying to play the same first level once again! Let me skip!

And then there is losing the game. Kids get so attached, that I dread the following interaction (which has happened):

  • Daddy, let’s play the Curious George game with the boats
  • Ok, *opens it up on the computer*
  • Um, it looks like that game isn’t there, let’s try the new one
  • NOOOOO I WANT THE BOATS

Kids really care, so game sites, please add rather than deleting if you can. There is a kid out there that loves the game, and you break his heart when you nuke it. The good news is that 5 minutes later he is onto the next thing…. but still.

Any other parents run into this? Any favourite games?

Dec 01

Application trust models; Expanding Web applications out of the sandbox

Security, Tech, Web Browsing with tags: 5 Comments »

Winter

A few years back Web developers were celebrating the glimpse of a beautiful Winter as some of our best hacked our way out of the prehistoric ages to give us Ajax.

Ajax Universe

Fast forward to Hope year and we have seen the Web platform explode. We have gone from Web hack to the mobile phone and even the desktop.

With technology such as Prism, Fluid, Gears, and AIR we get to use our Web skills to build desktop applications. If you play the numbers game and realise how many people understand how to hack on the Web versus write native applications you can see how if harnessed correctly, the Web could be a dominant platform far beyond the browser as we know it.

However, how do we break out of the Web sandbox? We gain a great deal of this “secure” (don’t say that to Crockford) place for us to build applications and we can’t just break out willy-nilly.

The problem is, that if we don’t come up with something you will always end up saying “I can’t prompt my users for every little thing, so I guess I will just write a native application.”

This of course doesn’t actually help make life secure for the end users. Instead, they hit OK on the “Sure, I know I downloaded that from the Internet” dialog and now native code is doing whatever it wants too!

ASIDE: I would love to know how many people: a) download something from the Web, b) run it, c) see that dialog and then d) say “oh, OK no.” I know what I am willing to bet on ;)

What if we took the weakness of the current Web sandbox and make it a strength. If our platform is able to intercept what is going on, imagine if we could have metrics that show us exactly what an application is doing. Chrome does one small thing here, showing you the memory that a tab is using. This is a great start. What if we go further and you think of iStatMenu being somewhere in the browser:

Browser Metrics

Now for every browser application you can see not only its memory footprint, but you can see if it is using your location, how it uses the network, the local database, and even the file system. Instead of asking once “is it ok for this app to do anything” we can ask a more nuanced question, but also give a lot of feedback after the fact, way after you have forgotten what you said would be OK.

We could also have power user modes that allow you to visually see the heap, allowing you to navigate it as you debug your application. Detailed networking views. And, more.

Of course, the best way of doing this work is through implicit interfaces. Having a Google Search with a “[x] near my location” checkbox is the obvious example.

This is a delicate issue, but I believe that the Web needs to move in a broad direction, and we need to work through these problems. What do you think?