checkbox sfoca chat figuccio

casella di controllo anti spioni

// ==UserScript==
// @name          checkbox sfoca chat figuccio
// @namespace     https://greasyfork.org/users/237458
// @version       1.1
// @description   casella di controllo anti spioni
// @author        figuccio
// @match         https://*.facebook.com/*
// @require       https://code.jquery.com/jquery-1.11.0.min.js
// @require       http://code.jquery.com/jquery-latest.js
// @require       https://code.jquery.com/ui/1.12.1/jquery-ui.js
// @grant         GM_setValue
// @grant         GM_getValue
// @grant         GM_addStyle
// @grant         GM_registerMenuCommand
// @icon          https://facebook.com/favicon.ico
// @noframes
// @license        MIT
// ==/UserScript==
(function() {
    'use strict';

////////////////////////////////////////////////////
var $ = window.jQuery;
var j = $.noConflict();
//avvia la funzione dopo che la pagina e stata caricata
$(document).ready(function() {
var body=document.body;
var style="position:fixed; top:-14px;left:300px;z-index:99999;"
var box=document.createElement("div");

box.id = "sfoca";
box.style = style;
j(box).draggable({
containment: "window" // Limita il trascinamento allo schermo
    });
body.append(box);

 //mostra/nascondi dal menu
function nascondi() {
var box = document.getElementById('sfoca');
box.style.display = ((box.style.display!='none') ? 'none' : 'block');
}
GM_registerMenuCommand("nascondi/mostra box",nascondi);
    //////////////////////////////////////////
 function savecheckbox() {
 GM_setValue("checkboxState", document.getElementById("showHideButton").checked.toString());
 var contactList = document.querySelector(".xwib8y2 ul");
    if (document.getElementById("showHideButton").checked) {contactList.style.filter ="blur(7px)";document.getElementById("showHideButton").value = "Show Chat😃";}
       else {contactList.style.filter =""; document.getElementById("showHideButton").value = "Hide Chat😩";}
    }
    ////////////////////////////////////////
    $(document).ready(function() {
    document.getElementById("showHideButton").addEventListener('change', () => {
    GM_setValue("checkboxState", document.getElementById("showHideButton").checked.toString());

    var contactList = document.querySelector(".xwib8y2 ul");
    if (document.getElementById("showHideButton").checked) {contactList.style.filter ="blur(7px)";document.getElementById("showHideButton").value = "Show Chat😃";}
       else {contactList.style.filter =""; document.getElementById("showHideButton").value = "Hide Chat😩";}
})
});

    //recupero local storage sfoca chat
document.onreadystatechange = function () {
  if (document.readyState == "complete") {
    if (GM_getValue("checkboxState") === "true") {
      document.getElementById("showHideButton").checked = true;
         savecheckbox();
      setInterval(savecheckbox,2000);
       }
  }
}

setInterval(document.onreadystatechange, 1000);
    ////////////////////////////////
  GM_addStyle(`
      #showHideButton{cursor:pointer;margin-right:80px;}

      input[type=checkbox] {accent-color:red;}

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

     /* bordo casella */
     input[type="checkbox"] {
     outline: 3px solid lime;
}

     /*ingrandisce checkbox */
     input[type="checkbox"] {
     cursor:; /*sulla checkbox*/
     width:16px;
     height:16px;
}

   /*se cliccata*/
      input[type="checkbox"]:checked {
      outline: 3px solid yellow;
}

    /*se cliccata colore testo*/
      input[type=checkbox]:checked::after{
      content: attr(value);
      margin: -2px 19px;
      vertical-align:top;
      display: ;
      white-space:nowrap;
      color:red;
      background:aquamarine;
      cursor:; /*sulla scritta*/
}

    `);
//elemento html nel div
    box.innerHTML=`
                      </p>
                   <fieldset style="background:#3b3b3b; border: 2px solid red;color:lime;border-radius:7px;text-align:center;width:80px;">
                   <legend>Sfoca Chat </legend>

   <div id=setui>

 <input type="checkbox"  id="showHideButton"     title="Sfoca"   value="Sfoca😃"/><br>
  </p>
                    </div>
                    </fieldset>
            `;

})();

})();