Git Product home page Git Product logo

Comments (1)

ordehi avatar ordehi commented on August 19, 2024

This is an old question but, in case anyone on the web starts using this and has the same question, here's what to do.

You need to add a file named options.html to the dist/ folder, then declare that as the options_page in the manifest.json file on the same folder.

As Google's docs put it:

{
  "name": "My extension",
  ...
  "options_page": "options.html",
  ...
}

Then, you also need to add an options.tsx file to the src/ui/ folder, then edit the webpack.config.js so that the entry object includes this file:

  entry: {
    content: './src/app/content.ts',
    background: './src/app/background.ts',
    popup: './src/ui/popup.tsx',
    options: './src/ui/options.tsx',
  },

Some observations:

  • You'll want to make sure your options.html file links to options.js.
  • If you want a separate stylesheet for options, create it under src/styles/, then link it to the options.html and make sure the options.tsx file imports it:

import '../styles/options.css';

For more on this read Webpack's docs on Configuration.

from chrome-extension-boilerplate.

Related Issues (3)

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.