diff --git a/src/Main.js b/src/Main.js index ffc14d3f71..79f96e9ed1 100644 --- a/src/Main.js +++ b/src/Main.js @@ -34,10 +34,22 @@ ipc.on('application:quitting', opts => { }); ipc.on('application:open-url', opts => { - console.log('Creating container'); - var url = opts.url.substr(19); - console.log(url); - ContainerStore.create(url, 'latest', () => {}); + console.log('Creating container from protocol'); + var parser = document.createElement('a'); + parser.href = opts.url; + + if (parser.protocol !== 'docker:') { + return; + } + + var pathname = parser.pathname.replace('//', ''); + var slash = pathname.indexOf('/'); + var base = pathname.slice(0, slash); + + if (base === 'runRepo') { + var repo = pathname.substring(slash + 1); + ContainerStore.create(repo, 'latest', () => {}); + } }); SetupStore.setup().then(() => { diff --git a/util/Info.plist b/util/Info.plist index 6a030f001b..5efd29e633 100644 --- a/util/Info.plist +++ b/util/Info.plist @@ -31,10 +31,10 @@ CFBundleURLSchemes - kitematic + docker CFBundleURLName - Kitematic Session Protocol + Docker App Protocol