Users of an experimental build of Firefox will be able to explore virtual reality inside the browser after Mozilla added support for the Oculus Rift headset.

People running Firefox Nightly will be able to use the Rift to experience 3D environments inside web pages, following the addition of support for the WebVR API.

Virtual reality allows users to traverse 3D spaces by donning a headset that tracks their head movements and allows them to look around a 3D computer-generated world.

While VR content on the web is scarce today, WebVR could eventually see VR scenes embedded into web pages, for example a car maker could embed a 3D 1:1 model of a vehicle for people to explore.

VR headsets are also yet to go mainstream, but towards the end of this year production is expected to begin of the consumer version of the Oculus Rift - the headset credited with kickstarting a resurgence of interest in VR.

The final version of the Rift is expected to have a resolution of at least 2560 x 1440 and to improve on the already impressive head tracking of the developer versions. Realising a high resolution is seen as important to reducing the 'screen door' effect when using the headset - the name given to the gaps between pixels that are visible when the user's eyes are right next to the screen.

Available now is the Samsung Gear VR, a headset that enables the user to snap in a Samsung Galaxy Note 4 phone to create a VR head-mounted display.

At about $200 for the headset and close to $1,000 for the phone the Samsung Gear VR is not the cheapest option. Those who want a taste of VR on the cheap can try Google Cardboard, which allows you to build a headset by slipping an Android phone running Jelly Bean 4.1 or newer into a cardboard headset costing as little as $2.

As browsers implement support for WebVR it should allow them to run VR apps on the Oculus VR, Gear VR, Google Cardboard and future headsets. Apps can be written in JavaScript and render two views of a 3D scene side-by-side using WebGL.

To try out virtual reality in Firefox Nightly users need to download the browser, install the WebVR Oculus Rift Enabler and open a dedicated browser window, referred to as a non-e10s.

Mozilla plans to add support to the beta and mainstream Firefox versions at a later date.

In a presentation from earlier this month Tony Parisi, from VR specialists Vizi, described WebVR as not ready for primetime on the Oculus, saying that latency is still an issue and software installation and device setup is clunky.

However, WebVR works "great" on Google Cardboard headsets and experimental version of the Chromium browser, according to Parisi, able to output smooth 3D images at 60fps. By Parisi's reckoning close to 500,000 Cardboard headsets have been shipped.

Tools for designing VR apps on the web are still "rough", he said, "especially compared to pro-tools like Unity and Unreal".

Other ways of creating VR web apps include GLAM (GL and Markup) - which allows apps to be built using a markup language and CSS.

WebVR support has also been added to certain builds of the Google's Chromium browser, the open source browser that Google Chrome draws its source code from.