Safari32

June 21st, 2007 by Joe Ranieri

This post is being restored from our old blog. It has been modified slightly from its original form. Comments have been lost.

Apple recently released the Windows version of Safari, spurring rumors about the return of Yellow Box (Cocoa for Windows). So, let’s take a look at the Safari directory (C:\Program Files\Safari\).

Apple libraries:

  • CFNetwork.dll: The networking library Safari depends on.
  • CoreFoundation.dll: A port of the OS X Foundation library. It’s partially open source in the form of CFLite.
  • CoreGraphics.dll: A partial port of OS X’s graphics engine (Quartz). It sits on top of Windows’ GDI and is handles all of Safari’s drawing needs.
  • PubSub.dll: A port of the OS X framework for handling RSS feeds. This framework isn’t public in 10.4, but will be in 10.5.
  • SafariTheme.dll: This takes care of rendering the OS X looking UI elements Safari and the WebKit use. If you were to replace this with something decent (upcoming blog post?) you’d almost have a decent UI.

Open source libraries:

You’ll notice that all of these APIs are C++ or C. Yes, even the WebKit, which exposes a COM interface almost identical to the OS X Objective-C API. I’ll be blogging about this later.

So, does YellowBox live on? Sadly, no. You’ll notice no signs of Cocoa or Objective-C (strings or functions). Sure, Apple could have obfuscated everything, but it’d still show signs of being Objective-C. Objective-C messages have to go through objc_msgSend first, which involves putting the self object onto the stack, then the selector, and then your arguments. Everything in Safari is just called directly, without the layer of indirection.

Anyways, it appears they wrote it in Microsoft Visual Studio.


Safari for Windows: Command line arguments

June 12th, 2007 by Joe Ranieri

This post is being restored from our old blog. It has been modified slightly from its original form. Comments have been lost.

/frameworkPath:
The directory with all of the DLLs (CFNetwork.dll, etc). The webkit nightly launcher uses this flag so it can just pass the new WebKit.dll to the existing Safari 3 install.

/showIcons
/hideIcons

Disables/enables site favicons.

/debug
Haven’t seen any changes yet with this enabled. One difference is that it’ll try to load “Webkit_debug.dll” instead of “WebKit.dll”.

/reinstall
I would assume it re-associates file extensions and re-registers DLLs.

/console
Opens up a console window when launching Safari. I haven’t seen anything be output to this window yet.

/enableDebugMenu
/disableDebugMenu

Enable and disable the debug menu. On my Windows Vista machine this disables the menubar completely… oops.

/printLaunchTime
Shows the time it took to launch in the console window opened with /console.

/quitAfterLaunch
Quits Safari after it’s launched.

-url
Specifies a URL to open on launch.

-stress
Rapidly opens different websites on launch.