Opened 9 days ago

Last modified 9 days ago

#7271 new change

Adjust Chrome API calls to use Promises where possible

Reported by: kzar Assignee: kzar
Priority: P2 Milestone:
Module: Platform Keywords: manifestv3
Cc: sebastian, greiner Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by kzar)

Background

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.

Notes

  • See #7272 for the equivalent adblockplusui changes.

Change History (4)

comment:1 Changed 9 days ago by kzar

  • Description modified (diff)

comment:2 Changed 9 days ago by greiner

For reference, I've created #7272 for doing the same in adblockplusui.

comment:3 Changed 9 days ago by kzar

  • Description modified (diff)

comment:4 Changed 9 days ago by kzar

  • Description modified (diff)
Note: See TracTickets for help on using tickets.