{"id":17132834,"url":"https://github.com/maximekjaer/programmatic-injection-template","last_synced_at":"2026-05-09T01:12:43.003Z","repository":{"id":149487732,"uuid":"96550977","full_name":"MaximeKjaer/programmatic-injection-template","owner":"MaximeKjaer","description":"Setup for programmatic injection in Chrome extensions","archived":false,"fork":false,"pushed_at":"2017-07-10T15:31:22.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T11:27:43.185Z","etag":null,"topics":["browseraction","chrome","chrome-extension","programmaticinjection","setup"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaximeKjaer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-07T15:18:28.000Z","updated_at":"2023-03-29T15:03:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"63a0ee0e-605c-4c39-8919-378fc3d52d1e","html_url":"https://github.com/MaximeKjaer/programmatic-injection-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeKjaer%2Fprogrammatic-injection-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeKjaer%2Fprogrammatic-injection-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeKjaer%2Fprogrammatic-injection-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeKjaer%2Fprogrammatic-injection-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaximeKjaer","download_url":"https://codeload.github.com/MaximeKjaer/programmatic-injection-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217792,"owners_count":20579297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browseraction","chrome","chrome-extension","programmaticinjection","setup"],"created_at":"2024-10-14T19:28:31.269Z","updated_at":"2026-05-09T01:12:37.978Z","avatar_url":"https://github.com/MaximeKjaer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Programmatic injection setup for Google Chrome extensions\nThis repository contains the setup for [programmatic injection](https://developer.chrome.com/extensions/content_scripts#pi) of JS and CSS into a given page when you click on the browser action icon. It makes it easier to start coding your Chrome extension by eliminating a lot of the front setup.\n\n- Displays whether the extension is active on the current tab\n- Supports JS and CSS injection\n- You can disable and enable the content script by clicking on the browser action icon\n\n![Example of extension being enabled and disabled](https://i.imgur.com/ZcRujH4.png)\n\nThis setup is useful if you want to be able to toggle your content script on and off; if you just need to run your code every time you click on the browser action icon, you should look into this [bare minimum setup](https://gist.github.com/danharper/8364399).\n\n## Quick Start\n\n### Step 1: Fork or clone this repository\nFork this repo, and rename the repository to whatever you're developing.\n\n### Step 2: Customize the manifest file\nEnter the name of your extension, a description and many other options by editing the `manifest.json` file.\n\n### Step 3: Replace the icons\nThis repository provides a very generic icon, that you may want to replace. It comes in two version; a dark one for when the extension is active, and a greyed out version for when it's inactive.\n\nThe darker one must be provided in the following sizes:\n- 16x16px\n- 24x24px\n- 32x32px\n- 48x48px\n- 128x128px\n\nThe greyed out one can be provided just using the following sizes:\n- 16x16px\n- 24x24px\n- 32x32px\n\nIf you're changing file names, make sure you're changing the name of the icons in the `manifest.json` file as well. Make sure you're reloading the extension from `chrome://extensions` after any change to `manifest.json`.\n\n### Step 4: Write JS and CSS!\nYou can now write your content scripts! Simply edit `js/content_script.js`.\n\n- If you need to inject more than one script, you can add it to the `jsInjects` or `cssInjects` arrays in `background.js`. Make sure you add them in the correct order if you have any dependencies.\n- If you are applying styles to elements on the page, you can chose only to enable them when the body has the `extension-enabled` class, or to override them when the body has the `extension-disabled` class.\n- You can use the `enabled` variable in `content_script.js` to know whether or not to do certain things\n- If there's anything you need to hide, reset or undo when the content script is disabled, you can do it at the commented lines in `content_script.js`\n\n## Local development\nYou can install the unpackaged extension from the source code by opening a new tab and typing `chrome://extensions`. You'll need to activate the developer mode, click on \"Load unpacked extension...\" and select the source folder.\n\nIf you modify `manifest.json` while the unpacked extension is installed, you'll have to reload it from `chrome://extensions`.\n\nPlease note that installing extensions this way is suitable for development purposes only; since Chrome 34 (2014), a warning popup will be displayed at every startup of the browser (to the [annoyance of every developer in the world](https://bugs.chromium.org/p/chromium/issues/detail?id=337734#c4)). The only way ([almost](https://stackoverflow.com/questions/23055651/disable-developer-mode-extensions-pop-up-in-chrome/38011386#38011386)) not to get the popup is to publish and install the extension through the Chrome Webstore.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximekjaer%2Fprogrammatic-injection-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximekjaer%2Fprogrammatic-injection-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximekjaer%2Fprogrammatic-injection-template/lists"}