Prevent browserify from leaking the require function
Define a "require" argument in the wrapper functions that runs browserify bundles, which will prevent browserify from leaking the require function. Note that this doesn't affect the isolated renderer script, only when `-r` flag is passed to browserify command it will export a require function. It is still added to isolated renderer script to prevent future mistakes(doesn't hurt defining a "require" local).
This commit is contained in:
parent
e1aebef57c
commit
bf756e3c00
2 changed files with 2 additions and 2 deletions
|
@ -206,7 +206,7 @@ void AtomSandboxedRendererClient::DidCreateScriptContext(
|
|||
std::string preload_bundle_native(node::preload_bundle_data,
|
||||
node::preload_bundle_data + sizeof(node::preload_bundle_data));
|
||||
std::stringstream ss;
|
||||
ss << "(function(binding, preloadPath) {\n";
|
||||
ss << "(function(binding, preloadPath, require) {\n";
|
||||
ss << preload_bundle_native << "\n";
|
||||
ss << "})";
|
||||
std::string preload_wrapper = ss.str();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue