Emscripten can compile C and C++ code to WebAssembly (WASM). WASM runs on a virtual machine that is provided by almost all modern browsers. This allows for compiling the SWI-Prolog source to WASM and run it in your browser. We keep up-to-data instructions for building the WASM version on the wiki page.
Currently the WASM version is a fairly comprehensive version of SWI-Prolog. It contains the core and a good selection of the packages, including many of the foreign packages.