WARNING: This Firefox extension is using legacy methods and outdated! Check the YOURLS Firefox WebExtension for the latest version.

Extension to shorten URLs from Firefox with your own YOURLS installation.

YOURLS is an URL shortener, just like bit.ly or goo.gl, but you are allowed to install your own private instance. So you can diminish the tracking of these big platforms ;-) This piece of software is an extension for the browser Firefox that let’s you quickly shorten the URL of the website you are just visiting. All you need is a Firefox and an installation of YOURLS. You can also find this plugin at Mozillas addon service platform.

Integration

This add-on for the Firefox consists of three modifications of your browser overlay:

  1. Toolbar-button: This button comes with a menu, you can shorten the current page or open a new window browsing to the admin page of your YOURLS API:
  2. Context-menu: A new entry is integrated in your browsers context menu, that will shorten the current page: You can also select some text on the website to give a hint about the keyword (works only if you setup the extension to ask for keywords):
  3. Statusbar-button: In addition a small button is placed into the add-ons status bar, a click shortens the current page:

The result of a shortening will be displayed in an alert box:

Settings

The setup can be done in the Add-ons Manager (browse to about:addons). Click on the Preferences button next to the YOURLS shortener entry and you’ll see a window like this:

Following values should be provided:

API URL
The URL to your YOURLS installation. In my case it's https://s.binfalse.de/
Signature
The signature of your account. You will find this string on the Tools page in the Secure passwordless API call section. This string is not required for public YOURLS installations.
Ask for a keyword?
Should the extension ask for a keyword before shortening? If this box is checked you'll always be asked like this: Not providing such a keyword has the same effect as unchecking the box: The API will decide about the short URL.
Max wait time
How many seconds should we wait for an answer from the API before we give up?

Download

This extension is licensed under GPLv3 and has it’s own project at GitHub and of course it’s listed on AMO.

(Please take a look at the man-page. Browse bugs and feature requests.)


Martin Scharm

stuff. just for the records.

Do you like this page?
You can actively support me!

25 comments

Ozh | Permalink |

Looks neat !! I’ve been reported it doesn’t work with FF 5, could you update?

Kristen | Permalink |

Hi there-

This is fantastic! Two quick questions for you. :)

  1. Am I understanding it correctly that the customization comes after the toolbar is installed?

  2. If so… As I understand it, this would be no bueno for public installations. Is there a way to adapt this in such a way that we could, say, offer the extension to download from our website for other people to use?

Thanks and best wishes, Kristen

That’s a very cruel authorization method you got going there, btw…

Martin Scharm | Permalink |

Hey Ozh,

since FF 5 wasn’t released officially while I developed the extension it is currently just available for versions < 4.1. When the AMO editors approve my current version I’ll submit a further version, also available for FF 5.

Adam | Permalink |

Thank you!

Adam | Permalink |

I suggest include the Russian language for your plagin, will help with translation. Is it possible, given the opportunity send a link to Twitter and Facebook? Thanks.

Adam | Permalink |

Will there be support for plug-in FF6?

Martin Scharm | Permalink |

I’m working on it, within the next days I’ll publish an update ;)

Ludo | Permalink |

Hello, Martin.

I’d like to install this extension, as I own my Yourls instance; do you have any news about FF 6.x compatibility release ?

Thanks, anymay.

Martin Scharm | Permalink |

Hi Ludo,

the plugin is available for FF6 since August 21, 2011. You’ll find it here. Unfortunately it has to get reviewed by the dev-team of Mozilla before you’ll find it on it’s main page (or in the search results). I submitted the plugin for review on August 21, but it’s still waiting for a review in the queue. (Currently it’s on position 56 of 241, after ~1 month!!). As long as it’s in this queue I cannot do anymore than waiting (and hoping that Mozilla extends it’s dev-team to fit it’s extremely shortened release cycles).

I hope this answer helps, Martin

RD | Permalink |

Hi Martin,

great extension, muchos kudos! With bumping the maxVersion in install.rdf to 7.* your extension also works fine on Firefox 7.

Would it be possible to automatically copy the short-url to the clipboard after it has been generated? Code would probably just this:

var clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"] .getService(Components.interfaces.nsIClipboardHelper); clipboard.copyString( ... );

RD | Permalink |

Some other small things I noticed while playing with the extension (btw: I am using v1.2, bumped for Fx7):

  • The extension should handle the case when the keyword already exists. You can test that easily if you set a specific keyword twice for different pages. On the second attempt the extension’s response is "The API returned crap". Better would be a hint of duplication and the chance to enter an alternative keyword (and all of this silently if the option to enter the keyword manually is not set).
  • While everything is configured and works correctly the button "test configuration" in the options returns "undefined", "4" and shortens afterwards. A test shouldn’t really write to the database but just check if the settings make sense and work. What does "undefined" and "4" mean?
  • If the option to enter the keyword manually is set it takes the keyword when entered and generates randomly when nothing is entered. But what is the Cancel button for? It seems to do the same thing as just entering nothing. Maybe it would be a good idea to give the user the option to cancel the keyword generation that way, so that hitting "Cancel" just closes all dialogues and doesn’t create a DB-entry.

Just thoughts. :-) Love your extension, makes using YOURLS so much easier.”

Martin Scharm | Permalink |

Hi RD,

thanks a lot for sharing your experiences! I just implemented some of your ideas in version 1.3 and submitted it for the review. I think it will stay there for about one month, but the extension is already available at http://s.binfalse.de/ffextv. Your pieces of advice were very useful, so thank you very much indeed!

Have a nice day, Martin

Antonio Rguez. Capita | Permalink |

Hi

I’ve a suggestion, it possible move button from statusbar to toolbar to made shorturl direct and fast? Or can you add a short key combination to made short url?

Congratulations for your addon

Martin Scharm | Permalink |

Hi Antonio,

there is already a button for integration to the toolbar, see figure 1 of this article. If you need help to integrate it feel free to ping me. I like the idea of a key-shortcut, maybe I’ll implement it in the next version.

Thanks a lot, Martin

[…] YOURLS Firefox extension […]

zlel | Permalink |

Right-clicked on a url on a page expecting the intuitive result of the link target url to be shortened, but the page itself got shortened instead.

zlel | Permalink |

Right-click on link to shorten target link seemed to be working after modifying browsel.xul:

thanks for the addon!

clarjon1 | Permalink |

Hey, nice job. Love this little plugin. I’d like to make a suggestion if you don’t mind.

Could there be an option to be able to turn off the dialog box that comes up with the confirmation if it succeeds, and just have the statusbar/toolbar icon change in appearance for a few seconds? EG: having a checkmark appear over it for 5 seconds? I think that it’d make the workflow a bit quicker for users. I almost didn’t notice that it auto-copied to clipboard because I was checking for the link while the dialog box was open.

Another feature that would improve the plugin would for a right click context on the status/toolbar icon/button, which would allow the user to access the settings dialog. I was a stumped for a couple of moments, before realizing that I could setup the plugin via the addons page. It’s a bit unintuitive for some users, as most new addons present the setup on the first-run, or via right click on the new icon the addon provides.

Martin Scharm | Permalink |

I finally pushed a new version to AMO: 1.5-rc1. In this version I’ve implemented some of your feature requests. Thanks a lot for sharing your thoughts!

stu | Permalink |

Loved this extention just as it is, but suddenly became unresponsive on all my machines. The test button works with a good response as does “browse to api” but a request to shorten just leaves me waiting for a dialog, I have even upped the wait time to 9 seconds. v1.5 FF24.0 win xp&vista.

stu | Permalink |

to clarify, buttons in toolbar and status bar unresponsive, context menu works fine.

Martin Scharm | Permalink |

Fixed this issue together with stu. (Thanks a lot!) An updated version is already submitted to the reviewing queue. Those, who don’t want to wait for the review can already update to the new version.

Stephane Mikaty | Permalink |

When selecting a sentence prior to clicking “Shorten”, and the sentence contains whitespaces, the whitespaces are stripped. I would like them to be replaced by ‘-‘, and all upper cases to be replaced by lowercases. Similar to soundcloud and in line with common practice elsewhere. What’s your opinion?

Martin Scharm | Permalink |

sounds reasonable, will implement it: https://bt.binfalse.de/view.php?id=7

Lars | Permalink |

Nice extension, just discovered :) Is there any chance it will be possible to handle multiple yourls installations in future releases?

Leave a comment

There are multiple options to leave a comment: