random color menu comand

cambio colore dal pulsante e dal menu

19.07.2022 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name           random color menu comand
// @namespace      https://greasyfork.org/users/237458
// @version        0.2
// @description    cambio colore dal pulsante e dal menu
// @author         figuccio
// @match          *://*/*
// @icon           https://www.google.com/s2/favicons?sz=64&domain=stackoverflow.com
// @grant          GM_addStyle
// @grant          GM_setValue
// @grant          GM_getValue
// @grant          GM_registerMenuCommand
// @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";
    Button .addEventListener("click",getRandomColor);

function getRandomColor() {
  var letters = "0123456789ABCDEF";
  var randomColor = "#";
  for (var i = 0; i < 6; i++) {
    randomColor += letters[Math.floor(Math.random() * letters.length)];
  }

  document.body.style.backgroundColor = randomColor;
}

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

GM_registerMenuCommand("mostra pulsante/nascondi",myFunctionnasc);