new Facebook figuccio

new facebook color 2025

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name          new Facebook figuccio
// @namespace     https://greasyfork.org/users/237458
// @version       44.5
// @author        figuccio
// @description   new facebook color 2025
// @match         https://*.facebook.com/*
// @grant         GM_addStyle
// @grant         GM_setValue
// @grant         GM_getValue
// @grant         GM_registerMenuCommand
// @require       https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js
// @run-at        document-start
// @require       https://code.jquery.com/jquery-latest.js
// @require       https://code.jquery.com/ui/1.13.2/jquery-ui.js
// @icon          https://facebook.com/favicon.ico
// @require       https://greasyfork.org/scripts/12228/code/setMutationHandler.js
// @require       https://cdn.jsdelivr.net/npm/[email protected]/dist/html-to-image.min.js
// @noframes
// @license        MIT
// ==/UserScript==
(function() {
 'use strict';
    //////////////////////////////////////////////////////sponsorizzato non interferisce con salva link luglio 2025
let blockadcontact = true;
let blockadpost = true;
let blockadinpost = true;
let interval = 1000;//milliseconds
let adword = "";
const list = ["Patrocinado", "Patrocinada","Patrocinat","Paeroniet","Publicidad","Pravkar","Peye","Рэклама","Plaćeni oglas","Реклама","Sponsored","Sponsorizzata","Sponsorjat","Sponsorizzato","Sponsitud","Sponsorizat","Sponsorisé","Spunsurizatu","Sponsorizuar", "Sponset","Sponsorowane","Szponzorált","Sponsorlu","Sponzorirano","Sponsoreret","Sponsorkirî","Stuðlað","Szpōnzorowane","Disponsori","Yoɓanaama","Babestua","Reklamo","Reklama","Remiama","Anzeige","Geborg","Gesponsord","Misy Mpiantoka","Apmaksāta reklāma","Akiliijjujjaujuq","Gesponsert","Kuxhasiwe","Oñepatrosinapyre","Imedhaminiwa","Daukar Nauyi","La maalgeliyey","광고","広告","赞助","贊助","スポンサー付き","赞助内容","Zvabhadharirwa","ⵉⴷⵍ","후원","የተከፈለበት ማስታወቂያ","បានឧបត្ថម្ភ","مُموَّل","ໄດ້ຮັບການສະໜັບສະໜູນ","დაფინანსებული","အခပေးကြော်ငြာ","પ્રાયોજિત","برعاية", "ממומן","प्रायोजित","Հովանավորվում է","ߘߡߍ߬ߟߋ߲","Спонсор","Спонсорирано","Жарнама","Được tài trợ","Χορηγούμενη","Aningaasaliiffigineqartoq"];
const urls = ["https://www.facebook.com/","http://www.facebook.com/","https://www.facebook.com","http://www.facebook.com/"];

if (urls.includes(document.location.href)) {
  getElementByInnerText(list);
}

function getElementByInnerText(list) {
  try {
    // ADS Contacts
    if (blockadcontact==true) {
      const allElements = document.getElementsByTagName('h3');//'span.x1lliihq.x6ikm8r.x10wlt62.x1n2onr6.x1j85h84
      for (const element of allElements) {
        if (list.includes(element.innerText)) {
          adword = element.innerText;
          element.innerText = ' ';
          element.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style="height: 0px; opacity: 0; visibility: hidden;";
          element.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display="none";
          break;
        }
      }
    }
  } catch (error) {
    console.error(error);
  }
  try {
    //ADS Posts
    if (blockadinpost==true) {
      let allElementsX;

      if (adword=="Sponsored") {
        return
      } else {
        allElementsX = document.querySelectorAll('div > span > div > span > span > a.x1i10hfl.xjbqb8w.x1ejq31n.xd10rxx.x1sy0etr.x17r0tee.x972fbf.xcfux6l.x1qhh985.xm0m39n.x9f619.x1ypdohk.xt0psk2.xe8uvvx.xdj266r.x11i5rnm.xat24cr.x1mh8g0r.xexx8yu.x4uap5.x18d9i69.xkhd6sd.x16tdsg8.x1hl2dhg.xggy1nq.x1a2a7pz.xkrqix3.x1sur9pj.xi81zsa.x1s688f');
        for (const elementX of allElementsX) {
          if (elementX.href.search("/?__cft__") != -1) {//if (elementX.href.search("/ads/about/") != -1) NEED MOUSE OVER TRIGGED TO SHOW/FOUND /ads/about/
            elementX.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style="height: 0px; opacity: 0; visibility: hidden;";
            elementX.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display="none";
          }
        }
      }
    }
  } catch (error) {
    console.error(error);
  }
  try {
    //ADS inside normal Posts
    if (blockadinpost==true) {
      const allElementsZ = document.querySelectorAll('div > a.x1i10hfl.xjbqb8w.x1ejq31n.xd10rxx.x1sy0etr.x17r0tee.x972fbf.xcfux6l.x1qhh985.xm0m39n.x9f619.x1ypdohk.xe8uvvx.xdj266r.x11i5rnm.xat24cr.x1mh8g0r.xexx8yu.x4uap5.x18d9i69.xkhd6sd.x16tdsg8.x1hl2dhg.xggy1nq.x1o1ewxj.x3x9cwd.x1e5q0jg.x13rtm0m.x1n2onr6.x87ps6o.x1lku1pv.x1a2a7pz.x1lliihq');
      for (const elementZ of allElementsZ) {
        elementZ.style = "height: 0px; opacity: 0; visibility: hidden;";
        elementZ.style.display = "none";
      }
    }
  } catch (error) {
    console.error(error);
  }
}

function exec() {
  try {
    if (urls.includes(document.location.href)) {
      getElementByInnerText(list);
    }
  } catch (error) {
    console.error(error);
  }
}

var intervalID = setInterval(exec,interval);
    /////////////////////////////////////
 // Disabilita bordi blu e ombre sul focus Screenshot sui post
  const style = document.createElement('style');
  style.textContent = `
    *:focus, *:focus-visible, *:focus-within {
      outline: none !important;
      box-shadow: none !important;
    }
  `;
  document.head.appendChild(style);

  let lastRun = 0;
  const debounceDelay = 800; // Ridotto per una migliore reattività

  function getFbidFromPost(post) {
    try {
      const dataFt = post.getAttribute('data-ft');
      if (dataFt) {
        const match = dataFt.match(/"top_level_post_id":"(\d+)"/);
        if (match) return match[1];
      }
      return new URL(window.location.href).searchParams.get('fbid') || 'unknownFBID';
    } catch (e) {
      return 'unknownFBID';
    }
  }

  const observer = new MutationObserver(() => {
    const now = Date.now();
    if (now - lastRun < debounceDelay) return;
    lastRun = now;

    document.querySelectorAll('div.x1lliihq').forEach(post => {
      if (post.dataset.sbtn === '1') return;

      const btnGroup = post.querySelector('div[role="group"], div.xqcrz7y, div.x1qx5ct2');
      if (!btnGroup) return;

      post.dataset.sbtn = '1';
      btnGroup.style.position = 'relative';

      const btn = document.createElement('div');
      btn.textContent = '📸';
      btn.title = 'Screenshot del post';
      Object.assign(btn.style, {
        position: 'absolute',
        left: '-40px',
        top: '0',
        width: '32px',
        height: '32px',
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        borderRadius: '50%',
        backgroundColor: '#3A3B3C',
        color: 'white',
        cursor: 'pointer',
        zIndex: '9999',
        transition: 'background .2s',
      });

      btn.addEventListener('mouseenter',function() {btn.style.backgroundColor = 'gold'});
      btn.addEventListener('mouseleave',function() {btn.style.backgroundColor ='#3A3B3C'});

      btn.addEventListener('click', async e => {
        e.stopPropagation();

        btn.textContent = '⏳';
        btn.style.pointerEvents = 'none';

        try {
          post.scrollIntoView({ behavior: 'smooth', block: 'center' });
          await new Promise(r => setTimeout(r, 500));

          const fbid = getFbidFromPost(post);
          const datetimeStr = new Date().toISOString().replace(/[^0-9]/g, '').slice(0, 14);
          const filename = `${fbid}_${datetimeStr}.png`;

          const dataUrl = await window.htmlToImage.toPng(post, {
            backgroundColor: '#1c1c1d',
            pixelRatio: 2,
            cacheBust: true,
          });

          const link = document.createElement('a');
          link.href = dataUrl;
          link.download = filename;
          link.click();

          btn.textContent = '✅';
        } catch (err) {
          console.error('Errore nello screenshot:', err);
          alert('Acquisizione dello schermo fallita, riprova più tardi.');
          btn.textContent = '❌';
        }

        setTimeout(() => {
          btn.textContent = '📸';
          btn.style.pointerEvents = 'auto';
        }, 1000);
      });

      btnGroup.appendChild(btn);
    });
  });

  observer.observe(document.body, { childList: true, subtree: true });

/////////////////////////////////////////
// Interrompe la riproduzione degli annunci pubblicitari durante un video.
window.addEventListener('playing', function(event) {
   event.stopImmediatePropagation();
   event.target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[0].setAttribute('hidden', 'hidden');
}, true);

//Interrompe la riproduzione degli annunci pubblicitari alla fine di un video.
window.addEventListener('ended', function(event) {
   event.stopImmediatePropagation();
   event.target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[0].removeAttribute('hidden');
}, true);
    /////////////////////////////
    //Facebook Reel: Video Controls
document.addEventListener('play', (evt) => {
  const target = (evt || 0).target;

  if (target instanceof HTMLVideoElement && !target.hasAttribute('controls') && location.href.includes('reel')) {
    let buttonLayer = target.closest('div[class][role="button"][tabindex]');

    if (buttonLayer) {
      target.setAttribute('controls', '');

      setTimeout(() => {
        Object.assign(target.style, {
          'position': 'relative',
          'zIndex': 999,
          'pointerEvents': 'all'
        });

        [...buttonLayer.querySelectorAll('.x10l6tqk.x13vifvy:not(.x1m3v4wt)')].forEach(s => {
          Object.assign(s.style, {
            'pointerEvents': 'none',
            'position': 'relative',
            'zIndex': 1000
          });
        });
      }, 1);
    }
  }
}, true);

    //Funzione per rilevare la pagina di login accetta cookie
    function isLoginPage() {
    return document.querySelector('form[action*="/login"]') !== null;
    }
    // Verifica se sei sulla pagina di login al caricamento della pagina
    if (isLoginPage()) {
        document.cookie = "datr=LVSeZ6822RyG0BNdfQNdbC3d;domain=.facebook.com;max-age=315360000";
//accetta tutti cookie facebook
GM_addStyle('div[data-cookiebanner=\"banner\"],.hasCookieBanner #root ~ .accelerate,body[tabindex] > div > #viewport > div:first-child:not(#MChromeHeader),div[data-testid=\"cookie-policy-dialog\"],div[data-testid=\"cookie-policy-manage-dialog\"]{display:none !important}.uiLayer[data-testid=\"cookie-policy-banner\"]{display:none !important}.hasCookieBanner > div{position:static !important}');
 if(!localStorage.reload) {
       //correzione errore triangolo giallo
        setTimeout(function(){document.location.reload();}, 2000);
        localStorage.reload = 1;
    }
    }
 /////////////////////////////////
        //mostra altro...
var l_foundButton = false;
function clickButton() {
    if (window.location.hostname !== 'www.facebook.com') return;//controlla se 6 sulla home
    //Cerca il pulsante
    const buttons = document.querySelectorAll('.x1iyjqo2');
    buttons.forEach((button) => {
        if (button.innerText == "Altro...") {
            button.click();
            l_foundButton = true;
        }
    });
// Aggiunto controllo e log per debug
    if (l_foundButton) {
        l_foundButton = false; // Reset per il prossimo ciclo
    }
}
// Chiama clickButton ogni 1000 millisecondi (1 secondo) finché il pulsante non viene trovato
var intervalId = setInterval(() => {
    if (!l_foundButton) {
        clickButton();
    } else {
        clearInterval(intervalId); //Interrompere l'intervallo una volta cliccato il pulsante
    }
}, 1000);
// Esegui clickButton() all'avvio per gestire i bottoni già presenti
clickButton();
///////////////////////////////////////////////
        //form login
GM_addStyle('._6luv {background-color:#476014!important;border:2px solid blue!important;}');
 //nasconde pop up notifica a sinistra quando si gioca
GM_addStyle('ul[data-gt*=\"\\\"ref\\\":\\\"beeper\\\"\"] {display:none!important;}');
 //nasconde pop up notifica a sinistra sulla home
GM_addStyle('div[role="complementary"][aria-labelledby] {display:none!important;}');
 // ti piace questo gioco popup
GM_addStyle('._3mqg {display:none!important}');
////////////////////////////////////////modificato 6 giugno 2025/////////////////////////////////////////////////
GM_addStyle(`
/* Stile ha cosa stai pensando */
.xz9dl7a.xf7dkkf.xv54qhq.x1a8lsjc.x1a02dak.x78zum5.x6s0dn4{
border:2px solid red!important;
border-radius:14px;
}

/* bordo verde sui feed */
.x6o7n8i.x1unhpq9.x1hc1fzr > div {
border:2px solid lime!important;
border-radius:14px;
}

/*sidebar sinistra*/
div[role="banner"]+div div [role="navigation"]{border-radius:14px;border:2px solid gold!important;}

/* Stili contatti */
div[role="complementary"]{border-radius:14px;border:2px solid red!important;}

/*stelline al passaggio mouse*/
div[role="navigation"]:hover,
div[role="complementary"]:hover {
background-image: url(https://media2.giphy.com/media/asG02gUfDyIxdODF76/giphy.gif);
background-blend-mode:overlay;
}

/* Nascondi watch marketplace groups gaming*/
div[role="navigation"][aria-label="Facebook"] > ul > li:nth-child(n+2):nth-child(-n+5) {
display:none!important;
}

/* cerchi notifiche messaggi ecc */
.x1qhmfi1 {
border-radius:22px!important;
border:2px solid #c471ed!important;
}
`);

var $ = window.jQuery;//$ evita triangolo giallo
$(document).ready(function() {
    ////////////////////////////////////////////////////////////
//feed piu grandi compreso ha cosa stai pensando giugno 2025
// 🔄 Inizializzazione variabili
let mutationObserver = null;
let timer = null;
let expandedCount = 0;

//Espande gli elementi target aumentando la loro larghezza al 100%.
const expandElements = () => {
    const targetElements = document.querySelectorAll(".x193iq5w.xvue9z.xq1tmr.x1ceravr");
    targetElements.forEach(el => {
        el.style.width = '100%';
        expandedCount++;
    });
};

//Avvia l'osservazione delle mutazioni DOM sulla sezione dinamica.
const observeDOMChanges = () => {
    const container = document.querySelector(".xxzkxad");
    if (!container) return;

    mutationObserver = new MutationObserver(() => {
        expandElements();
    });

    mutationObserver.observe(container, {
        childList: true,
        subtree: true
    });
};

// ▶️ Esegue l'espansione iniziale
expandElements();

//Dopo 3 secondi, attiva l'osservatore DOM
timer = setTimeout(observeDOMChanges, 3000);
 });
////////////////////color picker///////////
const $f = window.jQuery.noConflict();//$f evita triangolo giallo
//avvia la funzione dopo che la pagina e stata caricata
$f(document).ready(function() {
     // Aggiungi la funzione per il trascinamento limitato allo schermo
function makeDraggableLimited(element) {
    element.draggable({
        containment: "window",
        stop: function(event, ui) {
            // Memorizza la posizione dopo il trascinamento
            GM_setValue('boxPosition', JSON.stringify(ui.position));//importante
        }
    });
}
////////////////////////////
const body=document.body;
const style="position:fixed;top:-3px;left:720px;z-index:99999;"
const box=document.createElement("div");

box.id="myMenu";
box.style=style;
body.append(box);
 // Ripristina la posizione salvata se presente
const savedPosition = GM_getValue('boxPosition');
if (savedPosition) {
    const parsedPosition = JSON.parse(savedPosition);
    $(box).css({ top: parsedPosition.top, left: parsedPosition.left });
}
     // Rendi l'elemento trascinabile con limitazioni di schermo
    makeDraggableLimited($(box));
////////////////////////////audio effetto sonoro quando si clicca sulla x rossa
var Sound = new Audio("data:audio/mp3;base64,SUQzAwAAAAABTVRYWFgAAAARAAAAbWFqb3JfYnJhbmQAZGFzaFRYWFgAAAAXAAAAU29mdHdhcmUATGF2ZjU1LjMzLjEwMFRYWFgAAAAbAAAAY29tcGF0aWJsZV9icmFuZHMAaXNvNm1wNDFUWFhYAAAAEAAAAG1pbm9yX3ZlcnNpb24AMFRJVDIAAAAOAAAAU0tVTEwgVFJVTVBFVENPTU0AAAAwAAAAAAAAAGh0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9ZVZyWWJLQnJJN2//+5AEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAAAwAABU4ABUVFRUVFRUVKioqKioqKipAQEBAQEBAQFVVVVVVVVVVVWpqampqampqgICAgICAgICVlZWVlZWVlZWqqqqqqqqqqsDAwMDAwMDA1dXV1dXV1dXV6urq6urq6ur//////////wAAADlMQU1FMy45OXIBqgAAAAAAAAAAFIAkBnhGAACAAAAVOJoFAPEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==");

//mostra/nascondi dal menu
function prova() {
var box = document.getElementById("myMenu"); // Assicurati che ci sia un elemento con id="box"
    //Animazione per mostrare/nascondere + fermare setinterval orologio box nascosto e riavviarlo se visibile
if (box.style.display !== 'none') {
        box.style.display = 'none';
        clearInterval(intervalId); // Interrompere l'intervallo se la casella è nascosta
    } else {
        box.style.display = 'block';
        intervalId = setInterval(myTimer, intervalTime); // Riavvia l'intervallo se la casella è visibile
    }
}
GM_registerMenuCommand("nascondi/mostra box",prova);
///////////////////////////////////////////////////////////////
 function logout() {
 box.addEventListener("click", function(e) {e.preventDefault(); document.querySelector('form[action^="/logout.php?"').submit(); e.target.innerHTML='<img src="//www.facebook.com/images/loaders/indicator_blue_small.gif"/>'},false);
}
/////////////////////////////////////////////////////////////////
    const userdata = {color:'figuccio'}
    var mycolor = GM_getValue(userdata.color, "#980000"); // Valore predefinito   (marzo 2025)

  // salvare i dati personalizzati  ._95k9, schermata login
    function saveSetting(color) {GM_setValue(userdata.color,mycolor);
    $f('._95k9,div[role="banner"]+div div[role="navigation"], div[role="complementary"], div[aria-label="Facebook"][role="navigation"]').css("background-color",mycolor);
          }
 // Funzione per controllare se sei sulla homepage di Facebook
    function isHomePage() {
    return window.location.hostname === "www.facebook.com";
}
        // Aggiungi un MutationObserver per monitorare i cambiamenti nel DOM (aprile 2025)
      const observer = new MutationObserver((mutations) => {
      mutations.forEach((mutation) => {
        if (mutation.addedNodes.length > 0) {
            if (isHomePage()) {
            saveSetting(mycolor);// Applica il colore ogni volta che cambia il DOM
            saveCheckbox(); // Gestire checkbox
        }
      }

    });
});
    // Configura e osserva il body del documento
observer.observe(document.body, { childList: true, subtree: true, attributes: false });//aggiunto , attributes: false
///////////////////////////////////////////////////////////////////////////////////
    //Suggeriti per te
   GM_addStyle('[aria-label="Suggeriti per te"] {display:none!important;}');
   // Funzione per nascondere la sezione di creazione delle storie
   GM_addStyle('[aria-label="Storie"] {display:none!important;}');
// Funzione per gestire lo stato della checkbox e la sfocatura della chat
function saveCheckbox() {
    const checkbox = $("#checkbox1");
    const chat = $(".xwib8y2 ul");
    const isChecked = GM_getValue("checkboxState") === "true";

    checkbox.prop("checked", isChecked).val(isChecked ? "Show Chat 😃" : "Hide Chat 😩");
    chat.css("filter", isChecked ? "blur(7px)" : "");

    checkbox.change(() => {
    const newState = checkbox.prop("checked");
    GM_setValue("checkboxState", newState.toString());
    chat.css("filter", newState ? "blur(7px)" : "");
    checkbox.val(newState ? "Show Chat 😃" : "Hide Chat 😩");
    });
}
$f(document).ready(saveCheckbox);
document.onreadystatechange = function () {
    if (document.readyState === "complete") {
        saveCheckbox();
    }
};
      //Imposta lo stile css degli elementi checkbox (26 marzo 2025)
     GM_addStyle(`
  input[type=checkbox] {
    accent-color:red;
    outline:1px solid lime!important;
    cursor:pointer;
    width:15px;
    height:15px;
  }

  input[type=checkbox]::after {
    content: attr(value);
    margin:-2px 18px;
    vertical-align:top;
    white-space:nowrap;
    color:lime;
    background:brown;
  }

  input[type=checkbox]:checked {
    outline:1px solid yellow!important;
  }

  input[type=checkbox]:checked::after {
    color:red;
    background:aquamarine;
  }
`);
///////////////////////clock con mostra nascondi millisec cambio lingua it-en per la data
let use12HourFormat = GM_getValue('use12HourFormat', true); // Default è il formato 24 ore true
let showMilliseconds = GM_getValue('showMilliseconds', true);
let showDate = GM_getValue('showDate', true); // Aggiungi un valore predefinito se nulla è stato salvato
let intervalTime = showMilliseconds ? 90 : 1000; // Imposta l'intervallo iniziale in base allo stato
let language = GM_getValue('language') || 'it'; // Recupera la lingua dal localStorage o usa 'it' come predefinita

const languages = {
    en: { weekday: 'short', month: 'short', day: '2-digit', year: 'numeric' },
    it: { weekday: 'short', month: '2-digit', day: '2-digit', year: 'numeric' }
};

function initialize() {
    if (GM_getValue('showDate') === undefined) {
        GM_setValue('showDate', true); // Imposta il valore predefinito solo se non esiste
    }
    showDate = GM_getValue('showDate'); // Recupera il valore salvato
}

function myTimer() {
    const now = new Date();
    let hours = now.getHours();
    const minutes = String(now.getMinutes()).padStart(2, "0");
    const seconds = String(now.getSeconds()).padStart(2, "0");
    const milliseconds = String(now.getMilliseconds()).padStart(3, "0");
    const date = now.toLocaleString(language, languages[language]); // Usa la lingua selezionata per la data

    let period = "";

    if (!use12HourFormat) {
        period = hours >= 12 ? " PM" : " AM";
        hours = hours % 12 || 12; // Converte in formato 12 ore
    }

    hours = String(hours).padStart(2, "0");

    // Visualizzazione condizionale di data e millisecondi
    const displayDate = showDate ? date : "";
    const displayMilliseconds = showMilliseconds ? `:${milliseconds}` : "";
    document.getElementById("demo").textContent = `${displayDate} ${hours}:${minutes}:${seconds}${displayMilliseconds}${period}`;
}

function toggleMilliseconds() {
    showMilliseconds = !showMilliseconds;
    GM_setValue('showMilliseconds', showMilliseconds); // Salva lo stato di visualizzazione nel localStorage
    intervalTime = showMilliseconds ? 90 : 1000; // Aggiorna l'intervallo
    clearInterval(intervalId); // Cancella il setInterval corrente
    intervalId = setInterval(myTimer, intervalTime); // Avvia un nuovo setInterval
}

function toggleDate() {
    showDate = !showDate;
    GM_setValue('showDate', showDate); // Salva lo stato di visualizzazione della data
    myTimer(); // Aggiorna la visualizzazione immediatamente
}
function toggleFormat() {
    //Cambia il formato orario
    use12HourFormat = !use12HourFormat;
    GM_setValue('use12HourFormat', use12HourFormat); // Salva lo stato del formato
    //Cambia la lingua
    language = (language === 'it') ? 'en' : 'it';
    GM_setValue('language', language);// Salva la lingua scelta nel localStorage
}
// Crea il menu e inizializza il setInterval
initialize(); // Inizializza le impostazioni
let intervalId = setInterval(myTimer, intervalTime);
//elemento html . width:330px evita che spostandolo hai lati cambi di dimensioni
 box.innerHTML=`
<fieldset style="background:#3b3b3b;border:2px solid red;color:lime;border-radius:7px;text-align:left;height:39px;width:330px;">
<div id="demo" title="Data-ora" style="border:1px solid yellow;border-radius:5px;cursor:pointer;text-align:center;margin-top:-10px;margin-left:110px;font-size:14px;width:max-content;">
</div>
                       <legend>Time</legend>
<div id=setuiface style="width:auto;height:25px;margin-top:-9px;margin-left:40px;margin-right:-4px;margin-bottom:0px;border-width:1px;color:lime;">
<button id="colorspan" title="Hex value" style="margin-left:0px;margin-bottom:-19px;color:lime;background-color:brown;border:1px solid yellow;border-radius:5px;cursor:pointer;">${mycolor}</button>
<input type="color" title="Color picker" list="colors" id="colorinput" style="margin-left:1px;margin-top:12px;background-color:#3b3b3b;color:red;border:1px solid yellow;border-radius:5px;height:20px;width:30px;cursor:pointer;"value="${mycolor}">
<span class="button" title="Esci" id='logout' style="background-color:red;border:1px solid yellow;border-radius:3px;cursor:pointer;padding:0px 3px;font-size:14px;">Logout</span>
<span class="button" title="Chiudi" id='close' style="background-color:red;color:lime;border:1px solid yellow;border-radius:50%;cursor:pointer;font-size:14px;padding:3px 6px;display:inline-block;line-height:16px;margin-top:6px;">X</span>
<input type="checkbox" id="checkbox1"  title="Sfoca" value="Hide Chat 😩">
               <label title="Mostra/nascondi millisecond"   style="color:lime;cursor:pointer;position:absolute;top:12px;left:60px;display:inline-flex;">
               <input type="radio" name="options" title="Mostra/nascondi millisecond" value="toggleMilliseconds" style="cursor:pointer;">m/sec
                        </label>
               <label title="Cambia 12/24h"  style="color:lime;cursor:pointer;position:absolute;top:12px;left:5px;display:inline-flex;">
               <input type="radio" name="options" title="Cambia 12/24h" value="toggleFormat" style="cursor:pointer;">12/24h
               <label title="Nascondi/mostra data"  style="color:lime;cursor:pointer;position:absolute;top:20px;left:0px;display:inline-flex;">
               <input type="radio" name="options" title="Nascondi/mostra data" value="toggleDate" style="cursor:pointer;">data
                       </label>
               </fieldset>
    `;
//Ascoltatore di eventi per la selezione del pulsante di scelta
$('input[name="options"]').on('change', function() {
    const selectedValue = $(this).val();
    if (selectedValue === 'toggleMilliseconds') {
        toggleMilliseconds();
    } else if (selectedValue === 'toggleFormat') {
        toggleFormat();
    } else if (selectedValue === 'toggleDate') { // Nuova funzione per la data
        toggleDate();
    }
    //Disattivare temporaneamente i pulsanti di scelta
    $('input[name="options"]').prop('disabled', true);
    //Riattivare i pulsanti di scelta dopo un breve ritardo
    setTimeout(() => {
        $('input[name="options"]').prop('disabled', false).prop('checked', false);
    }, 300); // Milliseconds
});
        //Una serie di elementi get
        var colorspan=document.querySelector('#colorspan');
        var colorinput=document.querySelector('#colorinput');
        var MenuClose=document.querySelector('#close');
        var Menulogout=document.querySelector('#logout');//funzione logout
                      //chiude dalla x rossa
        MenuClose.addEventListener('click',prova,false);
                      //richiama effetto sonoro chiudendo con la x rossa
        MenuClose.onclick = function() {Sound.play();};
        Menulogout.addEventListener('click',logout,false);//funzione logout
    /////////////////////////////////////////////////////////////////////////
    //fa vedere la modifica colore
    colorinput.addEventListener('input', colorChange, false);
    function colorChange (e) {
    mycolor = e.target.value;
    colorspan.innerHTML=e.target.value;
    //colore immediatamente visibile
    GM_setValue(userdata.color, mycolor);
    saveSetting(mycolor);
        }
//////////////////no login recent (gennaio 2025)
 window.setTimeout(clearRecentLogins, 100);
function clearRecentLogins() {
 if (document.getElementById('email')) {
     document.getElementById('email').value = "";
     document.getElementById('email').focus();
        }
var recentLogins = document.querySelectorAll('.removableItem a[role="button"][ajaxify^="/login/device-based"]');
    if (recentLogins.length === 0) {
    return;
    }
    recentLogins.forEach(function(login) {
    login.click();
    });
}
})();
//////////
   })();