PushManager.hasPermission() was a legacy instance method that returned a Promise resolving to a PushPermissionStatus: "granted", "denied", or "default" (MDN).
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call pushManager.hasPermission. Start with this line.
JavaScript
pushManager.hasPermission()
Call
What it does
pushManager.hasPermission()
Primary signature.
pushManager.hasPermission(...)
Call with the arguments your case needs.
Built into the browser. Call hasPermission(...) on a PushManager — no import required.
Library declarations
JavaScript
pushManager.hasPermission()
Parameters
Parameter
Description
Feature detect
Required. Missing in most modern browsers
Return Value
Return Value
Description
*
Resolves to status string
JavaScript Examples
Example 1 — Legacy hasPermission() Shape
MDN idea: await the Promise and read the status string (do not ship this).
JavaScript
// Historical pattern — require feature detect in real browsers
const registration = await navigator.serviceWorker.ready;
const status = await registration.pushManager.hasPermission();
console.log(status); // "granted" | "denied" | "default"
Use the standard API.permissionState() is the MDN replacement.
Pass subscribe options. Match what you will use with subscribe().
Branch on three values.prompt replaces legacy default.
Then subscribe. Only call subscribe() when UX is ready.
Compatibility
Browser Support
PushManager.hasPermission() is Deprecated and Non-standard on MDN. It is missing or removed in modern browsers. Prefer permissionState() (Baseline Widely available).
✓ Deprecated · Non-standard
PushManager.hasPermission()
Legacy push permission Promise — avoid in new code. Use permissionState() instead.
LegacyDeprecated API
Google ChromeNot supported — use permissionState()
Not supported
Mozilla FirefoxLegacy only — use permissionState()
Legacy only
Apple SafariUse permissionState() / Notification.permission
Not supported
Microsoft EdgeFollow Chromium — use permissionState()
Not supported
OperaFollow Chromium
Not supported
Internet ExplorerNo Push API
Not supported
hasPermission()Limited
Bottom line: Feature-detect before calling. Build new push features with permissionState() and subscribe() after serviceWorker.ready.
Frequently Asked Questions
It returns a Promise that resolves to a PushPermissionStatus string: "granted", "denied", or "default" — whether the web app has push permission (MDN).
Yes. MDN marks it Deprecated and Non-standard. It is not Experimental. Prefer PushManager.permissionState() in new code.
Use PushManager.permissionState() (modern Push API). For a quick sync notification check, Notification.permission may also help.
No. MDN documents hasPermission() with no parameters. Call it on registration.pushManager.
Legacy hasPermission used "default" for undecided. Modern permissionState uses "prompt" for the same idea. granted and denied mean the same in both.
You may see it in old tutorials. Knowing it helps you migrate safely to permissionState() without breaking legacy checks.