APIs & Integrations

aleksandr-swoop
Participant

DOMException: The operation is insecure in https://js.usemessages.com/conversations-embed.js

The error "DOMException: The operation is insecure" happens in https://js.usemessages.com/conversations-embed.js when accessing localStorage

 

Stack trace:

 
File webpack:///./js/embed-script-context/createEmbedScriptContext.js line 27 col 1 in createEmbedScriptContext
var useLocalBuild = localStorage && localStorage['live-chat-local-toggle'] === 'true';
File webpack:///./js/startOnceReady.js line 26 col 1 in init
var embedScriptContext = (0, _createEmbedScriptContext.createEmbedScriptContext)();
File webpack:///./js/startOnceReady.js line 42 col 1 in startOnceReady
init();
File webpack:///./js/start.js line 11 col 1 in onDOMReady
(0, _startOnceReady.startOnceReady)();
 
Here is the screenshot of the line where error happens
localStorage-error.png
 
This error happens only in Safari.
 
Here is article "Why using localStorage directly is a bad idea" https://michalzalecki.com/why-using-localStorage-directly-is-a-bad-idea/
 
Please fix the error.
0 Upvotes
3 Replies 3
IsaacTakushi
HubSpot Employee
HubSpot Employee

DOMException: The operation is insecure in https://js.usemessages.com/conversations-embed.js

Hi, @aleksandr-swoop.

 

Could you share a link to a page showing this error?


I am browsing my own website in Safari after conversations-embed.js fires, but no DOMException errors appear in my console.

I am running an older version of Safari (12.0 (14606.1.36.1.9)), however my colleague who is running 13.0.5 (15608.5.11) also doesn't see the error.

Isaac Takushi

Associate Certification Manager
0 Upvotes
aleksandr-swoop
Participant

DOMException: The operation is insecure in https://js.usemessages.com/conversations-embed.js

Hello @IsaacTakushi 

 

Thank you for response! Yes sorry. Let me add more context here. 

 

We use HubSpot support chat in our app. We just embedded in our page 

<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/{hubId}.js"></script>

If you want I can share more details about our app but not in public forum.

 

I see the error only in our error logging system. I cannot repro this myself.

 

But you can see possible cases for this error in linked article https://michalzalecki.com/why-using-localStorage-directly-is-a-bad-idea/

Please read it to understand and fix the problem.

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

DOMException: The operation is insecure in https://js.usemessages.com/conversations-embed.js

Thank you for the additioanl context, @aleksandr-swoop. The team is investigating.

You should receive updates via your support ticket with my colleague John O'Riordan, but I will also post updates here.

Isaac Takushi

Associate Certification Manager