Description: | Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray. |
Availability: | Since Chrome 38. |
Permissions: | 'notifications' |
Learn More: | Rich Notifications Keep Users Informed Chrome Apps Office Hours: Rich Notifications |
Summary
Types | |
---|---|
TemplateType | |
PermissionLevel | |
NotificationOptions | |
Methods | |
create − chrome.notifications.create(string notificationId, NotificationOptions options, function callback) | |
update − chrome.notifications.update(string notificationId, NotificationOptions options, function callback) | |
clear − chrome.notifications.clear(string notificationId, function callback) | |
getAll − chrome.notifications.getAll(function callback) | |
getPermissionLevel − chrome.notifications.getPermissionLevel(function callback) | |
Events | |
onClosed | |
onClicked | |
onButtonClicked | |
onPermissionLevelChanged | |
onShowSettings |
If, like me, you’re both a Mac user and a Google Chrome zealot, you’ll be happy to know that the latest beta release of Chrome for Mac, version 5.0.307, finally supports extensions.
- Highfive Chrome Extension Download The Screenshots; Highfive Chrome Extension Free But You; Once the screenshot is captured, a new tab shows you the screenshot which you can then save. You can use the native PrtScn button on Windows or the Cmd Shift 4 keyboard shortcut on macOS.
- If you can’t wait until early next year to start trying out Chrome extensions, you can sign up for the developer version of Chrome for Mac. (You will have to reinstall the browser.) Or, you can.
Types
TemplateType
Enum |
---|
|
PermissionLevel
Enum |
---|
|
NotificationOptions
properties | ||||||||
---|---|---|---|---|---|---|---|---|
TemplateType | (optional) type | Which type of notification to display. Required for notifications.create method. | ||||||
string | (optional) iconUrl | A URL to the sender's avatar, app icon, or a thumbnail for image notifications. URLs can be a data URL, a blob URL, or a URL relative to a resource within this extension's .crx file Required for notifications.create method. | ||||||
string | (optional) appIconMaskUrl | Deprecated since Chrome 59. The app icon mask is not visible for Mac OS X users. A URL to the app icon mask. URLs have the same restrictions as iconUrl. The app icon mask should be in alpha channel, as only the alpha channel of the image will be considered. | ||||||
string | (optional) title | Title of the notification (e.g. sender name for email). Required for notifications.create method. | ||||||
string | (optional) message | Main notification content. Required for notifications.create method. | ||||||
string | (optional) contextMessage | Alternate notification content with a lower-weight font. | ||||||
integer | (optional) priority | Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. On platforms that don't support a notification center (Windows, Linux & Mac), -2 and -1 result in an error as notifications with those priorities will not be shown at all. | ||||||
double | (optional) eventTime | A timestamp associated with the notification, in milliseconds past the epoch (e.g. Date.now() + n ). | ||||||
array of object | (optional) buttons | Text and icons for up to two notification action buttons. Properties of each object | ||||||
string | (optional) imageUrl | Deprecated since Chrome 59. The image is not visible for Mac OS X users. A URL to the image thumbnail for image-type notifications. URLs have the same restrictions as iconUrl. | ||||||
array of object | (optional) items | Items for multi-item notifications. Users on Mac OS X only see the first item. Properties of each object
| ||||||
integer | (optional) progress | Current progress ranges from 0 to 100. | ||||||
boolean | (optional) isClickable | Deprecated since Chrome 67. This UI hint is ignored as of Chrome 67 | ||||||
boolean | (optional) requireInteraction | Since Chrome 50. Indicates that the notification should remain visible on screen until the user activates or dismisses the notification. This defaults to false. | ||||||
boolean | (optional) silent | Since Chrome 70. Indicates that no sounds or vibrations should be made when the notification is being shown. This defaults to false. |
Methods
create
chrome.notifications.create(string notificationId, NotificationOptions options, function callback)
Creates and displays a notification.
Parameters | ||||
---|---|---|---|---|
string | (optional) notificationId | Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. The identifier may not be longer than 500 characters. The notificationId parameter is required before Chrome 42. | ||
NotificationOptions | options | Contents of the notification. | ||
function | (optional) callback | Returns the notification id (either supplied or generated) that represents the created notification. The callback is required before Chrome 42. If you specify the callback parameter, it should be a function that looks like this: function(string notificationId) {...};
|
update
chrome.notifications.update(string notificationId, NotificationOptions options, function callback)
Updates an existing notification.
Parameters | ||||
---|---|---|---|---|
string | notificationId | The id of the notification to be updated. This is returned by notifications.create method. | ||
NotificationOptions | options | Contents of the notification to update to. | ||
function | (optional) callback | Called to indicate whether a matching notification existed. The callback is required before Chrome 42. If you specify the callback parameter, it should be a function that looks like this: function(boolean wasUpdated) {...};
|
clear
chrome.notifications.clear(string notificationId, function callback)
Clears the specified notification.
Parameters | ||||
---|---|---|---|---|
string | notificationId | The id of the notification to be cleared. This is returned by notifications.create method. | ||
function | (optional) callback | Called to indicate whether a matching notification existed. The callback is required before Chrome 42. If you specify the callback parameter, it should be a function that looks like this: function(boolean wasCleared) {...};
|
getAll
Retrieves all the notifications of this app or extension.
Google Chrome Download For Mac
Parameters | ||||
---|---|---|---|---|
function | callback | Returns the set of notification_ids currently in the system. The callback parameter should be a function that looks like this: function(object notifications) {...};
|
getPermissionLevel
chrome.notifications.getPermissionLevel(function callback)
Retrieves whether the user has enabled notifications from this app or extension.
Parameters | ||||
---|---|---|---|---|
function | callback | Returns the current permission level. The callback parameter should be a function that looks like this: function( PermissionLevel level) {...};
|
Events
onClosed
The notification closed, either by the system or by user action.
addListener
chrome.notifications.onClosed.addListener(function callback)
Parameters | ||||||
---|---|---|---|---|---|---|
function | callback | The callback parameter should be a function that looks like this: function(string notificationId, boolean byUser) {...};
|
onClicked
![Chrome app for macbook Chrome app for macbook](/uploads/1/3/4/2/134219696/141522944.jpg)
The user clicked in a non-button area of the notification.
addListener
chrome.notifications.onClicked.addListener(function callback)
Parameters | ||||
---|---|---|---|---|
function | callback | The callback parameter should be a function that looks like this: function(string notificationId) {...};
|
onButtonClicked
The user pressed a button in the notification.
addListener
chrome.notifications.onButtonClicked.addListener(function callback)
Parameters | ||||||
---|---|---|---|---|---|---|
function | callback | The callback parameter should be a function that looks like this: function(string notificationId, integer buttonIndex) {...};
|
onPermissionLevelChanged
The user changes the permission level. As of Chrome 47, only ChromeOS has UI that dispatches this event.
addListener
chrome.notifications.onPermissionLevelChanged.addListener(function callback)
Parameters | ||||
---|---|---|---|---|
function | callback | The callback parameter should be a function that looks like this: function( PermissionLevel level) {...};
|
onShowSettings
Deprecated since Chrome 65. Custom notification settings button is no longer supported.
The user clicked on a link for the app's notification settings. As of Chrome 47, only ChromeOS has UI that dispatches this event. As of Chrome 65, that UI has been removed from ChromeOS, too.
addListener
chrome.notifications.onShowSettings.addListener(function callback)
Parameters | ||
---|---|---|
function | callback | The callback parameter should be a function that looks like this: function() {...}; |
Does your work consist of using the browser? Why not get the most out of it, right? In this quick guide, we go over how to install Chrome extensions on Mac, and which Chrome extensions are worth it.
Google Chrome Extension For Mac
How to Install Chrome Extensions on Mac
As far as installing Chrome extensions goes, you have two options.
Both of them require not using Safari.
Why? As while Safari is loved by Apple users, since it’s not built on Chromium, it doesn’t support extensions or as some call them, add-ons.
Safari does offer some extensions, but the options are quite limited, with them mostly being limited to ad blockers.
The options?
- Google Chrome.
- Microsoft Edge Chromium.?
These two browsers are built on the Chromium engine, meaning they support Chrome extensions.
Reading this, you might naturally want to get the Google Chrome browser since you’ve probably heard of it more, but if you read our post on why Microsoft Edge Chromium is better than Google Chrome, then you will know that the Edge Chromium is a better option.
Why?
- Edge Chromium is much less resourceful than Chrome, comparing More to Safari. ✅
- Google Chrome doesn’t have the greatest privacy options. Edge does. ✅
- Microsoft Edge Chromium offers new features that Google doesn’t currently offer.
What do you need to do to install Chrome Extensions on Mac?
After you’ve installed either of the Chromium browsers, head over to the Chrome store, and simply install the Chrome extensions that you want to use.
It’s as simple as that.
If it was the other way around, it wouldn’t be as simple, since Safari isn’t available on Windows devices, at least not the newer versions.
The best Chrome add-ons to Install on MacOS?️
Having the ability to install Chrome extensions is great, but that’s only if you have the right extensions.
And here are some of them:
1. Volume Booster
When watching something on YouTube, this shouldn’t be a problem, but when you start watching TV productions, that’s when the speakers on laptops always become an issue.
Why?
As the TV standard for audio levels is designed for TVs that have speakers that can get loud. That doesn’t apply as much on macBooks.
2. MailTag – Know What Happens to Your Emails
Want to know what happens to your emails after you send them? So that you don’t need to spend time worrying over why someone isn’t replying and what you did wrong, when in reality your recipient didn’t see your email yet?
This is where MailTag comes in.
Track when and where your emails are opened. Know what links are clicked on. Send automatic follow-ups when your recipients don’t open your emails, and much more.
→ Add MailTag from the Chrome Store
3. Clockify
Time tracking saves time.
Why?
As we are more likely to do the task we are meant to do, when we set a tracker that states we are doing something.
Like MailTag, it also gives you data, allowing you to make changes, to do better work, faster, which is why it’s one of our favorite Chrome extensions on Mac.
4. The Great Suspender
Not as needed on the Microsoft Edge Chromium, but for sure super useful when it comes to using Google Chrome, or simply if you love to have tons of tabs open.
Why?
As the Great Suspender suspends the tabs you haven’t been using for quite some time, allowing you to use less resources of your macOS device.
5. Grammarly
Whether you write plenty of emails, or longer articles, how you write matters.
Grammarly?
Not only is it going to show you how well you are writing fixing your grammar and spelling mistakes, but it’s also going to show you how your tone sounds.
And that means that you can eliminate silly mistakes, and write content that is more successful.
That’s How to Install Chrome Extensions on Mac & the Best Extensions for It
Find Chrome Extensions On Computer
Want to see more worthy Chrome extensions? Make sure to check out these 14 critical Chrome Extensions.
Chrome Extension For Macro
→ Add MailTag from the Chrome Store