Skip to main content
1 of 7
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:

// ==UserScript==
// @name           Remove Favourite-Tag-Delete-Buttons
// @namespace      stackoverflow
// @include        *stackoverflow.com*
// ==/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()
    {
        if ($(".delete-tag").length == 0)
        {
            if (cancelWaiting) return;
            window.setTimeout(tag_wait, 10);
        } else
        {
            rem_them();
        }
    }

    function rem_them()
    {
        $(".delete-tag").remove();
    }
})();

(Improvement suggestions/edits are welcome)

brunnerh
  • 661
  • 3
  • 10