{"action":"created","issue":{"url":"https://api.github.com/repos/hundredrabbits/Left/issues/34","repository_url":"https://api.github.com/repos/hundredrabbits/Left","labels_url":"https://api.github.com/repos/hundredrabbits/Left/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/hundredrabbits/Left/issues/34/comments","events_url":"https://api.github.com/repos/hundredrabbits/Left/issues/34/events","html_url":"https://github.com/hundredrabbits/Left/issues/34","id":271380426,"number":34,"title":"'Open-with' context option doesn't seem to work with Left.","user":{"login":"Zaeche","id":6967538,"avatar_url":"https://avatars1.githubusercontent.com/u/6967538?v=4","gravatar_id":"","url":"https://api.github.com/users/Zaeche","html_url":"https://github.com/Zaeche","followers_url":"https://api.github.com/users/Zaeche/followers","following_url":"https://api.github.com/users/Zaeche/following{/other_user}","gists_url":"https://api.github.com/users/Zaeche/gists{/gist_id}","starred_url":"https://api.github.com/users/Zaeche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zaeche/subscriptions","organizations_url":"https://api.github.com/users/Zaeche/orgs","repos_url":"https://api.github.com/users/Zaeche/repos","events_url":"https://api.github.com/users/Zaeche/events{/privacy}","received_events_url":"https://api.github.com/users/Zaeche/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2017-11-06T07:22:14Z","updated_at":"2018-03-04T23:36:04Z","closed_at":null,"author_association":"NONE","body":"> _OS: Windows 10 (64-bit); version 1703_\r\n\r\nWhile the app wasn't running, I tried setting Left as the default app for my .txt files, but it seems this doesn't work. Even dragging and dropping the text-file on top of the Left executable doesn't communicate the text file's path to the app. It loads the last file opened by either a) dragging and dropping into the window b) loaded via ctrl+open when Left was actually running.\r\n\r\nI don't know if this is an issue that's particularly critical but from the scant reading I've done on the issue [here for instance](https://github.com/electron/electron/issues/9925) it seems this _should_ just be baked into the open-file event. It also appears to be an issue on Macs, though I haven't been able to confirm it on Windows.\r\n\r\nI'm trying to see if I can mend this on my own, but I haven't been able to crack _precisely_ what's wrong so far (my lack of experience with this general framework notwithstanding).\r\n\r\nIs there a fix for this I've overlooked? **Alternatively**, if I can be set on the right path, I wouldn't mind trying to sort this out on my own."},"comment":{"url":"https://api.github.com/repos/hundredrabbits/Left/issues/comments/370275128","html_url":"https://github.com/hundredrabbits/Left/issues/34#issuecomment-370275128","issue_url":"https://api.github.com/repos/hundredrabbits/Left/issues/34","id":370275128,"user":{"login":"Zaeche","id":6967538,"avatar_url":"https://avatars1.githubusercontent.com/u/6967538?v=4","gravatar_id":"","url":"https://api.github.com/users/Zaeche","html_url":"https://github.com/Zaeche","followers_url":"https://api.github.com/users/Zaeche/followers","following_url":"https://api.github.com/users/Zaeche/following{/other_user}","gists_url":"https://api.github.com/users/Zaeche/gists{/gist_id}","starred_url":"https://api.github.com/users/Zaeche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zaeche/subscriptions","organizations_url":"https://api.github.com/users/Zaeche/orgs","repos_url":"https://api.github.com/users/Zaeche/repos","events_url":"https://api.github.com/users/Zaeche/events{/privacy}","received_events_url":"https://api.github.com/users/Zaeche/received_events","type":"User","site_admin":false},"created_at":"2018-03-04T23:36:04Z","updated_at":"2018-03-04T23:36:04Z","author_association":"NONE","body":"Hello again folks! I've been chipping away at the ElectronJS boulder when I've had the time and I've slowly come to the point where I think I've almost got the open-with stuff working in Left? Almost.\r\n\r\nFrom what I've seen online, what I have working in a CLI setting ought to carry over after packaging too (but naturally it's not).\r\n\r\nI've also run into some conflicts when packaging with a couple of modules which frustrates me, (_especially_ tmp since I was using that to handle zero argv cases in my tests), but these are easily circumvented.\r\n\r\n\r\n\r\n![left-demo-gif](https://user-images.githubusercontent.com/6967538/36952146-04c8e898-1fda-11e8-80fe-23d442be233e.gif)\r\n\r\n\r\n\r\nA quick sampling of the code below. I added this inside app.on(\"ready\", () => **in main.js**\r\n\r\n```js\r\nconst fs = require('fs');\r\nconst {webContents} = require('electron');\r\n\r\n    if (process.argv.length < 3) { //add copy to packaged dir + replace with tmp stuff when module works...\r\n        var file_path = __dirname + \"/LICENSE.md\";\r\n    } else {\r\n        var file_path = fs.realpathSync(process.argv[2],[]);\r\n    }\r\n\r\n    fs.readFile(file_path, 'utf8', function(err, data) {\r\n        if (err) throw err;\r\n        preloaded_data = data;\r\n\r\n        console.log(data); //DEBUG\r\n        console.log(\"PATH\" + file_path); //DEBUG\r\n      })\r\n\r\n      app.win.webContents.on('did-finish-load', () => {\r\n          app.win.webContents.send('ping', preloaded_data)\r\n       }) \r\n```\r\n\r\nAnd this to **index.html**:\r\n\r\n```js\r\n require('electron').ipcRenderer.on('ping', (event, message) => {\r\n          left.write_to_left(message);\r\n        })\r\n```\r\n_Quick note: the 'write_to_left' function is simply a call to left.load(path) inside left.js._\r\n\r\nI thought I'd throw my progress out there and see if I can't get some help with this. **I'm currently stuck at getting the file_path when opening a file with a packaged version of Left**--unfortunately, it currently just defaults to the zero argument handler I've set up above. \r\n\r\nI believe this might be an OS-specfiic quirk but I haven't been able to track down a solution so far that works.\r\n\r\nThere are some other--minor--foibles which I'll tackle at some other time.\r\n\r\n\r\n> Using Nodejs + Windows 10 (64-bit). Making  use of the latest electron-packager to package.\r\n\r\n\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"Zaeche"}}