Ubiquity command – findbook(更新)

上一版沒有對 uri 作 encoding,所以找中文時會出錯,現在補上,只要呼叫 Ubiquity 內建的 encodeURIComponent() 就行了…

CmdUtils.CreateCommand({
name: "findbook",
contributors: ["elleryq"],
license: "MPL",
description: "讓買書變成更簡單的決定!",
takes: {"書名關鍵字": noun_arb_text},
icon: "http://findbook.tw/favicon.ico",
execute: function(directObject) {
Utils.openUrlInBrowser( "http://findbook.tw/search?keyword_type=keyword&q=" + encodeURIComponent(directObject.text) );
}
});