         alert("It looks like notifications are denied for this page.\n\nUse your browser settings to allow notifications for this page.")
       else
         $('.popup-notifications .switch').prop 'checked', false
-        window.webkitNotifications.requestPermission(=> @onPopupNotificationsEnabled())
+        Notification.requestPermission(=> @onPopupNotificationsEnabled())
 
     return
 

  # Apple locked notification icons to the app icons (for instance Chrome icon).
  @displayNotification: (sender, message)->
    if @popups_notifications_enabled && @webkitNotificationsEnabled()
      notification = window.webkitNotifications.createNotification('/assets/kandanlogo.png', "#{sender} says:", message);
      notification.onclick = ->
        window.focus()
        @cancel()
        return

      notification.show()

    if @fluid_notifications_enabled
      window.fluid.showGrowlNotification {


  # Returns true if notifications are enabled for this page.
  @webkitNotificationsEnabled: ()->
    Notification.permission == "granted"

  @webkitNotificationsDenied: ()->
    Notification.permission == "denied"

  # Callback when notifiactions are enabled for the first time
  @onPopupNotificationsEnabled: ()->
