What is the easiest way to develop Firefox extension?

前端 未结 5 609
不思量自难忘°
不思量自难忘° 2020-12-22 17:28

I\'m planning to develop a simple Firefox extension that will shorten URL of a currently active tab, display a popup with the shortened URL, and place it into the clipboard.

5条回答
  •  攒了一身酷
    2020-12-22 18:04

    As of https://blog.mozilla.org/addons/2016/11/23/add-ons-in-2017/, the only way going forward will be to use WebExtensions. The last SDK extensions will be accepted for Firefox 52, while Firefox 57 will end all other extension support, supporting only WebExtensions.

    Firefox copied Google Chrome's extension API. So you could just use your Chrome extension and see if all the APIs are already supported in Firefox (they should be as of now). Programmers such as NoScript's Giorgio Maone actively support the change to WebExtensions.

    To develop a WebExtension, you need

    • either the web-ext-tool that can be installed via

      npm install --global web-ext
      
    • or simply use Firefox's about:debugging or Chromium's chrome:extensions to temporarily load the webextension.

    Either way, you need a manifest.json file in a directory created by you, which glues all functionality together. See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Your_first_WebExtension for a first example. Or the Google docs at https://developer.chrome.com/getstarted.

提交回复
热议问题