morethanwords / tweb

Telegram Web K, GPL v3
https://web.telegram.org/k/
GNU General Public License v3.0
1.86k stars 595 forks source link

Implement way for display stickers/emoji without wasm #114

Open Azq2 opened 2 years ago

Azq2 commented 2 years ago

Is your feature request related to a problem? Please describe. I tried to use this client on localhost with CSP headers, but wasm not works without 'unsafe-eval' App works, but any big emoji or animated stickers not shown.

Uncaught (in promise) RuntimeError: abort(CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder). Build with -s ASSERTIONS=1 for more info.
    at abort (rlottie-wasm.js:1:13126)
    at rlottie-wasm.js:1:14788

My CSP headers:

add_header Content-Security-Policy "script-src 'self'; object-src 'self';";

// CSP with unsafe-eval is useless :)

Describe the solution you'd like It would be cool if we implement fallback for case, when wasm rlottie not works/not loaded.

Describe alternatives you've considered In https://github.com/Ajaxy/telegram-tt stickers works with CSP (But this client has 10 times more bugs. Not usable at all).

Additional context image image image