OneSignal-Website-SDK icon indicating copy to clipboard operation
OneSignal-Website-SDK copied to clipboard

[Bug]: [Firefox] Request to access cookie or storage on “https://cdn.onesignal.com/sdks/OneSignalSDK.js” was blocked because it came from a tracker and content blocking is enabled.

Open quarryman opened this issue 1 year ago • 1 comments

What happened?

Starting from Firefox version 109 I am getting next error in console It's clear this comes from browser policy to prevent 3-d party services from tracking users.

I consider this is known however I didnt find direct best practice from OneSignal how to deal with it.

What browsers are you seeing the problem on?

Firefox

What operating system are you running?

macOS SONOMA 14.2

Steps to reproduce?

Add OneSignal CDN to page
Get error in console in Firefox

What did you expect to happen?

CDN script to execute and work without errors

Relevant log output

No response

quarryman avatar Dec 27 '23 06:12 quarryman

@quarryman Thanks for reporting, I was able to reproduce the warning in Firefox 121.0 with default settings, but everything continues to work correctly.

Request to access cookie or storage on “<URL>” was blocked because it came from a tracker and content blocking is enabled. 4

Request to access cookie or storage on “https://onesignal.com/sdks/OneSignalSDK.js” was blocked because it came from a tracker and content blocking is enabled.
Request to access cookie or storage on “https://cdn.onesignal.com/sdks/OneSignalPageSDKES6.js?v=151605” was blocked because it came from a tracker and content blocking is enabled.
Request to access cookie or storage on “https://onesignal.com/api/v1/sync/f246ca4c-d595-454b-8c7e-4ddfad76e978/web?callback=__jp0” was blocked because it came from a tracker and content blocking is enabled.
Request to access cookie or storage on “https://onesignal.com/sdks/OneSignalSDKStyles.css?v=2” was blocked because it came from a tracker and content blocking is enabled.

image Screenshot from Firefox 121.0's JS console

Work around to hide some console warnings

crossorigin="anonymous" can be added to the <script> tag where you include OneSignal, as noted by Mozilla's docs, however this only removes 2 of the 4 warnings.

Follow up

We will investigate more if this should be the new recommendation for integrating the OneSignal SDK. Also on how the other 2 warnings can be addressed.

jkasten2 avatar Jan 03 '24 21:01 jkasten2