{"id":16769171,"url":"https://github.com/phptuts/chromeextensionstarter","last_synced_at":"2026-03-18T22:05:05.016Z","repository":{"id":87705152,"uuid":"233698217","full_name":"phptuts/ChromeExtensionStarter","owner":"phptuts","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-21T04:28:36.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-12T10:51:03.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phptuts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-01-13T21:34:11.000Z","updated_at":"2023-09-15T03:23:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae3aed61-a1a8-4181-abba-fb5948a1abeb","html_url":"https://github.com/phptuts/ChromeExtensionStarter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phptuts/ChromeExtensionStarter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phptuts%2FChromeExtensionStarter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phptuts%2FChromeExtensionStarter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phptuts%2FChromeExtensionStarter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phptuts%2FChromeExtensionStarter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phptuts","download_url":"https://codeload.github.com/phptuts/ChromeExtensionStarter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phptuts%2FChromeExtensionStarter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29464044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T01:01:38.065Z","status":"ssl_error","status_checked_at":"2026-02-15T01:01:23.809Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-13T06:13:29.870Z","updated_at":"2026-02-15T01:32:02.490Z","avatar_url":"https://github.com/phptuts.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chrome Extension Starter Kit\n\n## Setup Developement\n\n1. Download the chrome extension starter kit\n\n2. Install type hinting dependencies\n\n```\nnpm install\n```\n\n4. Go to chrome://extensions in the browser\n\n5. Turn on developer mode in the top right of the screen.\n\n6. Click on load unpacked extension\n\n## Chrome Extensions Snippets\n\n### How to register your right click icons\n\n```\nvar contextMenuItem = {\n  id: 'spendMoney',\n  title: 'SpendMoney',\n  contexts: ['selection']\n};\n\n// This should only happen once\nchrome.runtime.onInstalled.addListener(function() {\n  chrome.contextMenus.create(contextMenuItem);\n});\n```\n\n## How to respond to your own right click icon events\n\n```\nchrome.contextMenus.onClicked.addListener(function(clickedData) {\n  if (clickedData.menuItemId == 'spendMoney' \u0026\u0026 clickedData.selectionText) {\n      // Notice the id spend Money above\n  }\n});\n```\n\n### How to store data in for later\n\n```\nchrome.storage.sync.set({ example: data }, function() { });\n```\n\n### How to fetch data you stored\n\n```\nchrome.storage.sync.get(['example1', 'exampl2'], function(ex) { });\n```\n\n### How to send a simple notification\n\n```\nvar notifOptions = {\n    type: 'basic',\n    iconUrl: 'icon48.png',\n    title: 'Example!',\n    message: 'Example Message!'\n};\nchrome.notifications.create(\n    'limitNotif' + new Date().getTime(), // Id must be unique for every notification\n    notifOptions\n);\n```\n\n### How to register a content script\n\n```\n\"content_scripts\": [\n    {\n      \"js\": [\"content.js\"],\n      \"exclude_matches\": [\"*://*.youtube.com/watch*\"],\n      \"matches\": [\"https://*.youtube.com/*\"],\n      \"run_at\": \"document_end\"\n    }\n  ],\n```\n\n### How Send Message from background script to content script\n\n```\nchrome.tabs.query({ active: true, currentWindow: true }, function(tabs) {\n    chrome.tabs.sendMessage(tabs[0].id, {\n      src: clickedData.srcUrl,\n      type: 'replace_image'\n    });\n});\n```\n\n### How to recieve a message from background script to the content script\n\n```\nchrome.runtime.onMessage.addListener(function(message, sender, reply) { });\n```\n\n## Packing Chrome Extension\n\n- Delete node_modules folder we are using it for type hinting only.\n\n\n## Image Attribution\n\nIcons made by \u003ca href=\"https://www.flaticon.com/authors/freepik\" title=\"Freepik\"\u003eFreepik\u003c/a\u003e from \u003ca href=\"https://www.flaticon.com/\" title=\"Flaticon\"\u003e www.flaticon.com\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphptuts%2Fchromeextensionstarter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphptuts%2Fchromeextensionstarter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphptuts%2Fchromeextensionstarter/lists"}