Giter Site home page Giter Site logo

cezaraugusto / extension.js Goto Github PK

View Code? Open in Web Editor NEW
3.4K 17.0 79.0 4.06 MB

๐Ÿงฉ Plug-and-play, zero-config, cross-browser extension development tool.

Home Page: https://extension.js.org

License: MIT License

JavaScript 13.43% HTML 2.71% CSS 3.40% TypeScript 80.04% Vue 0.42%
webextensions webextension browser-extensions browser-extension extensions extension chrome firefox edge safari

extension.js's Introduction

Extension.js npm fossa workflow downloads PR's welcome

Make it very easy to develop cross-browser extensions.

Extension.js with all the browser runners open

Logo

Create cross-browser extensions with no build configuration.

Extension.js is a plug-and-play, zero-config, cross-browser extension development tool with built-in support for TypeScript, WebAssembly, and modern JavaScript.

Create A New Extension

npx extension create my-extension
cd my-extension
npm run dev

A new browser instance will open up with your extension ready for development.

You are done. Time to hack on your extension!

create-a-new-extension.mp4

Web Standards and Modern JavaScript Support

For a preview of extensions running these technologies, see documentation about Templates.

ESNext
โœ…
TypeScript
โœ…
WASM
โœ…
React
โœ…
Vue
โœ…
Angular
๐Ÿ‘‹
Svelte
๐Ÿ‘‹
Solid
๐Ÿ‘‹
Preact
๐Ÿ‘‹

๐Ÿ‘‹ = PR Welcome!

Get Started Immediately

Use Chrome to start developing an extension from Chrome Extension Samples

See the example below where we request the sample page-redder from Google Chrome Extension Samples.

npx extension dev https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/functional-samples/sample.page-redder --browser=edge
chrome-extension-sample-page-redder-on-edge.mp4
๐Ÿ”ฅ Use Edge to start developing an extension from Chrome Extension Samples

See the example below where we request the sample magic8ball from from Google Chrome Extension Samples with Edge as the runtime browser.

npx extension dev https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/api-samples/topSites/magic8ball --browser=edge
chrome-extension-sample-magic8ball-on-edge.mp4
๐Ÿ”ฅ๐Ÿ”ฅ Use Edge to start developing a Mozilla Add-On from MDN WebExtensions Examples

See the example below where we request the sample Apply CSS from MDN WebExtensions Examples using Edge as the runtime browser.

npx extension dev https://github.com/mdn/webextensions-examples/tree/main/apply-css --browser=edge --polyfill=true
mdn-webextensions-examples-apply-css-on-edge.mp4
๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ Use Chrome and Firefox to start developing a Mozilla Add-On from MDN WebExtensions Examples

See the example below where we request the sample firefox-code-search from MDN WebExtensions Examples using Chrome and Firefox as the runtime browsers.

npx extension dev https://github.com/mdn/webextensions-examples/tree/main/firefox-code-search --browser=chrome,firefox --polyfill=true
mdn-webextensions-examples-firefox-code-search-on-chrome-and-firefox.mp4

I have An Extension

usage-with-an-existing-extension.mp4

If you have an existing extension which is using a package manager, you can install the Extension.js package and manually create the scripts used to run your extension. See the demo above or follow these instructions to get it done:

Step 1 - Install extension as a devDependency

npm install extension --save-dev

Step 2 - Link your npm scripts with the executable Extension.js commands

{
  "scripts": {
    "build": "extension build",
    "dev": "extension dev",
    "start": "extension start",
  },
  "devDependencies": {
    // ...other dependencies
    "extension": "latest",
  },
}

Done. You are all set!

  • To develop the extension, run npm run dev.
  • To visualize the extension in production mode, run npm run start.
  • To build the extension in production mode, run npm run build.

Using a specific browser for development

Desktop Browsers

Arc
โ˜‘๏ธ
Brave
โ˜‘๏ธ
Chrome
โœ…
Chromium
โ˜‘๏ธ
Edge
โœ…
Firefox
โœ…
Opera
โ˜‘๏ธ
Safari
โ›”๏ธ
Vivaldi
โ˜‘๏ธ

โ˜‘๏ธ = It is theoretically possible to load all Chromium forks given the current support for Chrome. There is a request ticket for supporting all Chromium-based browsers. Most requested features are added first, so thumbs up it to speed-up the development process.

Mobile Browsers

Firefox (Android)
โ›”๏ธ
Safari (iOS)
โ›”๏ธ

If you want to target a specific browser, just pass the --browser flag to the dev/start command (based on the list available above), like npx extension dev path/to/extension --browser=edge.

Hint Pass --browser="all" to load all available browsers at once.

extension dev --browser=all
Extension.js with all the browser runners open

License

MIT (c) Cezar Augusto.

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.