Majost
2007-06-25, 22:55
So I got curious as to what kind of magic is done by the open source WebKit.app nightly build launcher (http://nightly.webkit.org) to dynamically link an existing Safari binary to the latest WebKit version.
As it turns out, you can actually launch *any* browser with *any* version of WebKit. Yes, this means you can get Shiira to launch this way, too, linked with the WebKit of your liking.
So, I thought it would be a fun 'learn-Cocoa' project to create a simple dialog box that allowed you to select the frameworks and browser dynamically at launch time. Interface Builder is *fun*
http://static.mbauman.net/random/WebKitsch.png
But: I am running into several problems. Firstly, all the WebKitLauncher magic is done *before* they load AppKit. So I don't think I can load any Nibs directly (please correct me if I'm wrong - that would be the easiest way to do it). Hm.
Well, my next idea was to use NSTask to spawn a independent Cocoa "helper" program. But the problem here that I need to pass back two stings: the path to the browser and the path to the frameworks. Sure, I'll just have the helper write a plist to the resources directory and then have WebKit.app load it in. But: I can't seem to write files to that directory when I launch the program from NSTask (it works fine when I double-click the helper by itself).
Do any of the programming gurus here want to see Safari 3 Beta as a stand-alone? Want to help me make it that way? I don't have a public SVN repo I can set up, but here's my source so far (http://static.mbauman.net/WebKitsch.tgz). My apologies if I don't conform to standard Cocoa conventions... I'm still learning. Advice, criticisms, etc, are all gladly welcomed. :)
(Just for clarity and differentiation, I named my modified launcher WebKitsch.app and the secondary helper app WebKitsch Helper.app. Also, for what it's worth, it's very easy to statically program the path to your browser of choice and its frameworks... I have Safari 3 running on my work computer that way. But that's no fun!).
As it turns out, you can actually launch *any* browser with *any* version of WebKit. Yes, this means you can get Shiira to launch this way, too, linked with the WebKit of your liking.
So, I thought it would be a fun 'learn-Cocoa' project to create a simple dialog box that allowed you to select the frameworks and browser dynamically at launch time. Interface Builder is *fun*
http://static.mbauman.net/random/WebKitsch.png
But: I am running into several problems. Firstly, all the WebKitLauncher magic is done *before* they load AppKit. So I don't think I can load any Nibs directly (please correct me if I'm wrong - that would be the easiest way to do it). Hm.
Well, my next idea was to use NSTask to spawn a independent Cocoa "helper" program. But the problem here that I need to pass back two stings: the path to the browser and the path to the frameworks. Sure, I'll just have the helper write a plist to the resources directory and then have WebKit.app load it in. But: I can't seem to write files to that directory when I launch the program from NSTask (it works fine when I double-click the helper by itself).
Do any of the programming gurus here want to see Safari 3 Beta as a stand-alone? Want to help me make it that way? I don't have a public SVN repo I can set up, but here's my source so far (http://static.mbauman.net/WebKitsch.tgz). My apologies if I don't conform to standard Cocoa conventions... I'm still learning. Advice, criticisms, etc, are all gladly welcomed. :)
(Just for clarity and differentiation, I named my modified launcher WebKitsch.app and the secondary helper app WebKitsch Helper.app. Also, for what it's worth, it's very easy to statically program the path to your browser of choice and its frameworks... I have Safari 3 running on my work computer that way. But that's no fun!).