管理多个 Chrome 配置文件 - OSX
我正在将此 shell 脚本作为应用程序运行在OSX 使用新的个人文件夹启动多个 Chrome 实例:
do shell script "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --enable-udd-profiles --user-data-dir=/Users/$USER/Library/Application\\ Support/Google/ChromePersonal > /dev/null 2>&1 &"
这太棒了 - 因为我可以在 Chrome 实例之间进行 CMD-TAB,而无需清除 cookie/缓存等。
问题:我想扩展脚本以覆盖一个大的“ 2”、“3”等在 Dock 和 CMD-TAB 弹出窗口中的每个实例的 Chrome 图标上,以便我可以区分实例。现在,我看到的只是多个 Chrome.app 图标。
关于如何实现这一目标有什么想法吗?我也愿意编辑图标,但是 Chrome2.app 图标不会影响 Dock 图标 - 因为 Dock 图标来自原始 Chrome.app。
更新:问题已解决,方法如下:
复制粘贴“Google Chrome.app”以在应用程序文件夹中创建副本。
将该副本命名为 Chrome2.app。
按照 Google 的说明创建Applescript,基于 Google Chrome.app 的新副本,现已命名为 Chrome2.app。 。这将使用正确的(备用)用户配置文件启动 Chrome 的新副本,因此不会发生 cookie 问题。
将 Chrome2.app 的名称和 Chrome2.app 的图标更改为您想要在任务切换器和任务栏中显示的任何内容。基本应用程序(而不是脚本快捷方式)决定了 OS X 中的图标和名称。
Ta-da。
可选:在两个 Chrome 副本之间设置 Google Sync,以便您的书签、偏好设置、扩展程序保持不变!
I'm running this shell script as an app in OSX to initiate multiple instances of Chrome with a fresh personal folder:
do shell script "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --enable-udd-profiles --user-data-dir=/Users/$USER/Library/Application\\ Support/Google/ChromePersonal > /dev/null 2>&1 &"
This is awesome - because I can CMD-TAB between instances of Chrome without purging cookies/cache etc.
The problem: I'd like to expand the script to overlay a big "2", "3", etc over the Chrome icon for each instance in the Dock and CMD-TAB popup so that I can differentiate between isntances. Right now, all I see are multiple Chrome.app icons.
Any ideas on how to accomplish this? I'm also open to editing the icon, however the Chrome2.app icon does not influence the Dock icon - because the dock icon comes from the original Chrome.app.
UPDATED: Problem Solved, Here's How:
Copy-Paste "Google Chrome.app" to create a carbon copy in the Applications folder.
Name the copy something like Chrome2.app.
Follow the instructions from Google to create the Applescript, based on the NEW copy of Google Chrome.app that is now named Chrome2.app. Could name this script something like LaunchChrome2.app, etc. This will launch the NEW copy of Chrome with the correct (alternate) user profile, therefore no cookie issues will happen.
Change the name of Chrome2.app and the icon of Chrome2.app to whatever you want to show up in the Task Switcher and Task Bar. The base application, NOT the script shortcut, is what determines the icon and name in OS X.
Ta-da.
Optional: Set up Google Sync between the two copies of Chrome so that your bookmarks, prefs, extensions, stay the same!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我正在使用 http://blog.duoconsulting.com/2011/03/13/multiple-profiles-in-google-chrome-for-os-x/,它会在“应用程序”文件夹中为您创建新的 Chrome 应用程序,绑定到特定的配置文件。
之后,您可以简单地获取信息并粘贴 PNG 作为您的图标。我为每个 Chrome 实例使用不同颜色的 Chrome 图标和主题。
I'm using the script at http://blog.duoconsulting.com/2011/03/13/multiple-profiles-in-google-chrome-for-os-x/, which creates new Chrome application for you in the Applications folder, tied to a specific profile.
After that you can simply Get Info and paste a PNG as your icon. I use differently colored Chrome icons and themes for each Chrome instance.
实现这一目标的最佳方法(由 此 Chromium 帮助文档) 是:
编写 AppleScript 包装器 (Mac OS X)
在 Mac OS X 上,您可以创建一个使用自定义的运行 Chrome 的应用程序
--user-data-dir
:打开应用程序>公用事业>脚本编辑器。
输入:
根据需要修改您的安装路径、Chrome 与 Chromium,以及
所需的用户数据目录。
使用文件格式将脚本保存在您的应用程序目录中
“申请”。
关闭脚本编辑器,找到新创建的应用程序,然后运行它。
这将打开一个指向您的新个人资料的 Chrome 实例。
如果需要,您可以为此应用程序提供与 Chrome 相同的图标:
突出显示图标周围。
左上角。
The best way to achieve this (courtesy of this Chromium help doc) is:
Writing an AppleScript wrapper (Mac OS X)
On Mac OS X, you can create an application that runs Chrome with a custom
--user-data-dir
:Open Applications > Utilities > Script Editor.
Enter:
Modify as needed for your installation path, Chrome versus Chromium, and
desired user data directory.
Save the script in your Applications directory with the file format
"Application".
Close the Script Editor, find your newly created application, and run it.
This opens a Chrome instance pointing to your new profile.
If you want, you can give this application the same icon as Chrome:
highlight around the icon.
top left.
此问题已得到正式答复,包括此处的 Google Chrome 帮助。我用它并且效果很好。我遇到的唯一问题是“配置文件 2”停靠图标没有保持突出显示,并且出现了一个新的“第三个”停靠图标。
This is duly answered including the icon in the Google Chrome help here. I use it and it works well. The only problem I have is that the "profile 2" dock icon doesn't keep highlighted and a new -third- dock icon appears.
问题中提到的“来自 Google 的说明”不再讨论如何创建 AppleScript,因此我无法让该脚本正常工作。
我还尝试了 @Miguel 的脚本的变体,它部分起作用(谢谢!),但我遇到了一些困难。主要问题是 Chrome 的包装副本虽然是独立的,但有自己的图标,并且可以自行正常工作,无法打开从其他应用程序发送的 URL,因此它无法与 Choosy 一起使用。
以下是对我有用的方法,获取可以通过 Choosy 打开链接的第二个 Chrome,例如:
Library/Application Support/Google/Chrome
复制到Library/Application Support/Google/ChromePersonal
在你的主目录中。这是可选的;我想将我的 Chrome 用户配置文件转移到新实例。但如果您可以重新开始,则可以跳过此步骤。
Google Chrome.app
复制到其他位置。我使用了/Applications/Google Chrome Personal.app
。Contents/MacOS
目录中。Contents/Info.plist
以指向包装器脚本(将CFBundleExecutable
值设置为wrapper.sh
),并让唯一的 CFBundleIdentifier(只需将“个人”添加到现有值中)。这是我修改后的wrapper.sh脚本。将其放在
/Applications/Google\ Chrome\ Personal.app/Contents/MacOS/wrapper.sh
中,然后按照步骤 4 编辑 Info.plist。(完全披露:我还在apple.stackexchange)
The "instructions from Google" mentioned in the question no longer talk about how to create an AppleScript, so I wasn't able to get that one to work.
I also tried a variant of the script from @Miguel and it partly worked (thanks!) but I ran into some difficulties. The main problem is that the wrapped copy of Chrome, although it is independent, has its own icon, and works correctly on its own, cannot open URLs sent from other applications, so it doesn't work with Choosy.
Here is what worked for me, to get a second Chrome which can open links via Choosy, for example:
Library/Application Support/Google/Chrome
toLibrary/Application Support/Google/ChromePersonal
in your home directory.This is optional; I wanted to transfer over my Chrome User profiles to the new instance. But if you're OK starting fresh you can skip this.
Google Chrome.app
to another location. I used/Applications/Google Chrome Personal.app
.Contents/MacOS
directory.Contents/Info.plist
in this new app to point to the wrapper script (setCFBundleExecutable
value towrapper.sh
), and to have a uniqueCFBundleIdentifier
(just add "Personal" to the existing value).Here is my modified wrapper.sh script. Put it at
/Applications/Google\ Chrome\ Personal.app/Contents/MacOS/wrapper.sh
and then edit the Info.plist as in step 4.(full disclosure: I also posted this answer on apple.stackexchange)