Like most network users, I sometimes have to use URL shorteners. But every time I don’t want to go to the website of the shortcut, I don’t want to add extra addons to Firefox. Any bookmarklets do not suit me, because they do not copy the shortened URL to the clipboard, but either transfer to the website of the shortcut, or display a dialog box in which the shortened URL. I also wanted the URL to be automatically copied to the clipboard, and the method itself could be conveniently used without a mouse.
Because I use
Vimperator , then the choice naturally fell on it. Logging on to the site and searching for plug-ins for it on the topic, I did not find anything. But I found a good plugin "
tr.im script ", which was quickly redone under Goo.gl :)
The above-mentioned plug-in and the article from the Habr “
Use Goo.gl without Google Toolbar ”, or rather a piece of code from the bookmarklet given in it were taken as a basis:
http://ggl-shortener.appspot.com/?url= "+ encodeURIComponent (window.location.href)
A little conjuring with javascript-code, which I almost do not know, got the finished result.
How to installTake
the plugin itself , copy it to the ~ / .vimperator / plugin / directory (or% HOME% \ vimperator \ plugin for Windows) and restart Firefox or execute a command in it (sometimes it doesn't help):
: loadplugins
How to useWe enter
: gg
and hit enter. The clipboard will contain the shortened url, and the vimperator command line will display
Yanked short_url
(Of course, instead of short_url there will be a shortened url;)).