This topic provides the basics for developing for Oculus Browser.
The user-agent (UA) string for Oculus Browser is:
Mozilla/5.0 (Linux; Android 7.1.1; Quest) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/18.104.22.168.38.210941660 SamsungBrowser/4.0 Chrome/81.0.4044.117 Mobile VR Safari/537.36
The UA string should not be used for feature detection.
The UA string for Oculus Quest devices is Quest.
Note the Browser and Chromium version numbers may be newer than stated above.
For Oculus Quest, Oculus Browser renders 2D web page content at 72Hz refresh rate by default, and WebXR content at 60Hz refresh rate by default.
For 2D web sites, users have the choice between 3 different widths of the Oculus Browser panel: 800px, 600px, and 400px. The height of the browser panel is 450px. Future versions of Oculus Browser may allow for more sizes or changes to these existing sizes, so be sure to support responsive design.
Oculus Browser supports both mobile and desktop browsing modes. In mobile mode, the Mobile token appears in the UA string and the meta viewport tag is supported. In desktop mode, there is no Mobile token in the UA string and any meta viewport tags are ignored.
Oculus Browser historically has defaulted to mobile mode and allowed users to request desktop mode on a per site basis. However, we are working to change this to default to desktop mode and allow users to request mobile mode on a per site basis (expected by summer 2020). Developers should test in both modes to ensure compatibility.
Oculus Browser supports using the Google Chrome developer tools to debug sites on your Oculus Quest device. This lets you access all of your familiar tools including the console, timeline, profiler, DOM viewer, etc. You’ll also be able to see a snapshot of what’s on screen in the headset right from your computer screen.
If you have not set up your device or have never connected your Oculus Quest to your development machine, see Debugging Your Content. Once set up, you can find the Oculus Browser tabs to inspect by using the dev tools Remote Devices panel while the developer mode enabled headset is connected.
Alternatively, most WebGL experiences can be debugged before you ever launch the Oculus Browser with just a little extra code. Here are some quick tips to debugging your experience locally before you enter VR: