Modifying Firefox's Context Menus

While I like the Firefox Web browser, there are a few things about it I’d change. For a start, I’d remove the Set As Wallpaper… context menu item. Not only do I never use it, I’d rather not have the option of invoking it by accident. Fortunately, it’s not too hard to change Firefox’s context menus.


I successfully applied this instruction in removing the Send Link… and Send Image… items in addition to the Set As Wallpaper… item mentioned above. After switching to web-based Gmail as my main e-mail client, mistakenly selecting the Send… items became a real nuisance as they triggered loading Thunderbird.

And now that I’ve done that, I discovered WebmailCompose, which promises to make those items work with webmail such as GMail. Well, I’ll be trying that next… Update: Nope, it doesn’t work with Firefox 2.0 despite that the extensions page claims compatibility with upto 3.0a1. A 1.5 compatible version is available at Jed Brown’s site, but even with that the compatibility issue with 2.0 is not the simple one of replacing the version string inside install.rdf

(Finnish Firefox note: Yritin etsiä suomenkielisen Firefoxini valikon sisältöä, mutta sitä ei löytänyt yllättäen edes fi.jar-paketin sisällä olevista tiedostoista. Raakasin sitten vain kylmästi sopivalta kuulostavat kohdat browser.xul:sta (browser.jar-paketin sisältä) muistelemalla niiden englanninkielisiä nimiä, ja näkyy toimivan.)

MPAA Lobbying for Home Theater Regulations

The MPAA is lobbying congress to push through a new bill that would make unauthorized home theaters illegal. [MPAA head Dan Glickman says] Just because you buy a DVD to watch at home doesn’t give you the right to invite friends over to watch it too.

BBspot via Vlk

I damn near fell for it. That’s probably because it’s not so far-fetched that the MPAA would actually do such a thing.

Nokia kierrättää WWF:n hyväksi

“Nokia lahjoittaa 2 € WWF:n ilmastotyön tukemiseen jokaisesta […] kierrätyskuoressa palautetusta Nokia-matkapuhelimesta ja -lisälaitteesta.

Näin se toimii:

  • Sujauta vanhat Nokia-matkapuhelimesi ja -lisälaitteesi kuoreen
  • Pane kuori postilaatikkoon, postimaksu on jo maksettu
  • WWF:n ilmastotyö saa Nokialta 2 €:n lahjoituksen per puhelin tai lisälaite”

Nokia via Vlk

WordPress and JavaScript links: use Text Control!

When writing the previous post, WordPress was seriously trying to prevent me from publishing a link with ‘javascript’ as its protocol (<a href=”javascript:the actual JavaScript was here“>…</a>). As publishing that link was, kinda, the point of the post, I had to make it work.

WordPress Codex’s Using Javascript told me to try a plugin called Text Control, so I installed it, and with No Formatting and No Character Encoding selected, the JavaScript link came to life.

Improving blosxom's bookmarklet for wikieditish

Tatsuhiko Miyagawa’s bookmarklet is a plugin for use with another Blosxom plugin, wikieditish. I’m relying heavily on the tiny bit of javascript provided by the bookmarklet on my linkblog, and came up with a small improvement.

The script already (at v.0.03) picks up any selection made by the user, and uses that for a title.
0){void(‘$blosxom::url’+path+’.wikieditish?bookmarklet=1&title=’+escape(d.title)+’&url=’+escape(d.location.href)+’&quote=’+escape(t),’_blank’,”))};”>My version uses the same data to fill in the prompt for entry path with a reasonable default; it is converted to lowercase and then all the whitespaces are replaced with dashes. The resulting path resembles that of WordPress’ so-called Pretty permalinks.

JavaScript string replace, every instance. No, every fucking instance!

If you wish to replace all instances of “foo” with “bar” in yourString using JavaScript, here’s how you do it:

yourNewstring = yourString.replace(/foo/g,"bar");

How’s that for elegance, simplicity and readability?

Fucking JavaScript.

Note that foo’s really just foo, no quotes or nothing even if it has whitespace in it – it’s treated as a so called regular expression and not a variable, because of the slashes surrounding it.

Every time I’m writing JavaScript it feels like drinking tar, and to make matters worse it seems that good, easy access JavaScript documentation online is sparse.

The title is a slightly formatted version of a search I ended up trying in frustration, desperately seeking the answer to how to do just that: replace every instance of substring with another in a given string. It sounded like a simple enough task to do, and as it turned out, it was relatively so, at least compared to how incredibly difficult it seems to be to articulate it, judging by the poor results my other, more targeted and not-so-desperate searches gave me.

Fixing the Feeling Lucky extension for FF 2.0

Brad Kowalczyk’s Feeling Lucky extension…

“Performs Google’s ‘I’m Feeling Lucky’ search with any selected text and opens the result in new a tab.

This is the first ever Firefox extension that I’ve created. I found myself selecting, copying, pasting text into the location bar to do an ‘I’m Feeling Lucky’ search all too often so I figured I should make an extension to make it just a little simpler.

Simply select some text and either hit ‘Enter’ or right-click it and select ‘Feeling Lucky’ The web page of the first Google search result for that text will open in a new tab.”


I felt I needed this, but it wasn’t FF 2.0 compatible, so I fixed it. Apparently, the only thing needed for that was replacing a call to gContextMenu.searchSelected() in feelingLucky.xul with a call to getBrowserSelection(). In addition to that, the em:maxVersion in install.rdf needs to be set for 2.0, naturally.

I’ve packed one fixed version of this, but I haven’t tested it (too lazy). Try it at your own risk.

Sonyn digikameroissa valmistusvirhe

“Tietoomme on äskettäin tullut, että rajallinen määrä tuotteita joissa on CCD-kenno joka on valmistettu lokakuun 2002 ja maaliskuun 2004 välillä, saattavat sisältää seuraavan ongelman: Kun tuotetta käytetään kuvaustilassa, LCD-näyttö tai etsin saattaa näyttää joko vääristyneen kuvan tai ei kuvaa ollenkaan.

Tämä ongelma esiintyy vain pienessä osassa tuotteita. Asiakastyytyväisyyden takaamiseksi Sony on päättänyt tarjota veloituksettoman huollon kyseisten tuotteiden omistajille, jos edellä mainittu ongelma ilmenee ja johtuu CCD-kennosta.”

Sony via

Tällä kertaa en ihmettele, ettei HS:n jutussa ollut linkkejä: listat still-kameroista, videokameroista ja ammattikameroista, joita ongelma koskee, olivat vähän turhan monen mutkan takana Sonyn sivuilla. Lisäksi ongelma koskee Clié PEG-NZ 90 -PDA:ta.