If C ++ code should be on the client, then there is no easy way to do this for a web application. The solution may include coding plugins for the browsers you want to support, which can then be accessed from javascript code.
If, for example, it is necessary for a client application, this is a different case. This was done and associated with binding your application to (or running from the outside), for example, using the chrome library or any other JavaScript execution mechanism. This way you can create bindings to C ++ classes and use such objects from javascript and vice versa. Please note that this is also not a trivial solution and may require a lot of effort (additional resources are also required).
Lyubomir Vasilev
source share