new picker barra Facebook figuccio

color picker allinterno barra facebook

目前為 2022-10-07 提交的版本,檢視 最新版本

// ==UserScript==
// @name          new picker barra Facebook figuccio
// @namespace     https://gf.qytechs.cn/users/237458
// @version       0.1
// @author        figuccio
// @description   color picker allinterno barra facebook
// @match         https://*.facebook.com/*
// @match         https://*.facebook.com/me/*
// @grant         GM_addStyle
// @grant         GM_setValue
// @grant         GM_getValue
// @grant         GM_registerMenuCommand
// @require       https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @run-at        document-start
// @icon          https://www.google.com/s2/favicons?domain=facebook.com
// @require       https://gf.qytechs.cn/scripts/12228/code/setMutationHandler.js
// @noframes
// @license        MIT
// ==/UserScript==
function topnavbarcolor(){
    console.log('topnavbarlogobutt');
  if(document.querySelectorAll('div[role="banner"] div[role="navigation"]').length!=2) {
    console.log("Didn't find insert point for colore facebook");
	return;
  }


(function() {
    'use strict';
jQuery(document).ready(function(){
 $('<input type="button"  id="hexcolor" title="Hex color"></input>').appendTo('body');
 $('#hexcolor').css({ 'position': 'fixed','top': 13,'right': 305, color:'darkred', 'border':'2px solid green', 'border-radius': '6px',});


         //Creazione del colorPicker
 $('<input type="color" list="colors" value="${mycolor}" id="colorinput"  title="color picker">').appendTo('body');
 $('#colorinput').css({ 'position': 'fixed','top': 10,'right': 210, 'border':'2px solid yellow', 'border-radius': '6px',});
//////////////////////////////////////////////////////////////////////////////////////////////////casella hex
 $('#colorinput').on('input', function() {$('#hexcolor').val(this.value);});

    //////////////////////////////////////////////////////////////////////////////////////////////
       //dati per la conservazione
        var userdata = { color: 'figuccio', }

        var mycolor;//dichiarare la variabile colore

        //imposta la variabile del colore
        if(/^#+\w+$/.test(GM_getValue(userdata.color))){ mycolor = GM_getValue(userdata.color); }

        else {mycolor="#000000"; }

 //evento della tavolozza dei colori
            function colorChange (e) {
            mycolor = e.target.value;
            }

                 var colorinput=document.querySelector('#colorinput');

                 colorinput.addEventListener('input', function(event){colorChange(event)},false);

                                                 var hex=GM_getValue("hexcolor");

$('body,#blueBarDOMInspector>div, #blueBarDOMInspector div[role="banner"], #fb2k_pagelet_bluebar>#blueBarDOMInspector>div>div, div[aria-label="Facebook"][role="navigation"]').css("background-color",mycolor );
                                  document.getElementById('hexcolor').value =mycolor;//value hex
                                document.getElementById('colorinput').value =mycolor;
                               colorinput.addEventListener('input', function(){
                                   var hex = document.getElementById('hexcolor').value;
                                   GM_setValue(userdata.color, mycolor);

                                   GM_setValue("hex", mycolor);
    console.log(this.value);

$('body,#blueBarDOMInspector>div, #blueBarDOMInspector div[role="banner"], #fb2k_pagelet_bluebar>#blueBarDOMInspector>div>div, div[aria-label="Facebook"][role="navigation"]').css("background-color",mycolor);
        });
})();
//////////////////////
})();

 document.querySelectorAll('div[role="banner"] div[role="navigation"]')[1].firstChild.parentNode.insertBefore(body,document.querySelectorAll('div[role="banner"] div[role="navigation"]')[1].firstChild);

}
window.setTimeout(topnavbarcolor,1000);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址