Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

How to use Safari 2 WebKit after installing Safari 3 Beta Web Browsers
After installing Safari 3 you won't be able to run Safari 2 to test websites or whatever any more. Here's one way to make them both available:
  1. Install Safari 3 Beta
  2. Rename /Applications » Safari.app to Safari3.app
  3. Install WebKit Nightly
  4. Rename /Applications » WebKit.app to Safari2.app
  5. Unarchive the backed up Safari -- expand /Library » Application Support » Apple » .SafariBetaArchive.tar.gz
  6. Copy the old Safari from /Library » Application Support » Apple » .SafariBetaArchive » Applications » Safari.app to /Applications » Safari.app
  7. Copy all the frameworks into Safari2. Inside the .SafariBetaArchive folder, you'll find these frameworks:
    • System » Library » Frameworks » WebKit.framework
    • System » Library » Frameworks » WebKit.framework » Versions » A » Frameworks » JavaScriptCore.framework
    • System » Library » Frameworks » WebKit.framework » Versions » A » Frameworks » WebCore.framework
    Copy all of these into /Applications » Safari2.app » Contents » Resources
That's it; now you can open Safari2. If you need it, there's much more detail in this post on my blog. I also include a shell script solution for getting both versions of Safari working.

Once you've done the above work, you can force another application to open with the old WebKit instead of the new with this Terminal command:
env DYLD_FRAMEWORK_PATH="/Applications/Safari2.app/Contents/Resources" \
WEBKIT_UNSET_DYLD_FRAMEWORK_PATH=YES "/path/to/bin/in/app" &
Just replace /path/to/bin/in/app with the path to the binary in the application you want to force to use the old WebKit frameworks. For instance, this will fix Adium with Safari 3:
env DYLD_FRAMEWORK_PATH="/Applications/Safari2.app/Contents/Resources" \
WEBKIT_UNSET_DYLD_FRAMEWORK_PATH=YES "/Applications/Adium.app/Contents/MacOS/Adium" &
[robg adds: I haven't tested this one, so proceed at your own risk. The referenced blog post has a lot more detail than I've chosen to show here...]
    •    
  • Currently 2.20 / 5
  You rated: 5 / 5 (5 votes cast)
 
[25,121 views]  

How to use Safari 2 WebKit after installing Safari 3 Beta | 12 comments | Create New Account
Click here to return to the 'How to use Safari 2 WebKit after installing Safari 3 Beta' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to use Safari 2 WebKit after installing Safari 3 Beta
Authored by: Old Toad on Jun 13, '07 08:53:41AM

Wouldn't selecting Safari 2.0.4 in the Debug->User Agent do the same thing and avoid a lot of messing around behind the scenes?



[ Reply to This | # ]
How to use Safari 2 WebKit after installing Safari 3 Beta
Authored by: mayo2ca on Jun 13, '07 11:17:13AM

Unfortunately no, that just changes the user agent string, nothing else.



[ Reply to This | # ]
Safari 2, Safari 3, AND WebKit alongside.
Authored by: Max_B on Sep 21, '07 03:17:38PM

This is a very good hint, thank you.
I have refined it a bit, as i wanted to be able to run Safari 3, Safari 2 AND WebKit.app.
1 - Copy Webkit.app to Safari2.app rather than rename it.
2 - Follow the step described in this page.
3 - Rename Safari.app (the old one you just restored) to Safar2.app (notice the name: the 2 REPLACE the ending i).
4 - Rename back Safari3.app to Safari.app
4 - With a binary editor, edit Safari2.app/Contents/MacOs/WebKit. Search for the sting "Safari.app" and replace to "Safar2.app".
Done.
Safari.app is Safari 3, Safari2.app is Safari 2, WebKit use Safari 3 GUI and feature with latest nightly.



[ Reply to This | # ]
Safari 2, Safari 3, AND WebKit alongside.
Authored by: Max_B on Sep 21, '07 03:27:04PM

I made a mistake while posting the preceding comment: it belongs to the main thread, not this one.
Sorry.



[ Reply to This | # ]
How to use Safari 2 WebKit after installing Safari 3 Beta
Authored by: percy on Jun 13, '07 09:48:16AM

Uh, this sounds like a really bad way.

The WebKit nightlies renders exactly like the Safari 3 beta, and the point of testing with Safari 2 would normally be to make sure that Safari 2 users see the page like you do.

Also, there are system-wide problems with installing the Safari 3 beta.

Instead, a much better way is to use Pacifist to extract Safari 3.app and the frameworks, placing the frameworks inside the Safari 3 bundle, thereby restricting the changes to that particular application.



[ Reply to This | # ]
How to use Safari 2 WebKit after installing Safari 3 Beta
Authored by: taylott on Jun 13, '07 11:53:43AM

This only uses the WebKit.app program, not it's frameworks.
It uses that app to easily force a program to use the backed up version of your Safari2 WebKit frameworks.



[ Reply to This | # ]
How to use Safari 2 WebKit after installing Safari 3 Beta
Authored by: leoofborg on Jun 14, '07 12:12:05PM
I agree with Percy; this is just asking for trouble. Please see my blog for a Pacifist screenshot:

[link:]http://expatleo.wordpress.com/2007/06/14/so-what-is-changed-in-safari3/

Me? I'm staying with WebKit Nightlies for now.

---
Leo of BORG
@ some smaller .org

[ Reply to This | # ]

Uses Backed up Safari2 WebKit
Authored by: taylott on Jun 13, '07 11:56:02AM

Apparently it isn't obvious exactly what's going on here.

The whole idea here is to force an app to use the Safari2 version of WebKit so that you can test websites or whatever.

I chose to use the WebKit.app program to make it easier. It doesn't use the nightly WebKit frameworks, it uses the backed up version of Safari 2 WebKit that the Safari3 installed archived before running.

It's the Safari2 WebKit.



[ Reply to This | # ]
How to use Safari 2 WebKit after installing Safari 3 Beta
Authored by: Echidna on Jun 13, '07 10:51:40PM

This is absolutely brilliant. Thank you!

Now I just wish there would be a way to get rid of the 'restored' Safari.app... it doesn't actually work, but it's required for the WebKit.app to run. As a kludge, I simply executed SetFile -a V /Applications/Safari.app, which uses the Developer Tool SetFile to make the defunct app invisible. Is there a better way (like changing where WebKit.app looks for it)?



[ Reply to This | # ]
Question
Authored by: simbalala on Jun 15, '07 11:33:48AM

On running this command to force another app to use the old frameworks

env DYLD_FRAMEWORK_PATH="/Applications/Safari2.app/Contents/Resources" \
WEBKIT_UNSET_DYLD_FRAMEWORK_PATH=YES "/path/to/bin/in/app" &

Which file does this affect? Is there any place I can examine the result of running the command? I'm assuming it results in a permanent change.

Mainly I'd like to get Vienna running using the old frameworks since some web pages crash it with the Safari 3 ones.



[ Reply to This | # ]
How to use Safari 2 WebKit after installing Safari 3 Beta
Authored by: taylott on Jun 29, '07 09:03:15AM
Doing the env thing does not change any files. It only forces the app to use the frameworks specified until the app is quit. When launched normally the app will still use the system WebKit. You have to run this command every single time you want the app to use the old webkit.

[ Reply to This | # ]
How to use Safari 2 WebKit after installing Safari 3 Beta
Authored by: mfripp on Sep 22, '07 04:13:58PM
I tried this, but found I needed to make a couple of minor changes. I will run through the way I did it in some detail, which may also help people who aren't so familiar with the terminal.

(Note: I recognize that some people think it is better to stick with the old Safari and Webkit, and just experiment with the Safari 3 beta. There's another hint for how to do that at http://www.macosxhints.com/article.php?story=20070628162610545 . My instructions below are useful if you want to switch over to Safari 3 completely, and just use Safari 2 sometimes.)

1. Download and install Safari 3.0 public beta.

2. Download a Webkit nightly build from http://nightly.webkit.org/ . These nightly builds have the special ability to use your existing Safari.app with their own Webkit framework. But you are going to replace your Safari.app with Safari 2, and the Webkit framework inside Webkit.app with the older version of Webkit. So then it will launch Safari 2 with a matching version of Webkit, even though the rest of your system uses a newer version of Webkit.

2. Copy the newly downloaded Webkit to your /Applications folder. Rename it to Safari2. This is what you will use to launch Safari 2 in the future.

3. Rename /Applications/Safari to Safari3. This is what you will use to launch Safari 3 in the future.

4. In terminal, execute "cp /Library/Application\ Support/Apple/.SafariBetaArchive.tar.gz ~/Desktop/SafariBetaArchive.tar.gz" This makes a copy of the hidden archive on the desktop, where it's easier to get at with the Finder.

5. Double-click on SafariBetaArchive.tar.gz on the desktop. This will create a SafariBetaArchive folder. Inside it, you will find an Applications folder and a System folder.

6. Drag Safari from the Applications folder inside SafariBetaArchive to your main Applications folder. You will never launch this directly, but the Safari2 that you created above will now know where to find it.

7. Right-click on Safari2 in your main Applications folder. (This is the one that used to be called Webkit; it has a gold-rimmed icon.) Choose "Show Package Contents". Then go into the "Contents" folder, then the Resources folder.

8. Copy the following four folders from the SafariBetaArchive folder to the Resources folder that you just opened:

SafariBetaArchive/System/Library/Frameworks/WebKit.framework

SafariBetaArchive/System/Library/Frameworks/WebKit.framework/Frameworks/JavaScriptCore.framework

SafariBetaArchive/System/Library/Frameworks/WebKit.framework/Frameworks/WebCore.framework

SafariBetaArchive/System/Library/PrivateFrameworks/JavaScriptGlue.framework

NOTE: The JavaScriptGlue.framework folder is omitted from the hint above, and Safari will crash without it. Also, if you just drag JavaScriptCore.framework and WebCore.framework from the Webkit.framework/Frameworks folder to the Resources folder, they will be moved instead of being copied, so they won't end up inside Safari2.app/Contents/Resources/WebKit.framework. However, this doesn't seem to cause any problems. (Use the option key when you drag if you want to make a copy while leaving WebKit.framework unchanged.)

9. At this point you should be finished. Launch Safari2 whenever you want to use the old version. You can also check which version of WebKit is active by opening the html file inside the webkit_normal.zip file at http://trac.webkit.org/projects/webkit/wiki/DetectingWebKit .

[ Reply to This | # ]