javascript - How to open a Chrome Packaged App with a parameter on Windows? -
i'm trying create file handler on app, i've not chrome os way try code launch app command line file in parameter. question is: how?
i've tried chrome --appid=[theidofmyapp] --[path of file open] opens app , entry function same when open mado no parameters.
to check if have entry :
chrome.app.runtime.onlaunched.addlistener(function(items) { console.log(items); // code open app's window... }); it returns me object {iskiosksession: false}.
[update]
my manifest looks (these file handlers , permissions parts):
"file_handlers": { "text": { "types": ["text/md"], "title": "myapp" } }, "permissions": [ {"filesystem": ["write", "retainentries"]}, {"mediagalleries": ["read", "allautodetected"]}, "storage", "webview" ] [end of update]
does know how check if app's file handler working on windows? code correct?
thanks help.
thanks ben wells, it's working now. code (if has same problem 1 day):
in manifest.json:
"file_handlers": { "text": { "extensions": [ "md" ], "title": "yourapp" } }, and on command line (remove (x86) if you're on 32-bit windows):
"c:\program files (x86)\google\chrome\application\chrome.exe" --app-id=yourappid "c:\path\to\document.md" if want see if app has detect parameter, add code above (the block begins chrome.app.runtime.onlaunched) background javascript.
Comments
Post a Comment