Skip to content

Use promises for extension API calls

Background

See trac#7271.

What to change

Where possible use Promises instead of callbacks when using the browser.* or chrome.* APIs.

This includes the following changes:

  • Update documentation files
    • docs/messaging.md
  • Update mock files
    • ext/content.js
  • Update UI files
    • js/desktop-options.js
      • Remove callback from getPref()
    • js/issue-reporter.js
      • Remove redundant promise wrapper
    • js/popup.js
    • js/popup.blockelement.js
    • js/popup.notifications.js
    • js/popup.utils.js
      • Remove redundant promise wrapper
      • Remove callback from
        • getPref()
        • isPageWhitelisted()
        • setPref()
        • togglePref()
      • Update calls to above functions in:
        • js/popup.js
        • js/popup.notifications.js
        • js/popup.toggle.js
    • common.js
      • Remove callback from getDocLink() and update calls in:
        • js/desktop-options.js
        • mobile-options.js
        • updates.js
    • devtools-panel.js
    • i18n.js
    • mobile-options.js
      • Remove redundant promise wrapper
  • Apply adblockpluschrome updates to same release branch on eyeo/adblockplus/abpui/adblockpluschrome

Further information

mobile-options.js is only being used in Firefox Mobile

Edited by Thomas Greiner
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information