pwnt.be

Breaking News: OpenSearch Here, Presumed Queer

While I was doing some initial refactoring on the code that handles searches through my blog posts, I added support for the OpenSearch standard. What this means is that decent browsers such as Firefox will now inform you of the presence of a custom search engine when you visit this site. Notice the blue glow on the search toolbar and bring on the oohs and aahs.

Search suggestionsUpdate: I’ve taken the liberty of adding search suggestions, as described at MDC. You should now be presented with some suggestions as you start typing in Firefox’s search toolbar. I say “should” because it doesn’t seem to be working, even though offline tests were successful. Some packet analysis confirmed that the suggestions are in fact coming through, yet Firefox adamantly refuses to display them. Any help would be appreciated, as I am at a loss.

Update: With a lot of help from biesi and gavin, I managed to figure it out: the server is just too slow to respond. Firefox’s timeout for suggestions is set to half a second, and the server generally doesn’t complete the request in that time. I’m pretty sure DreamHost’s configuration is to blame, specifically the MySQL over their LAN. Anyway, the whole ordeal did teach me a couple of things about Mozilla development:

  • Setting javascript.options.showInConsole to true in about:config directs chrome errors to the error console.

  • You can edit any JavaScript file in a nightly build’s components directory as long as you restart Firefox afterwards.

  • Calling Components.utils.reportError(String) inside chrome JavaScript logs that string to the error console.

  • The string (new Error()).stack gives you a JavaScript stack trace.

So I’m going to be keeping search suggestions around. Theoretically, there’s nothing wrong with the code, and even if it only succeeds every 100 attempts, at least it succeeded at all.

Update: Still, if you want to see it in action, you can go into your Firefox program directory, open up components/nsSearchSuggestions.js in a text editor, find the line

_suggestionTimeout: 500,

and change that number to 5000 (milliseconds) or so. That way, the request for suggestions won’t time out so fast—obviously, this will affect all search engines. When you’re done, restart Firefox and voilà.

Honestly, after this, I’m not touching this post anymore.

Post a Comment

This contraption supports Gravatar, as well as Markdown with SmartyPants. If none of that made sense to you, feel free to ignore it and start typing.

  • :)
  • :D
  • ;)
  • :-O
  • :P
  • :@
  • :$
  • :S
  • :(
  • :'(
  • :|
  • :-#
  • 8-|
  • ^o)
  • :-*
  • +o(
  • :^)
  • *-)
  • 8-)
  • |-)
Disorientation
Continuity
Tangentiality
Retributions
The HTC Desire Kicks the HTC Legend’s Ass
Tom, Tim, Tom, Tim, Tim, Tom
Google Chrome Still Sucks
smeezekitty, Tim, milosh
Automating OpenVPN Connection on Windows XP
Tim, Geb, 12vpn, Tim, neecom
Bizar Hairdressing & Beyond
Ruxi, Wim, Tim, Sarina, Lies, Lynn, erwin, Ano, Frederick, Jacqueline, Wazaaa, Tim, Rebecca, Charlie
Pidgin to Adium Emoticon Theme Converter
Tim, peter
Colophonics