title: Returning value from get function with content script
body: <p>I'm trying to make a function to return data from a worker but it doesn't seem to work, how should I do this?</p>
  
  <pre><code>function getExample()
  {
      worker = tabs.activeTab.attach({contentScript:
          "var testText = document.getElementsByClassName('exampleElement')[0].children[1].innerHTML;" +
          "self.port.emit('test', testText);"
      });
      worker.port.on('test', function(test) {return testText;});
  }
  </code></pre>