Monthly Archives: April 2009

Overriding Firefox’s Window.Alert – Part 1

Window.alert is a native function built into Firefox – but that doesn’t mean it can’t be overridden.

Check this out:

Open Firebug, and get to the console.  Then, click that little red arrow at the end of the input line so that you get the large box input on the right side of the screen.

Type this into the input box:

var alert_count = 0;
var old_alert = window.alert;
var alert_max = 5;
window.alert = function(alert_text) {
  if (alert_count < alert_max) {
    ++alert_count;
    old_alert(alert_text);
  } else {
    console.log("Reached maximum alerts");
  }
}

Now, hit “Run” at the bottom of that input window.  We’ve just overridden the window.alert function during runtime.

Hit “Clear” at the bottom of the input window, and type in:

for (i = 0; i < 10; ++i) {
  alert(i);
}

Hit “Run”.  Click “OK” for the first 5 alert windows, and watch as the rest of them are spewed out to the console.  Nice.

So, I don’t think this helps me much in creating my plug-in, but it’s interesting to see how window.alert is malliable at run-time.

This seems to be a more relevant discovery – Mozilla’s Chrome lets me create an alert popup with a checkbox using alertCheck.  I think this is exactly what I’m looking for.

I’ll tinker with it over the next few days, and post some code.

Summer Project: Firefox Plugin to Override Window.Alert

When I don’t have work to do, I get antsy.

And right now, I’ve got no work to do.

So I’ve come up with a project for myself:  remember how I created a Firefox Plugin a few months back?  I’d like to make another one – but this one will actually serve a useful purpose.

Have you ever been to a page that suddenly started spewing window.alert boxes at you?

If you haven’t, open up Firebug, and paste this into the console:

for(i = 0; i < 10; ++i){ alert(i); }

Now imagine if instead of 10 alert boxes, it spewed hundreds…or thousands….or god forbid, it uses a while(true) loop, and throws infinity alert boxes at you.

It totally cripples Firefox. It’s a super simple browser DoS attack.

Mozilla knows this, but so far, no solution except for killing the Firefox process, or disabling Javascript manually, or with NoScript (a plugin that I highly recommend).

Google Chrome has solved this problem by providing a checkbox on alert dialogs that allow a user to disable future popups from the current site.

Cool.  I want Firefox to have the same feature.

So, this summer, I’m going to try to build a Firefox Plugin that will override the standard window.alert function, with one that provides a checkbox, letting the user disable future alerts.

I don’t even know if this is possible, but I’m looking into it.

I’ll blog my research and progress as I go along, and share my code / final plugin when it’s all finished (or when I abandon it…hey, it happens).

So stay tuned.

That’s All Folks! Now for Celebration Rituals…

Today, I wrote my first and last final exam for this semester.

So my undergraduate career appears to be finished.  I’ve gotten confirmations of program completion from both the Computer Science and Drama departments.  New College is holding out on me with their blessing, but I think it’ll arrive in the mail soon.

I won’t be going to convocation – I’ll be in Poland.  I’m not that upset about it – Poland is totally worth it.

Besides, I have a Masters degree to complete now – my parents can go to THAT convocation.

Now For Celebration Rituals…

I’ve completed many a school year with my friends, and over time, rituals have formed to celebrate the end of the work.

In grade school and high school, it usually consisted of a symbolic “note toast” (the burning of our most hated assignments) along with a barbeque, and camp-out party.

Somewhere along the line, things changed for University.  Now, when one of us completes their last final exam, we’re given license to crank Sisqo’s Thong Song (usually restricted in our household for just this event) and dance up and down the halls.

If you’d like to celebrate with me, feel free to crank this wherever you are (NSFW):

Alternatively, the Thong Song can be replaced with either:

MOP’s Ante Up (NSFW):

Or Michael Jackson’s Don’t Stop ‘Till You Get Enough:

Since I’m finishing my undergrad degree, I’m totally going to rock out to all three.

Feel free to join me, remotely.

The Relationship Between UI Design and the Culture of Entitlement

Today, in my apartment, was spring cleaning.

As I helped Doug, one of my roommates, plunge a putrid black foulness out of the bathroom sink, my mind wandered, and I got to thinking about something that’s been bugging me for a few days:

In my User Interface design class (CSC318: The Design of Interactive Computational Media), we were given lots of tips and ideas on how to make our software interfaces easy to use, and invisible.  If we do our job right, the user should not even notice the interface they use in order to get what they want.  For example, a well designed doorknob is more or less invisible to the user – they just know they want to get to the other side of the door.  The only time they really notice the doorknob is when it stops working.

Which brings me to the other side of my thought:

I was reading something on CBC.ca about how Bell was changing their network so that competing ISP’s that use their network can no longer offer unlimited bandwidth.  Bell’s argument was that this would reduce network congestion, something like that.  Don’t quote me, I’m paraphrasing here.

Naturally, there was plenty of outrage in the comments.  Plenty of people posting about how Bell’s service is terrible, and that they’re less interested in network congestion, and more interested in handicapping their competitors.

All of this is just scenery, by the way.  What I’m getting to, is one particular comment that was posted, where someone complained about the “culture of entitlement” that we have, and that of course we should be billed for the amount of bandwidth that we use, just like we’re billed by how much water we use.  The user went on to say something about how we’re all spoiled brats, and that when we ask for something unlimited, we’re asking for others to pay for it.

Now, I neither agree nor disagree with this user.  I don’t know much about this Bell thing, and that’s not what I’m writing about.  What I’m interested in is this idea that we’re in a culture of entitlement, which immediately makes me feel like a spoiled brat.

Remember that video I posted a while back?  Everything is amazing, and nobody is happy? If you haven’t, take a look.  It more or less sums up this “culture of entitlement” idea.

So how does this relate to UI design?

Well, when we create something so easy for our user to work with, aren’t we just contributing to this spoiled culture of entitlement?

By making our software so blindingly simple, aren’t we catering to this mentality that things should “just work”, which fuels the outrage when things “don’t work”?

I know.  Part of my job is to make things that just work.  I know that.

But don’t you see where I’m getting at?  We’re making really cool technology, and really cool gadgets – but take a look:  doesn’t it seem like we’re all becoming a bunch of spoiled techno-brats?  Don’t we become howling imbeciles when our iPhone won’t work, or a web page loads slowly?

One of my Professors, Greg Wilson, taught me that when two options look bad, it’s more or less about trade-offs.  I guess that’s what we have here.

Because I’m completely split on this matter.  My UI self is saying “Yes!  For god’s sake, make it simple for people.  Make the interface invisible so that the user can get their work done.”

The other half of me is wondering:  what is happening to our culture?  I see people walking around with laptops out, demanding wifi and groaning when it doesn’t work, getting frustrated with their highly sophisticated phone, and getting upset at a global network of computers for having “congestion”.

I see this “culture of entitlement”.  I’m not sure that I like it.  And, regardless, I’m not exactly sure what I can do about it.

UPDATE:

I’ve thought about this some more.

This “culture of entitlement” idea…why do I get the feeling that this isn’t new?  If we look back at the older generation, of course they will call ours a “culture of entitlement”.

But what if we go back even further?  If we were to go back in time to, say, the 1950’s, and ask the old folk if the young people were part of a “culture of entitlement”, what would their answer be?  Probably yes.

Correct me if I’m wrong here, but it seems inevitable:  the older culture will always think the younger one is spoiled.

Everything is amazing, and nobody is happy.  Of course things are amazing, and of course we take things for granted.  I don’t think that will ever change.

Meanwhile, while I’m typing this, I’m working on a state of the art piece of machinery.

I guess that makes me one big ol’ hypocrite.

But I think that’s true of anyone who starts complaining about the “culture of entitlement”.

Correct me if I’m wrong.

Another Update: In hindsight, maybe I shouldn’t have used the term “culture of entitlement”, since it seems to have a more sophisticated meaning than I originally intended to convey. Maybe I just meant “culture of spoiled people”.