Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@
};
})();
//#endregion
//#region Prevent natives from being required as it will crash Electron 2+
(function () {
const Module = require('module');
const originalLoad = Module._load;

Module._load = function (request) {
if (request === 'natives') {
throw new Error('Cannot require the "natives" node module');
}
return originalLoad.apply(this, arguments);
};
})();
//#endregion

// Will be defined if we got forked from another node process
// In that case we override console.log/warn/error to be able
Expand Down