Search code examples
javascriptfirefoxfirefox-addonfirefox-addon-sdkbookmarklet

Turn bookmarklet into Firefox extension?


I have developed a very powerful and complicated bookmarklet, but it's starting to bump into the edges of the bookmarklet format. I'm considering turning it into a browser extension. For Chrome, I found this tool that makes it easy to get started. I'll need to tweak the outputs a bit, but it's fairly simple.

I'm wondering if there's something similar for Firefox. I want an extension that adds a button to the browser, and when you click it, it runs a script on the page. Can anyone point me to a tutorial, or the related part of the documentation?


Solution

  • Starting at version 42 (current stable version), Firefox includes support for WebExtensions, ie the same API as Chrome Extensions, so you can luckily use the same tool.

    Take into account that it's work in progress and it's not 100% ported, so please read the docs about the state of it.

    The current Addon SDK will be deprecated in the future in favor of WebExtensions, so I think you should give WebExtensions a try, even more when it allows you to only have to maintain one code base.