"disable_sanitize_html = true" disables all saving and shareing

I use version 6.4.x on Ubuntu in a WM in AWS.
I need HTML with embedded javascript and websockets.

I have two problems; to enable the HTML with javascript I must set “disable_sanitize_html = true”
However this disable all saving and sharing etc. I have tried many times, I get the HTML code running but can no longer save…

My second problem is that the websockets does not connect, but that still might be my error somehow.