We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS


註: この機能は Web Workers 内で利用可能です。


var permission = Notification.permission;


  • granted: ユーザーは現在のオリジンがシステム通知を表示することを明示的な許可を与えている。
  • denied: ユーザーは現在のオリジンがシステム通知を表示することを明示的に拒否している。
  • default: ユーザーの決定は分からない。この場合、アプリケーションは許可が拒否されたかのように実行するだろう。


function notifyMe() {
  // Let's check if the browser supports notifications
  if (!("Notification" in window)) {
    console.log("This browser does not support desktop notification");

  // Let's check whether notification permissions have alredy been granted
  else if (Notification.permission === "granted") {
    // If it's okay let's create a notification
    var notification = new Notification("Hi there!");

  // Otherwise, we need to ask the user for permission
  else if (Notification.permission !== 'denied') {
    Notification.requestPermission(function (permission) {
      // If the user accepts, let's create a notification
      if (permission === "granted") {
        var notification = new Notification("Hi there!");

  // At last, if the user has denied notifications, and you 
  // want to be respectful there is no need to bother them any more.


Specification Status Comment
Notifications API
permission の定義
現行の標準 Living standard


We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 5 webkit (see notes)
4.0 moz (see notes)
未サポート 25 6 (see notes)
Available in workers ? 41.0 (41.0) ? ? ?
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support ?


4.0 moz (see notes)
1.0.1 moz (see notes)
未サポート ? 未サポート


Available in workers ? ? 41.0 (41.0) ? ? ? ? ?

Firefox OS notes

Chrome notes

Safari notes



このページの貢献者: YuichiNukiyama
最終更新者: YuichiNukiyama,