Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
John Sterling committed Jun 30, 2015
1 parent 64179b0 commit 3050db1
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ When complete you'll find a freshly built **Finicky** app in
finicky.setDefaultBrowser('com.google.Chrome')

// Open social network links in Google Chrome
finicky.onUrl(function(url) {
finicky.onUrl(function(url, opts) {
if (url.match(/^https?:\/\/(youtube|facebook|twitter|linkedin)\.com/)) {
return {
bundleIdentifier: 'com.google.Chrome'
Expand All @@ -39,16 +39,16 @@ finicky.onUrl(function(url) {
});

// Open Spotify links in client
finicky.onUrl(function(url) {
finicky.onUrl(function(url, opts) {
if (url.match(/^https?:\/\/open\.spotify\.com/)) {
return {
bundleIdentifier: 'com.spotify.client'
}
}
});

// Rewrite Twitter status links to open in Twitter client
finicky.onUrl(function(url) {
// Open Twitter links in client
finicky.onUrl(function(url, opts) {
var matches = url.match(/^https?:\/\/twitter\.com\/.+\/status\/([0-9]+)/)
if (matches && matches[1]) {
var statusId = matches[1];
Expand All @@ -60,10 +60,21 @@ finicky.onUrl(function(url) {
});

// Rewrite all Bing links to DuckDuckGo instead
finicky.onUrl(function(url) {
finicky.onUrl(function(url, opts) {
var url = url.replace(/^https?:\/\/www\.bing\.com\/search/, 'https://duckduckgo.com')
return {
url: url
}
});

// Always open links from Mail in Safari
finicky.onUrl(function(url, opts) {
var sourceApplication = opts && opts.sourceBundleIdentifier
if (sourceApplication === 'com.apple.mail') {
return {
bundleIdentifier: 'com.apple.safari'
}
}
});

```

0 comments on commit 3050db1

Please sign in to comment.