Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Let nightlyApp.openNotification() fallback to notificationBox. Fixes #81. #83

Merged
merged 1 commit into from Jun 14, 2012

Conversation

Projects
None yet
2 participants
Collaborator

xabolcs commented Jun 6, 2012

A quick and simple resolution for legacy applications.
Based on an MDN example.

@whimboo whimboo commented on the diff Jun 12, 2012

extension/chrome/content/browser.js
@@ -79,12 +79,21 @@ openNotification: function(id, message, label, accessKey, callback) {
callback: callback,
accessKey: accessKey
};
- var options = {
- timeout: Date.now() + 10000
- };
+ if (typeof PopupNotifications != "undefined") {
@whimboo

whimboo Jun 12, 2012

Contributor

Where does PopupNotifications come from?

@xabolcs

xabolcs Jun 12, 2012

Collaborator

whimboo commented

Where does PopupNotifications come from?

It comes from Firefox:

Note: This code module is imported by Firefox chrome windows, so you don't have to do it yourself in most extensions.

@whimboo

whimboo Jun 12, 2012

Contributor

Ah, that explains it. In that case it would be enough to do if (PopupNotifications) which implicitly checks for the type and returns false if undefined or null.

@xabolcs

xabolcs Jun 13, 2012

Collaborator

As talked on IRC, will leave this check as is.

@whimboo whimboo merged commit f7ad4c9 into mozilla:master Jun 14, 2012

Contributor

whimboo commented Jun 14, 2012

Looks good. Pushed:
7cadadd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment