• Stars
    star
    3,403
  • Rank 13,012 (Top 0.3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🧩 Plug-and-play, zero-config, cross-browser extension development tool.

This project is under active development. Does not work on Windows yet.

extension-create workflow npm wip

Logo

Create modern cross-browser extensions with no build configuration.

extension-create helps you develop cross-browser extensions with built-in support for module imports/exports, auto-reload, and more. Interested to know how it's being developed? Every week I send emails about its progress. For goals, see the wiki.

Creating an Extension

npx extension-create my-extension-hello
cd my-extension-hello
npm start

A new browser instance (for now, Chrome) will open up with your extension ready for development.

You are done. Time to hack on your extension!

npm start

Getting Started Immediately

Kickstart any sample from Chrome Extension Samples

The chrome-extensions-sample project is a great way to kickstart developing your extension.

If we go to the samples repository and look for an extension sample to work, let's say the make_page_red sample, all we need is to copy and paste it's URL as an argument for the start command:

Optimized for git version 2.30.0. Older versions are supported, but download can take much longer.

npx extension-create start https://github.com/GoogleChrome/chrome-extensions-samples/blob/main/mv2-archive/api/browserAction/make_page_red/

npm start

Will not only download the extension but also kickstart a Chrome instance in a fresh profile with your sample extension loaded and default auto-reload support. Try it yourself!

Use Microsoft Edge to kickstart any sample from chrome-extesions-sample

You read it! Just run the command above with the --browser=edge flag:

npx extension-create start --browser=edge https://github.com/GoogleChrome/chrome-extensions-samples/blob/main/mv2-archive/api/browserAction/make_page_red/

And see a Crome Extension sample running automatically. On Edge!

I have an extension

extension-create was designed to have each command/major feature working as a standalone module. This is useful if you have your extension setup but want to benefit from specific features, such as the browser launcher w/ default auto-reload support. You have two ways of doing it.

Integrate extension-create via command line or npm scripts

The first option is to just use the command line interface extension-create provides and add it to your npm scripts. Assuming you want your extension to run the start command (path argument can be omitted if the manifest file is on your extension root folder), here's how it should look in your package.json:

{
  // ...npm stuff,
  "scripts": {
    "start": "npx extension-create start"
  }
}

Will load your extension the same way the screenshot above demonstrates. This method is, in fact, what the standard template does when you run the create command npx extension-create <extension-name>.

Using a specific browser for development

Chrome browser logo Microsoft Edge browser logo
Google Chrome βœ… Microsoft Edge βœ…

If you want to target a specific browser, just pass the --browser flag to the start command (Chrome or Edge, soon others), like npx extension-create start --browser=edge.

That's it!

Hint: pass all instead of edge as an argument to load both Edge and Chrome at the same time!

What's next?

See the Wiki for stable updates and future project roadmap. If you're interested in the latest news, I write weekly about this project development at https://cezaraugusto.substack.com.

License

MIT (c) Cezar Augusto.

More Repositories

1

You-Dont-Know-JS

πŸ“—πŸ“’ (PT-Br translation) JS Book Series.
JavaScript
5,505
star
2

github-template-guidelines

Guidelines for building GitHub templates.
226
star
3

mklicense

CLI tool for generating Licenses. Easily.
JavaScript
184
star
4

browser-extensions-book

The free book `Browser Extensions book`, by yours truly. Momentarily stale.
104
star
5

webpack-run-chrome-extension

Run your extension on Google Chrome with default auto-reload support for file changes.
TypeScript
35
star
6

curated-service-worker-list

βœ¨πŸ‘¨ A curated Service Worker's list
21
star
7

vscode-chrome-extension-manifest-json-schema

An extension to finally bring support for Chrome Extensions Manifest JSON schemas into Visual Studio Code
JavaScript
14
star
8

cezaraugusto.com

Interwebs presence of yours truly.
HTML
12
star
9

go-git-it

Download any repository or subdirectory on GitHub with support for Node.js and the CLI.
TypeScript
12
star
10

webpack-browser-extension-polyfill

webpack plugin to develop cross-browser extensions and Mozilla Add-Ons.
TypeScript
6
star
11

log-md

console.log with Markdown support for CLI.
JavaScript
5
star
12

node-module-quick-start

Template for new Node modules.
JavaScript
4
star
13

chromium-edge-launcher

Launch Microsoft Edge with ease from Node.js.
TypeScript
4
star
14

chrome-extension-manifest-json-schema

Chrome extension manifest JSON schemas (V2 and V3) with support for Node.js
JavaScript
4
star
15

webpack-run-edge-extension

Run and build your extension on Microsoft Edge with default auto-reload support for file changes.
JavaScript
3
star
16

emptykit.css

Specific CSS reset for Webkit/Chromium-based apps.
CSS
3
star
17

eslint-config-auditor

Shareable ESLint Config to help you write clear, efficient JavaScript code.
JavaScript
3
star
18

universo

Universo VSCode Theme
2
star
19

get-working-image-url

Helper module to check for broken image URLs.
JavaScript
2
star
20

random-from-array

Given an array, return a random value from it.
TypeScript
2
star
21

babel-preset-modern-browser-extension

Babel preset used for creating browser extensions. Supports React and TypeScript.
TypeScript
2
star
22

brave-json

JSON files for manual testing purposes
1
star
23

extension-manifest-assets

Output file paths from fields declared in a browsser extension manifest
JavaScript
1
star
24

fancy-json-stringify

A fancy way to convert a JavaScript value to JSON.
JavaScript
1
star
25

demo-extension

Fully-featured extension for testing and demo purposes.
HTML
1
star
26

cbe-standard-template

Standard template for create-browser-extension.
JavaScript
1
star
27

cezar.land

🏰 PÑgina de links pessoais.
HTML
1
star
28

fantastico

Hassle-free, raw Webpack 4 boilerplate for a quick dev setup experience
JavaScript
1
star
29

prefers-yarn

Check whether the working directory prefers yarn over npm.
JavaScript
1
star
30

get-version-from-package

Gets you a given version from a given npm package.
JavaScript
1
star
31

chrome-location2

Approximates the current location of the Chrome browser across platforms
JavaScript
1
star
32

brave-location

Approximates the current location of the Brave browser across platforms.
JavaScript
1
star
33

.github

1
star
34

browser-extension-test-data

Several extensions for testing on Chromium/Firefox browsers.
JavaScript
1
star
35

github-partials

Download any subdirectory of a GitHub repository.
JavaScript
1
star
36

edge-location

Approximates the current location of the Edge browser across platforms.
JavaScript
1
star
37

is-browser-env

Checks whether or not the current runtime environment is a browser.
TypeScript
1
star
38

nodejs-opensourceapi

Node API Bindings to the OSI License API.
JavaScript
1
star
39

webpack-resolve-background-script

Resolve background scripts defined in manifest.json at compile time.
JavaScript
1
star