I need to launch Chrome from command line with custom parameter, which contains path to some js-file. Further this path will be used in extension.
I browsed carefully all related documentation and clicked all nodes in Chrome debugger, but found nothing which can resemble on command line parameters. Is it possible anyway to get these parameters or it's need to write more complex npapi-extension? (theoretically in such npapi- extension we able to get self process through win-api, command line of self process and so on).
Hack alert: this post suggests passing a fake URL to open that has all the command-line parameters as query string parameters, e.g.,
chrome.exe http://fakeurl.com/?param1=val1¶m2=val2
Perhaps pass the path to your extension in a custom user agent string set via the command line. For example:
chrome.exe --user-agent='Chrome 43. My path is:/path/to/file'
Then, in your extension:
var path = navigator.userAgent.split(":");
console.log(path[1])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With