title: webFrame Context in electronjs
body: <p>Is there a way to get <code>webFrame</code> context to inject chrome-api, like electron does for webContents (or renderer process) in file <code>lib/renderer/content-script-injector.js</code> line number of the function <em>14</em> in electronjs version <em>3.0.14</em>.</p>
  
  <p>The following code is extract from electron repo. runInThisContext is 'vm' import and seems to run on rederer process of electron.</p>
  
  <pre><code>// Run the code with chrome API integrated.
  const runContentScript = function(extensionId, url, code) {
    const context = {};
    require('./chrome-api').injectTo(extensionId, false, context);
    const wrapper = `((chrome) =&gt; {\n  ${code}\n  })`;
    const compiledWrapper = runInThisContext(wrapper, {
      filename: url,
      lineOffset: 1,
      displayErrors: true
    });
    return compiledWrapper.call(this, context.chrome);
  };
  </code></pre>