Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Allow notifications API in content scripts #404

Closed
erosman opened this issue Jun 4, 2023 · 1 comment
Closed

Proposal: Allow notifications API in content scripts #404

erosman opened this issue Jun 4, 2023 · 1 comment
Labels
opposed: chrome Opposed by Chrome opposed: firefox Opposed by Firefox opposed: safari Opposed by Safari proposal Proposal for a change or new feature

Comments

@erosman
Copy link

erosman commented Jun 4, 2023

Preamble

Content scripts often need to show a notification. At the moment, the process involves adding a listener in the background script and then sending a message to the background script to generate the notifications.create().

Notification API should be a safe enough API to be allowed in the Content Script WebExtension APIs.

Proposal

Allow notifications in the Content Script WebExtension APIs

Purpose

Reduce reliance on the background script/service-worker/event-page
See also: #378, #403

@xeenon xeenon added proposal Proposal for a change or new feature and removed needs-triage labels Jun 8, 2023
@oliverdunk oliverdunk added the opposed: chrome Opposed by Chrome label Jun 8, 2023
@zombie
Copy link
Collaborator

zombie commented Jun 8, 2023

After a short discussion in the meeting, we decided against this proposal. Overall we believe in keeping the API surface of content scripts to a minimum, except when there's a strong use case that is better solved by exposing a specific API to that environment.

Sending a message to the background and (potentially) waking up the event page/service worker doesn't seem too burdensome, and the API is already asynchronous and "global" (not tied to a particular page where a content script is executing), so keeping the current state seems consistent with the API design and intended use.

Also note the regular web notifications DOM api is available to content scripts, and provides yet another potential option for extensions.

@zombie zombie closed this as completed Jun 8, 2023
@zombie zombie closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2023
@Rob--W Rob--W added opposed: safari Opposed by Safari opposed: firefox Opposed by Firefox labels Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
opposed: chrome Opposed by Chrome opposed: firefox Opposed by Firefox opposed: safari Opposed by Safari proposal Proposal for a change or new feature
Projects
None yet
Development

No branches or pull requests

5 participants