[1] https://www.mailvelope.com/
[2] https://www.mailvelope.com/en/blog/gmx-and-web-de-launch-pgp
load scripts, css, images. show native window (clearly different than anything js can do) with that rich text editor inside. user types message in, system encrypts (and/or signs) the message. regular html page sees the result.
Obligatory warning: it's in an alpha state according to the readme, so you shouldn't use it yet for real.
You shouldn't do that anyway because you're giving your password (and your keys if you encrypt!) away with that.
The problems are that some people hate the certification scheme of S/MIME and use GPG which isn't better at all. Then it's user unfriendly to generate the certificates (if you want to be a good email provider, do the job to provide your users with signing of certs) cert and to get them onto all of your devices (I'm looking at you Apple!).
Currently my threat-and-countermeasure model doesn't include obfuscation from the eyes of state actors. I do want to change that, though, so I'll have to break this habit.
Special UI for storing private/public pairs in a browser (private key never leaves the PC) special javascript commands (assume some standard here) to invoke native windows which can not be controlled via js. sign, type message, encrypt. confirm this specific message is actually signed by specific person (pretty trivial in terms of coding and bulletproof UI, except for "public identity storage" part which exceptionally hard).
Looks like very simple htmlsomething standard could overturn all the state of modern web privacy.