MetaFilter Recent Activity border o' rainbows

Shows rainbows atop tiny clouds around your own comments in Recent Activity (for logged-in members)

// ==UserScript==
// @name         MetaFilter Recent Activity border o' rainbows
// @namespace    https://greasyfork.org/scripts/1527-metafilter-recent-activity-border-o-rainbows
// @version      3.0
// @description  Shows rainbows atop tiny clouds around your own comments in Recent Activity (for logged-in members)
// @author       rangefinder 1.4	
// @include      https://www.metafilter.com/contribute/activity/*
// @include      http://www.metafilter.com/contribute/activity/*
// @match        https://www.metafilter.com/contribute/activity/*
// @match        http://www.metafilter.com/contribute/activity/*
// @grant        none
// ==/UserScript==
//
// Version 3.0: 2020-01-11 - Replaced GM_addStyle (deprecated in 
//  Greasemonkey 4.0). (Thanks to Tehhund for reporting the issue)
//  *Tampermonkey should still work with version 2.1 of this userscript.*
//
// Version 2.1: 2014-05-23 - Replaced @namespace with script home page.
// Version 2.0: 2014-05-23 - Changed script URLs to point to greasyfork.org,
//  since userscripts.org hasn't been stable recently.
//
// Version 1.1: 2013-11-01 - Added support for automatic script updates (had
//  to upload to userscripts.org first to get the URLs).
// Version 1.0: 2013-11-01 - Grand opening.
//
// This script was inspired by a MetaTalk comment from phunniemee:
// <http://metatalk.metafilter.com/22732/A-Pony-with-a-Green-Check-Cutie-Mark#1094368>
//
// The original rainbow cloud graphic is from a clip art library I got over
// 15 years ago.

// Border image is 126x126 transparent PNG divided into nine equal sections.
var rainbows = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAB+CAYAAADiI6WIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAC5xJREFUeNrsXAlwldUZPSEbCSEkIQFakSWyClI04ASwaCo4pWUKXSKOVYfFTscOUgEHGGSGspSII9qWaWtBgQmFVoIFWiEOqQuUQsqiDEHAEPZgMWyPkIUs5PZ87yUs4QX+t2Bzk+/M/Jn//ct3z/ede++/ZU6IMQaK5ocWWgIVXqHCK1R4hQqvUOEVKrxChVeo8IrGjTD5ExISEkiM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XZ8t6CMQx0ibh1dnyBgTqGGnLos6W9RCoY6QtUGfLegjUMdIWqLNlPQTqGGnLos6WXhCIY6RNN3fqbHkb+OoYafELHHW29Pr2yaFjZBP4SKPOlor/L/T/6lV4hQqvUOEVKrxChVeo8AoVXqHCK1R4hQqvUOEVKrxChVeo8AoVXqHCK1R4hQqv8BlWOVta4RgJdbYMurOlv53763SMVGfLu+BsaYNjpC08rXK2tMEx0haeVjlb2uAYaQtPq5wtbXCMtIWnVc6WNjhG2sLTKmdLGxwjbeFplbOlFY6RUGfLoDtb3g6NxTFSnS2vI2jOlg2hMTlGqrNlfQTB2bIhNCbHSHW29IYAnS3r0JgdI9XZsoGvgYE4W7rfHjZyx0h1tmwAgThbChq7Y6Q6W3pBoM6WNjhGqrOlFwTqbGmDY6QtPK1ytrTCMRLqbHkLAnW2tMExUp0tG0AgzpaCxu4Yqc6WDuCrs6W3t4uNzTFSnS19efvk0NnSBsdIW3iqs2Uzhf5fvQqvUOEVKrxChVeo8AoVXqHCK1R4RSPH/wQYACYkxLqBPIadAAAAAElFTkSuQmCC';

// Modify CSS class for user's own comments in Recent Activity.

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

addGlobalStyle("div.mycomments { border: inset grey 42px !important; border-image: url(" + rainbows + ") 42 round !important; padding-right: 12px !important; padding-left:12px !important; }");