cardboard-vr-display is a JavaScript implementation of a WebVR 1.1 VRDisplay. This is the magic behind rendering distorted stereoscopic views for browsers that do not support the WebVR API with the webvr-polyfill.
The base example parses the query params in the URL to pass configuration into a CardboardVRDisplay. Some examples links below.
There are other examples for testing other use cases. They also respond to the query params passed into the URL.