Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Livechat doesn't work with Brave browser (all platforms) #531

Closed
dlecan opened this issue Nov 6, 2020 · 3 comments
Closed

Livechat doesn't work with Brave browser (all platforms) #531

dlecan opened this issue Nov 6, 2020 · 3 comments

Comments

@dlecan
Copy link

dlecan commented Nov 6, 2020

Hello,

I would like to report a broken behaviour of the rocket.chat Livechat widget on my site: https://unikname.com

Only with Brave Browser (Linux, Windows, recent browser versions), the Livechat widget doesn't work with the following errors:

Store.js:43 Uncaught TypeError: Cannot read property 'setItem' of null
    at Store.js:43
connection.js:35 Connecting error:  TypeError: Cannot read property 'setItem' of null
    at e.value (Store.js:64)
    at e.value (Store.js:70)
    at main.js:26
    at s (runtime.js:63)
    at Generator._invoke (runtime.js:293)
    at Generator.next (runtime.js:118)
    at Ae (62.chunk.58722.js:1)
    at a (62.chunk.58722.js:1)
...

window.sessionStorage or window.localStorage are null in the Live iframe 😳

It works perfectly when:

  • using Chrome, Chromium and Firefox
  • disabling Brave protection on our site

So it's a Brave's bug, isn't it?
Maybe yes.

Maybe not, because the Livechat on https://rocket.chat is working perfectly too with Brave (with protections of course).

Do you know why? How to make the Livechat working with Brave on my website?

Thank you

@dlecan dlecan changed the title Weird behaviour with Brave browser Livechat doesn't work with Brave browser (all platforms) Nov 13, 2020
@dlecan
Copy link
Author

dlecan commented Nov 16, 2020

I've found this to explain the issue: RocketChat/Rocket.Chat#17786
I consider it as a workaround.

EDIT: wrong testing, it still doesn't work

@dlecan
Copy link
Author

dlecan commented Nov 19, 2020

So it's a feature of Brave: smart tracking, which blocks storage from first-party trackers.

The livechat is working on https://rocket.chat because the livechat iframe is loaded from a subdomain of domain of the top frame (rocketchatsales.rocket.chat "included" in rocket.chat).

See implementation discussion about smart tracking brave/brave-browser#803

A partial workaround would be to polyfill localstorage, sessionstorage in the iframe if they are undefined.
Core features would still be broken because the livechat "data" wouldn't be persistent, but the chat could be opened again and used in a "stateless" manner as if the user would delete all its website data when the browser is closed.

I would be happy to open a pull request to provide such small polyfill but wish to confirm interest from the maintainers first.

cc @rafaelblink @ggazzo

@dlecan
Copy link
Author

dlecan commented Nov 25, 2020

Final discussion: it's a Brave feature, which brakes the Livechat iframe.
For explanations 👉 brave/brave-browser#8514

@dlecan dlecan closed this as completed Nov 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant