Ubiquity command: insert-link · Curiosity is bliss

Curiosity is bliss    Archive    Feed    About    Search

Julien Couvreur's programming blog and more

Ubiquity command: insert-link

The 'insert-link' command let's you find and insert a url from your history.
Finding the url works just like the AwesomeBar. As you type characters, matches from your history get displayed. Then you can select which one you want to insert.

Read on for more details and to install.

Here's a screenshot of this command in action:
screenshot of the insert-link Ubiquity command

For comparison, here is a screenshot of the AwesomeBar showing the same suggestions as the 'insert-link' verb:
screenshot of the Awesome Bar


By now, the Ubiquity prompt should have appeared at the top of the page offering you to install the insert-js command.

After you install the command, open any page with a textarea, run the Ubiquity command "insert-link" and start filtering your history.


This command is based off the nsIAutoCompleteController service. The unittests in the Firefox source tree are very handy to learn how to operate that API (in this case, the examples came from firefox-3.0.1-source\mozilla\toolkit\components\places\tests\unit\test_000_frecency.js).

I must say that it is exciting to have access to the guts the browser like that. Experimentation is much easier with the command editor than writing full-fledged extensions, at least for simple things.
On the other hand, the debugging experience could be improved. I have not found how to debug commands or inspect the styling of the previews.
Also, this level of access poses a clear security risk, which will be an interesting challenge to address moving forward.


I can't believe someone *actually* made this. Totally awesome! I'm going to use this all the time when typing emails.

Posted by: Abi (August 31, 2008 11:46 PM) ______________________________________

The subscribe field for insert-list is not showing in the top of your page

Posted by: Henrik Marstrander (September 3, 2008 02:55 AM) ______________________________________

This is great! I've been desiring this command for a while now.

We really need to figure out how to do keyboard access in the preview area (or you should implement the links as a noun type).

Posted by: Aza Raskin (September 5, 2008 08:16 PM) ______________________________________

Hi Aza,
I tried implementing the links as noun type, but there are two problems doing it that way:
-suggestions have to be provided synchronously. The suggestions from the Places engine come back asynchronously.
-suggestions do not allow rich content (yet) . I need to display some text, a link and a favicon in the suggestions for this verb.

Posted by: Julien Couvreur (September 6, 2008 07:48 AM) ______________________________________

WoW - cool feature, this realy let you speed up your workflow...nice! ;-)

Posted by: Josef (September 6, 2008 10:48 AM) ______________________________________

Can we get more than 6 entries in preview pane?

Posted by: dualsighter (September 13, 2008 06:28 PM) ______________________________________

@DualSighter: you can easily modify the script to display more than 6 entries.
Another option would be to add a "show more" link at the bottom of the preview to expand the list as needed.

Posted by: Julien (September 17, 2008 01:28 PM)
comments powered by Disqus