8

I'm using WebKit2's WKWebView in a Cocoa+WebKit mac application. In the WebView I'm loading a page that sends notifications through the HTML5 Notification API (e.g. new Notification("notification")).

When running Notification.requestPermission() inside the page I expected to see a sheet style alert showing up that would request permission to display desktop notifications, like the one that shows up in Safari for instance. I don't see anything and upon closer inspection it seems the permission is actually set to denied.

Now I know this API is not really publicly exposed for Cocoa, but is there any way I can either override the permission and set it by default to "granted" or somehow enable displaying the sheet alert when requesting permission?

Just want to specify that I'm fairly new to programming for OSX with swift.

relu
  • 158
  • 1
  • 6

0 Answers0