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

Enable Notifications doesn't work on strims.gg, but works on chat.strims.gg #453

Open
bliutwo opened this issue Jun 10, 2021 · 0 comments
Open

Comments

@bliutwo
Copy link

bliutwo commented Jun 10, 2021

Currently, (only tested on Firefox on macOS) you cannot enable push notifications from strims.gg, but you can from chat.strims.gg. The console shows this error if you try directly from strims.gg:

The Notification permission may only be requested in a top-level document or same-origin iframe.

According to MDN docs, linked below, this is because:

Chrome and Firefox no longer allow notification permissions to be requested from cross-origin <iframe>s

According to the Stack Overflow link below,

In newer versions of Chrome you cannot request the Notification API, unless the site is https secured and also you cannot request it from a cross-origin iframe.

If you do meet this requirements, you should be able to use notifications and background push notifications on Chrome.

Potentially useful links:

According to Slugalisk:

you might be able to borrow part of the solution from the chat stream links implementation

https://github.com/MemeLabs/Rustla2/blob/master/src/actions/postmessage.js

https://github.com/MemeLabs/chat-gui/blob/master/assets/chat/js/chat.js#L495

@bliutwo bliutwo changed the title Enable Notifications from strims.gg instead of chat.strims.gg Enable Notifications doesn't work on strims.gg, but works on chat.strims.gg Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant