Safari 2, Safari 3, Adium & forcing WebKit Frameworks

by Thomas Aylott Tue, 12 Jun 2007 17:31:42 GMT

After installing Safari 3 you won’t be able to run Safari 2 to test websites or whatever anymore.

Here’s the trick to make it work

  1. Install Safari 3 Beta
    1. Yes, you have to reboot. Lame :(
    2. Rename /Applications/Safari.app to /Applications/Safari3.app
  2. Install WebKit Nightly as Safari2
    1. Rename /Applications/WebKit.app to /Applications/Safari2.app
  3. Unarchive the backed up Safari
    1. Open /Library/Application Support/Apple/.SafariBetaArchive.tar.gz
  4. Copy the old Safari from /Library/Application Support/Apple/.SafariBetaArchive/Applications/Safari.app to /Applications/Safari.app
  5. Copy all the frameworks into Safari2
    1. Copy /Library/Application Support/Apple/.SafariBetaArchive/System/Library/Frameworks/WebKit.framework
      /Library/Application Support/Apple/.SafariBetaArchive/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/JavaScriptCore.framework
      /Library/Application Support/Apple/.SafariBetaArchive/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework
      /Library/Application Support/Apple/.SafariBetaArchive/System/Library/PrivateFrameworks/JavaScriptGlue.framework
      to /Applications/Safari2.app/Contents/Resources
  6. Open Safari2

Shell script

Alternatively, you can use this shell script to make it all work without having to do it all manually…

  1. Install Safari 3 Beta
  2. Install WebKit Nightly
  3. Unarchive the backed up Safari
    1. Run this from the terminal:
open "/Library/Application Support/Apple/.SafariBetaArchive.tar.gz" 

4. Then run this script to do the rest…

mv /Applications/Safari.app /Applications/Safari3.app &&
mv /Applications/WebKit.app /Applications/Safari2.app &&
ditto "/Library/Application Support/Apple/.SafariBetaArchive/Applications/Safari.app" /Applications/Safari.app &&
rm -Rf \
  /Applications/Safari2.app/Contents/Resources/JavaScriptCore.framework/ \
  /Applications/Safari2.app/Contents/Resources/JavaScriptGlue.framework/ \
  /Applications/Safari2.app/Contents/Resources/WebCore.framework/ \
  /Applications/Safari2.app/Contents/Resources/WebKit.framework/ &&
cp -Rf \
  "/Library/Application Support/Apple/.SafariBetaArchive/System/Library/Frameworks/WebKit.framework" \
  "/Library/Application Support/Apple/.SafariBetaArchive/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/JavaScriptCore.framework" \
  "/Library/Application Support/Apple/.SafariBetaArchive/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework" \
  "/Library/Application Support/Apple/.SafariBetaArchive/System/Library/PrivateFrameworks/JavaScriptGlue.framework" \
  /Applications/Safari2.app/Contents/Resources/
UPDATED Date: 2007-06-13 18:15:32

How to force another app to open with the old WebKit

You can force anything to run with the old WebKit if it’s having problems working with the new beta.

env DYLD_FRAMEWORK_PATH="/Applications/Safari2.app/Contents/Resources" WEBKIT_UNSET_DYLD_FRAMEWORK_PATH=YES "PATH_TO_THE_BIN_IN_YOUR_APP" &

Just replace PATH_TO_THE_BIN_IN_YOUR_APP with the path to the binary in the app you want to force to use the old WebKit frameworks.

How to make Adium work after installing Safari 3

For Adium you’d use:

env DYLD_FRAMEWORK_PATH="/Applications/Safari2.app/Contents/Resources" WEBKIT_UNSET_DYLD_FRAMEWORK_PATH=YES "/Applications/Adium.app/Contents/MacOS/Adium" &

RSS feed for this post |Trackback from your site |Add your comment

  1. I followed this but I dont have SafariBetaArchive

    Roberto 1 day
  2. You won’t be able to see the folder .SafariBetaArchive

    Anything that starts with a dot like that is invisible. But if you run everything from the shell it should work for you.

  3. Bravo! I’m finally going to give Safari 3 a try now. I was reluctant to do so before, but this is a spectacular tip on how to gracefully run both.

    Thank you!

    Matt 1 day
  4. Excellent—thanks much!

  5. This is all moot now that Michel Fortin’s Multi-Safari is out:

    http://subtlegradient.com/articles/2007/10/10/multiple-standalone-safaris