You don't/can't. You have to trust the server is sending you trustworthy js.
The only more tamper-resistant approach would be a browser extension, or a native application. Both have much higher friction.
Exactly my point, if you trust the server's js code to do encryption than might as well trust server side encryption.
Yes, the cse implementation is possible and a bit optimistic, but ulda server allows you to work with the server only by communicating with packages, but then you will have to implement a slightly specific application or solution