New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 750505 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Last visit 29 days ago
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Blocked on:
issue 901680



Sign in to add a comment

Chrome displays a non-functioning Dock icon when running in headless mode on Mac

Reported by nicholas...@gmail.com, Jul 30 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8

Steps to reproduce the problem:
1. Start Chrome in headless mode: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --disable-gpu --remote-debugging-port=12345
2. Chrome successfully starts in headless mode.
3. A new Chrome icon appears in the Dock. Clicking it does nothing.

What is the expected behavior?
The Chrome icon should not be displayed in the Dock because we are running in headless mode and cannot interact with it. (No Chrome windows are ever displayed when running in headless mode.)

What went wrong?
A non-functioning Chrome icon appears in the Dock when running in headless mode. It should probably be hidden. Clicking on the headless mode Dock icon does nothing, and there are no useful right-click options. It is also confusing to have multiple Chrome icons in the Dock if running a normal instance of Chrome and several other instances in headless mode.

Did this work before? No 

Chrome version: 60.0.3112.78 (Official Build) (64-bit)  Channel: stable
OS Version: OS X 10.12.6
Flash Version: 26.0.0.137 /Users/Nicholas/Library/Application Support/Google/Chrome/PepperFlash/26.0.0.137/PepperFlashPlayer.plugin

I've also tested the latest build of Chromium, and this issue is still present. The Windows version of Chrome does not create an icon in the taskbar or system tray when headless Chrome is running. Headless mode is a developer tool, so I don't think a user would need to see the Dock icon.
 
Components: -Platform>DevTools Internals>Headless
Owner: dvallet@chromium.org
Status: Available (was: Unconfirmed)
I'ts probably some setup that Chrome does before giving control to headless, I'll see if it can be configured.

if you run headless_shell you shouldn't see any icon, but you do need to compile it though.

Eric found this application bundle plist edit for hiding the icon: https://discussions.apple.com/thread/7444141?start=0&tstart=0

That said, we'd probably do this another way. :)
I've noticed something else that I think might be related. When a headless Chrome instance is running, it becomes very difficult to open a normal instance of Chrome. Launching Chrome from the Applications folder, Spotlight, and Launchpad all fail because macOS thinks that you already have it open. I have to use the command line to get it to open; some users might not be able to figure that out.

Hiding the Dock icon might resolve this by making macOS consider the headless Chrome instance as a background process, but I'm not sure.
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c1a5a6c64e418c1e66fa938c553dfd7a0227ef0d

commit c1a5a6c64e418c1e66fa938c553dfd7a0227ef0d
Author: David Vallet <dvallet@chromium.org>
Date: Fri Aug 25 06:29:58 2017

Force hide dock in headless mode

Bug:  750505 
Change-Id: I3c870ac9ea5c463c49946443504629e2df3679c5
Reviewed-on: https://chromium-review.googlesource.com/634724
Reviewed-by: David Vallet <dvallet@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Commit-Queue: David Vallet <dvallet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497337}
[modify] https://crrev.com/c1a5a6c64e418c1e66fa938c553dfd7a0227ef0d/headless/lib/browser/headless_browser_main_parts_mac.mm

Status: Fixed (was: Available)
Confirmed fixed in Chromium canary
Cc: pnangunoori@chromium.org
Labels: TE-Verified-62.0.3198.0 TE-Verified-M62
Tested the issue on Mac 10.12.6 using Chrome version M62 - 62.0.3198.0 as per the issue mentioned in original comment. Observed that issue is working as intended (When Chrome is launched in the headless mode chrome icon is not displayed in dock). Hence adding TE-Verified label. Attached the screencast for reference.

Thank you!
750505.mov
7.0 MB Download

Comment 7 Deleted

Is this fix published? I have same issue, seeing a chrome Dock icon while running karma unit with ChromeHeadless. Google Chrome is up to date Version 61.0.3163.100 (Official Build) (64-bit).

    [exec] Running "karma:unit" (karma) task
     [exec] INFO [karma]: Karma v0.12.37 server started at http://localhost:8090/
     [exec] INFO [launcher]: Starting browser ChromeHeadless
     [exec] INFO [HeadlessChrome 0.0.0 (Mac OS X 10.12.6)]: Connected on socket lKfkcf8MyYLPn2IB5Lwb with id 37489852


Thank you
It's available in version 62.0.3198.0

Comment 10 by arn...@webhare.nl, Oct 19 2017

Can confirm, the dock icon is gone on 62.0.3202.62
This is still happening in 66.

"I've noticed something else that I think might be related. When a headless Chrome instance is running, it becomes very difficult to open a normal instance of Chrome. Launching Chrome from the Applications folder, Spotlight, and Launchpad all fail because macOS thinks that you already have it open. I have to use the command line to get it to open; some users might not be able to figure that out."
Blockedon: 901680
Labels: -TE-Verified-M62 -TE-Verified-62.0.3198.0

Sign in to add a comment