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

Installation


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.

Internals


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.

Posted by Julien on August 31, 2008. Permalink
Comments
comments powered by Disqus

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 at August 31, 2008 11:46 PM

The subscribe field for insert-list is not showing in the top of your page
http://blog.monstuff.com/archives/000343.html

Posted by: Henrik Marstrander at 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 at 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 at September 6, 2008 07:48 AM

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

Posted by: Josef at September 6, 2008 10:48 AM

Can we get more than 6 entries in preview pane?

Posted by: dualsighter at 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 at September 17, 2008 01:28 PM
Trackbacks