I wanted to know the best way to bring a Chrome extension on another browser, use Crossbrowser , re-coding is not an option as its very large.
相关问题
- How to call firefox addon function with onclick in
- How does same-domain policy apply to background sc
- SQLite Storage in Firefox 3.0 +
- How to include a safari only style in scss ? [dupl
- YouTube Data API v3 allowed referers for browser a
相关文章
- Progressive web app(PWA) vs Electron vs Browser ex
- Stop automatic scrolling on page content change
- Chrome (windows) does not hide scrollbar
- chrome.runtime.getURL vs. chrome.extension.getURL
- True Center Vertical and Horizontal CSS Div [dupli
- Will this hotkey work for Mac users?
- Chrome extension permission for “about:blank” page
- The height of the code-mirror block are not the sa
The argument here is based on the type of the extension but in most cases it is not the case that one would be able to transfer the extension from one browser to another. To answer the argument here, you need to specify what your extension is about, if it’s only related to modifying some pages (like userscripts/userstyles), extend browsers' features, or something else, as this does play a difference in the subject. There are a few portability notes, however, that could help you to simplify this process:
Hope this helps :)
I created this library to make crossbrowser way to write one code that will work in both FF/Chrome. But it based on promises behaviour (FF way). So it will be helpful for those who starting to write new extension. In your case you'll need to rewrite all callback behaviour to promise behaviour, but after that done, code will be much cleaner.
https://github.com/lawlietmester/webextension
Keep in mind that some APIs has absolutely different realizations in FF and Chrome, like Proxy API (not Proxy object).
the best way to port a chrome extension is to look into WebExtension: https://wiki.mozilla.org/WebExtensions
https://developer.mozilla.org/en-US/Add-ons/WebExtensions
Firefox already is on its way to support it: https://blog.mozilla.org/addons/2015/08/21/the-future-of-developing-firefox-add-ons/
and also Microsoft Edge has promissed to support the chrome APIs and already supports some chrome.* apis ive tried: http://www.winbeta.org/news/new-microsoft-edge-browser-can-use-chrome-and-firefox-extensions
Hopefully in a few months this will all work in production. Of course your code should still be cross-browser (another answer here has some tips) and this answer covers support for special extensions API.