Getting Started with InjectJS

This guide will walk you through installing InjectJS, creating your first script, and exploring the community repository. The whole process takes about two minutes.

Step 1: Install the Extension

InjectJS is available as a free Chrome extension. Visit the Chrome Web Store listing and click “Add to Chrome.” No account or sign-up is required to use the core features.

Once installed, you'll see the InjectJS icon in your browser toolbar. Clicking it opens a small popup that shows any manual scripts available for the current page.

Step 2: Open the Dashboard

Navigate to injectjs.net. When the extension is installed, the site automatically detects it and redirects you to the full dashboard where you can create, edit, and manage all your scripts.

The dashboard communicates directly with the extension — there is no server involved in storing or syncing your scripts. Everything stays in your browser.

Step 3: Create Your First Script

Click the “Create Injection” button in the dashboard to open the script editor. You'll need to fill in a few fields:

Title — A name for your script. This is what you'll see in the dashboard and in the right-click context menu for manual scripts.

Match Pattern — Determines which websites your script runs on. Use Chrome match patterns like https://*.google.com/* to match all Google pages, or <all_urls> to run on every site. The Chrome documentation on match patterns has the full syntax reference.

Trigger — Choose when the script executes. “After page load” (document_end) is the most common choice and runs after the page's HTML has been parsed. “Before page load” (document_start) runs earlier, before any of the page's own scripts. “Manual” scripts only run when you trigger them from the extension popup or the right-click context menu.

Code — The JavaScript to inject. The editor supports syntax highlighting and runs ESLint in the background to catch common mistakes.

Here's a simple example script that adds a red border to every image on a page:

document.querySelectorAll('img').forEach(img => {
  img.style.border = '3px solid red';
});

Set the match pattern to <all_urls> and the trigger to “After page load,” save it, and visit any website. Every image on the page will have a red border.

Step 4: Explore the Script Repository

The InjectJS script repository contains scripts shared by the community. You can browse them by title, description, or author, and install any script with a single click.

Popular scripts include ad blockers, UI customizers, productivity tools, and site-specific automations. If you sign in with Google, you can also upvote scripts you find useful and share your own creations with the community.

Step 5: Advanced Features

Once you're comfortable with the basics, here are some additional features to explore:

Import & Export

Export all your scripts as a zip bundle from the dashboard. The bundle includes each script as a .js file plus a metadata.json file with titles, match patterns, and settings. You can import this bundle on another machine to restore your entire setup.

Document Start Scripts

Scripts with the “Before page load” trigger use Chrome's User Scripts API, which requires an additional permission. Go to chrome://extensions, find InjectJS, click “Details,” and enable the “Allow User Scripts” toggle. This is necessary for scripts that need to run before any of the page's own JavaScript executes — useful for blocking analytics, modifying globals, or intercepting network requests.

Context Menu Execution

Manual scripts appear in Chrome's right-click context menu under the InjectJS submenu. If a manual script's match pattern matches the current page, it shows up in the context menu and you can run it with a click. This is useful for scripts you want available on-demand rather than running automatically.

Smart Storage

InjectJS automatically stores small scripts (under 7KB) in Chrome Sync storage so they follow your Google profile across devices. Larger scripts are stored in local storage to avoid hitting Chrome's sync quota limits. The dashboard shows a sync icon next to each script so you can see where it's stored.