Skip to main content
6 of 7
added 130 characters in body
brunnerh
  • 661
  • 3
  • 10

Remove Delete-Favourite-Tag-Buttons Script

A Screenshot

To help people not accidentally delete them, especially the short ones.
(Also see the cause to get them removed permanentely)

Sorry to not provide a file for download but i am sure you will manage somehow, adjust includes and exlcudes as needed:

// ==UserScript==
// @name           Remove Favourite-Tag-Delete-Buttons
// @namespace      stackoverflow
// @include        *stackoverflow.com*
// @exclude        *stackoverflow.com/users/preferences/*
// ==/UserScript==

(function ()
{
    var cancelWaiting = false;
    jq_wait();

    function jq_wait()
    {
        if (typeof unsafeWindow.jQuery == 'undefined')
        {
            window.setTimeout(jq_wait, 100);
        } else
        {
            $ = unsafeWindow.jQuery;
            window.setTimeout(function () { cancelWaiting = true; }, 5000);
            $(document).ready(tag_wait);
        }
    }

    function tag_wait()
    {
        var items = $("#interesting-tags .delete-tag");
        if (items.length == 0)
        {
            if (cancelWaiting) return;
            window.setTimeout(tag_wait, 10);
        } else
        {
            items.remove();
        }
    }
})();

Edits:

  • Selector also matched the delete buttons on comments, which was not wanted.
  • Added @exclude exception for the preferences page
brunnerh
  • 661
  • 3
  • 10