The second copy of firefox that is started by meek-client-torbrowser brings up a second Tor Browser dock icon on OS X. Better if we can find a way to hide it.
Something similar happens on Windows, but it doesn't look as bad because the icons appear in a little stack.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Thanks for this hint. Inside of TorBrowser.app, there is another app directory, Contents/MacOS/TorBrowser.app, which is the one that actually contains the firefox executable. If I edit Contents/MacOS/TorBrowser.app/Info.plist to add
<key>LSUIElement</key><true/>
it almost works—the headless browser doesn't show an icon, but the main browser doesn't, either. I did a lot of searching and didn't find a very nice solution. However I did find an ugly solution: Make a second copy of TorBrowser.app called TorBrowser.app-headless that symlinks all files to the first copy, all files except Info.plist. Set LSUIElement only in the second copy's Info.plist. Set up meek-client-torbrowser to point to TorBrowser.app-headless. To wit:
Contents/MacOS/TorBrowser.app/Contents:-rw-r-----@ 1 david staff 5540 Dec 31 1999 Info.plistdrwxr-x---@ 25 david staff 850 Dec 31 1999 MacOS-rw-r-----@ 1 david staff 8 Dec 31 1999 PkgInfodrwxr-x---@ 5 david staff 170 Dec 31 1999 ResourcesContents/MacOS/TorBrowser.app-headless/Contents:-rw-r-----@ 1 david staff 5572 May 11 13:07 Info.plistlrwxr-xr-x 1 david staff 35 May 11 13:06 MacOS -> ../../TorBrowser.app/Contents/MacOSlrwxr-xr-x 1 david staff 37 May 11 13:06 PkgInfo -> ../../TorBrowser.app/Contents/PkgInfolrwxr-xr-x 1 david staff 39 May 11 13:06 Resources -> ../../TorBrowser.app/Contents/Resources
This way is fairly dumb but it looks as if it will work if we can't think of anything better. I looked for a way to start an app with an alternate or override Info.plist file, and didn't find anything.
Here's a screenshot of the bug, as rue for remembrance after it gets fixed. The icon on the left is the actual browser that you interact with; the one on the right is the headless one without a menu bar that does nothing when you click on it.
The code works to disable the icon, but the problem is that the icon has already started appearing by the time the code starts to hide it. It's not always as obvious as this animation shows it; sometimes it only gets a few pixels wide before it disappears. (Here's I'm starting the meek-http-helper profile manually; normally there would be another Tor Browser icon to the left of the one that appears and disappears.)
I think I'll try the Info.plist approach, so the icon is hidden from startup. Something similar is going on, apart from the meek helper, in #12121 (closed).
I'll copy the commit log here.
This is an implementation of the icon-hiding idea from https://trac.torproject.org/projects/tor/ticket/11429#comment:5. The Info.plist file enables us to control whether an icon appears, but I could find no way to override the values we need at run time. So instead we create a copy of the original bundle directory, with the only difference being the contents of Info.plist. (The "copy" is actually a few symlinks, so it doesn't take much space.)
The shallow directory copy is in a directory named TorBrowser.app.meek-http-helper. I made the name not end in ".app" so that you can't open it as a bundle by accident from the Finder. I put a README in the bundle directory explaining why the directory exists.
There's a new build helper, background-plist.py, which deletes the LSUIElement key (if present) and sets LSBackgroundOnly=true. This is more robust than a sed script that inserts a LSBackgroundOnly key somewhere in the XML, because the same key could be already set, or LSUIElement have a contradictory value, elsewhere in the file.
I chose to set the key LSBackgroundOnly, rather than the LSUIElement we've discussed so far, though both of them work in terms of hiding the icon. I made this decision based only on the documentation for the two keys, which makes LSBackgroundOnly sound more background-y.
LSUIElement
LSUIElement specifies whether the app runs as an agent app. If this key is set to “1”, Launch Services runs the app as an agent app. Agent apps do not appear in the Dock or in the Force Quit window. Although they typically run as background apps, they can come to the foreground to present a user interface if desired. A click on a window belonging to an agent app brings that app forward to handle events.
LSBackgroundOnly
LSBackgroundOnly specifies whether this app runs only in the background. If this key exists and is set to “1”, Launch Services runs the app in the background only. You can use this key to create faceless background apps. You should also use this key if your app uses higher-level frameworks that connect to the window server, but are not intended to be visible to users. Background apps must be compiled as Mach-O executables.
The patch adds exactly these new files to the mac bundle:
$ ls -lR Contents/MacOS/TorBrowser.app.meek-http-helpertotal 8drwxr-x---@ 6 david staff 204 May 24 16:04 Contents-rw-r-----@ 1 david staff 672 Dec 31 1999 READMEContents/MacOS/TorBrowser.app.meek-http-helper/Contents:total 40-rw-r-----@ 1 david staff 5563 Dec 31 1999 Info.plistlr-xr-xr-x 1 david staff 35 Dec 31 1999 MacOS -> ../../TorBrowser.app/Contents/MacOSlr-xr-xr-x 1 david staff 37 Dec 31 1999 PkgInfo -> ../../TorBrowser.app/Contents/PkgInfolr-xr-xr-x 1 david staff 39 Dec 31 1999 Resources -> ../../TorBrowser.app/Contents/Resources
3.6.1-meek-2 bundles are built with this patch, and it works like a charm. I'm calling it fixed. We'll see what the TBB maintainers have to say about the symlinks when the larger meek patch is merged in #10935 (moved).
Trac: Status: needs_review to closed Resolution: N/Ato fixed