Keyboard-only searching with Safari 6’s unified URL bar

A couple of months ago, I adapted a user script called knogs (“keyboard navigation on Google Search”) into a Safari extension. knogs restores Google’s search page keyboard navigation shortcuts (background here), so you can navigate between search results with j (down) and k (up), and get to the search field with /.

Unfortunately, Safari 6’s new unified “URL + search” bar behaviour retains focus after a search. As a result, you have to click in the search page to use any keyboard shortcuts, rendering the extension fairly useless unless you like searching for JJ Abrams by mistake.

So I’ve updated the extension to remove focus from the unified search bar. (It’s an ugly hack, though–I did it by prepending an input field on the page, calling focus on it to remove focus from the search bar, and then removing focus with blur. Let me know if you have any better ideas.)

Download the Safari extension here, and the source (userscript version) is available here. If you were using the previous extension, it should have auto-updated, if I set it up right. Test it out by searching in Safari’s URL bar, waiting a few milliseconds, and entering j, k, or / to navigate.

A couple of notes on usage:

  • You have to be searching with google.com for this to work, and not any country-specific domains. This is due to the way Safari handles extension whitelisting–I can’t get it to whitelist google.com.* URLs.
  • Disable Google Instant search in your account settings, otherwise typing j will just append that letter to your search terms. Thanks to Nick Farina for helping me find this issue.

The state of tech blog writing in Singapore

Posting without comment; emphasis mine.

e27, Electronic Arts merges IronMonkey and Firemint to form Australia’s largest gaming studio Firemonkeys , 25 July 2012:

Good news aside, there are certainly expectations from the gaming community for the new Firemonkeys to perform, as they now eagerly awaits their first product.

e27, OS X Mountain Lion upgrade now available in Singapore for S$25.98, 25 July 2012:

Mac OS X can now grab the Mountain Lion upgrade at a price of S$25.98 in Singapore […] The upgrade will come a the cost of S$25.98 and comes with over 200 innovative new features. […] The Message app, which users had access to the beta version, will bring iMessage to the Mac and allows cross device communication across the iOS devices available in the market.

(The app is called “Messages”.)

Tech in Asia, Run a Singaporean Coffee Shop with the Kopi Tiam Game, 26 July 2012:

I downloaded the free Kopi Tiam version to give it a shot, after reading many positive reviews. It’s reminiscent to many time-management games […] […] We’ve also included a the game’s demo video below. Enjoy!

Tech in Asia, TackThis Powers Donation Drive in Singapore’s National Day 2012, 20 June 2012:

As a Singaporean, I confess feel compelled to doing so as well.

That’s it, for now. I might do more of these, if I get annoyed enough.

Oh, here’s one more. In this case, the bad grammar and awkward phrasing aren’t necessarily the writer’s fault. e27, The Demise of QR Codes, February 2012:

QR codes will remain a curious oddity for the technically proficient geeks and bleeding adopters.

Here are the search results for the odd term “bleeding adopters”. Compare this article from October 2011, which also contains that phrase, to the above e27 article.

Update, a day later: e27 and Tech in Asia have acknowledged and corrected the above. Both note that they appreciate error reports sent through their comment sections.

Big Head Squirrel Feeder

Laughing Squid:

If you get a Big Head Squirrel Feeder, you’ll be able to feed and humiliate squirrels at the same time. Hang this vinyl 5-1/2″ x 8″ Big Head Squirrel Feeder in front of a window or near a porch, fill it with something squirrels like to eat and when they stick their head up there, the squirrel looks like he has a hilariously huge head with a goofy smile.

So close to setting that picture as my iPhone wallpaper.

Chrome for iOS

I’m currently firmly welded to using Chrome on the desktop, thanks to (a) Vrome, a Vim keybindings extension for Chrome and the poor (and less insane) man’s Vimperator/Pentadactyl, and (b) Shortcut Manager, which allows me to assign random Javascript to keyboard shortcuts (great for bookmarklets to send the page to sites/apps like Pocket, Gimme Bar, Evernote and MarsEdit).

As such, I was a little concerned about having to switch back to Safari because I really like the new iCloud tabs sync feature in iOS 6 and Mountain Lion. The new Safari’s Omnibar retains focus after search, which prevents me from using my J/K keyboard shortcuts, and I’d have to go back to putting my Javascript bookmarklets in the bookmarks bar and trying to remember which number corresponds to which site.

Thank goodness then for Chrome for iOS, just announced today, with tab sync and easy tab navigation. I’m sold. Two things that bother me, though:

  • The icon follows Google’s standard iOS “slap the desktop icon onto a black background” motif, which doesn’t quite fit in the Dock with “fuller” icons like Messages and Mail. I would have loved to see something more interesting that made full use of the roundrect. I did a quick (terrible) mockup here.
  • There’s an extra, and fairly useless, row of keyboard icons when you bring up the URL bar, which gives easy access to :, ., -, / and .com. This feels odd: first, these characters aren’t that difficult to access; second, isn’t the point of the Omnibar to encourage you to search, and not type URLs?
  • Worse, on the iPad, the extra row of keyboard icons are non-Retina. CANNOT UNSEE NOW ARGH

To protect your personal interests

HSBC’s login page:

Screen Shot 2012 05 29 at 6 59 35 AM

“To protect your personal interests, repeated incorrect submissions of your Password or Security Code will disable your access to Internet Banking.”

Clearly, my ‘personal interests’ include:

  • Calling to reset my password
  • Yelling at customer service reps, then feeling guilty because it’s not their fault
  • Allowing other people to easily lock me out of my account if they know my user ID, or if they’re annoyed enough at having been locked out that they write a script to guess all possible user IDs and then proceed to lock them out to prove a point not that I’m doing that right now really
  • Being generally annoyed as fuck

Idiots.

“Please don’t learn to code”

Jeff Atwood went and set fire to the Internet a couple of days ago:

The “everyone should learn to code” movement isn’t just wrong because it falsely equates coding with essential life skills like reading, writing, and math. I wish. It is wrong in so many other ways.

This point feels a little stretched to me. I’m not sure where Atwood is getting these “coding is as important as reading/writing/math” vibes from, but why isn’t there a place for coding in schools beyond the core curriculum? Put another way: why exclude Computer Science / programming from that seemingly arbitrary list of auxiliary subjects that we make our schoolchildren learn over their 12 years of pre-university education?

The general populace (and its political leadership) could probably benefit most of all from a basic understanding of how computers, and the Internet, work. Being able to get around on the Internet is becoming a basic life skill, and we should be worried about fixing that first and most of all, before we start jumping all the way into code.

This part makes perfect sense. However, what he proposes here doesn’t have to be at the exclusion of teaching more people programming, yes?

Here’s a response, by Zed Shaw of Learn Code The Hard Way:

I wonder if he’s going to tell his kids they shouldn’t learn to code when they want to become just like Daddy? Probably not. He’ll gleefully run over and show them how to code and tell them it’s so much fun and that they should all do it and it’s the best thing ever! But, of course, _your_ kids shouldn’t learn to code, and you shouldn’t, and your friends shouldn’t, just Jeff and his kids should.

I do think Shaw’s taking a bit far when he cites resentment as Atwood’s motivation for telling people not to learn how to code, but then, running a (very good, supposedly) programming education website could do that to your perspective. Both articles make good points, but I’d recommend Shaw’s to anyone feeling a bit deflated after reading Atwood’s.

The day I lost a child on the Tube

From the Teacher Network Blog on The Guardian:

Twenty years ago our blogger lost one of his pupils on the London Underground and didn’t even report the incident to the child’s mother or his headteacher… fast forward to the present day and it’s a very different story

A little old in Internet-time, but I just got around to reading it, and it’s a fun read with a very insightful conclusion that’s not “OMG look at kids and parents nowadays ughhhh”.

When I first read the title, though, I thought it was “the day I lost a child on YouTube”. THE HORROR