Commit 85f1d840 authored by Andreas Heimann's avatar Andreas Heimann

added custom protocol

parent f516a543
const { app, BrowserWindow } = require('electron'); const { app, BrowserWindow, protocol } = require('electron');
const PROTOCOL_PREFIX = "csinstall";
app.setAsDefaultProtocolClient(PROTOCOL_PREFIX);
function createWindow () { function createWindow () {
const win = new BrowserWindow({ const win = new BrowserWindow({
...@@ -15,6 +18,11 @@ function createWindow () { ...@@ -15,6 +18,11 @@ function createWindow () {
win.webContents.openDevTools(); win.webContents.openDevTools();
win.setMenuBarVisibility(false); win.setMenuBarVisibility(false);
protocol.registerHttpProtocol(PROTOCOL_PREFIX, (req, cb) => {
const fullUrl = formFullTodoUrl(req.url);
console.log(fullUrl);
});
} }
app.whenReady().then(createWindow); app.whenReady().then(createWindow);
......
...@@ -6,6 +6,11 @@ ...@@ -6,6 +6,11 @@
"scripts": { "scripts": {
"start": "electron ." "start": "electron ."
}, },
"protocols": [{
"name": "customspeens",
"role": "CustomSpeens",
"schemes": ["csinstall"]
}],
"author": "Andreas Heimann", "author": "Andreas Heimann",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment