Closed
Bug 1254359
Opened 8 years ago
Closed 8 years ago
notifications.getAll() result is not Chrome-compatible
Categories
(WebExtensions :: Untriaged, defect)
WebExtensions
Untriaged
Tracking
(firefox48 verified, firefox52 verified)
People
(Reporter: wbamberg, Assigned: bsilverberg)
References
Details
(Whiteboard: [notifications])
Attachments
(2 files)
On Firefox, notifications.getAll() returns (via its callback) an array of notification IDs, so code like this: function gotAll(ids) { console.log(ids); } function getAll() { chrome.notifications.getAll(gotAll); } ...would give you console output like: Array [ "ghocyrlpa", "ffadcvitq", "ctzuox", "lkgzzgsgxqiw" ] On Chrome, the output seems to be an object, with a property for each notification, whose name is the ID, and whose value is true: Object {etdzysf: true, ocri: true, pwiof: true, vndcvm: true} I've attached a demo WebExtension.
Comment 1•8 years ago
|
||
I suppose we'll have to change this, but this change doesn't seem like an improvement to me... I'm leaning towards changing it to return an object, but make each value an object describing the notification rather than a boolean.
Flags: blocking-webextensions?
Whiteboard: [notifications]
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → bob.silverberg
Status: NEW → ASSIGNED
Iteration: --- → 48.1 - Mar 21
Assignee | ||
Comment 2•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/40411/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/40411/
Attachment #8731181 -
Flags: review?(kmaglione+bmo)
Comment 3•8 years ago
|
||
Comment on attachment 8731181 [details] MozReview Request: Bug 1254359 - notifications.getAll() result is not Chrome-compatible, r?kmag https://reviewboard.mozilla.org/r/40411/#review36947 ::: toolkit/components/extensions/ext-notifications.js:125 (Diff revision 1) > }, > > getAll: function() { > - let result = Array.from(notificationsMap.get(extension).keys()); > + let result = {}; > + notificationsMap.get(extension).forEach((value, key) => { > + result[key] = {id: value.id, options: value.options}; I think it would be better to just return the options object, rather than an object with an `options` key.
Attachment #8731181 -
Flags: review?(kmaglione+bmo) → review+
Assignee | ||
Comment 4•8 years ago
|
||
Comment on attachment 8731181 [details] MozReview Request: Bug 1254359 - notifications.getAll() result is not Chrome-compatible, r?kmag Review request updated; see interdiff: https://reviewboard.mozilla.org/r/40411/diff/1-2/
Assignee | ||
Comment 5•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5c3b6c8cc60c
Comment 8•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1d794d077cb1
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
I can reproduce this issue on Firefox 48.0a1 (20160321030217), here is a screenshot: http://screencast.com/t/lRhyMyiv8tbj This issue is verified as fixed in Firefox 48.0.2 (20160823121617) and Firefox 52.0a1 (20160929030426), notifications.getAll() returns (via its callback) an object and each value has an object describing the notification. Here is a screenshot: http://screencast.com/t/74LfyFhys
Updated•6 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•