Ubiquity 升級到 0.5 了,Parser API 也升級到了 2,語法有改變,所以參考轉換指南修正了一下之前的 findbook:
CmdUtils.CreateCommand({ names: ["findbook"], contributors: ["elleryq"], license: "MPL", description: "讓買書變成更簡單的決定!", arguments: [ {role: 'object', nountype: noun_arb_text, label: '書名關鍵字'} ], icon: "http://findbook.tw/favicon.ico", execute: function(args) { Utils.openUrlInBrowser( "http://findbook.tw/search?keyword_type=keyword&q=" + encodeURIComponent(args.object.text) ); } });
如果你想入門的話,這份文件可以作為參考:Labs/Ubiquity/Ubiquity Source Tip Author Tutorial。
另外,在Ubiquity Command Editor頁面裡也有 command APIs,告訴你有哪些 API 可用。