Skip to content

This extension allows for easy, shortened URL link generation using a Chhoto URL server.

License

Notifications You must be signed in to change notification settings

SolninjaA/Chhoto-URL-Extension

Repository files navigation

Chhoto URL Extension

This extension allows for easy, shortened URL link generation using a Chhoto URL server.

Requirements

Chhoto URL server

In order to use this extension, a Chhoto URL server is required. If you don't have one already, refer to the installation instructions.

Set the api_key environment variable

The api_key environment variable must be configured in the Chhoto URL server configuration.

For example, using Docker Compose, you can add the api_key environment variable under environment: like so:

environment:
    - api_key=SECURE_API_KEY

Alternatively, using Docker Run, you can add -e api_key="SECURE_API_KEY" \ to the command arguments.

Note: The Chhoto URL server will output a warning if this is insecure, and a generated API key will be output. You may use that value if you can't think of a secure key, or you may generate an API key using your operating system's terminal.

For example, on Linux, you could generate an API key by running tr -dc A-Za-z0-9 </dev/urandom | head -c 128

Ensure site_url and port are correct

In order for the Chhoto URL server to properly output the correct shortend URLs, and for this extension to do the same, the site_url and port environment variables must be properly set.

If your server is not located at http://localhost, make sure to set the site_url environment variable in the Chhoto URL server configuration. This value cannot be surrounded by quotes.

If your server's port is not 4567, make sure to set the port environment variable in the Chhoto URL server configuration. This value cannot be surrounded by quotes.

Example configuration:

environment:
    - site_url=https://chhoto-url.example.com
    - port=443

Installation

Firefox icon

Once you have installed the extension, either through an extension store (see icons above) or from source, you must configure the extension.

Firefox

  1. Right-click on the Chhoto URL extension icon (Chhoto URL extension icon). If the extension is not pinned, the Chhoto URL extension icon will be under this highlighted icon:

Firefox generic extension icon

  1. Select "Manage Extension"
  2. Select "Preferences"
  3. Configure the settings under Instance URL, API Key, and Protocol Filters

Chromium-based browsers

  1. (if the extension is not pinned) Click on the icon that is most similar to the highlighted icon in this image:

Chromium generic extension icon

  1. (if the extension is not pinned) Click on the pin icon next to the Chhoto URL extension icon
  2. Right-click on the Chhoto URL extension icon (Chhoto URL extension icon)
  3. Select "Options"
  4. Configure the settings under Instance URL, API Key, and Protocol Filters

Usage

When the Chhoto URL extension icon is clicked, the current page's URL will be shortened. The shortened link will be copied to the clipboard.

Alternatively, from v1.2.0 and onwards, you may right-click anywhere on a website or on the extension's icon (Chhoto URL extension icon), and click "Manually generate a Chhoto URL". This button will open a popup, allowing users to manually generate a shortened URL.

Context menu icon

Privacy and Security

This extension only communicates to the Chhoto URL server instance you configure. All of the extension's data is stored locally in your local browser storage. The API key is kept in plaintext.

Extension Permissions

Permission Required so that the extension can...
activeTab Get the active tab's URL
notifications Inform users if generating the shortened link was successful or not.
clipboardWrite Copy the shortened link to your clipboard.
storage Save the extension settings in your local browser storage.
https://*/* Contact the configured Chhoto URL server instance.
contextMenus Add an item (which opens a popup for manual URL generation) to the context menu

Installing from source

  1. Run git clone https://github.com/SolninjaA/Chhoto-URL-Extension.git
  2. Install the extension (see below for how to install the extension on common browsers)

Installing from source on Firefox

  1. Visit about:debugging#/runtime/this-firefox
  2. Click "Load Temporary Add-on..."
  3. Navigate to the cloned repository folder
  4. Select the manifest.json file
  5. Click "Open"

Installing from source on Brave

  1. Visit brave://extensions
  2. Enable "Developer mode" in the top right corner
  3. Click "Load unpacked"
  4. Navigate to the cloned repository folder
  5. Click "Select"

Contributors

SolninjaA
SolninjaA

💻 📆 📖
DarioDarko
DarioDarko

💻

Acknowledgements

This project was inspired by and modified from Edward Shen's Shlink extension. Modifications include:

  1. Rewriting the backend code to contact a Chhoto URL server, rather than a Shlink server.
  2. Adding a popup page for manual URL generation.
  3. Changing the appearance of the options.html page.
  4. Removing options which were either not possible to implement (because of the Chhoto URL server's limitations), or were not practical.
  5. Optimizing code where possible.
  6. Et cetera.

Information

Syncing from (main repository) Syncing to Syncing every
https://github.com/SolninjaA/Chhoto-URL-Extension https://git.solomon.tech/solomon/Chhoto-URL-Extension 8 hours

About

This extension allows for easy, shortened URL link generation using a Chhoto URL server.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •