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

OneSignal does not with the Brave browser #526

Closed
bitcoinvsalts opened this issue Jun 5, 2019 · 16 comments
Closed

OneSignal does not with the Brave browser #526

bitcoinvsalts opened this issue Jun 5, 2019 · 16 comments

Comments

@bitcoinvsalts
Copy link

bitcoinvsalts commented Jun 5, 2019

I am integrating OneSignal in my Vue app. it works good with Chrome but I am mainly use Brave and it seems it does not work. Any idea or suggestions?

@rgomezp
Copy link
Contributor

rgomezp commented Jun 5, 2019

Hello,
Thank you for bringing this up. After testing on my mobile Brave app, it appears push has not been set up for the time being. I suggest you bring this up in their community to confirm while referencing back to this issue.

@rgomezp
Copy link
Contributor

rgomezp commented Jun 17, 2019

Closing due to no response

@rgomezp rgomezp closed this as completed Jun 17, 2019
@kiily
Copy link

kiily commented Nov 24, 2021

Hi, is there any chance of having an update on this. It seems Brave is preventing OneSIgnal's worker js scripts from loading i.e. OneSignalSDKWorker.js and OneSignalSDKUpdaterWorker.js. Any idea why this could be?

@jkasten2
Copy link
Member

jkasten2 commented Nov 24, 2021

@kiily It seems Brave blocks installing the OneSignal service worker file OneSignalSDKWorker.js, or at least the importScripts('https://cdn.onesignal.com/sdks/OneSignalSDKWorker.js'); from it.

I see the following error from the console which I determined the above from.

ServiceWorkerManager.js:341 [Service Worker Installation] Installing service worker failed TypeError: Failed to register a ServiceWorker for scope ('https://onesignal.com/') with script ('https://onesignal.com/OneSignalSDKWorker.js?appId=ab76e2a0-6e87-4143-9b6f-452adb3e0742?sdkVersion=151510'): ServiceWorker script evaluation failed

Even when "disabling the shields" by clicking on Brave icon to the right of the Address bar. I recommend reporting this to Brave in hopes they can resolve this problem, at least for when the shields are down.

@kiily
Copy link

kiily commented Dec 8, 2021

Yeah seems to be what I have observed as well. I'll get in touch with them. Thank you.

@pandit69
Copy link

Having same issue

Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://cdn.onesignal.com/sdks/OneSignalSDKWorker.js' failed to load.
    at http://localhost:3000/OneSignalSDKWorker.js?appId=xxxxxx?sdkVersion=151512:1:1
    
[Service Worker Installation] Installing service worker failed TypeError: Failed to register a ServiceWorker for scope ('http://localhost:3000/') with script ('http://localhost:3000/OneSignalSDKWorker.js?appId=xxxxx?sdkVersion=151512'): ServiceWorker script evaluation failed

@rgomezp
Copy link
Contributor

rgomezp commented Dec 29, 2021

Separating the issue of it not working even without shields, the core issue is that Brave uses Easy List to block 3rd party scripts.

From my own conversations with the Brave team, it looks like they will not consider whitelisting certain URLs such as onesignal.com. To fix this, it would need to be removed from Easy List. However, Easy List has a strict policy and will block ANY 3rd party script that does any tracking whatsoever (such as session tracking -- regardless if no PID is collected). So unfortunately this doesn't look like it will be easily resolved.

As an idea, we may be able to develop a "lite" version of the OneSignal SDK in the far future as privacy browsers increase in popularity that provides basic push functionality and not much else.

@abhagsain
Copy link

@rgomezp It'd be great if we could proxy the request just like an analytics tool called Splitbee does at least for Next.js
Here's how they do it Documentation.

@bnd170
Copy link

bnd170 commented Jul 20, 2022

Any update about that?

@rgomezp
Copy link
Contributor

rgomezp commented Jul 25, 2022

@abhagsain @bnd170 ,
That might work. I don't think there's anything that is needed to do from OneSignal's side though. Was there anything extra you need to set up this sort of proxy method?

@cxnky
Copy link

cxnky commented Jan 5, 2023

is there any update on this?

@rgomezp
Copy link
Contributor

rgomezp commented Jan 9, 2023

From what I can tell, OneSignal is no longer blocked completely as I see the message received via the console. However, the message is not displaying.

Testing on tests.peter.sh doesn't appear to work either. So I'm not completely familiar with what Brave is doing behind the scenes, but it appears to me they don't fully support push notifications in general.

@djmtype
Copy link

djmtype commented Mar 5, 2023

After disabling Brave Shields the console error goes away, but there are 40 warnings all pertaining to SameSite.

Because a cookie’s SameSite attribute was not set or is invalid, it defaults to SameSite=Lax, which prevents the cookie from being sent in a cross-site request. This behavior protects user data from accidentally leaking to third parties and cross-site request forgery.

Resolve this issue by updating the attributes of the cookie:
Specify SameSite=None and Secure if the cookie should be sent in cross-site requests. This enables third-party use.
Specify SameSite=Strict or SameSite=Lax if the cookie should not be sent in cross-site requests.

I have no idea if this is what prevents OneSignal's alert from working in Brave when asking for the user's permission to subscribe.

@jkasten2
Copy link
Member

jkasten2 commented Aug 19, 2023

From what I can tell, OneSignal is no longer blocked completely as I see the message received via the console. However, the message is not displaying.

Testing on tests.peter.sh doesn't appear to work either. So I'm not completely familiar with what Brave is doing behind the scenes, but it appears to me they don't fully support push notifications in general.

Brave on desktop seems to disable push notifications by default (I don't think this is an issue on Android):
image

However once you enable this Brave setting on desktop and restart the browser that example push does work on tests.peter.sh.

@rgomezp
Copy link
Contributor

rgomezp commented Aug 21, 2023

From what I can tell, OneSignal is no longer blocked completely as I see the message received via the console. However, the message is not displaying.
Testing on tests.peter.sh doesn't appear to work either. So I'm not completely familiar with what Brave is doing behind the scenes, but it appears to me they don't fully support push notifications in general.

Brave on desktop seems to disable push notifications by default (I don't think this is an issue on Android): image

However once you enable this Brave setting on desktop and restart the browser that example push does work on tests.peter.sh.

Very interesting. It would be nice for this to be default on.

@jkasten2
Copy link
Member

I created an issue with Brave with the shields down not working:
brave/brave-browser#35461

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

No branches or pull requests

9 participants