A Chrome extension that enhances Google Ads keyword management by streamlining match type formatting, negative keyword handling, and bulk editing—all directly within the Google Ads interface.
- 🎯 Apply match types (Exact, Phrase, Broad) to keywords (primarily via popup).
- 📋 Bulk format multiple keywords at once using the extension popup.
- ✨ Highlight-to-Keyword: Enable a toggle in the popup to automatically capture selected text on Google Ads pages and add it to your keyword list.
- 🖍️ On-Page Highlighting: When enabled, automatically highlights your saved keywords on Google Ads pages.
- 🎨 Clean, modern UI that integrates with Google Ads and a user-friendly popup.
- 📋 Copy formatted keywords to clipboard (individually or all).
- 🧹 Clear keyword history easily.
- Clone this repository or download the ZIP file.
- Open Chrome and navigate to
chrome://extensions/. - Enable "Developer mode" in the top right.
- Click "Load unpacked" and select the
rocketmatchdirectory (the root directory of this project).
- Highlight-to-Keyword & On-Page Highlighting:
- Open the RocketMatch extension popup by clicking its icon in the browser toolbar.
- Enable the "Enable highlight-to-keyword" toggle.
- Now, when you select text on any
ads.google.compage, it will be automatically processed and added to your keyword list in the popup (viewable when you next open it). - Your existing saved keywords will also be highlighted directly on Google Ads pages.
- Click the RocketMatch extension icon in your browser toolbar to open the popup.
- Enter multiple keywords (one per line) in the text area. If "Highlight-to-keyword" is enabled, text you recently selected on a Google Ads page might already be populated here.
- Select your desired default match type(s) (Exact, Phrase, Broad) using the checkboxes. These selections are saved for future use.
- Click "Format Keywords". The keywords will be processed according to your selected match types and displayed in the "Previous Keywords" list.
- Use "Copy All" to copy the entire formatted list to your clipboard, or use the individual copy/delete buttons next to each keyword.
- Use "Clear History" to remove all keywords from the list and from storage.
The extension is built using:
- Chrome Extension Manifest V3
- Modern JavaScript (ES6+)
- CSS3 for styling (via
styles.css) - Chrome Storage API (
chrome.storage.local) for persisting settings and keywords.
rocketmatch/
├── manifest.json # Extension configuration: permissions, scripts, popup, etc.
├── js/
│ ├── background.js # Background service worker: handles core logic, events, and state management.
│ ├── content.js # Content script: interacts with Google Ads pages (DOM manipulation, event listening).
│ ├── popup.js # JavaScript logic for the popup interface (formatting, UI updates, storage interaction).
│ └── utils.js # Shared utility functions for formatting, URL checking, etc.
├── popup.html # HTML structure for the extension's popup.
├── styles.css # CSS styles for both the content script UI (page highlights) and the popup.
└── icons/
├── icon16.png # 16x16 icon
├── icon48.png # 48x48 icon
└── icon128.png # 128x128 icon
(Note: The project structure has been updated to reflect current files and usage, including the active js/utils.js for shared helper functions.)
manifest.json: Defines the extension's capabilities, permissions, and entry points (background script, content scripts, popup page). It declares which scripts run where and what browser features the extension can access.js/background.js: Acts as the central nervous system. It runs persistently (as a service worker) and listens for browser events (like tab updates, extension installation, messages from other scripts, context menu clicks). It manages global state (like theenableHighlightToKeywordtoggle status and the list ofsavedKeywordsviachrome.storage.local) and coordinates actions. For example, it handles the actual saving of highlighted text and keywords. It imports and uses shared functions fromjs/utils.js.js/content.js: Injected into Google Ads pages (ads.google.com). It can directly interact with the page's DOM. Its responsibilities include:- Listening for mouse events to capture user-selected text when the "highlight-to-keyword" feature is enabled.
- Sending captured text to
background.jsfor processing. - Highlighting keywords on the page based on the
savedKeywordslist fromchrome.storageif the feature is enabled. It utilizes helper functions fromRocketMatchUtils(provided byjs/utils.js).
popup.html&js/popup.js: Define the UI and functionality of the extension's popup window that appears when the user clicks the extension icon.popup.html: The HTML structure.js/popup.js: Handles user interactions within the popup, such as inputting keywords, selecting match types, triggering formatting, copying keywords, and managing the display of the keyword list. It communicates withchrome.storage.localto load and save settings (like default match types, the keyword list, and the highlight toggle state) and the currently highlighted text for the input field. It also uses utility functions fromRocketMatchUtils(provided byjs/utils.js).
js/utils.js: A utility script providing shared helper functions (e.g., keyword formatting, URL checking, DOM helpers) used bybackground.js,content.js, andpopup.jsunder theRocketMatchUtilsnamespace.styles.css: Contains all CSS rules for styling both the UI elements injected bycontent.jsinto web pages (like page highlights) and all elements withinpopup.html.
Communication:
- Content scripts, popup scripts, and the background script communicate via message passing (
chrome.runtime.sendMessage,chrome.runtime.onMessage) for immediate actions. - Persistent state and shared data (e.g., saved keywords, user settings) are managed through
chrome.storage.local, which all parts of the extension can access.chrome.storage.onChangedlisteners are used to react to data changes.
- Constants: Defined in
background.js,content.js, andpopup.jsfor UI selectors, storage keys, and message types to improve readability and maintainability. - Class-Based Structure: Logic in
content.js(viaRocketMatchContentclass) andpopup.js(viaKeywordFormatterclass) is organized into classes.background.jshas been refactored for better modularity with named handlers and clear sections. - Separation of Concerns:
- JavaScript logic is separated from HTML structure and CSS styling.
- Within JavaScript files, distinct responsibilities (e.g., DOM manipulation, event handling, storage interaction, UI rendering) are grouped into separate methods or sections.
- Centralized Styling: All CSS is managed in
styles.css. Inline styles in HTML (popup.html) have been removed, and inline styles in JavaScript (popup.js) have been replaced with CSS classes. - Event-Driven Architecture: The extension heavily relies on browser events and storage change events to trigger actions and keep different parts synchronized.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a PullRequest.
Distributed under the MIT License. See LICENSE file for more information (if a LICENSE file is present, otherwise assume MIT).
For issues and feature requests, please create an issue in the GitHub repository.