1
morgan1freeman OP main.js
```javascript chrome.contextMenus.create({ title: "Search Google for '%s'", contexts: ["selection"], onclick: function(info, tab) { chrome.tabs.create({ url: "https://www.google.com/search?q=" + encodeURIComponent(info.selectionText) }) } }); ``` manifest.json ```json { "manifest_version": 2, "name": "Right Click Search Google", "version": "1.0", "description": "Search selected text on Google with just a right-click.", "permissions": [ "contextMenus" ], "background": { "scripts": ["main.js"], "persistent": true } } ``` popup.html ```html <!doctype html> <html> <head> <title>Right Click Search Google</title> </head> <body> <h1>Right Click Search Google</h1> <p>This plugin allows you to search selected text on Google with just a right-click.</p> </body> </html> ``` |