Giter VIP home page Giter VIP logo

finicky's Introduction

Finickyfinicky logo - hand pointing downwards

Always open the right browser

Finicky is a macOS application that allows you to set up rules that decide which browser is opened for every link or url. With Finicky as your default browser, you can tell it to open Facebook or Reddit in one browser, and Trello or LinkedIn in another.

  • Write rules to open urls in any browser
  • Rewrite and replace parts of urls before opening them
  • Automatically resolves the destination url from short url providers

GitHub downloads GitHub release

Finicky screenshot

Table of Contents

Installation

  1. Installation alternatives:
  1. Create a file called .finicky.js with configuration (examples) in your home directory.
  2. Start Finicky. Please allow it to be set as the default browser.
  3. And you're done. All links clicked that would have opened your browser are now first handled by Finicky.

Example configuration

Basic configuration

module.exports = {
  defaultBrowser: "Google Chrome",
  handlers: [
    {
      // Open apple.com and example.org urls in Safari
      match: finicky.matchHostnames(["apple.com", "example.org"]),
      browser: "Safari"
    },
    {
      // Open any url including the string "workplace" in Firefox
      match: /workplace/,
      browser: "Firefox"
    }
  ]
};

Wildcard matching

module.exports = {
  defaultBrowser: "Safari",
  handlers: [
    {
      // Open google.com and *.google.com urls in Google Chrome
      match: finicky.matchHostnames([
        "google.com", // match google.com domain as string (to make regular expression less complicated)
        /.*\.google.com$/ // match all google.com subdomains
      ]),
      browser: "Google Chrome"
    }
  ]
};

Opening preferred browser

module.exports = {
  defaultBrowser: "Safari",
  handlers: [
    {
      match: finicky.matchHostnames(["example.com"]),
      // Opens the first running browsers in the list. If none are running, the first one will be started.
      browser: ["Google Chrome", "Safari", "Firefox"]
    }
  ]
};

Rewrite urls

module.exports = {
  defaultBrowser: "Google Chrome",
  rewrite: [
    {
      // Redirect all urls to use https
      match: ({ url }) => url.protocol === "http",
      url: ({ url }) => ({
        ...url,
        protocol: "https"
      })
    },
    {
      // Avoid being rickrolled
      match: [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/watch?v=oHg5SJYRHA0"
      ],
      url: "about:blank"
    }
  ]
};

Advanced usage, settings

module.exports = {
  defaultBrowser: "Google Chrome",
  options: {
    // Hide the finicky icon from the top bar
    hideIcon: true
  },
  handlers: [
    {
      // Open any link clicked in Slack in Safari
      match: ({ sourceBundleIdentifier }) =>
        sourceBundleIdentifier === "com.tinyspeck.slackmacgap",
      browser: "Safari"
    },
    {
      // You can get the path of the process that triggered Finicky (EXPERIMENTAL)
      match: ({ sourceProcessPath }) =>
        sourceProcessPath && sourceProcessPath.startsWith("/Applications/Slack.app"),
      browser: "Firefox"
    },
    {
      match: ["http://zombo.com"],
      browser: {
        name: "Google Chrome Canary",
        // Force opening the link in the background
        openInBackground: true
      }
    },
    {
      match: ["http://example.com"],
      // Don't open any browser for this url, effectively blocking it
      browser: null
    }
  ]
};

Keyboard modifiers

module.exports = {
  defaultBrowser: "Google Chrome",
  handlers: [
    {
      // Open links in Safari when the option key is pressed
      // Valid keys are: shift, option, command, control, capsLock, and function.
      // Please note that control usually opens a tooltip menu instead of visiting a link
      match: ({ keys }) => keys.option,
      browser: "Safari"
    }
  ]
};

Configuration ideas

See the wiki page for other configuration ideas

Issues

Bugs

Please file an issue for bugs, missing documentation, or unexpected behavior.

See Bugs

Feature Requests

Please file an issue to suggest new features. Vote on feature requests by adding a ๐Ÿ‘.

See Feature Requests

Questions

Have any other questions or need help? Please feel free to reach out to me on Twitter.

License

MIT

Support development

If you want to help support further development of finicky, feel free to buy me a coffee on ko-fi.

Buy Me a Coffee at ko-fi.com

Building from source

Install XCode and XCode command line tools and then run commands:

    git clone https://github.com/johnste/finicky.git
    cd finicky/Finicky
    xcodebuild

When complete you'll find a freshly built Finicky app in build/release.

finicky's People

Contributors

dependabot[bot] avatar gitetsu avatar johnste avatar joshtch avatar matthewdias avatar mergefailure avatar pqrth avatar skywinder avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.