This extension provides a shortcut button to generate a short url using Shlink.
Click the extension and a short link will be requested from your instance for the page you're currently on. This short link will be copied to your clipboard, so you can easily paste it.
An existing Shlink installation that's ready to use. If you don't have one, take a look at their Getting Started page to learn how to run your own instance.
Once installed, you'll need to set it up with your API key and host URL information:
- Right click the Shlink button in the top right and select the option to
manage the extension.
- In Chrome, you would select "Options".
- In Firefox, you would select "Manage Extension".
- (Firefox only) Then, select the Preferences tab.
- Here, you'll need to enter your API key and point to where your Shlink instance is located.
Once all these steps are complete, the extension should be ready to use. If you encounter any errors, check to see if your API key is correct and you're pointed to the right domain.
This extension does not log any information by itself, and only communicates with the Shlink instance you provide in its preferences. All other information is kept local.
This extension keeps your API key in plaintext in your local browser storage.
Permission | Reason |
---|---|
tabs |
Needed so that the extension read the current active tab. |
notifications |
Needed so that the extension can inform users if generating the short link was successful or not. |
clipboardWrite |
Needed so that the extension can copy the short link to your clipboard. |
offscreen |
Chrome only. Needed to workaround clipboard writing to an offscreen doc. |
storage |
Needed so that the extension can save the location of a Shlinker instance and your API key. |
bun
web-ext
Then, run bun install
.
bun run watch
This starts two scripts that watches for changes and updates the extension on an test browser instance.
Currently, the watch script accepts additional args to be provided to the
web-ext
script. By default, it opens up a firefox instance, but you can change
it by providing a --target
option:
bun run watch -- --target chromium
todo
Currently, bundle.mts
watches for changes in the assets/
and src
folder.
On change, this triggers bun
to output data into the dist
folder. The dist
folder is watched/used by web-ext
for testing/building.
The assets/
folder are items that should be directly copied over without
changes to the dist
folder. This is for things that bun
either name-mangles
or "helps" out by processing it into a .js
file. Notably, the manifest file
and various "simplier" files are here.
The src/
folder contains assets that need to be compiled. This is for any
other files.