Skip to content

Conversation

@p1gp1g
Copy link

@p1gp1g p1gp1g commented Nov 28, 2025

This PR uses the new web push support (#2662) to get push notifications on the web application, even when nextcloud isn't opened in the browser.

It achieves 2 things:

  • it gives push notifications when nextcloud isn't opened: this is particularly useful for collaborative work, as nexcloud isn't always opened but we can expect to be notified anyway. (I won't miss call, polls, or events anymore)
  • it gives real time notifications, without the notify_push app (which adds a websocket support to nextcloud). It should reduce load on the server as the periodic fetch is reduce to once every 15min. When the server get a notification for a user, it sends it to the user through its push server (all modern browser are connected to a push server)

To work, this PR needs to add worker-src 'sefl' to the CSP by default:

https://github.com/nextcloud/server/blob/master/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php#L62

-	protected $allowedWorkerSrcDomains = null;
+	protected $allowedWorkerSrcDomains = "'self'";

@p1gp1g p1gp1g mentioned this pull request Nov 28, 2025
@wrenix
Copy link

wrenix commented Nov 28, 2025

You do not signoff your commits, could you please check the DCO CI job?

Thankyou for your fantastisc work

p1gp1g added 20 commits December 2, 2025 08:56
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Signed-off-by: sim <git@sgougeon.fr>
Allows receiving notifications when no tab is opened.
Needs the default CSP to allow `worker-src 'self'`

Signed-off-by: sim <git@sgougeon.fr>
To avoid concurrency fetch

Signed-off-by: sim <git@sgougeon.fr>
Move out onload from setWebPush

Signed-off-by: sim <git@sgougeon.fr>
@nickvergessen nickvergessen marked this pull request as draft December 2, 2025 09:48
@nickvergessen
Copy link
Member

Putting this one to Draft so the backend is merged first

@github-actions
Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants