When launching google apps from command line , don't want to open google chrome browser

坚强是说给别人听的谎言 提交于 2019-12-10 15:16:22

问题


When I launch google apps[which is developed by myself] from command line, for example:

chrome.exe --load-and-launch-app="C:\Users\KyawKhaing\Desktop\chrome\Chrome App\Example2"

After I run this, I see Google Chrome Browser open first follow by my google chrome apps launch. I don't want to open google chrome browser when I launch a chrome app. Any one know the solution. Is it possible?


回答1:


Use the --silent-launch argument.

chrome.exe --silent-launch --load-and-launch-app="C:\Users\KyawKhaing\Desktop\chrome\Chrome App\Example2"



回答2:


As I was running automation scripts in java, i did notice that chrome did not open using command prompt.

Runtime.getRuntime().exec("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe \"http:\\www.google.com\"");

From Windows 7, I fixed the problem with the following steps:

  1. Go to the folder C:\Program Files (x86)\Google\Chrome\Application
  2. Right-click on chrome.exe
  3. Select Properties
  4. Select the Compatibility TAB
  5. Click on the "Change settings for all users" button
  6. Make sure to put a Check Mark on "Run this program in compatibility mode for:" and
  7. Select "Windows 7" from the drop down list.

Enjoy!




回答3:


I don't think you can do it currently. It is a reasonable feature request! You can make feature requests at http://crbug.com/new




回答4:


There is a bug already logged for this, see http://crbug.com/175381.

We are working on making app background pages keep the browser process alive; once this is done we can fix this bug. The problem currently is due to the way the process is kept alive - if we don't show the browser window the process exits between loading the app and the app opening a window.




回答5:


I don't think you can do that. The browser is the environment of the app. Its like trying to run a windows app, without running windows. The app depends on the browser. You can't open the app without opening the browser first. Sorry. Hope this helps.



来源:https://stackoverflow.com/questions/18029625/when-launching-google-apps-from-command-line-dont-want-to-open-google-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!