Silly Javascript tricks and the hunting thereof

Joel Spolsky has a theory that Google is starting to take a look at bounce rates when judging search result authority.  The theory (which may be resolved, at least for now, by the time you read this) is that if a user does a search, clicks a result, and comes back to Google really quickly, then the page might not have been any good or at least wasn’t relevant to that user’s search, so “short clicks” (clicks that come back to Google quickly) could be an indicator of rankings that need adjustment versus “long clicks” (clicks that don’t come back to Google for a while) could be an indicator that the ranking was good.

I don’t know if this would work in practical use, for all kinds of reasons, but I’ve reconciled with myself that I don’t use the internet like other people do, so who knows.

What I do suspect, though, is that there are people, right now, working on theoretical Javascript that will crash your browser if you hit the back button too soon.  If you click some other link on the page, that’s fine, but leaving via back?  Better to nuke the browser from orbit than signal to Google that the site sucks.

No, I don’t know about a Javascript hack to crash any browser.  It wouldn’t surprise me if there were one or more ways, but I tend to find these by accident and then, you know, try to not do that ever again.  Of course, now that I’ve identified a potential market for website suicide bombers, I reserve the right to, well, be busier than ever on actual cool stuff so I can’t entertain job offers like that.

This is all just a lead in to a fun story where I actually needed to do something non-standard with the browser.  Without going into enough details to make this more of a Toronto Programmer post, I needed to find a way to keep a browser app open indefinitely, basically by making a window that couldn’t be closed or that would always reopen (the actual use case involved some hooks into Internet Explorer on an enterprise desktop app that would crash horribly during a 15 second or so window when IE was closing, so the solution at the time was to make sure IE never died.)

My Javascript was weak back in the day, and as it turns out, this wasn’t the kind of thing you can Google for, at least not at the time.  Maybe there are 15 answers on Stack Overflow now, but this was circa 2003.

The beauty of Javascript is that everything on the internet is available for inspection, so if I couldn’t find a tutorial, I figured I could at least find a site that did something like that and find out how they did it.

Of course, you’d have to be a little seedy to actually make a page that could never be closed.  Maybe some really nasty pop up ad.  Or something equally unsavoury.

Maybe porn.

True story: I had to go home, because there’s no way I was doing this research from the office, and surf porn sites until I found what I needed.  And yes, I did, and no, it didn’t take long (did I mention I don’t use the internet like normal people do?)  I felt a little dirty by the end, but the app got deployed and worked as required.

There’s a moral here about a certain type of programmer, but I’m not sure what light it casts me in this time, so I’ll leave it at this: there are certain times where you need to do weird things in code to accomplish a legitimate business goal that doesn’t make you or your company look like a tool, and that is a sweet sweet spot to live in.  Especially if it’s something you can do entirely from your own desk.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *