Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Is it possible to show notifications even if the browser is closed?

1,731 views
Skip to first unread message

Uğur

unread,
Jun 23, 2023, 2:44:01 PM6/23/23
to Chromium Extensions
Hi everyone!

I have created an alarm and every time I receive a message from that alarm, I show a notification to the user, which is fine but when browser is closed, I don't see any notification.

What I would like to do is to show the notification to the user even if the browser is closed.

Is it technically possible?

Deco

unread,
Jun 23, 2023, 3:19:00 PM6/23/23
to Uğur, Chromium Extensions
Yes, only if you have the keep Chrome running in the background when closed option enabled in the settings.

Cheers,
Deco

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/136646d0-4a66-4d5a-b6cc-8eff5db80d70n%40chromium.org.

Uğur

unread,
Jun 23, 2023, 3:28:33 PM6/23/23
to Chromium Extensions, Deco, Chromium Extensions, Uğur
Hey Deco,

I assume I must ask to users to toggle on that feature right? is there a way to do it programatically?

I couldn't find "keep Chrome running in the background when closed" option in the Settings btw, is there a doc for it?

Robbi

unread,
Jun 23, 2023, 3:33:50 PM6/23/23
to Chromium Extensions, Uğur, Deco, Chromium Extensions
chrome://settings/system

Uğur

unread,
Jun 23, 2023, 3:36:16 PM6/23/23
to Chromium Extensions, Robbi, Uğur, Deco, Chromium Extensions
Screenshot 2023-06-23 at 22.34.42.png
Hey Robbi!

There are only two options available to me

Deco

unread,
Jun 23, 2023, 3:42:17 PM6/23/23
to Uğur, Chromium Extensions
You cannot switch on the toggle programmatically, so yes it has to be manually (disabled) by the user, it is enabled by default. The specific setting you are looking for is "Continue running background apps when Google Chrome is closed", under the Advanced settings in the browser.

Note that this assumes your extension is following proper procedure for background scripts, e.g. the use of ofInterval, if not, then the extension won't run in the background with this setting on.

Thanks,
Deco

Robbi

unread,
Jun 23, 2023, 4:16:38 PM6/23/23
to Chromium Extensions, Deco, Chromium Extensions, Uğur
There are only two options available to me
Weird, are you using Yandex Browser?

Uğur

unread,
Jun 23, 2023, 4:27:46 PM6/23/23
to Chromium Extensions, Robbi, Deco, Chromium Extensions, Uğur
No, maybe it's related to OS? I'm not sure.

My agent: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36`

Uğur

unread,
Jun 23, 2023, 4:30:19 PM6/23/23
to Chromium Extensions, Deco, Chromium Extensions, Uğur
Okay, it's nice to know that it's enabled by default. I will put an info box in my extension in case anyone disabled it. It would be a good feature to be able to detect it and show an alert to the user though.

Anyway,thanks, Deco :)

wOxxOm

unread,
Jun 24, 2023, 1:15:21 AM6/24/23
to Chromium Extensions, Uğur, Deco, Chromium Extensions
This option alone is not sufficient. You also need to add "background" to "permissions" in manifest.json.

Uğur

unread,
Jun 24, 2023, 1:58:51 PM6/24/23
to Chromium Extensions, wOxxOm, Uğur, Deco, Chromium Extensions
Hey wOxxOm,

You are like a superhero to me! I always  see your helpful comments, even from years ago (in stackoverflow too.)

Thank you so much for helping people in this community :)

Suraj SJARALI

unread,
Apr 16, 2025, 5:28:09 AMApr 16
to Chromium Extensions, Uğur, wOxxOm, Deco, Chromium Extensions
I have enabled 'Continue running background apps when Google Chrome is closed' in the settings. I've also added 'background', 'notifications', 'gcm', and 'storage' to the 'permissions' section of the manifest.json. However, I only receive notifications after Chrome is opened once post-restart. Is it possible to receive notifications even without opening Chrome at least once after restarting?

Suraj SJARALI

unread,
Apr 16, 2025, 5:28:11 AMApr 16
to Chromium Extensions, Uğur, wOxxOm, Deco, Chromium Extensions
I have enabled 'Continue running background apps when Google Chrome is closed' in the settings. I've also added 'background', 'notifications', 'gcm', and 'storage' to the 'permissions' section of the manifest.json. However, I only receive notifications after Chrome is opened once post-restart. Is it possible to receive notifications even without opening Chrome at least once after restarting?

On Saturday, June 24, 2023 at 11:28:51 PM UTC+5:30 Uğur wrote:
Reply all
Reply to author
Forward
0 new messages