extension-boilerplate

为 Chrome、Opera 和 Firefox 构建跨浏览器扩展的模板。(A template for building cross browser extensions for Chrome, Opera & Firefox.)

Github星跟踪图

Now that Firefox supports WebExtensions, it has become a lot easier to build browser extensions/addons for multiple browsers without duplicating the codebase. This project serves as a sensible starting point to help you get started.

I have extracted this from the browser extensions that I built for my side-project, Email This.

Side note: Do check out Email This. It is a simpler alternative to bookmarking tools like Pocket, Readability & Instapaper. Email This will remove ads & distractions from an article and send you a nice email with just the text/images. No need to install any additional applications or login to another app just to access your bookmarks.
The Chrome Extensions is available on the Chrome Web Store.

Features

You can also set custom data variables based on the platform (different variable for Chrome, FF, Opera).

Installation

  1. Clone the repository git clone https://github.com/EmailThis/extension-boilerplate.git
  2. Run npm install
  3. Run npm run build

Alternately, if you want to try out the sample extension, here are the download links. After you download it, unzip the file and load it in your browser using the steps mentioned below.

Load the extension in Chrome & Opera
  1. Open Chrome/Opera browser and navigate to chrome://extensions
  2. Select "Developer Mode" and then click "Load unpacked extension..."
  3. From the file browser, choose to extension-boilerplate/build/chrome or (extension-boilerplate/build/opera)
Load the extension in Firefox
  1. Open Firefox browser and navigate to about:debugging
  2. Click "Load Temporary Add-on" and from the file browser, choose extension-boilerplate/build/firefox

Developing

The following tasks can be used when you want to start developing the extension and want to enable live reload -

  • npm run chrome-watch
  • npm run opera-watch
  • npm run firefox-watch

Packaging

Run npm run dist to create a zipped, production-ready extension for each browser. You can then upload that to the appstore.

TODO

  • Add support for Safari
  • Add Firefox & Opera Promo images
  • Add sample screenshot templates
  • Write a guide for using config variables & JS preprocessor

This project is licensed under the MIT license.

If you have any questions or comments, please create a new issue. I'd be happy to hear your thoughts.

Bharani, Email This

主要指标

概览
名称与所有者EmailThis/extension-boilerplate
主编程语言JavaScript
编程语言JavaScript (语言数: 3)
平台Web browsers
许可证MIT License
所有者活动
创建于2017-02-21 06:10:49
推送于2024-05-02 11:02:01
最后一次提交2017-06-08 16:21:34
发布数1
最新版本名称v1.0 (发布于 )
第一版名称v1.0 (发布于 )
用户参与
星数3.3k
关注者数72
派生数374
提交数33
已启用问题?
问题数33
打开的问题数23
拉请求数6
打开的拉请求数5
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?