title: How to test if Fetch API is available in Web Worker from main frame
body: <p>I'm using the <a href="https://developer.mozilla.org/en/docs/Web/API/Fetch_API" rel="nofollow noreferrer">Fetch API</a> when available in a browser by simply testing the <code>window.fetch</code>.</p>
  
  <p>However in the case of Safari 10, <code>fetch</code> is available in the main frame, which instantiate a web worker but it is not available in the web worker frame.</p>
  
  <p>Is there a way to test if a top level function is available in a web worker from the main frame ?</p>
  
  <p>Ideally, we could have a reference of the web worker instance and test if a property is available on the <code>self</code> object.</p>