code: function runPreloadScript (preloadSrc) {
    const preloadWrapperSrc = `(function(require, process, Buffer, global, setImmediate, clearImmediate, exports) {
    ${preloadSrc}
    })`
  
    // eval in window scope
    const preloadFn = binding.createPreloadScript(preloadWrapperSrc)
    const { setImmediate, clearImmediate } = require('timers')
  
    preloadFn(preloadRequire, preloadProcess, Buffer, global, setImmediate, clearImmediate, {})
  }
docs: Wrap the script into a function executed in global scope. It won't have access to the current scope, so we'll expose a few objects as arguments:  - `require`: The `preloadRequire` function - `process`: The `preloadProcess` object - `Buffer`: Browserify `Buffer` implementation - `global`: The window object, which is aliased to `global` by browserify.  Browserify bundles can make use of an external require function as explained in https://github.com/substack/node-browserify#multiple-bundles, so electron apps can use multi-module preload scripts in sandboxed renderers.  For example, the user can create a bundle with:  $ browserify -x electron preload.js > renderer.js  and any `require('electron')` calls in `preload.js` will work as expected since browserify won't try to include `electron` in the bundle, falling back to the `preloadRequire` function above.