Site icon NodeXperts

Create Chrome Extension in Angular

Hi Everyone, I hope you and your family are doing well. You must have realized that life would be very tough for day-to-day work life without popular chrome extensions like Adblocker, screenshot by lightshot, or VPN extension. Right? 

Being a developer, you must have thought about how they create such cool extensions? Nope don’t google it. I am here today to explain the same. I will help you to create a basic chrome extension. To begin with, you need the following tools and skills:

You need:

Let’s Start

Go to the Angular.json file and set “aot” and “assets area” to look like this

“build”: {
“builder”: “@angular-devkit/build-angular:browser”,
“options”: {
“outputPath”: “dist/ngChromeExtension”,
“index”: “src/index.html”,
“main”: “src/main.ts”,

“polyfills”: “src/polyfills.ts”,
“tsConfig”: “tsconfig.app.json”,
“aot”: true, <= // Make sure this is set to true
“assets”: [
“src/assets/favicon.ico”,
“src/assets”,
“src/manifest.json” <= // Chrome manifest goes in root directory
],

“build”: {
“builder”: “@angular-devkit/build-angular:browser”,
“options”: {
“outputPath”: “dist/ngChromeExtension”,
“index”: “src/index.html”,
“main”: “src/main.ts”,

“polyfills”: “src/polyfills.ts”,
“tsConfig”: “tsconfig.app.json”,
“aot”: true, <= // Make sure this is set to true
“assets”: [
“src/assets/favicon.ico”,
“src/assets”,
“src/manifest.json” <= // Chrome manifest goes in root directory
],

 That’s pretty cool, in my opinion! It’s a way to get interested in learning Chrome Extension internals!

Explore documentation for API reference & more developer.chrome

I will be coming up with a more complex chrome extension with my next post. Stay tuned and subscribe to never miss an update!

Happy Coding!

Exit mobile version