Skip to content

Commit

Permalink
added google chrome extension
Browse files Browse the repository at this point in the history
  • Loading branch information
gdelmas committed Aug 26, 2014
1 parent b7e34ee commit a5d0c5d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
18 changes: 15 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
**Github Tower** is a lightweight Safari extension that allows you to use Github's "Clone in Desktop" button to open [Tower.app](http://www.git-tower.com) without the need of having the Github.app installed.
**Github Tower** is a lightweight browser extension that allows you to use Github's "Clone in Desktop" button to open [Tower.app](http://www.git-tower.com) without the need of having the Github.app installed. The extension is available for Google Chrome and Safari.

#Setup
Download, open and install [GithubTower.safariextz](https://github.com/gdelmas/GithubTower/releases). In [Tower.app](http://www.git-tower.com) > Settings > Integration select "Tower" to open repositories from github.com.
###Step 1: Download
Download and unzip [GithubTower.zip](https://github.com/gdelmas/GithubTower/releases).

###Step 2: Google Chrome
1. Click the Chrome *hamburger* menu icon on the browser toolbar.
2. Select Tools > Extensions.
3. Drag the extension file `GithubTower.crx` onto the Extensions page.

###Step 2: Safari
Open `GithubTower.safariextz`.

###Step 3: Tower.app
In [Tower.app](http://www.git-tower.com) > Settings > Integration select "Tower" to open repositories from github.com.

#Lightweight
Github's "Clone in Desktop" button only works if the official Github.app is installed on OS X. The [Github.app](https://mac.github.com) spawns a [helper "GitHub Conduit.app"](https://help.github.com/articles/github-conduit) which will always be running on the system. This helper has a webserver constantly listening for requests on the users local machine port 25035. If the Github website can reach this server it changes the "Clone in Desktop" button links to open in the users local Git App instead of redirecting to https://mac.github.com.

The Safari extensions eliminates the need to have a local webserver process running by injecting [7 lines of code](https://github.com/gdelmas/GithubTower/blob/master/src-safari/GithubTower.safariextension/main.js) only into Github's website.
This browser extensions eliminates the need to have a local webserver process running by injecting [7 lines of code](https://github.com/gdelmas/GithubTower/blob/master/src-safari/GithubTower.safariextension/main.js) only into Github's website.

#Tower
Tower 2 is a wonderful Git client for OS X. It brings all of Git’s powerful features to your desktop. Try it out here: [http://www.git-tower.com](http://www.git-tower.com)
Binary file added src-chrome/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src-chrome/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(function() {
var buttonElement = document.querySelector("a[data-url^='github-mac://']");

if ( buttonElement != null ) {
buttonElement.href = buttonElement.getAttribute("data-url");
}
}());
19 changes: 19 additions & 0 deletions src-chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"manifest_version": 2,

"name": "Github Tower",
"description": "Use Github's \"Clone in Desktop\" button with Tower",
"author": "Gerard Delmàs",
"homepage_url": "https://github.com/gdelmas/GithubTower",
"icons": {
"128": "icon.png"
},
"version": "1.0.1",

"content_scripts": [
{
"matches": ["*://github.com/*"],
"js": ["main.js"]
}
]
}

0 comments on commit a5d0c5d

Please sign in to comment.