title: Can a site invoke a browser extension?
body: <p>I am a newbie to the browser extension development and I understand the concept of browser extensions altering the page and injecting codes into it.</p>
  
  <p>Is there a way this direction can be turned around? I write an extension that provides a set of APIs, and web sites that want to use my extension can detect its presence and if it is present, the website can call my API methods like <code>var extension = Extenion(foo, bar)</code>. Is this possible in Chrome, Firefox and Safari?</p>
  
  <p>Example:</p>
  
  <ol>
  <li><p>Google created a new extension called BeautifierExtension. It has a set of APIs as JS objects.</p></li>
  <li><p>User goes to reddit.com. Reddit.com detects BeautifierExtension and invoke the API by calling <code>beautifer = Beautifier();</code></p></li>
  </ol>
  
  <p>See #2 - normally it's the extension that detects the matching sites and alter the pages. What I am interested to know is whether #2 is possible.</p>