Opened 17 months ago

Last modified 12 months ago

#7271 closed change

Adjust Chrome API calls to use Promises where possible — at Initial Version

Reported by: kzar Assignee: kzar
Priority: P2 Milestone: Adblock-Plus-for-Chrome-Opera-Firefox-next
Module: Platform Keywords: manifestv3
Cc: sebastian, greiner Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):



For version 3 of Chrome's extension manifest format, one planned change is to switch from callbacks to Promises for the Chrome APIs. From the draft spec:

Extension APIs will be promise-based. The older callback version will continue to be supported...

In order to maintain backwards compatibility (and not force developers to rewrite their extension
more than they already have to), providing a callback to an API method will continue to work. If
a callback is provided, a promise will not be returned.

=== What to change ===
Where possible use Promises instead of callbacks when using the browser.* or chrome.* APIs. If necessary wrap them - see `adblockpluschrome/polyfill.js`.

Change History (0)

Note: See TracTickets for help on using tickets.