The best way for you to identify this scenario would be to use the WEBGL_debug_renderer_info extension, where available, and detect the use of SwiftShader or Mesa/llvmpipe yourself. I don't think the WebGL implementation will signal even to the JS console that performance is expected to be low, and if it did, I don't think the JS app can interpose on that to receive it programmatically.
You can also measure performance in your app and warn the user if the framerate appears to be unacceptable. However, I'd caution against preventing users from accessing your content simply based on low frame rate; there can be other reason this happens, including heavy load on the system. Sometimes situations like this are recoverable, and you wouldn't want your app feeling "fragile".
P.S. Sorry for slow reply; the moderation notifications for new posters went into my spam folder.