Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Hagan committed Jan 22, 2012
0 parents commit 341014a
Show file tree
Hide file tree
Showing 13 changed files with 172 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@

.DS_Store
41 changes: 41 additions & 0 deletions ChromeHelper.app/Contents/Info.plist
@@ -0,0 +1,41 @@
<?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">
<?xml version="1.0"?>
<dict>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
<key>LSUIElement</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>applet</string>
<key>CFBundleIconFile</key>
<string>applet</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>ChromeHelper</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>aplt</string>
<key>LSMinimumSystemVersionByArchitecture</key>
<dict>
<key>x86_64</key>
<string>10.6</string>
</dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>chromehelper</string>
<key>CFBundleURLSchemes</key>
<array>
<string>chromehelper</string>
</array>
</dict>
</array>
</dict>
</plist>
Binary file added ChromeHelper.app/Contents/MacOS/applet
Binary file not shown.
1 change: 1 addition & 0 deletions ChromeHelper.app/Contents/PkgInfo
@@ -0,0 +1 @@
APPLaplt
Binary file not shown.
Binary file added ChromeHelper.app/Contents/Resources/applet.icns
Binary file not shown.
Binary file added ChromeHelper.app/Contents/Resources/applet.rsrc
Binary file not shown.
22 changes: 22 additions & 0 deletions LICENSE.md
@@ -0,0 +1,22 @@
The MIT License
===============

Copyright (c) 2012 Luke Hagan <lukehagan.com>.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
57 changes: 57 additions & 0 deletions OpenInChrome.safariextension/Info.plist
@@ -0,0 +1,57 @@
<?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>Author</key>
<string>Luke Hagan</string>
<key>Builder Version</key>
<string>7534.52.7</string>
<key>CFBundleDisplayName</key>
<string>Open in Chrome</string>
<key>CFBundleIdentifier</key>
<string>com.lukehagan.openinchrome</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>Chrome</key>
<dict>
<key>Global Page</key>
<string>global.html</string>
<key>Toolbar Items</key>
<array>
<dict>
<key>Identifier</key>
<string>openinchrome</string>
<key>Image</key>
<string>arrow.png</string>
<key>Label</key>
<string>Open in Chrome</string>
<key>Tool Tip</key>
<string>Open in Chrome</string>
</dict>
</array>
</dict>
<key>Content</key>
<dict>
<key>Scripts</key>
<dict/>
</dict>
<key>Description</key>
<string>Opens current web address in Chrome</string>
<key>ExtensionInfoDictionaryVersion</key>
<string>1.0</string>
<key>Permissions</key>
<dict>
<key>Website Access</key>
<dict>
<key>Include Secure Pages</key>
<true/>
<key>Level</key>
<string>All</string>
</dict>
</dict>
</dict>
</plist>
Binary file added OpenInChrome.safariextension/arrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions OpenInChrome.safariextension/global.html
@@ -0,0 +1,36 @@
<!--
Open in Chrome Safari Extension
by Luke Hagan <lukehagan.com>
created 2012-01-22
released under the MIT license (see LICENSE.md for details)
-->

<!DOCTYPE HTML>
<html>
<head>
<title>global page</title>
<script type="text/javascript">

function performCommand(event) {
if (event.command === "openinchrome") {
var currentURL = event.target.browserWindow.activeTab.url;
if (currentURL) {
event.target.browserWindow.activeTab.url = "chromehelper://" + currentURL.split("://")[1];
}
}
}

function validateCommand(event) {
if (event.command === "reload-page") {
// Disable the button if there is no URL loaded in the tab.
event.target.disabled = !event.target.browserWindow.activeTab.url;
}
}

// register with application:
safari.application.addEventListener("command", performCommand, false);
safari.application.addEventListener("validate", validateCommand, false);

</script>
</head>
<body> </body>
Binary file added OpenInChrome.safariextz
Binary file not shown.
13 changes: 13 additions & 0 deletions README.md
@@ -0,0 +1,13 @@
# Open in Chrome

Safari extension that opens the current page in Chrome. See [this post](http://daringfireball.net/2010/11/flash_free_and_cheating_with_google_chrome) by John Gruber for the "why" on this one.

Note: the extension depends on an AppleScript application to communicate with Chrome, so it will not work on Windows.

## Usage

1. [Download]() and extract the ZIP file
2. Install the extension (double-click OpenInChrome.safariextz)
3. Put the ChromeHelper app anywhere you want and double-click it to register with Mac OS X (nothing will happen yet)
4. Click the Open in Chrome arrow button in Safari to open the current page in Chrome

0 comments on commit 341014a

Please sign in to comment.