checkbox sfoca chat 2 figuccio

casella di controllo anti spioni

  1. // ==UserScript==
  2. // @name checkbox sfoca chat 2 figuccio
  3. // @namespace https://greasyfork.org/users/237458
  4. // @version 0.3
  5. // @description casella di controllo anti spioni
  6. // @author figuccio
  7. // @match https://*.facebook.com/*
  8. // @require https://code.jquery.com/jquery-1.11.0.min.js
  9. // @require http://code.jquery.com/jquery-latest.js
  10. // @require https://code.jquery.com/ui/1.13.2/jquery-ui.js
  11. // @grant GM_setValue
  12. // @grant GM_getValue
  13. // @grant GM_addStyle
  14. // @grant GM_registerMenuCommand
  15. // @icon https://facebook.com/favicon.ico
  16. // @noframes
  17. // @license MIT
  18. // ==/UserScript==
  19. (function () {
  20. 'use strict';
  21. function FunctionCheckbox() {
  22. document.getElementById("showHideButton").click();
  23. }
  24. GM_registerMenuCommand("sfoca/on-off",FunctionCheckbox);
  25. ////////////////////////////////////////////////////
  26. var $ = window.jQuery.noConflict();
  27. //avvia la funzione dopo che la pagina e stata caricata
  28. $(document).ready(function() {
  29. var body=document.body;
  30. var style="position:fixed; top:0px;left:300px;z-index:99999;"
  31. var box=document.createElement("div");
  32.  
  33. box.id="sfoca";
  34. box.style=style;
  35. $(box).draggable({
  36. containment: "window" // Limita il trascinamento alla finestra visibile
  37. });
  38. body.append(box);
  39.  
  40. //mostra/nascondi dal menu
  41. function nascondi() {
  42. var box = document.getElementById('sfoca');
  43. box.style.display = ((box.style.display!='none') ? 'none' : 'block');
  44. }
  45. GM_registerMenuCommand("nascondi/mostra box",nascondi);
  46. //////////////////////////////////////////
  47. $(document).ready(function() {
  48. document.getElementById("showHideButton").addEventListener('change', () => {
  49. GM_setValue("checkboxState", document.getElementById("showHideButton").checked.toString());
  50.  
  51. var contactList = document.querySelector(".xwib8y2 ul");
  52. if (document.getElementById("showHideButton").checked) {contactList.style.filter ="blur(7px)";document.getElementById("showHideButton").value = "Show Chat";}
  53. else {contactList.style.filter =""; document.getElementById("showHideButton").value = "Hide Chat";}
  54. })
  55. });
  56.  
  57. //recupero local storage sfoca chat
  58. document.onreadystatechange = function () {
  59. if (document.readyState == "complete") {
  60. if (GM_getValue("checkboxState") === "true") {
  61. document.getElementById("showHideButton").checked = true;
  62. var contactList = document.querySelector(".xwib8y2 ul");
  63. if (document.getElementById("showHideButton").checked) { contactList.style.filter ="blur(7px)";document.getElementById("showHideButton").value = "Show Chat";}
  64. else { contactList.style.filter =""; document.getElementById("showHideButton").value = "Hide Chat";}
  65. }
  66. }
  67. }
  68.  
  69. setInterval(document.onreadystatechange, 1000);
  70. ////////////////////////////////
  71. GM_addStyle(`
  72. .custom-checkbox {
  73. display: inline-block;
  74. position: relative;
  75. padding-left: 25px; /* Adjust as needed */
  76. cursor: pointer;
  77. color:lime;
  78. top:0px;
  79. left:0px;
  80. }
  81.  
  82. .checkbox-input {
  83. position: absolute;
  84. opacity: 0;
  85. cursor: pointer;
  86. }
  87.  
  88. .checkbox-icon {
  89. outline: 3px solid blue;
  90. position: absolute;
  91. top: 0;
  92. left: 0;
  93. width: 18px;
  94. height: 18px;
  95. background-color:white;
  96. }
  97.  
  98. .checkbox-input:checked + .checkbox-icon {
  99. outline: 3px solid lime;
  100. background-color:red; /* Change to your desired color */
  101. }
  102.  
  103. .checkbox-icon:after {
  104. content: "";
  105. position: absolute;
  106. display: none;
  107. }
  108.  
  109. .checkbox-input:checked + .checkbox-icon:after {
  110. display: block;
  111. left: 6px;
  112. top: 2px;
  113. width: 5px;
  114. height: 10px;
  115. border:3px solid green;
  116. border-width: 0 2px 2px 0;
  117. transform: rotate(45deg);
  118. }
  119. `);
  120. //elemento html nel div
  121. box.innerHTML=`
  122. <fieldset style="background:#3b3b3b; border: 2px solid red;color:lime;border-radius:7px;text-align:center;width:80px;">
  123. <legend>Sfoca Chat 2</legend>
  124. <div id=setui>
  125. <label class="custom-checkbox"><input type="checkbox" class="checkbox-input" id="showHideButton"><span class="checkbox-icon"></span>Sfoca</label>
  126. </fieldset>
  127. `;
  128.  
  129. })();
  130.  
  131. })();