# notice.js **Repository Path**: mirrors_Inndy/notice.js ## Basic Information - **Project Name**: notice.js - **Description**: A simple interface to webkitNotification - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-03-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README notice.js ========= A simple interface to `webkitNotification` ***It only works with Safari and Chromium-based browser*** * Specifications from Chromium --- [http://dev.chromium.org/developers/design-documents/desktop-notifications/api-specification][1] * Specifications from W3 --- [https://dvcs.w3.org/hg/notifications/raw-file/tip/Overview.html][2] ```javascript var ready_to_use = notice.ready(); // returns true if everything is ready // var result = notice.check(); // check permission // -1: not support // 0: allow // 1: need to request // 2: denied // // constants below was defined in Chrome // PERMISSION_ALLOWED = 0 // PERMISSION_NOT_ALLOWED = 1 // PERMISSION_DENIED = 2 if (result == -1) alert("Your browser doesn't support desktop notification."); else if (result == 1) notice.request(); else if (result == 2) alert("You have denied permission of desktop notification."); var obj = new notice("img.png", "title text", "content text"); obj.show(); // show notification without timedout obj.show(time); // show notification with timedout