新增加的FireFox Ubiquity指令:books、k+與en2zh

又增加幾個Ubiquity指令,能處理下列功能:

  • 博客來關鍵字搜尋,如:books 德川家康
  • Yahoo!知識+搜尋,如:k+ Twitter
  • 將目前網頁翻譯為中文,使用Google的翻譯功能將英文網頁翻譯為繁體中文,如:en2zh

 

下載資訊:

增加的程式碼:

  1. CmdUtils.CreateCommand({
  2. name: "books",
  3. author: { name: "emisjerry"},
  4. contributors: ["emisjerry"],
  5. license: "GPL",
  6. description: "博客來關鍵字搜尋",
  7. takes: {"要查詢的商品": noun_arb_text},
  8. icon: "http://www.books.com.tw/favicon.ico",
  9. execute: function(directObject) {
  10. Utils.openUrlInBrowser("http://search.books.com.tw/exep/prod_search.php?cat=all&key=" +
  11. encodeURIComponent(directObject.text));
  12. }
  13. });
  14.  
  15. CmdUtils.CreateCommand({
  16. name: "k+",
  17. author: { name: "emisjerry"},
  18. contributors: ["emisjerry"],
  19. license: "GPL",
  20. description: "Yahoo!知識+搜尋",
  21. takes: {"要搜尋的內容": noun_arb_text},
  22. icon: "http://www.books.com.tw/favicon.ico",
  23. execute: function(directObject) {
  24. Utils.openUrlInBrowser("http://tw.knowledge.yahoo.com/search/search_result?p=" +
  25. encodeURIComponent(directObject.text));
  26. }
  27. });
  28.  
  29. CmdUtils.CreateCommand({
  30. name: "en2zh",
  31. icon: "http://www.google.com/favicon.ico",
  32. description: "將目前網頁翻譯為中文",
  33. execute: function() {
  34. var word = context.focusedWindow.document.location;
  35. Utils.openUrlInBrowser( "http://translate.google.com/translate?sl=en&tl=zh-TW&hl=zh-TW&ie=UTF-8&u=" +
  36. escape(word) );
  37. },
  38. preview : function(obj){
  39. obj.innerHTML = "將目前網頁翻譯為中文";
  40. }
  41. });

您可能也會有興趣的類似文章

填寫回應

 

 

 

您可使用這些HTML標籤

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

隨機文章

  1. 方便查閱的jQuery 1.2 Cheat Sheet (1)
  2. [Misc] 無名小站的RSS失效? (2)
  3. [FireFox] 列出擴充套件 
  4. 使用WinMerge以忽略$Header$與$Id$的檔案比對方法 (2)
  5. Unicode Text-to-image 小工具 
  6. 用7-Zip Theme Manager幫7-Zip改頭換面 (5)
  7. 加入兔斯基表情圖形的網頁 (2)
  8. 幾篇值得注意的Subversion相關文章 
  9. [Tools] 跨平台的小畫家工具:mtPaint 2.30 
  10. 壓縮工具比較:7-Zip, ZipGenius, TUGZip (4)

歷史熱門文章

  1. 如何手動輸入Plurk的表情圖示? (352,022 點擊/2008-09-29)
  2. 簡單放大Plurk輸入區的方法[修訂] (86,776 點擊/2008-09-29)
  3. Plurk CSS樣式自訂修改全攻略 (82,766 點擊/2009-07-04)
  4. 啟用&關閉中華電信ZyXEL P874的無線網路連線功能的步驟[修訂] (82,381 點擊/2011-06-01)
  5. 網路升級光世代50M/3M與設定ZyXEL P874 (52,399 點擊/2011-05-28)
  6. 輕鬆學會彈指神功-揭露AutoHotkey絕技 (42,810 點擊/2008-04-10)
  7. iPad新手入門技巧 (39,992 點擊/2011-02-05)
  8. 分享世博台灣館主題曲『台灣的心跳聲』MV(附歌詞+下載連結+新歌詞) (38,040 點擊/2010-04-27)
  9. 把HTC Touch HD操作介面換成Spb Mobile Shell,美觀又便利! (37,863 點擊/2009-02-18)
  10. 另一套適用手機的影片轉檔工具:WinAVI 3GP/MP4/PSP/iPod Video Converter (35,795 點擊/2009-04-18)