Electron 24 - protocol handler (#85)

* added idea and coverage directories under gitignore

* electron-24: implemented handlers to process protocol actions

* electron-17: implemented use case for opening app if it is not open and handle the protocol url

* electron-24: added code and documentation comments

* electron-24: added unit tests for the protocol handler

* added npm-debug log to gitignore

* electron-24: added protocol handler support for windows

* electron-24: made changes as per comments on the PR

* electron-16: added more comments and further refactoring
This commit is contained in:
Vishwas Shashidhar
2017-05-13 23:53:44 +05:30
committed by Lynn
parent 4694e5206a
commit cda34b1d70
9 changed files with 307 additions and 41 deletions

View File

@@ -10,6 +10,7 @@ const windowMgr = require('./windowMgr.js');
const log = require('./log.js');
const activityDetection = require('./activityDetection/activityDetection');
const badgeCount = require('./badgeCount.js');
const protocolHandler = require('./protocolHandler');
const apiEnums = require('./enums/api.js');
const apiCmds = apiEnums.cmds;
@@ -69,6 +70,15 @@ electron.ipcMain.on(apiName, (event, arg) => {
return;
}
if (arg.cmd === apiCmds.checkProtocolAction) {
protocolHandler.checkProtocolAction();
return;
}
if (arg.cmd === apiCmds.registerProtocolHandler) {
protocolHandler.setProtocolWindow(event.sender);
}
if (arg.cmd === apiCmds.badgeDataUrl && typeof arg.dataUrl === 'string' &&
typeof arg.count === 'number') {
badgeCount.setDataUrl(arg.dataUrl, arg.count);
@@ -100,4 +110,4 @@ module.exports = {
shouldCheckValidWindow: function (shouldCheck) {
checkValidWindow = shouldCheck;
}
}
};