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
pnpmif not yet. Runpnpm install. - For development, run
pnpm run watch-angularandpnpm run watch-chrome-extension-webpack. - The built files are in the
distfolder.
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-extensionfolder, 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-extensionfolder:manifest.json: the Manifest file.background.ts: the Background script.content-script.ts/.css: the Content scripts.- In
.tsfiles, you can onlyimportorder 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-popupfolder: the Popup page.app/extension-optionsfolder: the Options page.app/sharedfolder: contains common code shared between 2 mentions builds above.