Giter VIP home page Giter VIP logo

uroute's Introduction

Uroute: Route URLs to configured browsers

Overview

Uroute is like the "Open URL with..." dialog on Android.

Suppose you have the Tor Browser, Brave, and LibreWolf installed, with LibreWolf profiles LAN and VPN. With Uroute as your default browser, you can open each clicked URL in any of those browsers, in any supported mode or profile.

Screenshot

The configuration for the scenario in the screenshot above looks like this:

[main]
default_program = brave-incognito

[program:tor-browser]
name = Tor Browser
command = /home/user/tor-browser_en-US/Browser/start-tor-browser
icon = /home/user/tor-browser_en-US/Browser/browser/chrome/icons/default/default128.png

[program:brave-incognito]
name = Brave: Incognito
command = brave-browser --incognito
icon = /usr/share/icons/hicolor/64x64/apps/brave-browser.png

[program:librewolf-lan]
name = LibreWolf LAN
command = librewolf --class librewolf-profile-lan -P LAN --private-window
icon = /usr/share/librewolf/browser/chrome/icons/default/default128.png

[program:librewolf-vpn]
name = LibreWolf VPN
command = librewolf --class librewolf-profile-vpn -P VPN --private-window
icon = /usr/share/librewolf/browser/chrome/icons/default/default128.png

See the Configuration section below for more details.

This program was developed for and tested on Ubuntu 18.04 (Bionic). It should work in other Freedesktop environments with Python 3 and GTK 3 installed.

Installation

$ sudo apt install python3-gi
$ mkvirtualenv -p $(which python3) uroute
$ pip install git+https://github.com/walterl/uroute.git
$ ln -s /usr/lib/python3/dist-packages/gi $VIRTUAL_ENV/lib/python3.6/site-packages/

Usage

$ uroute https://fsf.org

Features

  • Open command-line argument URL in any of the configured external browsers.
  • Detect if Uroute is the default browser, and install it as such.
  • Modify URL before opening it in the selected browser.
  • Modify command-line of configured browser before launching it.
  • Extract URL from clipboard contents if no URL was specified.
  • Filter/clean URL before launching browser
    • Remove tracking parameters
    • Automatically unshorten short URLs
  • Replace recognized service URLs with privacy friendly alternatives #5
  • Set default browser dynamically, based on URL
  • GUI for managing configuration
  • Improve browser detection: import configuration from installed browsers' XDG desktop entries
    • Create a browser configuration for each [Desktop Action ...]

Tips

Assign a keyboard shortcut to Uroute. Opening a URL in Uroute is then as simple as copying the URL and launching Uroute via the keyboard shortcut. This is especially useful when you want to open a link from one browser in another.

Configuration

The Uroute configuration file lives in $XDG_CONFIG_HOME/uroute/uroute.ini. On most Linux systems that is $HOME/.config/uroute/uroute.ini.

It is created automatically and pre-populated with some crude browser detection if that file does not exist.

It contains sections main, logging and a section prefixed with program: for each configured browser.

main section

The following keys are supported:

  • default_program: Set the value to a program ID of a configured browser. See Program sections below.
  • ask_default_browser: Set to no to avoid being asked to set Uroute as the default browser. This is set automatically after the user was prompted.
  • read_url_from_clipboard: Set to no to avoid reading URLs from the clipboard, when no URL was specified.
  • clean_urls_rules_file: Path to URL cleaning rules file. It defaults to $XDG_DATA_HOME/uroute/rules.json ($HOME/.local/share/uroute/rules.json). If the file is missing or contains invalid JSON, the ClearURLs data.min.js is downloaded.

logging section

Note: If you don't understand this section, you can safely ignore it.

This section is optional, and provides control over the Python logging configuration. All keys and values are passed to logging.basicConfig, and should be formatted accordingly.

The default level is INFO and the default format is %(levelname)s %(message)s.

program: sections

Each browser and execution mode needs to be configured in a separate section. The section title is in the form program:some-browser, where some-program is the browser's program ID. The program ID can be used to set the default_program in the main section.

[program:brave-incognito]
name = Brave: Incognito
command = brave-browser --incognito @URL
icon = /usr/share/icons/hicolor/64x64/apps/brave-browser.png

Here the program ID is brave-incognito.

name is the browser's display name.

command is the full command used to launch the browser. The string @URL is substituted for the URL to open. If not specified, the URL is appended to the end.

icon is the full path to the display icon.

Thanks

uroute's People

Contributors

cwh1te avatar kevinroebert avatar walterl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

uroute's Issues

Replace recognized service URLs with privacy friendly alternatives

Like privacy-redirect: Automatically replace URLs to recognized services, with one to a privacy friendly alternative.

Make it very clear and easy to revert back to the original URL.

The user must be able to configure this functionality in the following ways:

  • Enable/disable it completely
  • If enabled, replace URL with privacy friendly service automatically or manually.
  • Manage replacement URLs for services independently. Perhaps a solution similar to ClearURLs's rules JSON used by uroute.url.clean_url().

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.