4

I want to demo a web page being used to interact with a physical object in the same proximity as a web-enabled device (Mac/Windows/Linux laptop). In order to do this, I want to create my own window.bluetooth object in Javascript that will provide an interface to the host device's Bluetooth controller via the Serial Port Profile. For now it's just a demo, but I might want to develop a generic API to abstract Bluetooth drivers in Javascript.

I'm not particularly concerned with portability or generic solutions at this point. I just want to see if it would work on my laptop with a device I'm building using a BlueSMiRF Silver modem. I know Google Chrome extensions are capable of injecting Javascript into every page the user visits, and NPAPI is capable of compiling native OS code into a form that can communicate with Javascript. It looks like someone has done something vaguely similar before with slightly more specific applications.

My question is, is a Chrome extension with NPAPI the best way to do this? Alternatives could be Flash or a Java applet, but those are kind of 1996 solutions. Here are the metrics I use to evaluate a solution:

  • Feasibility. Is it possible?
  • Ease of development. How many lines of code would it take?
  • Leverage. Does anything else out there already do something similar?

For those of you thinking it's preposterous for the browser to monitor lower-level network status, it's already been done with Wi-Fi.

Community
  • 1
  • 1
Zach Rattner
  • 20,745
  • 9
  • 59
  • 82
  • 1
    Not encouraging users to install Java is a good thing, but what are the actual arguments against doing this with Flash? If it can be done with an existing plugin with a big install base, you get around distribution issues, avoid another attack vector, probably save yourself a lot of time, ... – Georg Fritzsche Mar 07 '13 at 13:17
  • If it is feasible for you to write a Chrome App instead of a web page, you can use chrome.bluetooth API (https://developer.chrome.com/trunk/apps/bluetooth.html). – 方 觉 Mar 08 '13 at 22:06

0 Answers0