您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
cambia colori random
当前为
// ==UserScript== // @name colore barra facebook ramdom figuccio // @namespace https://greasyfork.org/users/237458 // @version 1.1 // @author figuccio // @description cambia colori random // @match https://*.facebook.com/* // @match https://*.facebook.com/me/* // @grant GM_addStyle // @grant GM_setValue // @grant GM_getValue // @grant GM_registerMenuCommand // @run-at document start // @icon https://www.google.com/s2/favicons?domain=facebook.com // @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js // @license MIT // @noframes // ==/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.setAttribute('class', 'test'); Button.style = "position:absolute;top:370px;right:0px;z-index:9999999999999999999999;background-color:yellow;color:black;padding:5px;border-radius: 5px;border-color:green;"; Button.innerHTML = "cambia colore fb random"; ////////////////////////////////////////////////////body, const colors = document.getElementById('prova'); let index = 0; $(document).ready(function() { $('button').click(function() { const colors = ["blue","salmon", "green", "violet", "red","orange","purple","pink","Yellow","Cyan","#0099cc","#587b2e","#990000","#000000","#1C8200","#987baa","#981890","#AA8971","#1987FC","#99081E"]; GM_setValue('lista', colors[index]); ///////////////////////////////////barra facebook $('body,#blueBarDOMInspector>div, #blueBarDOMInspector div[role="banner"], #fb2k_pagelet_bluebar>#blueBarDOMInspector>div>div, div[aria-label="Facebook"][role="navigation"]').css("background",GM_getValue("lista")); ////////////////////////////////////////// var body = Math.floor(Math.random() * colors.length); var selectedcolor = colors[index]; $('body,#blueBarDOMInspector>div, #blueBarDOMInspector div[role="banner"], #fb2k_pagelet_bluebar>#blueBarDOMInspector>div>div, div[aria-label="Facebook"][role="navigation"]').css("background",selectedcolor); Button.innerHTML = " cambio colore <br/> " + selectedcolor; //button dello stesso colore pagina Button.style.backgroundColor = selectedcolor; //colore testo button 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 $('body,#blueBarDOMInspector>div, #blueBarDOMInspector div[role="banner"], #fb2k_pagelet_bluebar>#blueBarDOMInspector>div>div, div[aria-label="Facebook"][role="navigation"]').css("background",GM_getValue("lista")); }