Code Monkey home page Code Monkey logo

mv3-vue-chrome-extension-template's Introduction

mv3-vue-chrome-extension-template

chrome-extension development template with firebase

Support

  • Chrome Extension
  • Manifest V3
  • Vue3
  • Typescript
  • Hot Reload
  • Firebase Authentication

Quick Start

Install

git clone https://github.com/munron/mv3-vue-chrome-extension-template.git
cd mv3-vue-chrome-extension-template
npm install
npm run build
mv .env.sample .env

Fix Extension ID

Open chrome://extensions

Click Pack Extension

Click Browse and select dist folder

dist.crx and dist.pem are generated.

Edit .env

Copy private key from dist.pem and paste to VUE_APP_MV3_KEY

VUE_APP_FIREBASE_APIKEY=XXXXXXXX
VUE_APP_FIREBASE_AUTHDOMAIN=XXXXXXXX
VUE_APP_FIREBASE_PROJECTID=XXXXXXXX
VUE_APP_FIREBASE_STORAGEBUCKET=XXXXXXXX
VUE_APP_FIREBASE_MESSAGINGSENDERID=XXXXXXXX
VUE_APP_FIREBASE_APPID=XXXXXXXX
VUE_APP_MEASUREMENTID=XXXXXXXX
VUE_APP_OAUTH2_CLIENT_ID=XXXXXXXX
VUE_APP_MV3_KEY="-----BEGIN PRIVATE KEY-----\nXXXXX.....XXXXXX\n....\nXXXXXX.....XXXXXXX\n-----END PRIVATE KEY-----"

Setup Firebase

Create New Project

https://console.firebase.google.com

Copy Firebase Configuration to .env

const firebaseConfig = {
   apiKey: "XXX",
   authDomain: "XXX",
   projectId: "XXX",
   storageBucket: "XXX",
   messagingSenderId: "XXX",
   appId: "XXX",
   measurementId: "XXX"
};

Add Google to Sign-in provider

Build → Authentication → Sign-in method → Google → Save

Add domain

Build → Authentication → Settings → Add domain
domain: chrome-extension://{Chrome Extension ID}

Setup Google Cloud Platform

Open API&Service → Credential → +CREATE CREDENTIALS → OAuth Client ID

Select Chrome App, fill Name and Application ID (Chrome Extension ID)

Edit .env.

Copy Your Client Id to VUE_APP_OAUTH2_CLIENT_ID

Edit rollup.config.js.

Uncomment oauth2 settings.

chromeExtension({
  extendManifest: {
    "oauth2": {
      "client_id": process.envVUE_APP_OAUTH2_CLIENT_ID,
      "scopes": [
        "https://www.googleapis.com/authuserinfo.email",
        "https://www.googleapis.com/authuserinfo.profile"
      ]
    },
    "key": process.env.VUE_APP_MV3_KEY
  }
}),

Build

npm run build

Hot reload

npm run dev

mv3-vue-chrome-extension-template's People

Contributors

munron avatar karukenert 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.