0

From the command line, I can open a url as a chrome application by running e.g.

chromium --app=https://www.stackoverflow.com

Is it possible to do open a url in this mode from javascript in an existing page? To be clear, the url should ideally be opened in a new window, which has the properties implied by the --app flag (e.g. no address bar), whether or not the current page is running in that mode.

My reason for asking is that I'd like to integrate this into vimium.

ajp
  • 1,723
  • 14
  • 22
  • possible duplicate of [Open URL in same window and in same tab](http://stackoverflow.com/questions/8454510/open-url-in-same-window-and-in-same-tab) – Maximillian Laumeister Aug 09 '15 at 00:16
  • @MaximillianLaumeister in this question I want the url to open in a separate window, which has some different properties (granted by the --app flag, or its javascript equivalent) – ajp Aug 09 '15 at 00:23
  • You will have to be more specific. What different properties do you mean? – Maximillian Laumeister Aug 09 '15 at 00:24
  • I just updated the question - for example, I'm interested in the new window not displaying the address bar. – ajp Aug 09 '15 at 00:26
  • Just to be clear, Do you want to open an external application (chrome with flags) from Javascript? – MAC Aug 09 '15 at 00:37
  • not necessarily. I know that one way to open a url in chrome while not displaying the address bar is to launch it from the command line, using the --app flag. I am now seeking any means to get the same behavior from within chromium itself – ajp Aug 09 '15 at 01:19

1 Answers1

0

There is no way to do what you need directly from Javascript. I think you'll need to create an Chrome extension to do that.

You still can find an extension called "Open with external application" which do that, but its use NPAPI and NPAPI is not supported anymore by latest Chrome version. The source is hosted on BitBucket.

The new way to do the same thing is using the native messaging API. In this case the external application would have to register a native messaging host in order to exchange messages with your application. You can see more at http://developer.chrome.com/extensions/messaging.html#native-messaging

MAC
  • 151
  • 8