Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


reply links on comments


This user script adds a little "reply" link to each comment. Clicking this link will

  1. fetch the rest of the comments, if some of them were hidden
  2. show the "add comment" text box
  3. pre-populate the text box with "@" and the name of the user you're replying to (removing spaces).

Be aware that there's no guarantee that the replied-to user will be notified of the comment -- all the @-reply caveats still apply (see the blog or the community faq for some information).


install / update scriptview source


I have tested this script in Chrome (Windows 7), Chromium (Fedora 14), and Firefox + Greasemonkey (both OSes).


This script is created by Benjamin Dumke-von der Ehe. Note that this is a free-time project of mine, and has nothing to do with my employment at Stack Overflow. See my profile for contact details; you can also often find me in the Tavern on Meta Stack Exchange chat.

share|improve this question
The script somehow seems to swallow certain characters at times, e.g. infensus was turned into inensus. – H.B. Aug 2 '11 at 1:31
Please make it work with other sites as well. – LifeH2O Aug 8 '11 at 14:51
Loving this script, especially after a couple minor tweaks – freiheit Aug 13 '11 at 18:54
@H.B.: Any chance the f was a unicode character instead of a standard f? – freiheit Aug 13 '11 at 18:55
@freiheit: No idea, i should have linked to the profile, cannot find it anymore... – H.B. Aug 13 '11 at 19:17
@freiheit: He/she just posted another question, (profile), you could try the reply button on this question for example. – H.B. Aug 14 '11 at 0:38
How is this script affected by Will you still maintain it? – Tshepang Jan 25 '12 at 22:28
@Tshepang: It still works, and I'm still using it myself. I have found myself using the tab completion more and more, but I also still use this script. – balpha Jan 26 '12 at 7:30
It does seem to like to eat the first non-capitalized 'f' in someone's name. – Ullallulloo Feb 3 '12 at 0:05
This does not work with usernames which contain only non-ascii characters like in When replying to "ガベージコレクタ" the script eats the complete username (with FF15 on Win7). – Martin Schröder Sep 28 '12 at 13:26
@MartinSchröder Ah yeah, I never fixed that... (To be honest, I haven't been using this script much since we put the tab autocompleter in). I'll fix it over the weekend; it's easy enough. – balpha Sep 28 '12 at 14:17
Doesn't work on as it seems – Oliver Salzburg Dec 18 '12 at 11:59
Stackoverflow finally seems to support https, but your script is hardcoded for http://. – Martin Schröder Jan 5 '14 at 11:07
Now (v1.1) it doesn't open the comment field anymore; it still adds the arrow and when the comment field is open the user name is added. – Martin Schröder Aug 9 '14 at 21:28
Please address the bug with not opening the command field anymore – Mr_and_Mrs_D Mar 30 '15 at 22:39

I would like to suggest

  1. Add to list of sites
  2. Allow the common "upside-down" unicode characters that have become trendy lately (and some users are using in their names now).
  3. Allow basic greek alphabet, since that also seems popular (lot of math and science symbols are greek)

Diff format, tested and working for me in Chrome:

--- 68252.user.js.orig  2011-08-13 11:15:22.000000000 -0700
+++ 68252.user.js   2011-08-13 11:51:49.000000000 -0700
@@ -15,6 +15,7 @@
 // @include*
 // @include*
 // @include*
+// @include*
 // @author         Benjamin Dumke
 // ==/UserScript==

@@ -82,7 +83,13 @@
-                            ,'\u00f8','\u00f9','\u00fa','\u00fb','\u00fc','\u00fd'         ,'\u00ff').join('');
+                            ,'\u00f8','\u00f9','\u00fa','\u00fb','\u00fc','\u00fd'         ,'\u00ff'
+                            // upside-down lowercase from
+                            ,'\u0250','\u0254','\u01dd','\u025f','\u0183','\u0265','\u0131','\u027e'
+                            ,'\u029e','\u0283','\u026f','\u0279','\u0287','\u028c','\u028d','\u028e'
+                            // basic greek
+                            ,'\u0370-\u03FF'
+                            ).join('');

     var bad = new RegExp("[^" + goodletters + "\\w.'-]", "ig");
share|improve this answer
Upside-down and greek because the hard-to-type usernames are exactly the ones I want to use a reply button for. – freiheit Aug 13 '11 at 19:37
Actually, all this script (in its current version) really needs is to remove spaces, so the character whitelist isn't really necessary anymore (I really thought I had made this change already, but it looks like I never did). I'll add your characters to, though. And good point about updating the site list; will do. Thanks! – balpha Aug 13 '11 at 20:20

Clicking on the icon won't reveal the comment-box anymore.

One has to click the "add comment" link, for the comment box to appear, then click on the script icon to add the reply signature into the revealed comment-box.

share|improve this answer
I fixed it at… – Michael Freidgeim Jan 30 at 11:03

Unable to click on Comment. When i click on the icon then it doesn't show comment box.

share|improve this answer
This looks to be the same issue that Basilevs reported. – Brock Adams Sep 8 '15 at 14:26

I've made a couple of fixes to make this work again. While I don't fork and ask for a merge, here it is a copy of my script for convenience, the modifications are indicated with comments. The matches of sites has been revised as well.

// ==UserScript==
// @name           stackoverflow-comment-reply
// @namespace      stackapps
// @description    Add "reply" links to comments
// @version        1.1c
// @match          *://**
// @match          *://**
// @match          *://**
// @match          *://**
// @match          *://**
// @match          *://**
// @match          *://**
// @match          *://*
// @author         Benjamin Dumke-von der Ehe
// ==/UserScript==

/* MOD: don't run if not SE and user not logged in */
if (!window.StackExchange || window.StackExchange.options.user.isAnonymous )

// Thanks to Shog9 for this idea for making the script work in both
// Chrome and Firefox:
function with_jquery(f) {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.textContent = "(" + f.toString() + ")(jQuery)";

with_jquery(function($) {

        setTimeout(function () {
        }, 100);

    // event handler for a click on the reply links
    function reply() {
        /* MOD: changed the following 2 lines to detect the new Add Comment link */
        var commentlinkId = $(this).closest(".comments").next().attr("id");
        var commentlink = $('#'+commentlinkId + ' a.js-add-link')[0].click();
        var username = goodify($(this).prev().text().replace(/♦/, ""))
        var formid = commentlinkId.replace(/^.*-(\d+)$/, "add-comment-$1");
        var ta = $("#" + formid + " textarea")[0];
        var start = ta.selectionStart;
        var end = ta.selectionEnd;
        var shift = username.length + 3;
        ta.value = "@" + username + ": " + ta.value;
        ta.selectionStart = start + shift;
        ta.selectionEnd = end + shift;

    function put_reply_links() {
        $(this).find(".comment:not(:has(.reply-link)) .comment-user").each(function () {
            /* MOD: // changed click by on(click) */
            $("<span class='reply-link' style='cursor:pointer;opacity:0.3' title='reply'> &crarr;</span>").on('click',reply).insertAfter(this); 


    function goodify(s) {
        return s.replace(/ +/g, "");
share|improve this answer

You need to open the comment box before clicking the arrow. If you need to click the comment box, I think starting tagging user from keyboard is quicker than move your mouse to click the arrow, then start typing the comment.

share|improve this answer
It was a bug, not an intentional behavior. I fixed it at… – Michael Freidgeim Jan 30 at 11:02
@MichaelFreidgeim how do I use it? – Ooker Jan 30 at 11:15
In Chrome, install and open Tampermonkey, then copy my script from bitbucket, save it and insure it shown as Installed Userscript. Then refresh any stackoverflow page and you will see arrows on each comment. For other browsers there are different extensions to run Userscripts – Michael Freidgeim Jan 30 at 11:37
@MichaelFreidgeim: it works. Thanks for your effort. – Ooker Jan 30 at 11:56

You must log in to answer this question.

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