Skip to main content
Updated to use .js-comment-delete, because SE took out .comment-delete
Source Link

Here is a GreaseMonkey script I threw together:

// ==UserScript==
// @name     Old Comment Delete Button
// @version  1.1.0
// @grant    none
// @author   a stone arachnid
// @include  https://*stackoverflow.com/*
// @include  https://*superuser.com/*
// @include  https://*serverfault.com/*
// @include  https://*stackapps.com/*
// @include  https://*askubuntu.com/*
// @include  https://*mathoverflow.net/*
// @include  https://*stackexchange.com/*
// @exclude  http*://*chat.*/
// @require  https://gist.githubusercontent.com/BrockA/2625891/raw/9c97aa67ff9c5d56be34a55ad6c18a314e5eb548/waitForKeyElements.js
// ==/UserScript==

(function(){
    var styles = `
.js-comment-delete,.js-comment-delete:hover,.js-comment-delete:focus{
  margin:0;
  line-height:1;
  width:14px;
  height:14px;
  background:rgba(36,39,41,0.25);
  border-radius:7px;
  box-sizing:border-box;
  padding:2px;
  color:white!important;
  display:none;
}
.comment:hover .js-comment-delete,.js-comment-delete:focus{
  display:inline;
}
.js-comment-delete:hover{
  background:rgba(36,39,41,0.6);
}
.js-comment-delete:active{
  background:rgba(127,0,0,1)!important;
}
.js-comment-delete:focus{
  box-shadow:none;
}
`,svg='<svg class="svg-icon va-text-bottom iconClearSm" width="14" height="14" viewBox="0 0 20 20"><path d="M12 3.41L10.59 2 7 5.59 3.41 2 2 3.41 5.59 7 2 10.59 3.41 12 7 8.41 10.59 12 12 10.59 8.41 7z"></path></svg>';
    StackExchange.ready(function(){
        $("<style></style>").text(styles).appendTo("head");
        $(".js-comment-delete").removeClass("fc-red-600").html(svg);
    });
    waitForKeyElements(".comment",function(jNode){
        $(jNode).find(".js-comment-delete").removeClass("fc-red-600").html(svg);
    })
})();

Here is a GreaseMonkey script I threw together:

// ==UserScript==
// @name     Old Comment Delete Button
// @version  1.1.0
// @grant    none
// @author   a stone arachnid
// @include  https://*stackoverflow.com/*
// @include  https://*superuser.com/*
// @include  https://*serverfault.com/*
// @include  https://*stackapps.com/*
// @include  https://*askubuntu.com/*
// @include  https://*mathoverflow.net/*
// @include  https://*stackexchange.com/*
// @require  https://gist.githubusercontent.com/BrockA/2625891/raw/9c97aa67ff9c5d56be34a55ad6c18a314e5eb548/waitForKeyElements.js
// ==/UserScript==

(function(){
    var styles = `
.comment-delete,.comment-delete:hover,.comment-delete:focus{
  margin:0;
  line-height:1;
  width:14px;
  height:14px;
  background:rgba(36,39,41,0.25);
  border-radius:7px;
  box-sizing:border-box;
  padding:2px;
  color:white!important;
  display:none;
}
.comment:hover .comment-delete,.comment-delete:focus{
  display:inline;
}
.comment-delete:hover{
  background:rgba(36,39,41,0.6);
}
.comment-delete:active{
  background:rgba(127,0,0,1)!important;
}
.comment-delete:focus{
  box-shadow:none;
}
`,svg='<svg class="svg-icon va-text-bottom iconClearSm" width="14" height="14" viewBox="0 0 20 20"><path d="M12 3.41L10.59 2 7 5.59 3.41 2 2 3.41 5.59 7 2 10.59 3.41 12 7 8.41 10.59 12 12 10.59 8.41 7z"></path></svg>';
    StackExchange.ready(function(){
        $("<style></style>").text(styles).appendTo("head");
        $(".comment-delete").removeClass("fc-red-600").html(svg);
    });
    waitForKeyElements(".comment",function(jNode){
        $(jNode).find(".comment-delete").removeClass("fc-red-600").html(svg);
    })
})();

Here is a GreaseMonkey script I threw together:

// ==UserScript==
// @name     Old Comment Delete Button
// @version  1.1.0
// @grant    none
// @author   a stone arachnid
// @include  https://*stackoverflow.com/*
// @include  https://*superuser.com/*
// @include  https://*serverfault.com/*
// @include  https://*stackapps.com/*
// @include  https://*askubuntu.com/*
// @include  https://*mathoverflow.net/*
// @include  https://*stackexchange.com/*
// @exclude  http*://*chat.*/
// @require  https://gist.githubusercontent.com/BrockA/2625891/raw/9c97aa67ff9c5d56be34a55ad6c18a314e5eb548/waitForKeyElements.js
// ==/UserScript==

(function(){
    var styles = `
.js-comment-delete,.js-comment-delete:hover,.js-comment-delete:focus{
  margin:0;
  line-height:1;
  width:14px;
  height:14px;
  background:rgba(36,39,41,0.25);
  border-radius:7px;
  box-sizing:border-box;
  padding:2px;
  color:white!important;
  display:none;
}
.comment:hover .js-comment-delete,.js-comment-delete:focus{
  display:inline;
}
.js-comment-delete:hover{
  background:rgba(36,39,41,0.6);
}
.js-comment-delete:active{
  background:rgba(127,0,0,1)!important;
}
.js-comment-delete:focus{
  box-shadow:none;
}
`,svg='<svg class="svg-icon va-text-bottom iconClearSm" width="14" height="14" viewBox="0 0 20 20"><path d="M12 3.41L10.59 2 7 5.59 3.41 2 2 3.41 5.59 7 2 10.59 3.41 12 7 8.41 10.59 12 12 10.59 8.41 7z"></path></svg>';
    StackExchange.ready(function(){
        $("<style></style>").text(styles).appendTo("head");
        $(".js-comment-delete").removeClass("fc-red-600").html(svg);
    });
    waitForKeyElements(".comment",function(jNode){
        $(jNode).find(".js-comment-delete").removeClass("fc-red-600").html(svg);
    })
})();
Updated to use waitForKeyElements
Source Link

Here is a GreaseMonkey script I threw together:

// ==UserScript==
// @name     Old Comment Delete Button
// @version  1.0.1.0
// @grant    none
// @author   a stone arachnid
// @include  https://*stackoverflow.com/*
// @include  https://*superuser.com/*
// @include  https://*serverfault.com/*
// @include  https://*stackapps.com/*
// @include  https://*askubuntu.com/*
// @include  https://*mathoverflow.net/*
// @include  https://*stackexchange.com/*
// @require  https://gist.githubusercontent.com/BrockA/2625891/raw/9c97aa67ff9c5d56be34a55ad6c18a314e5eb548/waitForKeyElements.js
// ==/UserScript==

(function(){
    var styles = `
.comment-delete,.comment-delete:hover,.comment-delete:focus{
  margin:0;
  line-height:1;
  width:14px;
  height:14px;
  background:rgba(36,39,41,0.25);
  border-radius:7px;
  box-sizing:border-box;
  padding:2px;
  color:white!important;
  display:none;
}
.comment:hover .comment-delete,.comment-delete:focus{
  display:inline;
}
.comment-delete:hover{
  background:rgba(36,39,41,0.6);
}
.comment-delete:active{
  background:rgba(127,0,0,1)!important;
}
.comment-delete:focus{
  box-shadow:none;
}
`;
  StackExchange.ready(function(){
    $("<style></style>").text(styles).appendTo("head");
    $(".comment-delete").removeClass("fc-red-600").html('<svg`,svg='<svg class="svg-icon va-text-bottom iconClearSm" width="14" height="14" viewBox="0 0 20 20"><path d="M12 3.41L10.59 2 7 5.59 3.41 2 2 3.41 5.59 7 2 10.59 3.41 12 7 8.41 10.59 12 12 10.59 8.41 7z"></path></svg>'svg>';
    StackExchange.ready(function(){
        $("<style></style>").text(styles).appendTo("head");
        $(".comment-delete").removeClass("fc-red-600").html(svg);
    });
    waitForKeyElements(".comment",function(jNode){
        $(jNode).find(".comment-delete").removeClass("fc-red-600").html(svg);
    })
})();

Here is a GreaseMonkey script I threw together:

// ==UserScript==
// @name     Old Comment Delete Button
// @version  1.0.1
// @grant    none
// @author   a stone arachnid
// @include  https://*stackoverflow.com/*
// @include  https://*superuser.com/*
// @include  https://*serverfault.com/*
// @include  https://*stackapps.com/*
// @include  https://*askubuntu.com/*
// @include  https://*mathoverflow.net/*
// @include  https://*stackexchange.com/*
// ==/UserScript==

(function(){
  var styles = `
.comment-delete,.comment-delete:hover,.comment-delete:focus{
  margin:0;
  line-height:1;
  width:14px;
  height:14px;
  background:rgba(36,39,41,0.25);
  border-radius:7px;
  box-sizing:border-box;
  padding:2px;
  color:white!important;
  display:none;
}
.comment:hover .comment-delete,.comment-delete:focus{
  display:inline;
}
.comment-delete:hover{
  background:rgba(36,39,41,0.6);
}
.comment-delete:active{
  background:rgba(127,0,0,1)!important;
}
.comment-delete:focus{
  box-shadow:none;
}
`;
  StackExchange.ready(function(){
    $("<style></style>").text(styles).appendTo("head");
    $(".comment-delete").removeClass("fc-red-600").html('<svg class="svg-icon va-text-bottom iconClearSm" width="14" height="14" viewBox="0 0 20 20"><path d="M12 3.41L10.59 2 7 5.59 3.41 2 2 3.41 5.59 7 2 10.59 3.41 12 7 8.41 10.59 12 12 10.59 8.41 7z"></path></svg>');
  });
})();

Here is a GreaseMonkey script I threw together:

// ==UserScript==
// @name     Old Comment Delete Button
// @version  1.1.0
// @grant    none
// @author   a stone arachnid
// @include  https://*stackoverflow.com/*
// @include  https://*superuser.com/*
// @include  https://*serverfault.com/*
// @include  https://*stackapps.com/*
// @include  https://*askubuntu.com/*
// @include  https://*mathoverflow.net/*
// @include  https://*stackexchange.com/*
// @require  https://gist.githubusercontent.com/BrockA/2625891/raw/9c97aa67ff9c5d56be34a55ad6c18a314e5eb548/waitForKeyElements.js
// ==/UserScript==

(function(){
    var styles = `
.comment-delete,.comment-delete:hover,.comment-delete:focus{
  margin:0;
  line-height:1;
  width:14px;
  height:14px;
  background:rgba(36,39,41,0.25);
  border-radius:7px;
  box-sizing:border-box;
  padding:2px;
  color:white!important;
  display:none;
}
.comment:hover .comment-delete,.comment-delete:focus{
  display:inline;
}
.comment-delete:hover{
  background:rgba(36,39,41,0.6);
}
.comment-delete:active{
  background:rgba(127,0,0,1)!important;
}
.comment-delete:focus{
  box-shadow:none;
}
`,svg='<svg class="svg-icon va-text-bottom iconClearSm" width="14" height="14" viewBox="0 0 20 20"><path d="M12 3.41L10.59 2 7 5.59 3.41 2 2 3.41 5.59 7 2 10.59 3.41 12 7 8.41 10.59 12 12 10.59 8.41 7z"></path></svg>';
    StackExchange.ready(function(){
        $("<style></style>").text(styles).appendTo("head");
        $(".comment-delete").removeClass("fc-red-600").html(svg);
    });
    waitForKeyElements(".comment",function(jNode){
        $(jNode).find(".comment-delete").removeClass("fc-red-600").html(svg);
    })
})();
Rolled back broken code
Source Link

Here is a GreaseMonkey script I threw together:

// ==UserScript==
// @name     Old Comment Delete Button
// @version  1.0.21
// @grant    none
// @author   a stone arachnid
// @include  https://*stackoverflow.com/*
// @include  https://*superuser.com/*
// @include  https://*serverfault.com/*
// @include  https://*stackapps.com/*
// @include  https://*askubuntu.com/*
// @include  https://*stackexchange*mathoverflow.comnet/*
// ==/UserScript==

function with_jquery(f) {
  var script = document.createElement("script");
  script.type@include = "texthttps:/javascript";
  script.textContent = "(" + f/*stackexchange.toString() + ")(jQuery)";com/*
 // document.body.appendChild(script);
}==/UserScript==

with_jquery(function(){
  var styles = `
.comment-delete,.comment-delete:hover,.comment-delete:focus{
  margin:0;
  line-height:1;
  width:14px;
  height:14px;
  background:rgba(36,39,41,0.25);
  border-radius:7px;
  box-sizing:border-box;
  padding:2px;
  color:white!important;
  display:none;
}
.comment:hover .comment-delete,.comment-delete:focus{
  display:inline;
}
.comment-delete:hover{
  background:rgba(36,39,41,0.6);
}
.comment-delete:active{
  background:rgba(127,0,0,1)!important;
}
.comment-delete:focus{
  box-shadow:none;
}
`,`;
 svg =StackExchange.ready(function(){
    $("<style></style>").text(styles).appendTo("head");
    $(".comment-delete").removeClass("fc-red-600").html('<svg class="svg-icon va-text-bottom iconClearSm" width="14" height="14" viewBox="0 0 20 20"><path d="M12 3.41L10.59 2 7 5.59 3.41 2 2 3.41 5.59 7 2 10.59 3.41 12 7 8.41 10.59 12 12 10.59 8.41 7z"></path></svg>';
  StackExchange.ready(function(){
    $("<style></style>").text(styles).appendTo("head");
    $(".comment-delete").removeClass("fc-red-600").html(svgsvg>');
  });
  $('body').on('DOMNodeInserted', '.comment', function () {
    $(this).find(".comment-delete").removeClass("fc-red-600").html(svg);
  });
}();

Here is a GreaseMonkey script I threw together:

// ==UserScript==
// @name     Old Comment Delete Button
// @version  1.0.2
// @grant    none
// @author   a stone arachnid
// @include  https://*stackoverflow.com/*
// @include  https://*superuser.com/*
// @include  https://*serverfault.com/*
// @include  https://*stackapps.com/*
// @include  https://*askubuntu.com/*
// @include  https://*stackexchange.com/*
// ==/UserScript==

function with_jquery(f) {
  var script = document.createElement("script");
  script.type = "text/javascript";
  script.textContent = "(" + f.toString() + ")(jQuery)";
  document.body.appendChild(script);
}

with_jquery(function(){
  var styles = `
.comment-delete,.comment-delete:hover,.comment-delete:focus{
  margin:0;
  line-height:1;
  width:14px;
  height:14px;
  background:rgba(36,39,41,0.25);
  border-radius:7px;
  box-sizing:border-box;
  padding:2px;
  color:white!important;
  display:none;
}
.comment:hover .comment-delete,.comment-delete:focus{
  display:inline;
}
.comment-delete:hover{
  background:rgba(36,39,41,0.6);
}
.comment-delete:active{
  background:rgba(127,0,0,1)!important;
}
.comment-delete:focus{
  box-shadow:none;
}
`, svg = '<svg class="svg-icon va-text-bottom iconClearSm" width="14" height="14" viewBox="0 0 20 20"><path d="M12 3.41L10.59 2 7 5.59 3.41 2 2 3.41 5.59 7 2 10.59 3.41 12 7 8.41 10.59 12 12 10.59 8.41 7z"></path></svg>';
  StackExchange.ready(function(){
    $("<style></style>").text(styles).appendTo("head");
    $(".comment-delete").removeClass("fc-red-600").html(svg);
  });
  $('body').on('DOMNodeInserted', '.comment', function () {
    $(this).find(".comment-delete").removeClass("fc-red-600").html(svg);
  });
});

Here is a GreaseMonkey script I threw together:

// ==UserScript==
// @name     Old Comment Delete Button
// @version  1.0.1
// @grant    none
// @author   a stone arachnid
// @include  https://*stackoverflow.com/*
// @include  https://*superuser.com/*
// @include  https://*serverfault.com/*
// @include  https://*stackapps.com/*
// @include  https://*askubuntu.com/*
// @include  https://*mathoverflow.net/*
// @include  https://*stackexchange.com/*
// ==/UserScript==

(function(){
  var styles = `
.comment-delete,.comment-delete:hover,.comment-delete:focus{
  margin:0;
  line-height:1;
  width:14px;
  height:14px;
  background:rgba(36,39,41,0.25);
  border-radius:7px;
  box-sizing:border-box;
  padding:2px;
  color:white!important;
  display:none;
}
.comment:hover .comment-delete,.comment-delete:focus{
  display:inline;
}
.comment-delete:hover{
  background:rgba(36,39,41,0.6);
}
.comment-delete:active{
  background:rgba(127,0,0,1)!important;
}
.comment-delete:focus{
  box-shadow:none;
}
`;
  StackExchange.ready(function(){
    $("<style></style>").text(styles).appendTo("head");
    $(".comment-delete").removeClass("fc-red-600").html('<svg class="svg-icon va-text-bottom iconClearSm" width="14" height="14" viewBox="0 0 20 20"><path d="M12 3.41L10.59 2 7 5.59 3.41 2 2 3.41 5.59 7 2 10.59 3.41 12 7 8.41 10.59 12 12 10.59 8.41 7z"></path></svg>');
  });
})();
Made it work without refresh for dynamic comments
Source Link
Loading
Changed the non-hovering color, according to OP's request
Source Link
Loading
Source Link
Loading