diff options
author | Ben Murdoch <benm@google.com> | 2011-05-05 14:36:32 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-10 15:38:30 +0100 |
commit | f05b935882198ccf7d81675736e3aeb089c5113a (patch) | |
tree | 4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /Tools/WebKitLauncher | |
parent | 60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff) | |
download | external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2 |
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'Tools/WebKitLauncher')
-rw-r--r-- | Tools/WebKitLauncher/Configurations/Base.xcconfig | 39 | ||||
-rw-r--r-- | Tools/WebKitLauncher/Configurations/WebKitLauncher.xcconfig | 27 | ||||
-rw-r--r-- | Tools/WebKitLauncher/Configurations/WebKitNightlyEnabler.xcconfig | 29 | ||||
-rw-r--r-- | Tools/WebKitLauncher/Info.plist | 493 | ||||
-rw-r--r-- | Tools/WebKitLauncher/VERSION | 1 | ||||
-rw-r--r-- | Tools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj | 448 | ||||
-rw-r--r-- | Tools/WebKitLauncher/WebKitLauncherURLProtocol.h | 33 | ||||
-rw-r--r-- | Tools/WebKitLauncher/WebKitLauncherURLProtocol.m | 123 | ||||
-rw-r--r-- | Tools/WebKitLauncher/WebKitNightlyEnabler.h | 31 | ||||
-rw-r--r-- | Tools/WebKitLauncher/WebKitNightlyEnabler.m | 236 | ||||
-rw-r--r-- | Tools/WebKitLauncher/WebKitNightlyEnablerSparkle.h | 30 | ||||
-rw-r--r-- | Tools/WebKitLauncher/WebKitNightlyEnablerSparkle.m | 156 | ||||
-rw-r--r-- | Tools/WebKitLauncher/main.m | 248 | ||||
-rw-r--r-- | Tools/WebKitLauncher/nightly.webkit.org.public.pem | 20 | ||||
-rw-r--r-- | Tools/WebKitLauncher/start.html | 33 | ||||
-rw-r--r-- | Tools/WebKitLauncher/webkit.icns | bin | 0 -> 319035 bytes |
16 files changed, 1947 insertions, 0 deletions
diff --git a/Tools/WebKitLauncher/Configurations/Base.xcconfig b/Tools/WebKitLauncher/Configurations/Base.xcconfig new file mode 100644 index 0000000..0a4dc2e --- /dev/null +++ b/Tools/WebKitLauncher/Configurations/Base.xcconfig @@ -0,0 +1,39 @@ +// Copyright (C) 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ARCHS = $(ARCHS_STANDARD_32_64_BIT); +DEAD_CODE_STRIPPING = YES; +DEBUG_INFORMATION_FORMAT = dwarf; +GCC_DEBUGGING_SYMBOLS = full; +GCC_MODEL_TUNING = G5; +GCC_PREPROCESSOR_DEFINITIONS = ENABLE_SPARKLE=$(ENABLE_SPARKLE); +GCC_TREAT_WARNINGS_AS_ERRORS = YES; +GCC_VERSION = 4.0; +GCC_VERSION[arch=x86_64] = 4.2; +MACOSX_DEPLOYMENT_TARGET = 10.4; +MACOSX_DEPLOYMENT_TARGET[arch=x86_64] = 10.5; +PREBINDING = NO; +SDKROOT = macosx10.5; +WARNING_CFLAGS = -Wall; + +ENABLE_SPARKLE = 0; diff --git a/Tools/WebKitLauncher/Configurations/WebKitLauncher.xcconfig b/Tools/WebKitLauncher/Configurations/WebKitLauncher.xcconfig new file mode 100644 index 0000000..c4dde36 --- /dev/null +++ b/Tools/WebKitLauncher/Configurations/WebKitLauncher.xcconfig @@ -0,0 +1,27 @@ +// Copyright (C) 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +INFOPLIST_FILE = Info.plist; +PRODUCT_NAME = WebKit; +WRAPPER_EXTENSION = app; +MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.2; diff --git a/Tools/WebKitLauncher/Configurations/WebKitNightlyEnabler.xcconfig b/Tools/WebKitLauncher/Configurations/WebKitNightlyEnabler.xcconfig new file mode 100644 index 0000000..ff352e6 --- /dev/null +++ b/Tools/WebKitLauncher/Configurations/WebKitNightlyEnabler.xcconfig @@ -0,0 +1,29 @@ +// Copyright (C) 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRODUCT_NAME = WebKitNightlyEnabler; +INSTALL_PATH = @executable_path/../Resources; + +OTHER_LDFLAGS = $(OTHER_LDFLAGS_$(ENABLE_SPARKLE)); +OTHER_LDFLAGS_0 = ; +OTHER_LDFLAGS_1 = -framework Sparkle; diff --git a/Tools/WebKitLauncher/Info.plist b/Tools/WebKitLauncher/Info.plist new file mode 100644 index 0000000..83564a7 --- /dev/null +++ b/Tools/WebKitLauncher/Info.plist @@ -0,0 +1,493 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleDocumentTypes</key> + <array> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>css</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>text/css</string> + </array> + <key>CFBundleTypeName</key> + <string>CSS style sheet</string> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>pdf</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>application/pdf</string> + </array> + <key>CFBundleTypeName</key> + <string>PDF document</string> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>webarchive</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>webarchive.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>application/x-webarchive</string> + </array> + <key>CFBundleTypeName</key> + <string>Web archive</string> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>syndarticle</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>RSS article</string> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>webbookmark</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Safari bookmark</string> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>webloc</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Web internet location</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>ilht</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>download</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>download10.icns</string> + <key>CFBundleTypeName</key> + <string>Safari download</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> + <key>LSTypeIsPackage</key> + <true/> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>gif</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>image/gif</string> + </array> + <key>CFBundleTypeName</key> + <string>GIF image</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>GIFf</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>html</string> + <string>htm</string> + <string>shtml</string> + <string>jhtml</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>text/html</string> + </array> + <key>CFBundleTypeName</key> + <string>HTML document</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>HTML</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>js</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>application/x-javascript</string> + </array> + <key>CFBundleTypeName</key> + <string>JavaScript script</string> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>jpg</string> + <string>jpeg</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>image/jpeg</string> + </array> + <key>CFBundleTypeName</key> + <string>JPEG image</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>JPEG</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>jp2</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>image/jp2</string> + </array> + <key>CFBundleTypeName</key> + <string>JPEG 2000 image</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>jp2 </string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>txt</string> + <string>text</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>text/plain</string> + </array> + <key>CFBundleTypeName</key> + <string>Plain text document</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>TEXT</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>png</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>image/png</string> + </array> + <key>CFBundleTypeName</key> + <string>PNG image</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>PNGf</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>rtf</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>application/rtf</string> + </array> + <key>CFBundleTypeName</key> + <string>Rich Text Format (RTF) document</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>RTF </string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>tiff</string> + <string>tif</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>image/tiff</string> + </array> + <key>CFBundleTypeName</key> + <string>TIFF image</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>TIFF</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>url</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeName</key> + <string>Web site location</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>LINK</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>ico</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>image/x-icon</string> + </array> + <key>CFBundleTypeName</key> + <string>Windows icon image</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>ICO </string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>xhtml</string> + <string>xhtm</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>application/xhtml+xml</string> + </array> + <key>CFBundleTypeName</key> + <string>XHTML document</string> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>xml</string> + <string>xbl</string> + <string>xsl</string> + <string>xslt</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>document.icns</string> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>application/xml</string> + <string>text/xml</string> + </array> + <key>CFBundleTypeName</key> + <string>XML document</string> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>NSDocumentClass</key> + <string>BrowserDocument</string> + </dict> + </array> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleGetInfoString</key> + <string>rVERSION, Copyright 2005-2009 Apple Inc.</string> + <key>CFBundleIconFile</key> + <string>webkit.icns</string> + <key>CFBundleIdentifier</key> + <string>org.webkit.nightly.WebKit</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>wbkt</string> + <key>CFBundleVersion</key> + <string>VERSION</string> + <key>CFBundleShortVersionString</key> + <string>rVERSION</string> + <key>LSArchitecturePriority</key> + <array> + <string>x86_64</string> + <string>i386</string> + <string>ppc</string> + </array> + <key>LSMinimumSystemVersionByArchitecture</key> + <dict> + <key>x86_64</key> + <string>10.6</string> + </dict> + <key>SUFeedURL</key> + <string>http://nightly.webkit.org/builds/trunk/mac/rss</string> + <key>SUShowReleaseNotes</key> + <false/> + <key>SUAllowsAutomaticUpdates</key> + <false/> + <key>SUPublicDSAKeyFile</key> + <string>nightly.webkit.org.public.pem</string> + <key>NSPrincipalClass</key> + <string>BrowserApplication</string> + <key>CFBundleHelpBookFolder</key> + <string>SafariHelp</string> + <key>CFBundleHelpBookName</key> + <string>Safari Help</string> + <key>CFBundleURLTypes</key> + <array> + <dict> + <key>CFBundleURLName</key> + <string>Web site URL</string> + <key>CFBundleURLSchemes</key> + <array> + <string>http</string> + <string>https</string> + </array> + </dict> + <dict> + <key>CFBundleURLName</key> + <string>local file URL</string> + <key>CFBundleURLSchemes</key> + <array> + <string>file</string> + </array> + </dict> + </array> + <key>NSAppleScriptEnabled</key> + <string>Yes</string> + <key>UTExportedTypeDeclarations</key> + <array> + <dict> + <key>UTTypeConformsTo</key> + <string>public.data</string> + <key>UTTypeDescription</key> + <string>Safari bookmark</string> + <key>UTTypeIdentifier</key> + <string>com.apple.safari.bookmark</string> + <key>UTTypeTagSpecification</key> + <dict> + <key>public.filename-extension</key> + <array> + <string>webbookmark</string> + </array> + </dict> + </dict> + </array> +</dict> +</plist> diff --git a/Tools/WebKitLauncher/VERSION b/Tools/WebKitLauncher/VERSION new file mode 100644 index 0000000..fd85e30 --- /dev/null +++ b/Tools/WebKitLauncher/VERSION @@ -0,0 +1 @@ +VERSION diff --git a/Tools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj b/Tools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c130f45 --- /dev/null +++ b/Tools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj @@ -0,0 +1,448 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXAggregateTarget section */ + 5DE79BC30F1C62450067BE08 /* Extract Sparkle */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 5DE79BD80F1C629B0067BE08 /* Build configuration list for PBXAggregateTarget "Extract Sparkle" */; + buildPhases = ( + 5DE79BC20F1C62450067BE08 /* ShellScript */, + ); + dependencies = ( + ); + name = "Extract Sparkle"; + productName = "Extract Sparkle"; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 5D1067640FE63758002A2868 /* WebKitLauncherURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D1067620FE63758002A2868 /* WebKitLauncherURLProtocol.h */; }; + 5D1067650FE63758002A2868 /* WebKitLauncherURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D1067630FE63758002A2868 /* WebKitLauncherURLProtocol.m */; }; + 5D18A1FF103FE255006CA7C7 /* nightly.webkit.org.public.pem in Resources */ = {isa = PBXBuildFile; fileRef = 5D18A1FE103FE255006CA7C7 /* nightly.webkit.org.public.pem */; }; + 5D41141C0A50A9DE00C84CF0 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 5D41141B0A50A9DE00C84CF0 /* VERSION */; }; + 5D4DF982097F89FB0083D5E5 /* start.html in Resources */ = {isa = PBXBuildFile; fileRef = 5D4DF981097F89FB0083D5E5 /* start.html */; }; + 5D650F3609DB8B370075E9A8 /* WebKitNightlyEnabler.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D650F3509DB8B370075E9A8 /* WebKitNightlyEnabler.m */; }; + 5D650F3A09DB8B410075E9A8 /* WebKitNightlyEnabler.dylib in Resources */ = {isa = PBXBuildFile; fileRef = 5D650F3409DB8B280075E9A8 /* WebKitNightlyEnabler.dylib */; }; + 5D877FCD0A5795F200D0C67B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + 5DA88F6D0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA88F6B0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.h */; }; + 5DA88F6E0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA88F6C0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.m */; }; + 5DA88F7A0FC813EB00AB2F62 /* WebKitNightlyEnabler.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA88F790FC813EB00AB2F62 /* WebKitNightlyEnabler.h */; }; + 5DB70525097B94CD009875EC /* webkit.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5DB70524097B94CD009875EC /* webkit.icns */; }; + 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 5D650F4409DB8B830075E9A8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5D650F3309DB8B280075E9A8; + remoteInfo = WebKitNightlyEnabler; + }; + 5DE79BC90F1C62850067BE08 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5DE79BC30F1C62450067BE08; + remoteInfo = "Extract Sparkle"; + }; + 5DE79BCB0F1C62890067BE08 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5DE79BC30F1C62450067BE08; + remoteInfo = "Extract Sparkle"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; + 5D1067620FE63758002A2868 /* WebKitLauncherURLProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitLauncherURLProtocol.h; sourceTree = "<group>"; }; + 5D1067630FE63758002A2868 /* WebKitLauncherURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitLauncherURLProtocol.m; sourceTree = "<group>"; }; + 5D18A1FE103FE255006CA7C7 /* nightly.webkit.org.public.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = nightly.webkit.org.public.pem; sourceTree = "<group>"; }; + 5D41141B0A50A9DE00C84CF0 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; }; + 5D4DF981097F89FB0083D5E5 /* start.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = start.html; sourceTree = "<group>"; }; + 5D650F3409DB8B280075E9A8 /* WebKitNightlyEnabler.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = WebKitNightlyEnabler.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + 5D650F3509DB8B370075E9A8 /* WebKitNightlyEnabler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitNightlyEnabler.m; sourceTree = "<group>"; }; + 5DA88F6B0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitNightlyEnablerSparkle.h; sourceTree = "<group>"; }; + 5DA88F6C0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitNightlyEnablerSparkle.m; sourceTree = "<group>"; }; + 5DA88F790FC813EB00AB2F62 /* WebKitNightlyEnabler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitNightlyEnabler.h; sourceTree = "<group>"; }; + 5DA88F7E0FC8176100AB2F62 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; }; + 5DA88F7F0FC8176100AB2F62 /* WebKitLauncher.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebKitLauncher.xcconfig; sourceTree = "<group>"; }; + 5DA88F800FC8176100AB2F62 /* WebKitNightlyEnabler.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebKitNightlyEnabler.xcconfig; sourceTree = "<group>"; }; + 5DB70524097B94CD009875EC /* webkit.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = webkit.icns; sourceTree = "<group>"; }; + 5DE79BEB0F1C63CC0067BE08 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; + 8D1107320486CEB800E47090 /* WebKit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WebKit.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 5D650F3209DB8B280075E9A8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5D877FCD0A5795F200D0C67B /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8D11072E0486CEB800E47090 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + ); + name = "Linked Frameworks"; + sourceTree = "<group>"; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 5DE79BEB0F1C63CC0067BE08 /* Sparkle.framework */, + 8D1107320486CEB800E47090 /* WebKit.app */, + 5D650F3409DB8B280075E9A8 /* WebKitNightlyEnabler.dylib */, + ); + name = Products; + sourceTree = "<group>"; + }; + 29B97314FDCFA39411CA2CEA /* WebKit */ = { + isa = PBXGroup; + children = ( + 29B97315FDCFA39411CA2CEA /* Source */, + 5DA88F7D0FC8174E00AB2F62 /* Configurations */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = WebKit; + sourceTree = "<group>"; + }; + 29B97315FDCFA39411CA2CEA /* Source */ = { + isa = PBXGroup; + children = ( + 29B97316FDCFA39411CA2CEA /* main.m */, + 5D1067620FE63758002A2868 /* WebKitLauncherURLProtocol.h */, + 5D1067630FE63758002A2868 /* WebKitLauncherURLProtocol.m */, + 5DA88F790FC813EB00AB2F62 /* WebKitNightlyEnabler.h */, + 5D650F3509DB8B370075E9A8 /* WebKitNightlyEnabler.m */, + 5DA88F6B0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.h */, + 5DA88F6C0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.m */, + ); + name = Source; + sourceTree = "<group>"; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 8D1107310486CEB800E47090 /* Info.plist */, + 5D18A1FE103FE255006CA7C7 /* nightly.webkit.org.public.pem */, + 5D4DF981097F89FB0083D5E5 /* start.html */, + 5D41141B0A50A9DE00C84CF0 /* VERSION */, + 5DB70524097B94CD009875EC /* webkit.icns */, + ); + name = Resources; + sourceTree = "<group>"; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, + ); + name = Frameworks; + sourceTree = "<group>"; + }; + 5DA88F7D0FC8174E00AB2F62 /* Configurations */ = { + isa = PBXGroup; + children = ( + 5DA88F7E0FC8176100AB2F62 /* Base.xcconfig */, + 5DA88F7F0FC8176100AB2F62 /* WebKitLauncher.xcconfig */, + 5DA88F800FC8176100AB2F62 /* WebKitNightlyEnabler.xcconfig */, + ); + path = Configurations; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 5D650F3009DB8B280075E9A8 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 5D1067640FE63758002A2868 /* WebKitLauncherURLProtocol.h in Headers */, + 5DA88F7A0FC813EB00AB2F62 /* WebKitNightlyEnabler.h in Headers */, + 5DA88F6D0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 5D650F3309DB8B280075E9A8 /* WebKitNightlyEnabler */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5D650F3709DB8B370075E9A8 /* Build configuration list for PBXNativeTarget "WebKitNightlyEnabler" */; + buildPhases = ( + 5D650F3009DB8B280075E9A8 /* Headers */, + 5D650F3109DB8B280075E9A8 /* Sources */, + 5D650F3209DB8B280075E9A8 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 5DE79BCC0F1C62890067BE08 /* PBXTargetDependency */, + ); + name = WebKitNightlyEnabler; + productName = WebKitNightlyEnabler; + productReference = 5D650F3409DB8B280075E9A8 /* WebKitNightlyEnabler.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; + 8D1107260486CEB800E47090 /* WebKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "WebKit" */; + buildPhases = ( + 8D1107290486CEB800E47090 /* Resources */, + 8D11072C0486CEB800E47090 /* Sources */, + 8D11072E0486CEB800E47090 /* Frameworks */, + 5DA892AC0FC8E3A100AB2F62 /* Copy Sparkle in to Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 5D650F4509DB8B830075E9A8 /* PBXTargetDependency */, + 5DE79BCA0F1C62850067BE08 /* PBXTargetDependency */, + ); + name = WebKit; + productInstallPath = "$(HOME)/Applications"; + productName = WebKit; + productReference = 8D1107320486CEB800E47090 /* WebKit.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "WebKitLauncher" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* WebKit */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D1107260486CEB800E47090 /* WebKit */, + 5D650F3309DB8B280075E9A8 /* WebKitNightlyEnabler */, + 5DE79BC30F1C62450067BE08 /* Extract Sparkle */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D1107290486CEB800E47090 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5D4DF982097F89FB0083D5E5 /* start.html in Resources */, + 5D41141C0A50A9DE00C84CF0 /* VERSION in Resources */, + 5DB70525097B94CD009875EC /* webkit.icns in Resources */, + 5D650F3A09DB8B410075E9A8 /* WebKitNightlyEnabler.dylib in Resources */, + 5D18A1FF103FE255006CA7C7 /* nightly.webkit.org.public.pem in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 5DA892AC0FC8E3A100AB2F62 /* Copy Sparkle in to Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Sparkle in to Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [[ \"${ENABLE_SPARKLE}\" == \"1\" ]]\nthen\n ditto \"${CONFIGURATION_BUILD_DIR}/Sparkle.framework\" \"${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sparkle.framework\"\n cd \"${CONFIGURATION_BUILD_DIR}/Sparkle.framework/Resources\"\n find . -name '*lproj' -not -name 'en.lproj' -print0 | xargs -0 rm -rf\nelse\n rm -rf \"${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sparkle.framework\"\nfi\n"; + }; + 5DE79BC20F1C62450067BE08 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/Sparkle.framework.tar.gz", + ); + outputPaths = ( + "$(CONFIGURATION_BUILD_DIR)/Sparkle.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [[ \"${ENABLE_SPARKLE}\" == \"1\" ]]\nthen\n tar -C \"${CONFIGURATION_BUILD_DIR}\" -xvzf \"${SRCROOT}/Sparkle.framework.tar.gz\"\n cd \"${CONFIGURATION_BUILD_DIR}/Sparkle.framework/Resources\"\n find . -name '*lproj' -not -name 'en.lproj' -print0 | xargs -0 rm -rf\nelse\n rm -rf \"${CONFIGURATION_BUILD_DIR}/Sparkle.framework\"\nfi\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 5D650F3109DB8B280075E9A8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5D1067650FE63758002A2868 /* WebKitLauncherURLProtocol.m in Sources */, + 5D650F3609DB8B370075E9A8 /* WebKitNightlyEnabler.m in Sources */, + 5DA88F6E0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8D11072C0486CEB800E47090 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072D0486CEB800E47090 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 5D650F4509DB8B830075E9A8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5D650F3309DB8B280075E9A8 /* WebKitNightlyEnabler */; + targetProxy = 5D650F4409DB8B830075E9A8 /* PBXContainerItemProxy */; + }; + 5DE79BCA0F1C62850067BE08 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5DE79BC30F1C62450067BE08 /* Extract Sparkle */; + targetProxy = 5DE79BC90F1C62850067BE08 /* PBXContainerItemProxy */; + }; + 5DE79BCC0F1C62890067BE08 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5DE79BC30F1C62450067BE08 /* Extract Sparkle */; + targetProxy = 5DE79BCB0F1C62890067BE08 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 5D650F3809DB8B370075E9A8 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5DA88F800FC8176100AB2F62 /* WebKitNightlyEnabler.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + 5D650F3909DB8B370075E9A8 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5DA88F800FC8176100AB2F62 /* WebKitNightlyEnabler.xcconfig */; + buildSettings = { + }; + name = Release; + }; + 5DE79BC40F1C62450067BE08 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "Extract Sparkle"; + }; + name = Debug; + }; + 5DE79BC50F1C62450067BE08 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "Extract Sparkle"; + }; + name = Release; + }; + C01FCF4B08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5DA88F7F0FC8176100AB2F62 /* WebKitLauncher.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + C01FCF4C08A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5DA88F7F0FC8176100AB2F62 /* WebKitLauncher.xcconfig */; + buildSettings = { + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5DA88F7E0FC8176100AB2F62 /* Base.xcconfig */; + buildSettings = { + GCC_OPTIMIZATION_LEVEL = 0; + ONLY_ACTIVE_ARCH = YES; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5DA88F7E0FC8176100AB2F62 /* Base.xcconfig */; + buildSettings = { + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 5D650F3709DB8B370075E9A8 /* Build configuration list for PBXNativeTarget "WebKitNightlyEnabler" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5D650F3809DB8B370075E9A8 /* Debug */, + 5D650F3909DB8B370075E9A8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5DE79BD80F1C629B0067BE08 /* Build configuration list for PBXAggregateTarget "Extract Sparkle" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5DE79BC40F1C62450067BE08 /* Debug */, + 5DE79BC50F1C62450067BE08 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "WebKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4B08A954540054247B /* Debug */, + C01FCF4C08A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "WebKitLauncher" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/Tools/WebKitLauncher/WebKitLauncherURLProtocol.h b/Tools/WebKitLauncher/WebKitLauncherURLProtocol.h new file mode 100644 index 0000000..9159f5d --- /dev/null +++ b/Tools/WebKitLauncher/WebKitLauncherURLProtocol.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import <Foundation/Foundation.h> + +@interface WebKitLauncherURLProtocol : NSURLProtocol +{ + +} + +@end diff --git a/Tools/WebKitLauncher/WebKitLauncherURLProtocol.m b/Tools/WebKitLauncher/WebKitLauncherURLProtocol.m new file mode 100644 index 0000000..9e56857 --- /dev/null +++ b/Tools/WebKitLauncher/WebKitLauncherURLProtocol.m @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "WebKitLauncherURLProtocol.h" +#import "WebKitNightlyEnabler.h" + +#if ENABLE_SPARKLE +#import <AppKit/AppKit.h> +#import <Sparkle/Sparkle.h> +#endif + +@interface WebKitLauncherURLProtocol (ImplementationDetails) +-(void)handleIsWebKitLauncherAvailableJS; +-(void)handleCheckForUpdates; +-(void)resourceNotFound; +@end + +@implementation WebKitLauncherURLProtocol + ++(void)load +{ + [NSURLProtocol registerClass:self]; +} + ++(BOOL)canInitWithRequest:(NSURLRequest *)request +{ + if (![[[request URL] scheme] isEqualToString:@"x-webkit-launcher"]) + return NO; + + NSURL *mainDocumentURL = [request mainDocumentURL]; + if (!mainDocumentURL) + return NO; + + NSString *mainDocumentHost = [mainDocumentURL host]; + if (![mainDocumentHost isEqualToString:@"webkit.org"] && ![mainDocumentHost hasSuffix:@".webkit.org"]) + return NO; + + return YES; +} + ++(NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request +{ + return request; +} + +-(void)startLoading +{ + NSURLRequest *request = [self request]; + NSString *resourceSpecifier = [[request URL] resourceSpecifier]; + if ([resourceSpecifier isEqualToString:@"is-x-webkit-launcher-available.js"]) { + [self handleIsWebKitLauncherAvailableJS]; + return; + } +#if ENABLE_SPARKLE + if ([resourceSpecifier isEqualToString:@"check-for-updates"]) { + [self handleCheckForUpdates]; + return; + } +#endif + [self resourceNotFound]; +} + +-(void)stopLoading +{ +} + +-(void)handleIsWebKitLauncherAvailableJS +{ + id client = [self client]; + NSURLResponse *response = [[NSURLResponse alloc] initWithURL:[[self request] URL] MIMEType:@"text/javascript" expectedContentLength:0 textEncodingName:@"utf-8"]; + [client URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageAllowed]; + [response release]; + + NSData *data = [@"var isWebKitLauncherAvailable = true;" dataUsingEncoding:NSUTF8StringEncoding]; + [client URLProtocol:self didLoadData:data]; + [client URLProtocolDidFinishLoading:self]; +} + +#if ENABLE_SPARKLE +-(void)handleCheckForUpdates +{ + id client = [self client]; + NSURLResponse *response = [[NSURLResponse alloc] initWithURL:[[self request] URL] MIMEType:@"text/plain" expectedContentLength:0 textEncodingName:@"utf-8"]; + [client URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed]; + [response release]; + + SUUpdater *updater = [SUUpdater updaterForBundle:webKitLauncherBundle()]; + [updater performSelectorOnMainThread:@selector(checkForUpdates:) withObject:self waitUntilDone:NO]; + [client URLProtocolDidFinishLoading:self]; +} +#endif + +-(void)resourceNotFound +{ + id client = [self client]; + NSDictionary *infoDictionary = [NSDictionary dictionaryWithObject:NSErrorFailingURLStringKey forKey:[[self request] URL]]; + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist userInfo:infoDictionary]; + [client URLProtocol:self didFailWithError:error]; +} + +@end diff --git a/Tools/WebKitLauncher/WebKitNightlyEnabler.h b/Tools/WebKitLauncher/WebKitNightlyEnabler.h new file mode 100644 index 0000000..2fe1444 --- /dev/null +++ b/Tools/WebKitLauncher/WebKitNightlyEnabler.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef WebKitNightlyEnabler_h +#define WebKitNightlyEnabler_h + +@class NSBundle; +extern NSBundle *webKitLauncherBundle(); + +#endif // WebKitNightlyEnabler_h diff --git a/Tools/WebKitLauncher/WebKitNightlyEnabler.m b/Tools/WebKitLauncher/WebKitNightlyEnabler.m new file mode 100644 index 0000000..eef0f8c --- /dev/null +++ b/Tools/WebKitLauncher/WebKitNightlyEnabler.m @@ -0,0 +1,236 @@ +/* + * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2006 Graham Dennis. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import <Cocoa/Cocoa.h> +#import "WebKitNightlyEnablerSparkle.h" + +static void enableWebKitNightlyBehaviour() __attribute__ ((constructor)); + +static NSString *WKNERunState = @"WKNERunState"; +static NSString *WKNEShouldMonitorShutdowns = @"WKNEShouldMonitorShutdowns"; + +typedef enum { + RunStateShutDown, + RunStateInitializing, + RunStateRunning +} WKNERunStates; + +static char *webKitAppPath; +static bool extensionBundlesWereLoaded = NO; +static NSSet *extensionPaths = nil; + +static int32_t systemVersion() +{ + static SInt32 version = 0; + if (!version) + Gestalt(gestaltSystemVersion, &version); + + return version; +} + + +static void myBundleDidLoad(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) +{ + NSBundle *bundle = (NSBundle *)object; + NSString *bundlePath = [[bundle bundlePath] stringByAbbreviatingWithTildeInPath]; + NSString *bundleFileName = [bundlePath lastPathComponent]; + + // Explicitly ignore SIMBL.bundle, as its only purpose is to load extensions + // on a per-application basis. It's presence indicates a user has application + // extensions, but not that any will be loaded into Safari + if ([bundleFileName isEqualToString:@"SIMBL.bundle"]) + return; + + // If the bundle lives inside a known extension path, flag it as an extension + NSEnumerator *e = [extensionPaths objectEnumerator]; + NSString *path = nil; + while ((path = [e nextObject])) { + if ([bundlePath length] < [path length]) + continue; + + if ([[bundlePath substringToIndex:[path length]] isEqualToString:path]) { + NSLog(@"Extension detected: %@", bundlePath); + extensionBundlesWereLoaded = YES; + break; + } + } +} + +static void myApplicationWillFinishLaunching(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) +{ + CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(), &myApplicationWillFinishLaunching, NULL, NULL); + CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(), &myBundleDidLoad, NULL, NULL); + [extensionPaths release]; + extensionPaths = nil; + + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + [userDefaults setInteger:RunStateRunning forKey:WKNERunState]; + [userDefaults synchronize]; + + if (extensionBundlesWereLoaded) + NSRunInformationalAlertPanel(@"Safari extensions detected", + @"Safari extensions were detected on your system. Extensions are incompatible with nightly builds of WebKit, and may cause crashes or incorrect behavior. Please disable them if you experience such behavior.", @"Continue", + nil, nil); + + initializeSparkle(); +} + +static void myApplicationWillTerminate(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) +{ + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + [userDefaults setInteger:RunStateShutDown forKey:WKNERunState]; + [userDefaults synchronize]; +} + +NSBundle *webKitLauncherBundle() +{ + NSString *executablePath = [NSString stringWithUTF8String:webKitAppPath]; + NSRange appLocation = [executablePath rangeOfString:@".app/" options:NSBackwardsSearch]; + NSString *appPath = [executablePath substringToIndex:appLocation.location + appLocation.length]; + return [NSBundle bundleWithPath:appPath]; +} + +extern char **_CFGetProcessPath() __attribute__((weak)); +extern OSStatus _RegisterApplication(CFDictionaryRef additionalAppInfoRef, ProcessSerialNumber* myPSN) __attribute__((weak)); + +static void poseAsWebKitApp() +{ + webKitAppPath = strdup(getenv("WebKitAppPath")); + if (!webKitAppPath) + return; + + unsetenv("WebKitAppPath"); + + // Set up the main bundle early so it points at Safari.app + CFBundleGetMainBundle(); + + if (systemVersion() < 0x1060) { + if (!_CFGetProcessPath) + return; + + // Fiddle with CoreFoundation to have it pick up the executable path as being within WebKit.app + char **processPath = _CFGetProcessPath(); + *processPath = NULL; + setenv("CFProcessPath", webKitAppPath, 1); + _CFGetProcessPath(); + unsetenv("CFProcessPath"); + } else { + if (!_RegisterApplication) + return; + + // Register the application with LaunchServices, passing a customized registration dictionary that + // uses the WebKit launcher as the application bundle. + NSBundle *bundle = webKitLauncherBundle(); + NSMutableDictionary *checkInDictionary = [[bundle infoDictionary] mutableCopy]; + [checkInDictionary setObject:[bundle bundlePath] forKey:@"LSBundlePath"]; + [checkInDictionary setObject:[checkInDictionary objectForKey:(NSString *)kCFBundleNameKey] forKey:@"LSDisplayName"]; + _RegisterApplication((CFDictionaryRef)checkInDictionary, 0); + [checkInDictionary release]; + } +} + +static BOOL insideSafari4OnTigerTrampoline() +{ + // If we're not on Tiger then we can't be in the trampoline state. + if ((systemVersion() & 0xFFF0) != 0x1040) + return NO; + + // If we're running Safari < 4.0 then we can't be in the trampoline state. + CFBundleRef safariBundle = CFBundleGetMainBundle(); + CFStringRef safariVersion = CFBundleGetValueForInfoDictionaryKey(safariBundle, CFSTR("CFBundleShortVersionString")); + if ([(NSString *)safariVersion intValue] < 4) + return NO; + + const char* frameworkPath = getenv("DYLD_FRAMEWORK_PATH"); + if (!frameworkPath) + frameworkPath = ""; + + // If the framework search path is empty or otherwise does not contain the Safari + // framework's Frameworks directory then we are in the trampoline state. + const char safariFrameworkSearchPath[] = "/System/Library/PrivateFrameworks/Safari.framework/Frameworks"; + return strstr(frameworkPath, safariFrameworkSearchPath) == 0; +} + +static void enableWebKitNightlyBehaviour() +{ + // If we're inside Safari in its trampoline state, it will very shortly relaunch itself. + // We bail out here so that we'll be called again in the freshly-launched Safari process. + if (insideSafari4OnTigerTrampoline()) + return; + + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + unsetenv("DYLD_INSERT_LIBRARIES"); + poseAsWebKitApp(); + + extensionPaths = [[NSSet alloc] initWithObjects:@"~/Library/InputManagers/", @"/Library/InputManagers/", + @"~/Library/Application Support/SIMBL/Plugins/", @"/Library/Application Support/SIMBL/Plugins/", + @"~/Library/Application Enhancers/", @"/Library/Application Enhancers/", + nil]; + + // As of 2008-11 attempting to load Saft would cause a crash on launch, so prevent it from being loaded. + NSArray *disabledInputManagers = [NSArray arrayWithObjects:@"Saft", nil]; + + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + NSDictionary *defaultPrefs = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:RunStateShutDown], WKNERunState, + [NSNumber numberWithBool:YES], WKNEShouldMonitorShutdowns, + disabledInputManagers, @"NSDisabledInputManagers", nil]; + [userDefaults registerDefaults:defaultPrefs]; + if ([userDefaults boolForKey:WKNEShouldMonitorShutdowns]) { + WKNERunStates savedState = (WKNERunStates)[userDefaults integerForKey:WKNERunState]; + if (savedState == RunStateInitializing) { + // Use CoreFoundation here as AppKit hasn't been initialized at this stage of Safari's lifetime + CFOptionFlags responseFlags; + CFUserNotificationDisplayAlert(0, kCFUserNotificationCautionAlertLevel, + NULL, NULL, NULL, + CFSTR("WebKit failed to open correctly"), + CFSTR("WebKit failed to open correctly on your previous attempt. Please disable any Safari extensions that you may have installed. If the problem continues to occur, please file a bug report at http://webkit.org/quality/reporting.html"), + CFSTR("Continue"), NULL, NULL, &responseFlags); + } + else if (savedState == RunStateRunning) { + NSLog(@"WebKit failed to shut down cleanly. Checking for Safari extensions."); + CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), &myBundleDidLoad, + myBundleDidLoad, (CFStringRef) NSBundleDidLoadNotification, + NULL, CFNotificationSuspensionBehaviorDeliverImmediately); + } + } + [userDefaults setInteger:RunStateInitializing forKey:WKNERunState]; + [userDefaults synchronize]; + + CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), &myApplicationWillFinishLaunching, + myApplicationWillFinishLaunching, (CFStringRef) NSApplicationWillFinishLaunchingNotification, + NULL, CFNotificationSuspensionBehaviorDeliverImmediately); + CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), &myApplicationWillTerminate, + myApplicationWillTerminate, (CFStringRef) NSApplicationWillTerminateNotification, + NULL, CFNotificationSuspensionBehaviorDeliverImmediately); + + NSLog(@"WebKit %@ initialized.", [webKitLauncherBundle() objectForInfoDictionaryKey:@"CFBundleShortVersionString"]); + + [pool release]; +} diff --git a/Tools/WebKitLauncher/WebKitNightlyEnablerSparkle.h b/Tools/WebKitLauncher/WebKitNightlyEnablerSparkle.h new file mode 100644 index 0000000..7ff4fef --- /dev/null +++ b/Tools/WebKitLauncher/WebKitNightlyEnablerSparkle.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef WebKitNightlyEnablerSparkle_h +#define WebKitNightlyEnablerSparkle_h + +extern void initializeSparkle(); + +#endif // WebKitNightlyEnablerSparkle_h diff --git a/Tools/WebKitLauncher/WebKitNightlyEnablerSparkle.m b/Tools/WebKitLauncher/WebKitNightlyEnablerSparkle.m new file mode 100644 index 0000000..8b13ab8 --- /dev/null +++ b/Tools/WebKitLauncher/WebKitNightlyEnablerSparkle.m @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if !ENABLE_SPARKLE + +void initializeSparkle() +{ + // No-op. +} + +#else // ENABLE_SPARKLE + +#import <Cocoa/Cocoa.h> +#import <Sparkle/SUUpdater.h> +#import <objc/objc-runtime.h> +#import "WebKitNightlyEnabler.h" + +// We need to tweak the wording of the prompt to make sense in the context of WebKit and Safari. +static NSString* updatePermissionPromptDescription(id self, SEL _cmd) +{ + return @"Should WebKit automatically check for updates? You can always check for updates manually from the Safari menu."; +} + +static NSPanel *updateAlertPanel(id updateItem, id host) +{ + NSString *hostName = objc_msgSend(host, @selector(name)); + NSPanel *panel = NSGetInformationalAlertPanel([NSString stringWithFormat:@"Would you like to download and install %@ %@ now?", hostName, objc_msgSend(updateItem, @selector(displayVersionString))], + [NSString stringWithFormat:@"You are currently running %@ %@.", hostName, objc_msgSend(host, @selector(displayVersion))], + @"Install Update", @"Skip This Version", @"Remind Me Later"); + NSArray *subviews = [[panel contentView] subviews]; + NSEnumerator *e = [subviews objectEnumerator]; + NSView *view; + while ((view = [e nextObject])) { + if (![view isKindOfClass:[NSButton class]]) + continue; + + NSButton *button = (NSButton *)view; + [button setAction:@selector(webKitHandleButtonPress:)]; + if ([button tag] == NSAlertOtherReturn) + [button setKeyEquivalent:@"\033"]; + } + [panel center]; + return panel; +} + +// Sparkle's udpate alert panel looks odd with the release notes hidden, so we +// swap it out with a standard NSAlert-style panel instead. +static id updateAlertInitForAlertPanel(id self, SEL _cmd, id updateItem, id host) +{ + NSPanel *panel = updateAlertPanel(updateItem, host); + [panel setDelegate:self]; + + self = [self initWithWindow:panel]; + if (!self) + return nil; + + [updateItem retain]; + [host retain]; + + object_setInstanceVariable(self, "updateItem", (void*)updateItem); + object_setInstanceVariable(self, "host", (void*)host); + + [self setShouldCascadeWindows:NO]; + + return self; +} + +@implementation NSAlert (WebKitLauncherExtensions) + +- (void)webKitHandleButtonPress:(id)sender +{ + // We rely on the fact that NSAlertOtherReturn == -1, NSAlertAlternateReturn == 0 and NSAlertDefaultReturn == 1 + // to map the button tag to the corresponding selector + SEL selectors[] = { @selector(remindMeLater:), @selector(skipThisVersion:), @selector(installUpdate:) }; + SEL selector = selectors[[sender tag] + 1]; + + id delegate = [[sender window] delegate]; + objc_msgSend(delegate, selector, sender); +} + +@end + +#if __LP64__ + +#define setMethodImplementation method_setImplementation + +#else + +static void setMethodImplementation(Method m, IMP imp) +{ + m->method_imp = imp; +} + +#endif + +static NSString *userAgentStringForSparkle() +{ + NSBundle *safariBundle = [NSBundle mainBundle]; + NSString *safariVersion = [[safariBundle localizedInfoDictionary] valueForKey:@"CFBundleShortVersionString"]; + NSString *safariBuild = [[[safariBundle infoDictionary] valueForKey:(NSString *)kCFBundleVersionKey] substringFromIndex:1]; + NSString *webKitRevision = [[webKitLauncherBundle() infoDictionary] valueForKey:(NSString *)kCFBundleVersionKey]; + NSString *applicationName = [NSString stringWithFormat:@"Version/%@ Safari/%@ WebKitRevision/%@", safariVersion, safariBuild, webKitRevision]; + Class WebView = objc_lookUpClass("WebView"); + return objc_msgSend(WebView, @selector(_standardUserAgentWithApplicationName:), applicationName); +} + +void initializeSparkle() +{ + // Override some Sparkle behaviour + Method methodToPatch = class_getInstanceMethod(objc_getRequiredClass("SUUpdatePermissionPrompt"), @selector(promptDescription)); + setMethodImplementation(methodToPatch, (IMP)updatePermissionPromptDescription); + + methodToPatch = class_getInstanceMethod(objc_getRequiredClass("SUUpdateAlert"), @selector(initWithAppcastItem:host:)); + setMethodImplementation(methodToPatch, (IMP)updateAlertInitForAlertPanel); + + SUUpdater *updater = [SUUpdater updaterForBundle:webKitLauncherBundle()]; + [updater setUserAgentString:userAgentStringForSparkle()]; + + // Find the first separator on the Safari menu… + NSMenu *applicationSubmenu = [[[NSApp mainMenu] itemAtIndex:0] submenu]; + int i = 0; + for (; i < [applicationSubmenu numberOfItems]; i++) { + if ([[applicationSubmenu itemAtIndex:i] isSeparatorItem]) + break; + } + + // … and insert a menu item that can be used to manually trigger update checks. + NSMenuItem *updateMenuItem = [[NSMenuItem alloc] initWithTitle:@"Check for WebKit Updates…" action:@selector(checkForUpdates:) keyEquivalent:@""]; + [updateMenuItem setTarget:updater]; + [applicationSubmenu insertItem:updateMenuItem atIndex:i]; + [updateMenuItem release]; +} + +#endif // ENABLE_SPARKLE diff --git a/Tools/WebKitLauncher/main.m b/Tools/WebKitLauncher/main.m new file mode 100644 index 0000000..4fee68a --- /dev/null +++ b/Tools/WebKitLauncher/main.m @@ -0,0 +1,248 @@ +/* + * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import <Cocoa/Cocoa.h> +#import <CoreFoundation/CoreFoundation.h> + +// We need to weak-import posix_spawn and friends as they're not available on Tiger. +// The BSD-level system headers do not have availability macros, so we redeclare the +// functions ourselves with the "weak" attribute. + +#define WEAK_IMPORT __attribute__((weak)) + +#define POSIX_SPAWN_SETEXEC 0x0040 +typedef void *posix_spawnattr_t; +typedef void *posix_spawn_file_actions_t; +int posix_spawnattr_init(posix_spawnattr_t *) WEAK_IMPORT; +int posix_spawn(pid_t * __restrict, const char * __restrict, const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict, char *const __argv[ __restrict], char *const __envp[ __restrict]) WEAK_IMPORT; +int posix_spawnattr_setbinpref_np(posix_spawnattr_t * __restrict, size_t, cpu_type_t *__restrict, size_t *__restrict) WEAK_IMPORT; +int posix_spawnattr_setflags(posix_spawnattr_t *, short) WEAK_IMPORT; + + +static void displayErrorAndQuit(NSString *title, NSString *message) +{ + NSApplicationLoad(); + NSRunCriticalAlertPanel(title, message, @"Quit", nil, nil); + exit(0); +} + +static int getLastVersionShown() +{ + [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObject:@"-1" forKey:@"StartPageShownInVersion"]]; + return [[NSUserDefaults standardUserDefaults] integerForKey:@"StartPageShownInVersion"]; +} + +static void saveLastVersionShown(int lastVersion) +{ + [[NSUserDefaults standardUserDefaults] setInteger:lastVersion forKey:@"StartPageShownInVersion"]; + [[NSUserDefaults standardUserDefaults] synchronize]; +} + +static NSString *getPathForStartPage() +{ + return [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"start.html"]; +} + +static int getCurrentVersion() +{ + return [[[[NSBundle mainBundle] infoDictionary] valueForKey:(NSString *)kCFBundleVersionKey] intValue]; +} + +static int getShowStartPageVersion() +{ + return getCurrentVersion() + 1; +} + +static BOOL startPageDisabled() +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:@"StartPageDisabled"]; +} + +static void addStartPageToArgumentsIfNeeded(NSMutableArray *arguments) +{ + if (startPageDisabled()) + return; + + if (getLastVersionShown() < getShowStartPageVersion()) { + saveLastVersionShown(getCurrentVersion()); + NSString *startPagePath = getPathForStartPage(); + if (startPagePath) + [arguments addObject:startPagePath]; + } +} + +static cpu_type_t preferredArchitecture() +{ +#if defined(__ppc__) + return CPU_TYPE_POWERPC; +#elif defined(__LP64__) + return CPU_TYPE_X86_64; +#else + return CPU_TYPE_X86; +#endif +} + +static void myExecve(NSString *executable, NSArray *args, NSDictionary *environment) +{ + char **argv = (char **)calloc(sizeof(char *), [args count] + 1); + char **env = (char **)calloc(sizeof(char *), [environment count] + 1); + + NSEnumerator *e = [args objectEnumerator]; + NSString *s; + int i = 0; + while ((s = [e nextObject])) + argv[i++] = (char *) [s UTF8String]; + + e = [environment keyEnumerator]; + i = 0; + while ((s = [e nextObject])) + env[i++] = (char *) [[NSString stringWithFormat:@"%@=%@", s, [environment objectForKey:s]] UTF8String]; + + if (posix_spawnattr_init && posix_spawn && posix_spawnattr_setbinpref_np && posix_spawnattr_setflags) { + posix_spawnattr_t attr; + posix_spawnattr_init(&attr); + cpu_type_t architecturePreference[] = { preferredArchitecture(), CPU_TYPE_X86 }; + posix_spawnattr_setbinpref_np(&attr, 2, architecturePreference, 0); + short flags = POSIX_SPAWN_SETEXEC; + posix_spawnattr_setflags(&attr, flags); + posix_spawn(NULL, [executable fileSystemRepresentation], NULL, &attr, argv, env); + } else + execve([executable fileSystemRepresentation], argv, env); +} + +static NSBundle *locateSafariBundle() +{ + NSArray *applicationDirectories = NSSearchPathForDirectoriesInDomains(NSApplicationDirectory, NSAllDomainsMask, YES); + NSEnumerator *e = [applicationDirectories objectEnumerator]; + NSString *applicationDirectory; + while ((applicationDirectory = [e nextObject])) { + NSString *possibleSafariPath = [applicationDirectory stringByAppendingPathComponent:@"Safari.app"]; + NSBundle *possibleSafariBundle = [NSBundle bundleWithPath:possibleSafariPath]; + if ([[possibleSafariBundle bundleIdentifier] isEqualToString:@"com.apple.Safari"]) + return possibleSafariBundle; + } + + CFURLRef safariURL = nil; + OSStatus err = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR("com.apple.Safari"), nil, nil, &safariURL); + if (err != noErr) + displayErrorAndQuit(@"Unable to locate Safari", @"Nightly builds of WebKit require Safari to run. Please check that it is available and then try again."); + + NSBundle *safariBundle = [NSBundle bundleWithPath:[(NSURL *)safariURL path]]; + CFRelease(safariURL); + return safariBundle; +} + +static NSString *currentMacOSXVersion() +{ + SInt32 version; + if (Gestalt(gestaltSystemVersion, &version) != noErr) + return @"10.4"; + + return [NSString stringWithFormat:@"%x.%x", (version & 0xFF00) >> 8, (version & 0x00F0) >> 4]; +} + +static NSString *fallbackMacOSXVersion(NSString *systemVersion) +{ + NSDictionary *fallbackVersionMap = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"FallbackSystemVersions"]; + if (!fallbackVersionMap) + return nil; + NSString *fallbackSystemVersion = [fallbackVersionMap objectForKey:systemVersion]; + if (!fallbackSystemVersion || ![fallbackSystemVersion isKindOfClass:[NSString class]]) + return nil; + return fallbackSystemVersion; +} + +static BOOL checkFrameworkPath(NSString *frameworkPath) +{ + BOOL isDirectory = NO; + return [[NSFileManager defaultManager] fileExistsAtPath:frameworkPath isDirectory:&isDirectory] && isDirectory; +} + +static BOOL checkSafariVersion(NSBundle *safariBundle) +{ + NSString *safariBundleVersion = [[safariBundle infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey]; + NSString *majorComponent = [[safariBundleVersion componentsSeparatedByString:@"."] objectAtIndex:0]; + NSString *majorVersion = [majorComponent substringFromIndex:[majorComponent length] - 3]; + return [majorVersion intValue] >= 530; +} + +int main(int argc, char *argv[]) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSString *systemVersion = currentMacOSXVersion(); + NSString *frameworkPath = [[[NSBundle mainBundle] privateFrameworksPath] stringByAppendingPathComponent:systemVersion]; + + BOOL frameworkPathIsUsable = checkFrameworkPath(frameworkPath); + + if (!frameworkPathIsUsable) { + NSString *fallbackSystemVersion = fallbackMacOSXVersion(systemVersion); + if (fallbackSystemVersion) { + frameworkPath = [[[NSBundle mainBundle] privateFrameworksPath] stringByAppendingPathComponent:fallbackSystemVersion]; + frameworkPathIsUsable = checkFrameworkPath(frameworkPath); + } + } + + if (!frameworkPathIsUsable) + displayErrorAndQuit([NSString stringWithFormat:@"Mac OS X %@ is not supported", systemVersion], + [NSString stringWithFormat:@"Nightly builds of WebKit are not supported on Mac OS X %@ at this time.", systemVersion]); + + NSString *pathToEnablerLib = [[NSBundle mainBundle] pathForResource:@"WebKitNightlyEnabler" ofType:@"dylib"]; + + NSBundle *safariBundle = locateSafariBundle(); + NSString *executablePath = [safariBundle executablePath]; + + if (!checkSafariVersion(safariBundle)) { + NSString *safariVersion = [[safariBundle localizedInfoDictionary] objectForKey:@"CFBundleShortVersionString"]; + displayErrorAndQuit([NSString stringWithFormat:@"Safari %@ is not supported", safariVersion], + [NSString stringWithFormat:@"Nightly builds of WebKit are not supported with Safari %@ at this time. Please update to a newer version of Safari.", safariVersion]); + } + + if ([frameworkPath rangeOfString:@":"].location != NSNotFound || + [pathToEnablerLib rangeOfString:@":"].location != NSNotFound) + displayErrorAndQuit(@"Unable to launch Safari", + @"WebKit is located at a path containing an unsupported character. Please move WebKit to a different location and try again."); + + NSMutableArray *arguments = [NSMutableArray arrayWithObject:executablePath]; + NSMutableDictionary *environment = [[[NSDictionary dictionaryWithObjectsAndKeys:frameworkPath, @"DYLD_FRAMEWORK_PATH", @"YES", @"WEBKIT_UNSET_DYLD_FRAMEWORK_PATH", + pathToEnablerLib, @"DYLD_INSERT_LIBRARIES", [[NSBundle mainBundle] executablePath], @"WebKitAppPath", nil] mutableCopy] autorelease]; + [environment addEntriesFromDictionary:[[NSProcessInfo processInfo] environment]]; + addStartPageToArgumentsIfNeeded(arguments); + + while (*++argv) + [arguments addObject:[NSString stringWithUTF8String:*argv]]; + + myExecve(executablePath, arguments, environment); + + char *error = strerror(errno); + NSString *errorMessage = [NSString stringWithFormat:@"Launching Safari at %@ failed with the error '%s' (%d)", [safariBundle bundlePath], error, errno]; + displayErrorAndQuit(@"Unable to launch Safari", errorMessage); + + [pool release]; + return 0; +} diff --git a/Tools/WebKitLauncher/nightly.webkit.org.public.pem b/Tools/WebKitLauncher/nightly.webkit.org.public.pem new file mode 100644 index 0000000..174c1e4 --- /dev/null +++ b/Tools/WebKitLauncher/nightly.webkit.org.public.pem @@ -0,0 +1,20 @@ +-----BEGIN PUBLIC KEY----- +MIIDOjCCAi0GByqGSM44BAEwggIgAoIBAQCkQLoVjuu3dPn1dO8N6xIFf4riPVuJ +XOVpx+QlFMno+qzqGJcJxqhfqZhIRwLq62eHpeuYKIuuPG8fqXY/hquHQIjrtEFZ +euCW8cxqC7iBg3PlX6RsKUXHD+WY82HJ5Hdkd+5G3jD9qO+Ka7RXgOnL7fTRcbkW +rtBjL7lVAlMBSVG54+zvti/h1CmdfpO83JAnoGl8c+WGgKlwt5nR7jxp4PgBdAw2 +aJt+UqrMkZOr4Npik1a8IzW+KTlBn96DbF5M6PP6Uh9TblnYtt0ic/Vnr6MKS60X +WNCb/2/HFjQYaINYtJfXpBaGUMZ0dsAyMxn/Sf1vApmVWh2t0TRMgI4JAhUAtL7E +pauM+spqaZnAxcMNMP0uFaECggEAe1lF6yZHJh89QdPQvmwROKFHOXYvEX5/IFRw +pFJDdJJdw53nS/yXWKy8o/wBqESzeVCbktYRqQE84ApO/KJs4KdwiL2LU32FiMD0 +c4UCkRf/RxSLxE4/FGKQzTaBB5TGMfuNLn6C/4aoNXnxcB399QxKF2slBp1GQgsC +6/4KZZYN+kxGxqAfA1UqrleVtv9OwmaCJwMYYqq20zxYhryuBjTSAD+VN6ncerUf +IxUceX83mWriBMtXHHR0x12WUDfnFQZg583MeMguFc8qESqZX7mWtzSnblsGmez3 +pD028APHFWJSdruT2YI1NJf08S7A9GLdkLRaUNQTABygANviQwOCAQUAAoIBAGDn +SFRJ3o/wKBm1PwQyaMfE8dtFt1NVOqTA2/VL3CVfqPV6tizRSvto45HSBn96R6nC +cxZCi3knJy/9V9ITtlCw1UtqeYOW7sp0PRAgct93XuzlMpOFQr5Q8jydvqMEymOD +c55QE2vbSgHYbQH362uNXsyMWN1xRVSlT13MBi+fmZ86Z5CkRWvIPWg2NRO16bnx +jK6l0LGvBKiU79HIrH7DlEfX0zVJBYi6NnJqvFSDeoKyiOMWaCAquWDgu00k3NOl +gndPnl+mVzEEgNvvN0H6KGVTf55H7KR1LqtWFWCw0VXy5oFgRB359hrLvxe91U4M +iN3jD7YxuENTOTefu9c= +-----END PUBLIC KEY----- diff --git a/Tools/WebKitLauncher/start.html b/Tools/WebKitLauncher/start.html new file mode 100644 index 0000000..2c94e79 --- /dev/null +++ b/Tools/WebKitLauncher/start.html @@ -0,0 +1,33 @@ +<html> + <head> + <title>Loading WebKit...</title> + <meta http-equiv="refresh" content="1;URL=http://nightly.webkit.org/start/" /> + <script type="text/javascript"> + function getWebKitRevision() + { + var request = new XMLHttpRequest(); + request.open("GET", "VERSION", false); + request.send(); + var revision = parseInt(request.responseText); + if (isNaN(revision)) + return ""; + + return revision; + } + + function getWebKitBranch() + { + var request = new XMLHttpRequest(); + request.open("GET", "BRANCH", false); + request.send(); + return (request.responseText || "trunk").replace(/\s/g, '') + } + + var revision = getWebKitRevision(); + var branch = getWebKitBranch(); + document.location = "http://nightly.webkit.org/start/" + branch + "/" + revision; + </script> + </head> + <body> + </body> +</html> diff --git a/Tools/WebKitLauncher/webkit.icns b/Tools/WebKitLauncher/webkit.icns Binary files differnew file mode 100644 index 0000000..b1e1017 --- /dev/null +++ b/Tools/WebKitLauncher/webkit.icns |