This is a scaffold for Chrome Extension development using Angular framework.
- Update name and description with your desire in
src/chrome-extension/manifest.json
. - Search and replace all the text "angular-chrome-extension-scaffold" with your desired name.
- Install
pnpm
if not yet. Runpnpm install
. - For development, run
pnpm run watch-angular
andpnpm run watch-chrome-extension-webpack
. - The built files are in the
dist
folder.
To build for production, run pnpm run build-prod
.
There are basically 2 builds:
- One is for building Manifest file, Background script, Content scripts (they are in
src/chrome-extension
folder, the folder also contains some Popup and Options files, but are just for redirecting to Angular builtindex.html
); - The second one is for building Popup page and Options page (Angular code).
Folders you should care for development:
src/chrome-extension
folder:manifest.json
: the Manifest file.background.ts
: the Background script.content-script.ts/.css
: the Content scripts.- In
.ts
files, you can onlyimport
order things (interfaces, enums, etc.) from this folder or inapp/shared
. To be able to import from more, edit in the[ts-loader include section]
inchrome-extension-webpack.config.js
.
app/extension-popup
folder: the Popup page.app/extension-options
folder: the Options page.app/shared
folder: contains common code shared between 2 mentions builds above.