Closed
Bug 940196
Opened 12 years ago
Closed 12 years ago
add dir, lang and tag options to notifications (and align with WebNotifications api?)
Categories
(Add-on SDK Graveyard :: General, defect, P2)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla28
People
(Reporter: zombie, Assigned: zombie)
Details
Attachments
(2 files)
while working on bug 895693, and reading the docs for nsIAlertsService, i noticed new arguments added in Firefox 22: `dir` and `lang`, so i implemented them (along with `tag`), and Jordan asked for this to be in a separate bug.
it's obvious those were added for the Web Notification implementation, and with this addition, the `sdk/notifications` api looks fairly close to w3c specification, so it might be a good idea to align with it where possible.
http://www.w3.org/TR/notifications/#api
differences:
1) uses the Notification constructor for each new notification
2) has one required argument `title`, and the rest are in the `options` object
3) uses `body` instead of `text` option key
4) uses lowercase `onerror` event handler
those all seem solvable in a backwards-compatible way. what do you think Irakli?
Flags: needinfo?(rFobic)
| Assignee | ||
Comment 1•12 years ago
|
||
note: this is just the patch for dir, lang and tag options, not the Web Notifications compatibility stuff proposed above.
also, where i said 'onerror' above, i meant 'onclick'.
Attachment #8334710 -
Flags: review?
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → tomica+amo
Status: NEW → ASSIGNED
Priority: -- → P2
Attachment #8334710 -
Flags: review? → review?(rFobic)
Updated•12 years ago
|
Attachment #8334710 -
Flags: review?(rFobic) → review+
Comment 2•12 years ago
|
||
Pointer to Github pull-request
Comment 3•12 years ago
|
||
(In reply to Tomislav Jovanovic [:zombie] from comment #0)
> while working on bug 895693, and reading the docs for nsIAlertsService, i
> noticed new arguments added in Firefox 22: `dir` and `lang`, so i
> implemented them (along with `tag`), and Jordan asked for this to be in a
> separate bug.
>
>
> it's obvious those were added for the Web Notification implementation, and
> with this addition, the `sdk/notifications` api looks fairly close to w3c
> specification, so it might be a good idea to align with it where possible.
>
> http://www.w3.org/TR/notifications/#api
>
> differences:
> 1) uses the Notification constructor for each new notification
> 2) has one required argument `title`, and the rest are in the `options`
> object
> 3) uses `body` instead of `text` option key
> 4) uses lowercase `onerror` event handler
>
> those all seem solvable in a backwards-compatible way. what do you think
> Irakli?
I think we should totally embrace standard APIs where possible. I have already landed your change.
I have also made a WIP patch that exposes HTML5 notifications API directly as implemented in DOM.
It needs some tests cleanup etc, but cool thing is it actually works. I'll try to finish it up
in coming days. If anyone want's to take over, I'm happy to delegate.
Flags: needinfo?(rFobic)
Comment 4•12 years ago
|
||
Submitted separate bug to expose HTML5 notifications API (see bug 946016)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•12 years ago
|
Target Milestone: --- → mozilla28
You need to log in
before you can comment on or make changes to this bug.
Description
•