Skip to content

Instantly share code, notes, and snippets.

@bouassaba
Forked from songgao/gist:3185894
Last active August 29, 2015 14:13
Show Gist options
  • Save bouassaba/f555e1f144548dfd2671 to your computer and use it in GitHub Desktop.
Save bouassaba/f555e1f144548dfd2671 to your computer and use it in GitHub Desktop.

How to enable Gmail notification for Safari 6 in Mountain Lion

If you're like me who uses Safari, and finds Gmail in browser most comfortable to use, you might want to enable notification from Gmail in Safari 6. Notification Center in Mountain Lion does support websites in Safari to send notifications, but by now Gmail does not ask for permission to send notifications. Fortunately Gmail uses html5 notification, which is supported in Safari 6. We can manually request permission from Safari for Gmail.

  1. Enable Develop menu. Safari->Preferences->Advanced: Check "Show Develop menu in menu bar".
  2. Open mail.google.com.
  3. Develop->Show Web Inspector. The console will show at bottom. Paste in following command in the console and press Enter. [1] window.webkitNotifications.requestPermission(function(){alert(window.webkitNotifications.checkPermission());})
  4. If the alert box shows 0, it means mail.google.com successfully gets notification permission. Send yourself an email with a different email address to test.

Reference

[1] Code stole from http://dangercove.github.com/html5-notifications/

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