fork download
  1. {
  2. "name": "DoGoogle(No offical)",
  3. "author": "Yakitori@2016",
  4. "version": "0.1",
  5. "description": "選択された文字列をGoogleにかけます。(非公式版)",
  6. "background": {
  7. "scripts": ["background.js"],
  8. "persistent": false
  9. },
  10. "permissions": ["contextMenus"]
  11. }
  12. //////////////////
  13. browser.contextMenus.create({
  14.  
  15. id: 'DoGoogle_Tab',
  16.  
  17. title: 'ToGoogle:"%s"', //%s は選択している文字列で置き換わる
  18.  
  19. contexts: ['selection'], //選択しているときのみメニューに表示される
  20.  
  21. onclick: (info, tab)=>{ //クリックされた際のアクション
  22. var G = "http://www.google.com/search?q="
  23. var S = info.selectionText;
  24.  
  25. S = encodeURIComponent(S);
  26.  
  27. browser.tabs.create({"url": G+S });
  28. }
  29.  
  30. });
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty