0

Presently, I have a Rails CMS that allows a user to upload an image. Before saving it to the database, the page displays a 2D preview of their image. After saving, the preview is removed and the image is instead rendered to the user as a 3D panorama inside an iframe.

Ideally, I would like to create a whitelist of browsers that allow the user to view the saved image as a 3D panorama - otherwise the image remains 2D.

My question is that, given A-Frame does not support Internet Explorer (and potentially earlier versions of other browsers), how do I detect which specific browser a user is viewing the website with?

I've read through the Utils documentation and this thread on device detection, however neither yield any insights.

Any advice would be appreciated :)

  • As a heads up, for both cleanliness and intuitiveness I ended up using the Ruby Gem ["Browser"](https://github.com/fnando/browser). – Mr-Nicholas Sep 01 '16 at 11:44

1 Answers1

0

You can use navigator.userAgent to determine browser information. Tons of utilities for it online, not only specific to A-Frame.

A-Frame has several utilities, currently not documented:

AFRAME.utils.isMobile

AFRAME.utils.isIOS

AFRAME.utils.isGearVR

ngokevin
  • 12,980
  • 2
  • 38
  • 84