问题
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:
- Go to the folder C:\Program Files (x86)\Google\Chrome\Application
- Right-click on chrome.exe
- Select Properties
- Select the Compatibility TAB
- Click on the "Change settings for all users" button
- Make sure to put a Check Mark on "Run this program in compatibility mode for:" and
- 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