Skip to content
Chethan Yadav
Work

Engineering/2022/Active

Google Word Lookup Extension

A simple extension that allows you to navigate to the Google page of any word you highlight.

JavaScript

Overview

This is a minimal Manifest V3 Chrome extension (internally named Text-to-Google in its manifest) that adds a right-click "Search on Google" entry to the browser's context menu. Select any text on a page, right-click, and it opens a new tab with a Google search for that selection. The entire implementation is a single background service worker — no content script, popup, or options page.

Key Features

  • Context-menu integration — registers a "Search on Google" item that appears only when text is selected (contexts: ["selection"]), via the chrome.contextMenus API
  • New-tab search — builds the query URL directly from the highlighted text (https://www.google.com/search?q=<selection>) and opens it with chrome.tabs.create, leaving the current tab untouched
  • Minimal permissions — the manifest requests only contextMenus and tabs; no host permissions or content-script injection

Installation

The extension isn't published to the Chrome Web Store — install it unpacked:

git clone https://github.com/chethanyadav456/Google-Extension.git
  1. Open chrome://extensions in Chrome (or another Chromium-based browser)
  2. Enable Developer mode
  3. Click Load unpacked and select the cloned Google-Extension folder
  4. Highlight any text on a page, right-click, and choose Search on Google

View on GitHub ↗