title: How should a browser interact with a local device?
body: <p><strong>How should this be implemented?</strong></p>
  
  <ol>
  <li>User has a USB device ("doorbell") attached to their machine.</li>
  <li>User goes to the client's web page and clicks a link.</li>
  <li>A notification appears "Please press the doorbell."</li>
  <li>User presses doorbell, website is notified.</li>
  </ol>
  
  <p>The "doorbell" is actually a complex device with its own SDK, and it's sending back a big blob of data. The device manufacturer provides SDKs for both Windows and OSX. I can write native code for either platform to interact with the device at the OS level.</p>
  
  <h2>Plan A</h2>
  
  <ol>
  <li><code>LocalWatchdog</code> process runs on the user's machine.</li>
  <li>Browser plugin catches the webpage event</li>
  <li>Browser plugin does <strong>something</strong> (using NPAPI?) to signal <code>LocalWatchdog</code></li>
  <li><code>LocalWatchdog</code> pops the notification &amp; gets the doorbell-press event</li>
  <li><code>LocalWatchdog</code> does <strong>something</strong> to tell the plugin that the doorbell has been pressed.</li>
  <li>The plugin tells the website.</li>
  </ol>
  
  <h2>Plan B</h2>
  
  <ol>
  <li>The website downloads a Java applet which runs locally on the user's machine.</li>
  <li>The applet pops the notification.</li>
  <li>The applet does <strong>something</strong> to catch the doorbell-press event.</li>
  <li>The applet tells the website the doorbell has been pressed.</li>
  </ol>
  
  <p>Other plans welcomed, but in any case, what are the <strong>somethings</strong>?</p>
  
  <ul>
  <li>Any language is acceptable.</li>
  <li>Non-trivial installation process is acceptable.</li>
  <li>Must run on OSX and Windows. If I have to write it twice, I will.</li>
  <li>Must run with Chrome, Firefox, and IE. If I have to write it three times, I will.</li>
  </ul>