26 August, 2011

Chrome tip: Open new tab next to current tab, using JavaScript in a search engine "bookmark"

In the Chrome browser, the keystroke for opening a new, blank tab (Ctrl-T or Cmd-T) always opens the tab at the far right of all tabs. Usually I would prefer it to open to the immediate right of my current tab.

You can do this by right-clicking on your current tab and selecting "New Tab" but I prefer keystrokes to mouse actions.

You can also do this with the Tab to the next right extension (a deservedly popular extension), but it also controls which tab will be selected when you close one and I prefer to use Chrome's own selection method. Also, sometimes I DO want the tab to open at the far right. :)

I've worked out that I can get what I want with some JavaScript in Chrome's search engine preferences. I tested it only on a Mac so the steps might be slightly different on other devices. It looks like a long process but it's really very simple.
  1. Go to Chrome's Options / Preferences screen (click the wrench icon on the browser toolbar then select Options or Preferences -- whichever appears on your system).
  2. You'll find yourself in the "Basics" preference page, which should have a "Search" section. Click on the Manage Search Engines... button.
  3. You'll see a list of your custom-built search engines for various sites (if curious, read about Chrome's search engine configuration). At the bottom of the screen, find the set of empty fields for adding a new search engine.
  4. In the first field (labelled "Add a new search engine"), enter Open new tab or something similar. The words you choose are not important -- make them meaningful to you so they'll trigger your memory if you go back into this screen any time in the future.
  5. In the second field (labelled "Keyword"), enter a single word or single letter or a sequence of letters (no spaces nor punctuation). You'll be typing this every time you want to open a new tab to the immediate right, so short and memorable is good. I use tt
  6. In the third field (labelled "URL with %s in place of query"), enter exactly this text including the semi-colon at the end:
    javascript:window.open();
  7. Click anywhere outside the fields to "save" your entry.
That's the end of the set up. Now whenever you want to open a new tab next to your current tab, you can do this:
  1. Move the keyboard focus to the address bar (Ctrl-L or Cmd-L).
  2. The entire current address should be highlighted, but if not, highlight it all (Ctrl-A or Cmd-A).
  3. Type the keyword you chose in step 5 above -- e.g., tt -- and hit Enter or Return.
Once you get used to doing this, you'll be able to do it very quickly: Cmd-L tt Enter

The new tab will open immediately to the right of your current tab. Your current tab will not be affected except that the URL might have disappeared from the address bar; if you want to see the URL again, just reload the page hit the ESC key (thanks lehrblogger for your tip!). If you ever want to open a new tab at the far right of the address bar, use Chrome's default new tab keystroke (Ctrl-T or Cmd-T).

If you know of a better method for opening a new tab next to your current tab, please tell me by comment or email!

25 August, 2011

red lentils with tomato and spinach



I made red lentils with tomato and spinach for dinner! Yes, from an actual recipe! I even had all the ingredients on hand except that I used chard instead of baby spinach.

It was sufficiently edible. Cooking it was very easy, and was only briefly interrupted by me dropping a wine glass on the floor directly under my heel that I was in the process of lowering to said floor. I used spare pieces of chard to mop up the small drops of blood.

I ate half of the meal and left the rest for tomorrow's lunch. Kissy helped me clean the saucepan.


[Recipe from stonesoup virtual cookery school.]

21 August, 2011

Brisbane BCC waste vouchers

I have the standard rate-payer's set of Brisbane City Council waste vouchers for ewaste, green waste, and general waste. Traditionally, I keep them in a kitchen drawer until a fortnight before expiry and then stuff them in my neighbour's letterbox in the hope that they'll be used by a family of four who have overflowing rubbish bins every single damn week. However, I have recently started keeping foodstuffs in my kitchen drawers so I need to do something more experimental with this year's vouchers.

So, who wants them? They expire on 31 July 2012 so there's no hurry to claim some. I'll probably repost this on 31 June 2012 if there's any left. (BTW, we need a metric calendar system.)

When meeting the lucky winner(s) to present them with their vouchers, I reserve the right to hand over a small stash of my own ewaste. :)


(And for the pendantic among us, which includes me, yes I KNOW the title contains a tautology. "BCC" with no context doesn't immediately bring "Brisbane" to mind [an important consideration for a post that is viewable around the world], and "Brisbane City Council" is too long to make an efficient title, and "Brisbane CC" is so little used it doesn't invoke any meaning.)