Skip to content

Commit

Permalink
Fixed problem where ChromeEngine would try to update itself and get d…
Browse files Browse the repository at this point in the history
…estroyed. Fixed problem where custom icon would revert back to Chrome icon after a file download. Updated documentation in README.
  • Loading branch information
David Marmor committed Feb 15, 2016
1 parent b9c3860 commit 37a59e2
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 62 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Original file line Diff line number Diff line change
@@ -1,27 +1,27 @@
# Epichrome 2.1.9 # Epichrome 2.1.10


**Epichrome** is made up of two parts: an AppleScript-based Mac application (*Epichrome.app*) and a companion Chrome extension (*Epichrome Helper*). *Epichrome.app* creates Chrome-based site-specific browsers (SSBs) for Mac OSX (Chrome must be installed in order to run them, but they are full Mac apps, each with its own separate Chrome profile). **Epichrome** is made up of two parts: an AppleScript-based Mac application (*Epichrome.app*) and a companion Chrome extension (*Epichrome Helper*). *Epichrome.app* creates Chrome-based site-specific browsers (SSBs) for Mac OSX (Chrome must be installed in order to run them, but they are full Mac apps, each with its own separate Chrome profile).


Each app automatically installs *Epichrome Helper*, which uses rules to decide which links the app should handle itself, and which should be sent to the default web browser. Each app automatically installs *Epichrome Helper*, which uses rules to decide which links the app should handle itself, and which should be sent to the default web browser.


**Important note: due to the way Chrome updates itself, it is *not* recommended to turn on "Set Up Automatic Updates for All Users" in Chrome. This could cause fatal errors in Epichrome apps when a Chrome update is applied.**

**You can find out if this is on by checking if your system contains the directory /Library/Google/GoogleSoftwareUpdate. If you find this directory, the surest way to disable this option is by *first* removing the directory from your system (you'll need administrator privileges), then deleting Chrome and reinstalling the latest release from Google. In rare cases, you may also need to delete your user-specific directory at ~/Library/Google/GoogleSoftwareUpdate before running the reinstalled Chrome.**

Download the binary release [here](https://github.com/dmarmor/osx-chrome-ssb-gui/releases "Download"). Download the binary release [here](https://github.com/dmarmor/osx-chrome-ssb-gui/releases "Download").


See [CHANGELOG.md](https://github.com/dmarmor/osx-chrome-ssb-gui/blob/master/CHANGELOG.md "CHANGELOG") for the latest changes. See [CHANGELOG.md](https://github.com/dmarmor/osx-chrome-ssb-gui/blob/master/CHANGELOG.md "CHANGELOG") for the latest changes.




## New in version 2.1.9. ## New in version 2.1.10.


*Note: This is likely to be my last update for a while (except for fixing catastrophic problems like 2.1.7). My day job has gotten very busy, so I probably won't have time to work on new features or major updates for the foreseeable future.* *Note: This is likely to be my last update for a while (except for fixing catastrophic problems like 2.1.7). My day job has gotten very busy, so I probably won't have time to work on new features or major updates for the foreseeable future.*


Version 2.1.9 fixes a minor bug where on first run after update, apps would display the wrong icon in the task switcher and dock. Thanks to [trak3r](https://github.com/trak3r "trak3r") for reporting this. **If you're running any previous version, please update to version 2.1.10 as soon as possible. It fixes a potentially serious bug where updates to Chrome could break Epichrome apps permanently, so they'd have to be deleted and recreated.**

Version 2.1.8 fixes a long-standing bug that caused all Epichrome apps to run without hardware graphics acceleration due to the GPU process crashing on startup. This could cause sluggish graphics response (especially on retina displays) and failures to load WebGL sites.


(Note that it's possible the first time you run your apps or Chrome after updating, you may have to re-log in to Chrome in your settings, and you may also have to re-log in to some or all your websites. Once you've done that, though, your credentials should persist even after you quit the newly-updated apps.) This version also fixes a minor bug that would cause apps to display the wrong dock icon if an app was used to download a file or display certain dialog boxes. Thanks to [rschend](https://github.com/rschend "rschend") for finding this and tracking down the cause, and to the others who contributed their reports.


Big thanks to [mhwinkler](https://github.com/mhwinkler "mhwinkler") and [jdsimcoe](https://github.com/jdsimcoe "jdsimcoe") for identifying this bug (in two utterly different forms) and putting in a bunch of time helping isolate it and test approaches to a fix, and to [breeden](https://github.com/breeden "breeden") for once again testing the new update before I inflicted it on everyone else. This version will also fix crashes you may be experiencing since the release (on January 21, 2016) of Chrome 48.0.2564.82, which was breaking all Epichrome apps based on 2.1.7 or earlier. If your apps no longer start, install the latest Epichrome and run them again. Each one should offer you the choice of updating to the latest version, after which they should work again. See [CHANGELOG.md](https://github.com/dmarmor/osx-chrome-ssb-gui/blob/master/CHANGELOG.md "CHANGELOG") for more details.

This version will also fix crashes you may be experiencing since the release (on January 21, 2016) of Chrome 48.0.2564.82. This update was breaking all Epichrome apps. If your apps no longer start, install Epichrome 2.1.8 and run them again. Each one should offer you the choice of updating to 2.1.8, after which they should work again. See [CHANGELOG.md](https://github.com/dmarmor/osx-chrome-ssb-gui/blob/master/CHANGELOG.md "CHANGELOG") for more details.


Thanks to [ylluminate](https://github.com/ylluminate "ylluminate"), [evansthompson](https://github.com/evansthompson "evansthompson"), [msubel](https://github.com/msubel "msubel"), and everyone else who pointed this problem out. Special thanks to [breeden](https://github.com/breeden "breeden") for helping test the solution! Thanks to [ylluminate](https://github.com/ylluminate "ylluminate"), [evansthompson](https://github.com/evansthompson "evansthompson"), [msubel](https://github.com/msubel "msubel"), and everyone else who pointed this problem out. Special thanks to [breeden](https://github.com/breeden "breeden") for helping test the solution!


Expand Down Expand Up @@ -53,6 +53,8 @@ Alternately (or if you don't want Spotlight indexing on), you can always copy ex


### Advanced method (change app URL) ### Advanced method (change app URL)


*Warning: Only try this if you're comfortable editing shell scripts and understand what you're doing inside an app bundle. If you make a mistake with this method, it is possible to render your Epichrome app unusable.*

If you primarily want to change the URL, browse to the folder containing your app. Ctrl-click and choose *Show package contents*. Open /Contents > Resources > Scripts > config.sh/ in a text editor such as TextEdit or Atom. On the final line, you'll see something like: If you primarily want to change the URL, browse to the folder containing your app. Ctrl-click and choose *Show package contents*. Open /Contents > Resources > Scripts > config.sh/ in a text editor such as TextEdit or Atom. On the final line, you'll see something like:


```shell ```shell
Expand Down
7 changes: 7 additions & 0 deletions app/CHANGELOG.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
This project adheres to [Semantic Versioning](http://semver.org/). This project adheres to [Semantic Versioning](http://semver.org/).




## [2.1.10] - 2016-02-14
### Fixed
- Fixed a potentially serious bug where updates to Chrome could break Epichrome apps permanently, so they'd have to be deleted and recreated. The internal ChromeEngine in each app had Info.plist keys that would cause it to try to auto-update and that would break it. Those keys are now removed.
- Fixed a minor bug that would cause apps to display the wrong dock icon if an app was used to download a file or display certain dialog boxes. The internal ChromeEngine now uses the localized name and icons of the main app, so that when the download badge appears, the icon and name don't change. Thanks to [rschend](https://github.com/rschend "rschend") for finding this and tracking down the cause, and to the others who contributed their reports.
- Added warning to README that Chrome should not be set up with Automatic Updates for All Users.
- [wizonesolutions](https://github.com/wizonesolutions "wizonesolutions") contributed README documentation for editing an app's URL.

## [2.1.9] - 2016-01-31 ## [2.1.9] - 2016-01-31
### Fixed ### Fixed
- Fixed a minor bug in 2.1.8 where on first run after update, apps would display the wrong icon in the task switcher and dock. Thanks to [trak3r](https://github.com/trak3r "trak3r") for reporting this. - Fixed a minor bug in 2.1.8 where on first run after update, apps would display the wrong icon in the task switcher and dock. Thanks to [trak3r](https://github.com/trak3r "trak3r") for reporting this.
Expand Down
149 changes: 97 additions & 52 deletions app/src/runtime.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@


# CONSTANTS # CONSTANTS


# app executable name # app executable names
CFBundleExecutable="Epichrome" CFBundleExecutable="Epichrome"
chromeEngineName="ChromeEngine"


# icon names # icon names
CFBundleIconFile="app.icns" CFBundleIconFile="app.icns"
Expand All @@ -40,10 +41,10 @@ CFBundleTypeIconFile="document.icns"
appInfoPlist="Info.plist" appInfoPlist="Info.plist"
appConfigScript="Resources/Scripts/config.sh" appConfigScript="Resources/Scripts/config.sh"
appStringsScript="Resources/Scripts/strings.py" appStringsScript="Resources/Scripts/strings.py"
appChromeEngine="Resources/ChromeEngine.app" appChromeEngine="Resources/$chromeEngineName.app"


# engine exec path -- relative to engine root # engine exec path -- relative to engine root
engineExec="Contents/MacOS/ChromeEngine" engineExec="Contents/MacOS/$chromeEngineName"


# lproj directory regex # lproj directory regex
lprojRegex='\.lproj$' lprojRegex='\.lproj$'
Expand Down Expand Up @@ -685,33 +686,71 @@ function linkchrome { # $1 = destination app bundle Contents directory
try /bin/mkdir -p "$tmpEngineMacOS" 'Unable to create Chrome engine.' try /bin/mkdir -p "$tmpEngineMacOS" 'Unable to create Chrome engine.'
try /bin/mkdir "$tmpEngineResources" 'Unable to create Chrome engine Resources directory.' try /bin/mkdir "$tmpEngineResources" 'Unable to create Chrome engine Resources directory.'


# link everything in Chrome Contents except MacOS & Resources directories # link everything in Chrome Contents except Info.plist, MacOS & Resources directories
local chromeContents="$chromePath/Contents" local chromeContents="$chromePath/Contents"
dirlist "$chromeContents" curdir 'Chrome engine Contents' dirlist "$chromeContents" curdir 'Chrome engine Contents'
if [[ "$ok" ]] ; then if [[ "$ok" ]] ; then
for entry in "${curdir[@]}" ; do for entry in "${curdir[@]}" ; do
if [[ ( "$entry" != 'MacOS' ) && ( "$entry" != 'Resources' ) ]] ; then if [[ ( "$entry" != 'Info.plist' ) && ( "$entry" != 'MacOS' ) && ( "$entry" != 'Resources' ) ]] ; then
try /bin/ln -s "$chromeContents/$entry" "$tmpEngineContents" \ try /bin/ln -s "$chromeContents/$entry" "$tmpEngineContents" \
'Unable to create link to $entry in Chrome engine.' 'Unable to create link to $entry in Chrome engine.'
fi fi
done done
fi fi


# create list of keys to filter
# CFBundleDisplayName string "$CFBundleDisplayName"
# CFBundleIdentifier string "$CFBundleIdentifier"
# CFBundleName string "$CFBundleName"
# CFBundleShortVersionString string "$SSBVersion"
# CFBundleVersion string "$SSBVersion"
# CFBundleSignature string '????'
# BuildMachineOSBuild ''
# OSAScriptingDefinition ''
# LSHasLocalizedDisplayName ''
# UTExportedTypeDeclarations ''
# SCMRevision ''
# NSHighResolutionCapable true
local filterkeys=(CFBundleExecutable string "$chromeEngineName" \
CFBundleIconFile string "$CFBundleIconFile" \
CFBundleTypeIconFile string "$CFBundleTypeIconFile" \
DTSDKBuild '' \
DTSDKName '' \
DTXcode '' \
DTXcodeBuild '' \
KSChannelID-32bit '' \
KSChannelID-32bit-full '' \
KSChannelID-full '' \
KSProductID '' \
KSUpdateURL '' \
KSVersion '')

# filter Info.plist file from Chrome
filterchromeinfoplist "$1" "$tmpEngineContents" "${filterkeys[@]}"

# create link to Chrome executable in engine's MacOS directory # create link to Chrome executable in engine's MacOS directory
try /bin/ln -s "$chromeExec" "$tmpEngine/$engineExec" "Unable to link to Chrome Engine executable" try /bin/ln -s "$chromeExec" "$tmpEngine/$engineExec" "Unable to link to Chrome Engine executable"

# recreate Resources directory (except for .lproj directories) # recreate Resources directory (except for .lproj directories & icons)
local chromeResources="$chromeContents/Resources" local chromeResources="$chromeContents/Resources"
dirlist "$chromeResources" curdir 'Chrome engine Resources' dirlist "$chromeResources" curdir 'Chrome engine Resources'
if [[ "$ok" ]] ; then if [[ "$ok" ]] ; then
for entry in "${curdir[@]}" ; do for entry in "${curdir[@]}" ; do
if [[ ! "$entry" =~ $lprojRegex ]] ; then if [[ ! ( ("$entry" =~ \.icns$ ) || ( "$entry" =~ $lprojRegex ) ) ]] ; then
try /bin/ln -s "$chromeResources/$entry" "$tmpEngineResources" \ try /bin/ln -s "$chromeResources/$entry" "$tmpEngineResources" \
'Unable to create link to $entry in Chrome engine Resources directory.' 'Unable to create link to $entry in Chrome engine Resources directory.'
fi fi
done done
fi fi


# link to this app's icons
if [[ "$ok" ]] ; then
try /bin/ln -s "../../../$CFBundleIconFile" "$tmpEngineResources/$CFBundleIconFile" \
"Unable to link to application icon file in Chrome engine Resources directory."
try /bin/ln -s "../../../$CFBundleTypeIconFile" "$tmpEngineResources/$CFBundleTypeIconFile" \
"Unable to link to document icon file in Chrome engine Resources directory."
fi

# filter Chrome .lproj directories to modify InfoPlist.strings files # filter Chrome .lproj directories to modify InfoPlist.strings files
if [[ "$ok" ]] ; then if [[ "$ok" ]] ; then


Expand Down Expand Up @@ -744,10 +783,16 @@ function linkchrome { # $1 = destination app bundle Contents directory
} }




# WRITEPLIST: write out new Info.plist file # FILTERCHROMEINFOPLIST: write out new Info.plist file
function writeplist { # $1 = destination app bundle Contents directory function filterchromeinfoplist { # PY-CONTENTS-DIR DEST-CONTENTS-DIR FILTER-KEYS...


if [[ "$ok" ]]; then if [[ "$ok" ]]; then

local pyContentsDir="$1" # Contents directory to use as root for Info.plist-filtering Python script
shift
local destContentsDir="$1" # Contents directory to use as root for destination Info.plist
shift
local filterkeys=("$@") # keys to filter


# ensure Chrome's Info.plist file is where we think it is # ensure Chrome's Info.plist file is where we think it is
if [ ! -f "$chromeInfoPlist" ] ; then if [ ! -f "$chromeInfoPlist" ] ; then
Expand All @@ -757,48 +802,14 @@ function writeplist { # $1 = destination app bundle Contents directory
fi fi


# full path to Info.plist file # full path to Info.plist file
local fullInfoPlist="$1/$appInfoPlist" local fullInfoPlist="$destContentsDir/$appInfoPlist"


# create name for temp Info.plist file # create name for temp Info.plist file
local tmpInfoPlist="$(tempname "$fullInfoPlist")" local tmpInfoPlist="$(tempname "$fullInfoPlist")"

# create list of keys to filter
filterkeys=(CFBundleDisplayName string "$CFBundleDisplayName" \
CFBundleExecutable string "$CFBundleExecutable" \
CFBundleIconFile string "$CFBundleIconFile" \
CFBundleIdentifier string "$CFBundleIdentifier" \
CFBundleName string "$CFBundleName" \
CFBundleShortVersionString string "$SSBVersion" \
CFBundleVersion string "$SSBVersion" \
CFBundleTypeIconFile string "$CFBundleTypeIconFile" \
CFBundleSignature string '????' \
BuildMachineOSBuild '' \
OSAScriptingDefinition '' \
LSHasLocalizedDisplayName '' \
UTExportedTypeDeclarations '' \
SCMRevision '' \
DTSDKBuild '' \
DTSDKName '' \
DTXcode '' \
DTXcodeBuild '' \
KSChannelID-32bit '' \
KSChannelID-32bit-full '' \
KSChannelID-full '' \
KSProductID '' \
KSUpdateURL '' \
KSVersion '' \
NSHighResolutionCapable true )

# if we're not registering as a browser, delete these keys too
if [[ "$SSBRegisterBrowser" != "Yes" ]] ; then
filterkeys+=( CFBundleURLTypes '' \
NSPrincipalClass '' \
NSUserActivityTypes '' )
fi


# run python script to filter Info.plist # run python script to filter Info.plist
local pyerr= local pyerr=
try 'pyerr&=' python "$1/Resources/Scripts/infoplist.py" \ try 'pyerr&=' python "$pyContentsDir/Resources/Scripts/infoplist.py" \
"$chromeInfoPlist" \ "$chromeInfoPlist" \
"$tmpInfoPlist" \ "$tmpInfoPlist" \
"${filterkeys[@]}" 'Error filtering Info.plist file.' "${filterkeys[@]}" 'Error filtering Info.plist file.'
Expand Down Expand Up @@ -954,9 +965,6 @@ function updatessb {
safecopy "$customIconFile" "${contentsTmp}/Resources/${CFBundleIconFile}" "custom icon" safecopy "$customIconFile" "${contentsTmp}/Resources/${CFBundleIconFile}" "custom icon"
fi fi


# link to Chrome
linkchrome "$contentsTmp"

if [[ "$ok" ]] ; then if [[ "$ok" ]] ; then


# create a bundle identifier if necessary # create a bundle identifier if necessary
Expand Down Expand Up @@ -1059,9 +1067,46 @@ function updatessb {


# OPERATIONS FOR UPDATING CHROME # OPERATIONS FOR UPDATING CHROME


# link to latest version of Chrome
linkchrome "$contentsTmp"

# create list of keys to filter
local filterkeys=(CFBundleDisplayName string "$CFBundleDisplayName" \
CFBundleExecutable string "$CFBundleExecutable" \
CFBundleIconFile string "$CFBundleIconFile" \
CFBundleIdentifier string "$CFBundleIdentifier" \
CFBundleName string "$CFBundleName" \
CFBundleShortVersionString string "$SSBVersion" \
CFBundleVersion string "$SSBVersion" \
CFBundleTypeIconFile string "$CFBundleTypeIconFile" \
CFBundleSignature string '????' \
BuildMachineOSBuild '' \
OSAScriptingDefinition '' \
LSHasLocalizedDisplayName '' \
UTExportedTypeDeclarations '' \
SCMRevision '' \
DTSDKBuild '' \
DTSDKName '' \
DTXcode '' \
DTXcodeBuild '' \
KSChannelID-32bit '' \
KSChannelID-32bit-full '' \
KSChannelID-full '' \
KSProductID '' \
KSUpdateURL '' \
KSVersion '' \
NSHighResolutionCapable true )

# if we're not registering as a browser, delete these keys too
if [[ "$SSBRegisterBrowser" != "Yes" ]] ; then
filterkeys+=( CFBundleURLTypes '' \
NSPrincipalClass '' \
NSUserActivityTypes '' )
fi

# write out Info.plist # write out Info.plist
writeplist "$contentsTmp" filterchromeinfoplist "$contentsTmp" "$contentsTmp" "${filterkeys[@]}"



# WRITE OUT CONFIG FILE # WRITE OUT CONFIG FILE


Expand Down
2 changes: 1 addition & 1 deletion app/src/version.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,2 +1,2 @@
# Epichrome version # Epichrome version
mcssbVersion=2.1.9 mcssbVersion=2.1.10

0 comments on commit 37a59e2

Please sign in to comment.