An interesting news has appeared this morning in my RSS news reader. Mac OS X’s Web Kit source code is now open to all. On the new public CVS repository can be found a small script that inspired me to do something I wanted for some time now: run two different versions of Safari simultaneously on the same computer. This has now been achieved, and this is how you can do the same.
This script sets up the
DYLD_FRAMEWORK_PATHenvironment variable, which will cause the system loader to use the frameworks you built from your Xcode build products directory instead of the ones installed in /System/Library/Frameworks, so it will start the version of Safari from the Applications directory with the WebKit frameworks you just built.
I rewrote the script in a different way which has allowed me to make a self-contained application of Safari 1.2.3 using Web Kit 125.9 from Mac OS X 10.3.8. And it runs perfectly on Mac OS X 10.3.9 alongside Safari 1.3 which I have on my iBook.
To make this work, you will need a computer with the version of Safari you wish to duplicate. Here are the steps to perform:
Make a copy of the older Safari application. This is the application we will modify.
Open your new copy of Safari to see the package content using the contextual menu in the Finder. Then, in the “Content” folder, create a “Frameworks” folder.
On the startup disk with the older version of Mac OS X, copy the WebKit framework from “/System/Library/Frameworks” to your new “Frameworks” folder in the Safari application bundle.
Now that frameworks are in place, we need to make sure the binary program
uses them. Inside the Safari application bundle, rename the “Safari” binary
found inside “Contents/MacOS” to “TrueSafari”. Then we will put a shell
script called “Safari” in it’s place. The shell script will launch the
“TrueSafari” binary after having set the
variable so that it prefer frameworks from it’s own bundle.
Download the shell script here: Safari
There is no sixth step, but you should rename this new Safari to something like “Safari 1.2.3” so that it’s clear what it is.
You can now double-click on your new old Safari. Anyone else has it working?
Update: I now have Safari version 1.0, 1.2, 1.2.3, and 1.3 running simultaneously on my computer. I would like to share the files, but I cannot because of the file sizes and the bandwidth it would take if it becomes somewhat popular.