Giter VIP home page Giter VIP logo

chrome-extension-starter's Introduction

Chrome Extension Starter

Chrome Extension Starter Logo

Chrome Extension starter using Nx workspace and Angular.

๐Ÿ“– Table of Contents

โœจ Features

โœ… Nx Workspace

โœ… Angular

โœ… Typescript

โœ… Chrome Types

โœ… Live Reload

โœ… Very Fast Build

โœ… All In One Command

โœ… Support Manifest V3

โœ… Popup Page

โœ… Options Page

โœ… Devtools Panel

โœ… Background Script

โœ… Content Script

๐ŸŽฏ Prerequisites

  • Node.js (>= 16 required)
  • npm package manager (>= 8 required)
  • Chrome

๐Ÿš€ Getting Started

  1. Install dependencies
npm i
  1. Run development live reload
npm run start:dev
  1. Open Chrome browser
  2. Go to this url: chrome://extensions
  3. Click on "Developer mode"
  4. Click on "Load unpacked"
  5. Choose the extension directory from this root directory
  6. Yay, you did it! ๐Ÿ˜
  7. Now update the code as you want! ๐Ÿ˜›

โ„น๏ธ More info about developing Chrome extension can be found here

๐Ÿ— Project Structure

So the purpose is to take the advantage of the type system of TypeScript and to use the power of Nx workspace to create multiple applications with the powerful framework Angular!

So we have 3 applications:

  1. Popup (apps/popup) - used for the upper popup
  2. Options (apps/options) - used for the options page
  3. DevTools Panel (apps/devtools-panel) - used for the devtools panel

In every Chrome extension we have background script that communicate with the content scripts, which can be found in apps/scripts/background/src/main.ts.

We are also can inject content script which can be found in apps/scripts/content/src/main.ts.

All the applications have already the Chrome types so can just use chrome and the editor will recognize it.

๐Ÿ•น Commands

Start with development configuration

npm run start:dev

Start with production configuration.

npm run start:prod

Build with development configuration.

npm run build:dev

Build with production configuration.

npm run build:prod

๐Ÿ“ฆ Release

I recommend making the release automatic with GitHub actions or other ci service.

  • Bump the version number in manifest.json
  • Create a git tag containing the version you are releasing using git tag -a <version>
  • Run npm run build:prod
  • Create zip file from the extension directory
  • Upload the zip to the Chrome developer dashboard

๐Ÿ“œ License

MIT

chrome-extension-starter's People

Contributors

avivharuzi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.