Monday, October 20, 2008

Ubiquity Command: Open in New Tab

Here is a Ubiquity script to open a link in a new tab.

open_in_new_tab.js
CmdUtils.CreateCommand({
name: "open_in_new_tab",
homepage: "http://pynej.blogspot.com/",
author: { name: "Jeremy Pyne", email: "jeremy.pyne@gmail.com"},
description: "Open the selected url in a new tab.",
takes: {"URL": noun_type_url},
preview: function( pblock, url ) {
pblock.innerHTML = "Will open: " + url.text;
},
execute: function( url ) {
Utils.openUrlInBrowser(url.text);
}
})

No comments: