This script was previously called "Insert APT Link" but has now been renamed. As such, you need to uninstall any previous versions before installing the new one.

Screenshot / Code Snippet


This UserScript adds some buttons to the editing toolbar that allow the following to easily be inserted:

  • Package installation button:

    Software center

  • Package installation text and icon:

    stackapplet Install stackapplet

This UserScript is fully compatible with inline editing and the toolbar buttons should show up anywhere there is a WMD editor.


MIT License


You can install the script by clicking the link below:


Tested on Firefox 11 (and reported to work on Chrome too).


I can be reached at [email protected]


Written in JavaScript using jQuery.

  • Can this be made into an addon? Greasemonkey doesn't work with nightlies :/
    – RolandiXor
    Commented Jul 7, 2011 at 20:23
  • @Roland: Really? (Shame on GreaseMonkey!) Actually, I'm afraid I have never written a Firefox addon. Ever. :( Commented Jul 7, 2011 at 20:25
  • I guess this is time for me to brush up on javascript and write a jetpack :).
    – RolandiXor
    Commented Jul 7, 2011 at 22:26
  • Guess who got greasemonkey working since the latest update :D...
    – RolandiXor
    Commented Jul 28, 2011 at 4:54
  • @Roland: Hooray! So what Firefox version are we working with now? :) Commented Jul 28, 2011 at 4:56
  • Firefox 8 still, 9 is on the way but hasn't landed yet :)
    – RolandiXor
    Commented Jul 28, 2011 at 5:20
  • Can this be updated to insert this new awesome button? meta.askubuntu.com/a/395/235 Commented Apr 24, 2012 at 22:32
  • @JorgeCastro: Sure - that button looks awesome. Commented Apr 25, 2012 at 5:56
  • It looks like apps.ubuntu.com is the preferred way to install now, see here: meta.askubuntu.com/a/395/235 Commented Apr 25, 2012 at 16:20
  • This script is awesome! I took it and misused it to support some long wanted functionality on mathematica.SE. Nathan, I left your name as developer, your company URL and the download link for livequery.js in there. Would you mind leaving me a comment under our meta post whether this is OK or what I should change? Thanks.
    – halirutan
    Commented Jul 6, 2013 at 14:32
  • @halirutan: I don't have an account on Mathematica.SE, but you are more than welcome to use my code and link to my hosted version of Livequery. I'm glad you were able to adapt my code so easily :) Commented Jul 6, 2013 at 21:19
  • @NathanOsman Yes, it's tested now by several users and works like a charm. I was having a chat with Tim Stone yesterday about how I could have possibly found things like StackExchange.MarkdownEditor.refreshAllPreviews() because they are documented nowhere. That's why I'm so glad you did the hard work and I only had to use it.
    – halirutan
    Commented Jul 6, 2013 at 21:23
  • @halirutan: Right - I spent a long time playing around with the Chrome Inspector before I figured that one out. Eventually I'm thinking of creating a JavaScript library with a bunch of functions for doing common things on Stack Exchange pages - like creating toolbar buttons, inserting text into the editor, and creating popup boxes. Then UserScripts can just include the library. Commented Jul 6, 2013 at 22:52
  • @NathanOsman We found an issue: When you are not logged on SE or if you are a new user, than the markdown editor gets an additional toolbar which makes that your additional buttons are placed at the very left and are not visible completely.
    – halirutan
    Commented Jul 8, 2013 at 13:49
  • Please see this screenshot. The most left Key button is the last of the three buttons I'm using. The reason for this shift to the left seems to be the additional Links Images ... toolbar which appears for guests or new users.
    – halirutan
    Commented Jul 8, 2013 at 13:54

1 Answer 1


I've made some improvements:

  • [bugfix] At some pages, the button would not be added: Tag wiki and pressing "Add another answer"
  • [feature] selected text will now immediately be converted to an APT link
  • [feature] URLs like http://packages.ubuntu.com/package will now be converted to package (technically, it takes the part after the last /)
  • Code cleanup: stripping http:// made no sense and was possibly a leftover from copying code directly



  • (13 June 2011): Release
  • (7 July 2011): [bugfix] the editors textareas for posts seems to have a numeric ID part now.
  • (7 July 2011): [bugfix] Edit Posts works now properly again
  • (18 January 2015): [bugfix] Apply to https://askubuntu.com/ too, fix API usage, jshint fixes, use new artwork and app URL.
  • Thanks! Do you mind if I credit you and update the original? Commented Jun 13, 2011 at 16:55
  • 1
    @GeorgeEdison: No problem, you may remove the download link from my answer after updating, keeping multiple (out-dated) copies is not a good idea. Could you add an link to this page in the userscript for future reference? E.g. @website http://stackapps.com/q/2405
    – Lekensteyn
    Commented Jun 13, 2011 at 18:22
  • Chrome is giving me errors when I try to use the button when editing answers: Uncaught SyntaxError: Unexpected token ILLEGAL edit:13 // Uncaught TypeError: Object [object Object] has no method 'selection' Commented Jun 15, 2011 at 6:44
  • I found the issue: I wrongly assumed that the selection method was something from jQuery (it's part of cdn.sstatic.net/Js/tageditor.js). I've also found an issue at the tag editing page which is now fixed. The download link has not changed, do not forget to clear your cache.
    – Lekensteyn
    Commented Jun 15, 2011 at 8:22
  • Did a quick fix for the old Insert Apt Link userscript.
    – Lekensteyn
    Commented Jan 18, 2015 at 21:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .