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:
- 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:
- 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):
- 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 SourceForge and of course it’s listed on AMO.
Extension: from AMO
Extension: 1.4 from SourceForge
Extension: 1.3 from SourceForge
Extension: 1.2 from SourceForge
Extension: 1.1 from SourceForge
Extension: 1.0 from SourceForge
SourceCode: from SourceForge
(Please take a look at the man-page. Browse bugs and feature requests.)






Looks neat !!
I’ve been reported it doesn’t work with FF 5, could you update?
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.
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…
Thank you!
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.
Will there be support for plug-in FF6?
I’m working on it, within the next days I’ll publish an update ;)
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.
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
Hi Martin,
great extension, muchos kudos!
With bumping the
maxVersionininstall.rdfto7.*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:
2
3
.getService(Components.interfaces.nsIClipboardHelper);
clipboard.copyString( ... );
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.
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
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
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 [...]
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.
Right-click on link to shorten target link seemed to be working after modifying browsel.xul:
thanks for the addon!