<p>yes, the TCPSocket API is only enabled by default on Firefox OS and off by default in desktop Firefox, so it cannot be used from a webpage, but I figured it may be possible to do from an extension, but I wasn't sure as I'd never tried, but after doing a little more research it does look possible: according to <a href="http://stackoverflow.com/a/26359452/2965637">http://stackoverflow.com/a/26359452/2965637</a> you should be able to create a TCPSocket instance from an extension using the following:</p>

<div class="highlight highlight-js"><pre><span class="pl-s">var</span> socket <span class="pl-k">=</span> Cc[<span class="pl-s1"><span class="pl-pds">"</span>@mozilla.org/tcp-socket;1<span class="pl-pds">"</span></span>].createInstance(Ci.nsIDOMTCPSocket);</pre></div>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/opentechinstitute/mlab-browser-ext/issues/22#issuecomment-68895174">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AC7qBP7BM-INp7bkoNhscx4xi8WbT6UYks5nfA2egaJpZM4CoJ1I.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/opentechinstitute/mlab-browser-ext/issues/22#issuecomment-68895174"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>