2

Possible Duplicate:
Can I programmatically access a smartphone's sensors through the browser and JavaScript?

Is it possible to get access to a smartphone's sensors data in a browser. i.e. Can we get data from a phone's Gyroscope at the browser level? Say in JS?

Community
  • 1
  • 1
Roozbeh15
  • 4,047
  • 6
  • 27
  • 30

2 Answers2

2

I recently discovered an abstract describing this feature as harmful because you can log the users' key strokes - it's called TouchLogger.

W3C has recently published DeviceOrientation Event Specification to allow web applications to access accelerometer and gyroscope sensors through Javascript Javascript, which both Android 3.0 and iOS4.2 will support. This suggests that our motion-based key logger can be delivered from a website, without requiring the user to install any application.

Source: http://www.cs.ucdavis.edu/~hchen/paper/hotsec11.pdf

So yes, the phone's Gyroscope must somehow be accessed in JS.

ottel142
  • 2,016
  • 1
  • 26
  • 37
0

No, unless the browser is a custom app which provides this data through a JavaScript interface (ie on iPhone, the iPhone app uses stringByEvaluatingJavaScriptFromString: to tell Safari that a sensor updated each time it does)

Tim
  • 14,447
  • 6
  • 40
  • 63