puter.notifications.hasPermission() Checks whether the user lets your app send push notifications.
It never prompts, so use it to decide whether to ask with requestPermission().
The user gives this permission in Puter's prompt, or on a website by turning pushes on with enable(). It says nothing about the browser the user is in. To check whether pushes reach this browser, use status().
The answer is about the app making the call. Called from an account session with no app, such as Node.js with an account token, it's always true.
puter.notifications.hasPermission()
None.
A Promise that resolves to true or false.
if (!await puter.notifications.hasPermission()) {
showAllowPushesButton();
}