browser.storage.local.get() expects a callback instead of returning a promise

By design Issue #9420301

Details

Author
Wladimir P.
Created
Oct 19, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
14.14393
Reports
Reported by 4 people

Sign in to watch or report this issue.

Steps to reproduce

In an extension, use the following code:

browser.storage.local.get("foo").then(result => console.log(result));

This throws an exception:

Invocation of form storage.local.get(string) doesn’t match definition storage.local.get(optional string or array or object keys, function callback).

This API is supposed to be supported and links to https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/Storage/StorageArea/get. There it says: “This API is also available as browser.storage.<storageType>.get() in a version that returns a promise.” So it is supposed to return a promise, just like all the other APIs - yet currently it expects a callback, just like chrome.storage.local.get().

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Ibrahim O.”

      Changed Assigned To from “Ibrahim O.” to “Chee C.”

      Changed Status to “Confirmed”

      Changed Assigned To from “Chee C.” to “Brad E.”

      Changed Assigned To from “Brad E.” to “Chee C.”

    • Also in version 14986.1000.

    • Microsoft Edge Team

      Changed Status from “Confirmed” to “By design”

    • Hello,

      Thank you for providing this information about the issue. A Microsoft Edge Extension does not support the Promise model; this is a documented difference between Mozilla and Edge’s platform. Currently, we do not plan to release a fix. Please update this case if you can provide new information for us to consider.

      Best Wishes,
      The MS Edge Team

    You need to sign in to your Microsoft account to add a comment.

    Sign in