Closed Bug 607860 Opened 14 years ago Closed 14 years ago

remove navigator.mozNotification from Firefox desktop

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: dougt, Assigned: dougt)

Details

Attachments

(1 file)

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.
i can add a pref that can be set in fennec (or by an addon for ff desktop).  sounds good, jonas?
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk
Attached patch patch v.1Splinter Review
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+
peterv,  do you have time to review?
Attachment #486681 - Flags: review?(peterv) → review?(jst)
jst/jonas.  i think we want this for ff4.
Attachment #486681 - Flags: review?(jst) → review+
Comment on attachment 486681 [details] [diff] [review]
patch v.1

wanted for ff4.
Attachment #486681 - Flags: approval2.0?
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Attachment #486681 - Flags: approval2.0?
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.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: