Closed
Bug 601477
Opened 15 years ago
Closed 14 years ago
Desktop Notifications in Fennec require user action before any notification
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(fennec2.0+)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
fennec | 2.0+ | --- |
People
(Reporter: paul, Assigned: dougt)
Details
Attachments
(1 file)
8.04 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
Calling notification.show() brings the "foo.com wants to use notifications. Allow - Don't allow" prompt every time.
A "Always allow" option should be added and the prompt should be shown on createNotification(), not on show().
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → doug.turner
Comment 1•15 years ago
|
||
We currently use the same mechanism that geo-location uses. After answering "allow" 5 times, we never ask again for that domain.
Assignee | ||
Comment 2•15 years ago
|
||
i was mostly concerned about the "the prompt should be shown on createNotification(), not on show()."
not sure if I agree, but i will discuss with other implementers. paul, any reason why you do not like the permission prompt on show()?
Reporter | ||
Comment 3•15 years ago
|
||
The notification mechanism exists to attract the attention of the user, even if the browser is in the background.
With current behavior, the notification is only shown if the user is in front of the browser.
I think it would be better if:
* the user load a web page
* web page asks for the permission to show notification (on createNotifaction or on via another dedicated request)
* notification happens later in the future
Assignee | ||
Comment 4•15 years ago
|
||
yeah, i think you are right.
Assignee | ||
Comment 5•15 years ago
|
||
oh, i should point out that we have been discussing a permission api such that you can ask the user at any point for a set of permissions. For example, something like:
navigator.requestPermissions("geolocation, desktop-notifications", callback())
This would also address the problem, but i will think you are right.
Assignee | ||
Comment 6•15 years ago
|
||
s/will/still
Assignee | ||
Comment 7•14 years ago
|
||
Attachment #502571 -
Flags: review?(jst)
Assignee | ||
Updated•14 years ago
|
tracking-fennec: --- → ?
Assignee | ||
Updated•14 years ago
|
Attachment #502571 -
Flags: review?(jst) → review?(Olli.Pettay)
Updated•14 years ago
|
tracking-fennec: ? → 2.0+
Comment 8•14 years ago
|
||
Could you explain the behavior the patch gives.
Assignee | ||
Comment 9•14 years ago
|
||
yes. the patch will change the behavior of prompting when .show() is called to when createNotification() is called. This will allow sites to request permission prior to the show().
Comment 10•14 years ago
|
||
What happens if one does createNotification().show() ?
Assignee | ||
Comment 11•14 years ago
|
||
we remember that show() was called, and when the notification is approved, we post a desktop notification. Is that what you are asking?
Comment 12•14 years ago
|
||
Comment on attachment 502571 [details] [diff] [review]
patch v.1
>
> void
>+nsDOMDesktopNotification::SetAllow(PRBool aAllow)
>+{
>+ mAllow = aAllow;
>+
>+ // if we have called Show() already, lets go ahead and post a notification
>+ if (mShowHasBeenCalled)
>+ PostDesktopNotification();
>+}
>+
Why do you call PostDesktopNotification() even is aAllow is false?
Assignee | ||
Comment 13•14 years ago
|
||
as an exercise for the reviewer! :D
Comment 14•14 years ago
|
||
Comment on attachment 502571 [details] [diff] [review]
patch v.1
Ok, fix that :)
I wish there were some tests...
Attachment #502571 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 15•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 16•14 years ago
|
||
Can you provide some steps to reproduce so that i could verify this bug ?
Comment 17•14 years ago
|
||
Is it http://vingtetun.org/todo/ a proper website to verify this bug? If no, could you suggest me one please?
You need to log in
before you can comment on or make changes to this bug.
Description
•