Greasy Fork is available in English.

Background random

Change the background color random

// ==UserScript==
// @name          Background random
// @namespace     https://greasyfork.org/users/237458
// @description   Change the background color random
// @match          *://*/*
// @author        figuccio
// @version       1.2
// @require       https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @grant         GM_setValue
// @grant         GM_getValue
// @grant         GM_registerMenuCommand
// @icon		  https://images2.imgbox.com/b3/67/Aq5XazuW_o.png
// @noframes
// @license       MIT
// ==/UserScript==
(function() {
    'use strict';
    var Button = document.createElement('button');
    document.getElementsByTagName('body')[0].appendChild(Button);
    Button.setAttribute ('id', 'prova');
    Button.setAttribute ('title', 'cambio colore');
    Button.style = "position:absolute;top:370px;right:0px;z-index:9999999999999999999999;background-color:green;color:red;padding:3px;border-radius: 5px;border-color:black;";
    Button.innerHTML = "cambia colore random";
   ///////////////////////////////////////////////
    const colors = document.getElementById('prova');
    let index = 0;
    $(document).ready(function() {
    $('button').click(function() {
    var colors = ["blue", "green", "violet", "red","orange","purple","pink","Yellow","Cyan",];
         GM_setValue('lista', colors[index]);
        ///////////////////////////////////barra facebook
        $("div[aria-label=Facebook][role=navigation]").css("background-color" ,GM_getValue("lista"));
        /////////////////////////
                var body = Math.floor(Math.random() * colors.length);
                var selectedcolor = colors[index];
               $("body,div[aria-label=Facebook][role=navigation]").css("background",selectedcolor);
                Button.innerHTML = "&nbsp;cambio colore <br/>&nbsp;" + selectedcolor;
                     //colore button e lo stesso di quello backgrond della pagina
                 Button.style.backgroundColor = selectedcolor;
                    // testo sul pulsante
                 Button.style.color = 'white';

                index = index >= colors.length - 1 ? 0 : index + 1;
             });
});

////////////////////////////////
    })();

 function myFunctionnasc() {
 if(prova.style.display = (prova.style.display!='none') ? 'none' : 'block');}
GM_registerMenuCommand("mostra pulsante/nascondi",myFunctionnasc);

if(GM_getValue('lista')){
     $('#Button').val(GM_getValue('lista'));
     document.getElementById('prova').value =GM_getValue('lista');
     document.body.style.backgroundColor=GM_getValue('lista');
                    //barra facebook
     $("div[aria-label=Facebook][role=navigation]").css("background-color" ,GM_getValue("lista"));
    }