more complete support for network-less electron frontend-backend communication including protected session

This commit is contained in:
azivner
2017-11-29 23:30:35 -05:00
parent 8bd76721ad
commit d0a0366b05
7 changed files with 41 additions and 29 deletions

12
app.js
View File

@@ -80,16 +80,24 @@ if (utils.isElectron()) {
req.url = arg.url;
req.method = arg.method;
req.body = arg.data;
req.headers = {};
req.headers = arg.headers;
const res = {
statusCode: 200
};
const res = {};
res.setHeader = function() {
};
res.status = function(statusCode) {
res.statusCode = statusCode;
};
res.send = function(obj) {
event.sender.send('server-response', {
requestId: arg.requestId,
statusCode: res.statusCode,
body: obj
});
};