karma-chrome-launcher icon indicating copy to clipboard operation
karma-chrome-launcher copied to clipboard

Launch in background

Open mightyiam opened this issue 9 years ago • 20 comments

I know this is out of scope but out of interest...

I didn't find a way to specify opening the browser in the background. Stealing focus from the terminal window is just unwanted, for most cases, I guess.

I think it should be default.

There's a flags thing. I read the manual. There's nothing. Perhaps a trick with --display?

It points to this and this, which also don't seem to have what is required. Perhaps something with --class?

This is relevant for all the other "real" browser launchers, as well.

mightyiam avatar Oct 11 '14 18:10 mightyiam

I too would like the ability to launch the browsers minimized or in the background. Very annoying to have to keep minimizing the screens manually. Did you find a solution?

I've seen this been suggested:

browsers: [
    'ChromeBackground'
],
customLaunchers: {
    ChromeBackground: {
        base: 'Chrome',
        flags: ['--no-startup-window']
    }
},

While that works and launches Chrome in the background, Karma doesn't seem to detect the browser. So I've resorted to just making the window less obnoxious:

browsers: [
    'ChromeSmall'
],
customLaunchers: {
    ChromeSmall: {
        base: 'Chrome',
        flags: ['--window-size=300,300']
    }
},

adamreisnz avatar Nov 30 '14 19:11 adamreisnz

@AdamBuczynski Thanks for your answer. I use --window-position=-9999,0.

ijse avatar Dec 30 '14 07:12 ijse

A possible solution on linux would also be

DISPLAY=:1 meteor

which just opens on another display.

jimmiebtlr avatar Feb 11 '15 17:02 jimmiebtlr

I totally agree that this would be nice, but I still have to see a way of making this actually possible, cross platform & cross browser :/

dignifiedquire avatar May 18 '15 20:05 dignifiedquire

+1

aldendaniels avatar May 20 '15 09:05 aldendaniels

Perhaps a related thing... when karma launches chrome that new chrome window seems to be the place where all new browser tabs appear. So for instance if the karma browser window is up and running and I follow a web link in an email the web page always loads as a new tab in the karma browser instance, as opposed to the normal chrome instance I already have running. Switching focus to the normal browser instance doesn't seem to have any effect. Any way to keep that from happening?

chrisspurgeon avatar Aug 13 '15 17:08 chrisspurgeon

@chrisspurgeon my workaround was to start using Chromium as my default browser, and just use Chrome for karma.

bentrevor avatar Aug 14 '15 14:08 bentrevor

Ooh, great idea!

chrisspurgeon avatar Aug 17 '15 04:08 chrisspurgeon

Just crossed my fingers - https://code.google.com/p/chromium/issues/detail?can=1&q=launch%20in%20background&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified&id=534047&thanks=534047&ts=1442756400

markelog avatar Sep 20 '15 13:09 markelog

+1

jstejada avatar Oct 29 '15 18:10 jstejada

+1

chadcallahan avatar Feb 25 '16 17:02 chadcallahan

+1

belveryin avatar May 20 '16 08:05 belveryin

+1

mspoerer avatar Feb 21 '17 12:02 mspoerer

+1

sherzinger avatar Mar 24 '17 06:03 sherzinger

+1

jmrowka-cyber avatar Mar 29 '17 14:03 jmrowka-cyber

Looks like running Chrome headless is just around the corner: https://www.chromestatus.com/features/5678767817097216

shooksm avatar Apr 13 '17 14:04 shooksm

https://developers.google.com/web/updates/2017/04/headless-chrome

antonybudianto avatar May 02 '17 12:05 antonybudianto

Just a heads up, on OSX, headless chrome doesn't behave completely like a background app. If you have a chrome already running, its window will be focused when you start headless mode.

Can anyone confirm this behaviour in other operating systems?

rogeriopvl avatar May 02 '17 15:05 rogeriopvl

@rogeriopvl headless chrome steals focus on OSX.. the desirable thing to have is what PhantomJS does, run completely silent in the background.. Are there any flags that can be passed as chrome options to change this behaviour?

captainjackrana avatar Jul 07 '17 06:07 captainjackrana

@captainjackrana exactly. That is a known problem. I'm not aware of any flag that changes that behaviour. But it seems to me that it is OSX causing it.

rogeriopvl avatar Jul 07 '17 07:07 rogeriopvl