remove navigator.mozNotification from Firefox desktop

RESOLVED FIXED

Status

()

Core
DOM
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: dougt, Assigned: dougt)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(blocking2.0 betaN+)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Jonas mentioned over IRC we should consider removing navigator.mozNotification from FF desktop.

I am not entirely convinced we should, but we should discuss.
We (and every other browser vendor) have been pushing hard the message that people should use feature detection rather than browser detection. So we want them to do things like

function myNotify(body, title, callback) {
  if ("Notification" in window) {
    var x = new Notification(myiconurl, title, body);
    x.onclick = callback;
  }
  else if ("mozNotification" in navigator) {
    var x = navigator.mozNotification.createNotification(myiconurl, title, body);
    x.show(callback);
  }
  else {
    ...fallback code, maybe use alert()...
  }
}

That doesn't work if we expose function which doesn't "work" on some platforms.
(Assignee)

Comment 2

7 years ago
i can add a pref that can be set in fennec (or by an addon for ff desktop).  sounds good, jonas?
Yup, that'd be awesome.
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk
(Assignee)

Comment 4

7 years ago
Created attachment 486681 [details] [diff] [review]
patch v.1

worked locally.  pushed to try.
Assignee: nobody → doug.turner
Attachment #486681 - Flags: review?(jonas)
Comment on attachment 486681 [details] [diff] [review]
patch v.1

Looks good to me, but I'd like to have either peterv or jst look at the nsDOMClassInfo.cpp changes.
Attachment #486681 - Flags: review?(peterv)
Attachment #486681 - Flags: review?(jonas)
Attachment #486681 - Flags: review+
(Assignee)

Comment 6

7 years ago
peterv,  do you have time to review?
(Assignee)

Updated

7 years ago
Attachment #486681 - Flags: review?(peterv) → review?(jst)
(Assignee)

Comment 7

7 years ago
jst/jonas.  i think we want this for ff4.
blocking2.0: --- → betaN+

Updated

7 years ago
Attachment #486681 - Flags: review?(jst) → review+
(Assignee)

Comment 8

7 years ago
Comment on attachment 486681 [details] [diff] [review]
patch v.1

wanted for ff4.
Attachment #486681 - Flags: approval2.0?
(Assignee)

Comment 9

7 years ago
http://hg.mozilla.org/mozilla-central/rev/6566ead94c4e
(Assignee)

Updated

7 years ago
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
(Assignee)

Updated

7 years ago
Attachment #486681 - Flags: approval2.0?
(Assignee)

Comment 10

7 years ago
http://hg.mozilla.org/mozilla-central/rev/845b9487ffb3  (disabling tests)

Tests were disabled because they were failing:

5268 ERROR TEST-UNEXPECTED-FAIL | /tests/dom/tests/mochitest/notification/test_basic_notification.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - Permission denied for <http://mochi.test:8888> to get property XPCComponents.classes at http://mochi.test:8888/tests/dom/tests/mochitest/notification/notification_common.js:76
5271 ERROR TEST-UNEXPECTED-FAIL | /tests/dom/tests/mochitest/notification/test_basic_notification_click.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - Permission denied for <http://mochi.test:8888> to get property XPCComponents.classes at http://mochi.test:8888/tests/dom/tests/mochitest/notification/notification_common.js:76
5274 ERROR TEST-UNEXPECTED-FAIL | /tests/dom/tests/mochitest/notification/test_leak_windowClose.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - is_feature_enabled is not defined at http://mochi.test:8888/tests/dom/tests/mochitest/notification/test_leak_windowClose.html:13

Because these tests do not test anything in Firefox (as we disabled this feature), we just removed notifications from the makefile dirs.

The feature is only enabled on mobile which uses IPC, and IPC mochitests do not completely work :(


When we re-enable for firefox desktop, we will re-enable these tests.
You need to log in before you can comment on or make changes to this bug.