There is a WebCrypto API in browsers. It allows clients to sign data. However, it seems to me that it does not prevent web page to access the private key.
After key has been generated, it can be marked as non-extractable and can be saved to IndexedDb API.
How to generate the key, that it is clear for the client that web page could not access the private key during the generation?
For instance, web page can generate extractable key and then import it as non extractable and send the private key to the server, which served the web page.
(Is it possible to ensure this without proprietary addons?)