All Projects → webextension-toolbox → Webextension Toolbox

webextension-toolbox / Webextension Toolbox

Licence: mit
Small CLI toolbox for cross-browser WebExtension development

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Webextension Toolbox

Mue
Fast, open and free-to-use new tab page for modern browsers
Stars: ✭ 56 (-84.66%)
Mutual labels:  edge, chrome-extension, chrome, firefox, firefox-extension, opera-extension
Floccus
☁️ Sync your bookmarks privately across browsers
Stars: ✭ 2,630 (+620.55%)
Mutual labels:  chrome-extension, chrome, firefox, firefox-extension, webextension, edge-extension
page-shadow
A Chrome, Firefox, Opera and Edge extension to increase contrast, decrase brightness and invert color of websites
Stars: ✭ 14 (-96.16%)
Mutual labels:  firefox, webextension, firefox-extension, opera-extension, edge-extension
Github Mermaid Extension
A browser extension for Chrome, Opera & Firefox that adds Mermaid language support to Github
Stars: ✭ 170 (-53.42%)
Mutual labels:  chrome-extension, chrome, firefox, firefox-extension, webextension
Web Extension Starter
🖥🔋Web Extension starter to build "Write Once Run on Any Browser" extension
Stars: ✭ 987 (+170.41%)
Mutual labels:  edge, chrome-extension, chrome, firefox, opera-extension
Disable Javascript
Adds the ability to disable JavaScript on specific sites.
Stars: ✭ 151 (-58.63%)
Mutual labels:  chrome-extension, chrome, firefox, firefox-extension, webextension
Browser Addon
Kee adds free, secure and easy password management features to your browser which save time and keep your private data more secure.
Stars: ✭ 386 (+5.75%)
Mutual labels:  chrome-extension, chrome, firefox, firefox-extension, edge-extension
Gooreplacer
⚡️⚡️A browser extension to modify HTTP requests :-)
Stars: ✭ 850 (+132.88%)
Mutual labels:  edge, chrome-extension, chrome, firefox, edge-extension
Save In
WebExtension for saving media, links, or selections into user-defined directories
Stars: ✭ 99 (-72.88%)
Mutual labels:  chrome-extension, chrome, firefox, firefox-extension, webextension
quickjira
🚤 📂 Quickly access the JIRA of your choice by typing the ticket id
Stars: ✭ 65 (-82.19%)
Mutual labels:  webextension, edge, firefox-extension, opera-extension, edge-extension
Web Extension Starter
Typescript, React, Redux, Styled-Component and Webpack based sample extension boilerplate. Runs on Chrome and Firefox. Sample chrome extension.
Stars: ✭ 115 (-68.49%)
Mutual labels:  webpack, chrome-extension, chrome, firefox, firefox-extension
Smartproxy
Firefox/Chrome browser extension. SmartProxy will automatically enable/disable proxy for the sites you visit, based on customizable patterns.
Stars: ✭ 199 (-45.48%)
Mutual labels:  chrome-extension, firefox, firefox-extension, edge-extension
Generator Web Extension
Advanced WebExtension generator that creates everything you need to get started with cross-browser web-extension development.
Stars: ✭ 212 (-41.92%)
Mutual labels:  chrome-extension, firefox-extension, edge-extension, opera-extension
Extanalysis
Browser Extension Analysis Framework - Scan, Analyze Chrome, firefox and Brave extensions for vulnerabilities and intels
Stars: ✭ 351 (-3.84%)
Mutual labels:  chrome-extension, chrome, firefox, firefox-extension
Sponsorblock
Skip YouTube video sponsors (browser extension)
Stars: ✭ 3,627 (+893.7%)
Mutual labels:  chrome-extension, chrome, firefox, firefox-extension
Synology Download Manager
An open source browser extension for adding/managing download tasks to your Synology DiskStation.
Stars: ✭ 138 (-62.19%)
Mutual labels:  chrome-extension, chrome, firefox, webextension
Bypass Paywalls Chrome
Bypass Paywalls web browser extension for Chrome and Firefox.
Stars: ✭ 20,876 (+5619.45%)
Mutual labels:  chrome-extension, chrome, firefox, firefox-extension
Startpage
A minimal starpage for Chrome and Firefox
Stars: ✭ 240 (-34.25%)
Mutual labels:  chrome-extension, chrome, firefox, firefox-extension
Urql Devtools
A tool for monitoring and debugging urql during development
Stars: ✭ 131 (-64.11%)
Mutual labels:  chrome-extension, chrome, firefox, webextension
Jjb
一个帮助你自动申请京东价格保护的chrome拓展
Stars: ✭ 3,083 (+744.66%)
Mutual labels:  chrome-extension, chrome, firefox, webextension

WebExtension Toolbox

npm package build status Build Status dependencies devDependencies JavaScript Style Guide license

Small cli toolbox for creating cross-browser WebExtensions.

If you want to get started quickly check out the yeoman generator for this project.

Browser Support

Features

react.js

Works with react.js out of the box!
Run $ npm i react react-dom and you are ready to go.

packing

The build task creates bundles for:

  • Firefox (.xpi)
  • Chrome (.zip)
  • Opera (.crx)
  • Edge (.zip)

manifest validation

Validates your manifest.json while compiling.

manifest defaults

Uses default fields (name, version, description) from your package.json

manifest vendor keys

Allows you to define vendor specific manifest keys.

Example

manifest.json

"name": "my-extension",
"__chrome__key": "yourchromekey",
"__chrome|opera__key2": "yourblinkkey"

If the vendor is chrome it compiles to:

"name": "my-extension",
"key": "yourchromekey",
"key2": "yourblinkkey"

If the vendor is opera it compiles to:

"name": "my-extension",
"key2": "yourblinkkey"

else it compiles to:

"name": "my-extension"

polyfill

The webextension standard is currently only supported by firefox and edge. This toolbox adds the necessary polyfills for chrome and opera.

This way many webextension apis will work in chrome and opera out of the box.

In addition to that, this toolbox comes with babel-preset-env.

Usage

Install

$ npm install -g webextension-toolbox

Development

  • Compiles the extension via webpack to dist/<vendor>.
  • Watches all extension files and recompiles on demand.
  • Reloads extension or extension page as soon something changed.
  • Sets process.env.NODE_ENV to development.
  • Sets process.env.VENDOR to the current vendor.

Syntax

$ webextension-toolbox dev <vendor> [..options]

Examples

$ webextension-toolbox dev --help
$ webextension-toolbox dev chrome
$ webextension-toolbox dev firefox
$ webextension-toolbox dev opera
$ webextension-toolbox dev edge

Note: For Microsoft Edge, it is not allowed to connect to localhost with WebSocket. You need to disable "Include all local (intranet) sites not listed in other zones" under "Internet options": GIF Animation showing a cursor turning off Include all local (intranet) sites not listed in other zones option under Internet properties, Security, Local intranet

or using Registry Editor (regedit):

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap]
"IntranetName"=dword:00000000

Build

  • Compile extension via webpack to dist/<vendor>.
  • Minifies extension Code.
  • Sets process.env.NODE_ENV to production.
  • Sets process.env.VENDOR to the current vendor.
  • Packs extension to packages.

Syntax

Usage: build [options] <vendor>

Compiles extension for production

Options:
  -s, --src [src]                       specify source directory (default: "app")
  -t, --target [target]                 specify target directory (default: "dist/[vendor]")
  -d, --devtool [devtool]               controls if and how source maps are generated (default: false)
  -m, --no-minimize                     disables code minification
  -v, --vendorVersion [vendorVersion]   last supported vendor (default: current)
  -h, --help                            output usage information

Browser API

Always use the webextension browser api. Webextension-Toolbox will polyfill it for you in chrome and opera.

Entry points

All javascript files located at the root of your ./app or ./app/scripts directory will create a seperate bundle.

app dist
app/background.js dist/<vendor>/background.js
app/scripts/background.js dist/<vendor>/scripts/background.js
app/some-dir/some-file.js Will be ignored as entry file.
app/scripts/some-dir/some-file.js Will be ignored as entry file.

Customizing webpack config

In order to extend our usage of webpack, you can define a function that extends its config via webextension-toolbox-config.js.

// This file is not going through babel transformation.
// So, we write it in vanilla JS
// (But you could use ES2015 features supported by your Node.js version)
const webpack = require('webpack')

module.exports = {
  webpack: (config, { dev, vendor }) => {
    // Perform customizations to webpack config

    // Important: return the modified config
    return config
  }
}

As WebExtension Toolbox uses webpack’s devtool feature under the hood, you can also customize the desired devtool with the --devtool argument. For example, if you have problems with source maps on Firefox, you can try the following command:

webextension-toolbox build firefox --devtool=inline-cheap-source-map

Please see Issue #58 for more information on this

CI/CD

For testing WebExtension Toolbox, we rely mainly on Azure Pipelines and Travis.

We try to target every platform our users use: Linux, macOS or Windows Regarding Node.js versions, we try to target what would our users would use:

  • Last version in Maintenance LTS (currentl: v8)
  • Active LTS (currently v10)
  • Current (currently: v11)

Currently, passing all tests is required to merge a Pull Request

Test matrix

CI/CD vendor Operating System NodeJS versions
Azure Pipelines Ubuntu (ubuntu-16.04)
  • 8.x
  • 10.x
  • 11.x
macOS (macOS-10.13)
Windows (win1803)
Travis CI Ubuntu Xenial 16.04
  • lts (10.x)
  • current (11.x)
In other words, every pull request goes through on 11 test environment

FAQ

What is the difference to web-ext?

If want to develop browser extensions for Firefox only web-ext might be a better fit for you, since it supports, extension signing, better manifest validation and auto mounting.

Nevertheless if you want to develop cross browser extensions using

  • the same development experience in every browser
  • a single codebase
  • react
  • and custom webpack configuration

webextension-toolbox might be your tool of choice.

License

Copyright 2018 Henrik Wenz

This project is free software released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].