Greasy Fork is available in English.

Auto-Espande Google Search Tools

Mostra il menu Strumenti di ricerca nei risultati di ricerca di Google

Od 22.10.2023.. Pogledajte najnovija verzija.

// ==UserScript==
// @name           Auto-Espande Google Search Tools
// @description    Mostra il menu Strumenti di ricerca nei risultati di ricerca di Google
// @namespace      https://greasyfork.org/users/237458
// @author         figuccio
// @version        20.0
// @match          https://*.google.com/*
// @match          https://*.google.it/*
// @match          https://*.google.fr/*
// @match          https://*.google.es/*
// @exclude        https://translate.google.it/?hl=it
// @exclude        https://drive.google.com/*
// @require        https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @require        https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=19641
// @grant          GM_addStyle
// @grant          GM_setValue
// @grant          GM_getValue
// @run-at         document-start
// @icon           https://www.google.com/favicon.ico
// @noframes
// @license        MIT
// @grant          GM_registerMenuCommand
// @require        http://code.jquery.com/jquery-latest.js
// @require        https://code.jquery.com/ui/1.12.1/jquery-ui.js
// ==/UserScript==
//disable safesearch
(function() {
    'use strict';
    window.addEventListener("load",function(){
        disableSafesearch();
    });

   function disableSafesearch() {
        var safeui = document.querySelector("a[aria-label][href*='setprefs?sig']");
        if(safeui != null){
            if(safeui.href.match(/safeui=off$/) == null){
                window.location = safeui.href.replace(/safeui=(on|images)$/,"safeui=off");
                console.log("Google disable safesearch: done!");
            } else {
                console.log("Google disable safesearch: nothing to do!");
            }
        } else {
            safeui = document.querySelector("a[href*='setprefs?sig'][href$='safeui=off']");
            if(safeui != null) {
                window.location = safeui.href;
                console.log("Google disable safesearch: done!");
            } else {
                if(document.querySelector("a[href*='setprefs?sig'][href$='safeui=on']") != null){
                    console.log("Google disable safesearch: nothing to do!");
                } else {
                    console.log("Google disable safesearch: failed!");
                }
            }
        }
    }
})();
/////////////////////////////////////////////////////////////////////////
//popup accedi a google (invasivo)settembre 2023
GM_addStyle(".nD2EKb{display:none!important;}");
//Filtro alcuni  risultati potrebbero essere espliciti click automatico su ignora
setTimeout(function(){document.querySelector("#appbar > div.zNFAfd > div > div.zRHtD > div.O6QT3d > div > div").click();},1000);//8marzo 2023
              // Show the Search Tools menu
GM_addStyle("#hdtbMenus{display:block !important;position:absolute !important;top:8px !important;right:500px!important;}");//giugno 2023 riposizionato
GM_addStyle("#result-stats{display:none!important;}");/* Circa 261.000.000 risultati (0,61 secondi) nascosto */

//pulsante Strumenti di ricerca rosso
GM_addStyle("#hdtb-tls {color:red!important;background:green!important;border-radius:12px;border:2px solid red!important}");
GM_addStyle("#hdtb-tls:hover{color:gold!important;}");
                             //pulsante tutti i filtri
GM_addStyle(".fKmH1e {color:red!important;background:green!important;border-radius:12px;border:2px solid red!important;height:36px;}");//pulsante tutti i filtri
GM_addStyle(".fKmH1e:hover{color:gold!important;}");
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                             //safesearch
GM_addStyle(".F75bid {color:red!important;}");//link
GM_addStyle(".F75bid:hover {color:gold!important;}");//al passaggio mouse
GM_addStyle(".fFI3rb {background:green!important;border-radius:10px;border:2px solid red!important;}");//background
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
GM_addStyle('.IUOThf{background-color:#303134!important;width:723px;border-radius:12px;border:2px solid red!important}');
   //colore link immag notiz libri mappe
GM_addStyle('.GKS7s .FMKtTb, .GKS7s .RWhoyd.mol54e{color:red!important;}');
   //al passaggio mouse link
GM_addStyle('.GKS7s :hover {color:green!important;}');
GM_addStyle('.GKS7s{background:gold!important;border:2px solid blue!important;}');
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//colori testo strumenti colore verde Search Tools (qualsiasi paese-lingua -data-tutti i risultati)
GM_addStyle('.hdtb-mn-hd {color:green!important;background:gold!important;border-radius:9px;border:2px solid blue!important}');
//link espansione strumenti colore verde che diventa rosso al passaggio mouse
GM_addStyle('.hdtb-mn-hd:hover {color:red!important}');
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//topbar espansioni strumenti colorata Search Tools
GM_addStyle('.WE0UJf {background:#303134!important;width:700px;border-radius:12px;border:1px solid red!important}');//ok
//pulsante tutti
GM_addStyle('#hdtb-msb .hdtb-mitem.hdtb-msel{color:red!important;background:orange!important;border-radius:8px;border:2px solid green!important;padding:4px 4px;border-bottom:6px solid blue!important}');
//triangolini rossi
GM_addStyle('.gTl8xb {border-color:red transparent!important}');
//menu colorato
GM_addStyle('.cF4V5c {color:lime!important;background:red !important;}');
GM_addStyle('.cF4V5c {border:2px solid blue!important}');//bordo blu

//no publicita correlate
GM_addStyle('#rcnt .col:nth-of-type(3) {display:none !important;}');

   //le persone anno chiesto anche
GM_addStyle('.OJXvsb.Wnoohf.cUnQKe.kp-blk {display:none !important;}');

//Promemoria sulla privacy di Google
GM_addStyle('#cnsh,#cnso,#cnsi{display:none!important}');
//////////////////////////////////////////////////aggiunto youtube
process();
new MutationObserver(process).observe(document.body || document.documentElement, { childList: true, subtree: true });

function process(mutations) {
  let q,
    queryElement = document.querySelector('input[name="q"]');// selector for the Google search input textbox

  if (queryElement?.value) q = encodeURIComponent(queryElement.value);
  else if (q = location.href.match(/^.+?(?:[#/&?](?:q|query))=(.+?)(?:|&.+|\|.+)$/)) q = q[1];

  let link = document.querySelector(`a[href*='tbm=vid']`);

  if (q && link?.href) {
    link.href = 'https://www.youtube.com/results?search_query=' + q;
    link.textContent = 'YouTube';
    console.log('create', link.textContent);
  }
}
///ricerche correlate
GM_addStyle('#brs {display:none !important;}');
GM_addStyle('.commercial-unit-desktop-top {display:none !important;}');
///////////////cookie consent//////////////giugno 2023
(function(){
"use strict";
if (document.readyState != 'loading') consent();
else document.addEventListener('DOMContentLoaded', consent);

function consent() {
  var e=document.querySelector('#introAgreeButton');
  if (!e) e=document.querySelector('#L2AGLb > div, form[action="https://consent.google.com/s"] button');
  e && e.click();
  }

})();
/////////////////////////////ricarica tema anche su google.com  storage
if (GM_getValue('color-theme')) {
        if (GM_getValue('color-theme') === 'light') {
            document.documentElement.classList.add('dark');
            GM_setValue('color-theme', 'dark');
        } else {
            document.documentElement.classList.remove('dark');
            GM_setValue('color-theme', 'light');
        }
    // se NON impostato in precedenza tramite archiviazione locale
    } else {
        if (document.documentElement.classList.contains('dark')) {
            document.documentElement.classList.remove('dark');
            GM_setValue('color-theme', 'light');
        } else {
            document.documentElement.classList.add('dark');
           GM_setValue('color-theme', 'dark');
        }
    }

////////////////////////////////
//di nuovo publicita e correlati a destra
GM_addStyle('#rhs {display:none !important;}');
GM_addStyle('.YTDezd {display:none !important;}');
/////////////////////////////////////////////////
(function() {
  'use strict';
  if (GM_getValue('Open in new window?') === undefined)
 { //Avvia la condizione if

    GM_setValue('Open in new window?', 1); //Imposta lo script per aprire i siti Web in una nuova scheda 1 apre 0 no
  } //Termina la condizione if

  if (location.pathname === '/search' && location.href.match('&newwindow=' + GM_getValue('Open in new window?')) === null) //If the current search doesn't have the user choices applied
  { //Avvia la condizione if
    location.href = location.href += '&newwindow=' + GM_getValue('Open in new window?'); //Reindirizza per aggiungere le scelte dell'utente
  } //Termina la condizione if
})();
///////////////////////time-list///////////
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:-13px;margin-left:850px;z-index:99999;"
var box=document.createElement("div");

box.id="googleok";
box.style=style;
j(box).draggable();
body.append(box);

 //mostra/nascondi box
function provag() {
var box = document.getElementById('googleok');
box.style.display = ((box.style.display!='none') ? 'none' : 'block');
}
GM_registerMenuCommand("nascondi/mostra time",provag);

///////////////////////////////////////////////////////////////
   //Imposta lo stile CSS degli elementi nel menu
  GM_addStyle(`
  #setui{width:500px;height:29px; margin-top:-12px;margin-left:-52px; margin-right:-50px;margin-bottom:0px;border-width:1px;}
  #dynamic_select{background:#3b3b3b;color:lime;border:1px solid yellow; border-radius:5px;cursor:pointer;}
  input[type="datetime-local"] {background:#3b3b3b;color:lime;border:1px solid yellow; border-radius:5px;margin:9px;margin-left:0px;text-align:center;cursor:pointer;}
  #ricarica{background:#3b3b3b;color:lime;border:1px solid yellow; border-radius:5px;cursor:pointer;}
  .button {padding: 3px 6px; line-height:16px;margin-top:-19px;display:inline-block;border:1px solid yellow;border-radius:3px;cursor:pointer;background:chocolate;}

            `);

setInterval(function(){
let today = new Date();
today.setMinutes(today.getMinutes() - today.getTimezoneOffset());
document.getElementById('datePickerx').value = today.toISOString().slice(0, -1);
}, 70);
    //stile list colorata
$(function(){
$("select").change(function(){
    var $selectedOption = $(this).find("option:selected");
    $(this).removeAttr("style").attr("style", $selectedOption.attr("style"));
});

});

/////////////////////menu ha tendina(change url)
    $(function() {
      $('#dynamic_select').on('change',function() {
        window.location.href = $(this).val();
          //apre in nuova scheda
         //window.open(this.value)
      });
});
////////////////////reflesh pagina
    $(document).ready(function(){
        $("#ricarica").click(function(){
            location.reload(true);
        });
    });
    ////////////////
 //elemento html nel div readonly datatime non fa comparire licona del calendario width:310px evita che spostandolo hai lati cambi di dimensioni
    box.innerHTML=`
                      </p>
                   <fieldset style="background:#3b3b3b; border: 2px solid red;color:lime;border-radius:7px;text-align:center;width:310px;">
                   <legend>DATA-TIME</legend>
   <div id=setui>
                           <button id="ricarica" title="Reflesh"<button type="button">Reflesh</button>

    <select id="dynamic_select" title="Selezione siti">
    <option value="#">Scegli ...</option>
    <option style="background-color:Green"title="Vai su facebook" value="https://www.facebook.com/?sk=h_chr">Facebook</option>
    <option style="background-color:Brown"title="Vai su youtube"  value="https://www.youtube.com/">Youtube</option>
    <option style="background-color:Red"title="Vedi altri script" value="https://greasyfork.org/it/users/237458-figuccio">Autore</option>
    </select>

<input readonly id="datePickerx" type="datetime-local" title="Data-ora" />
 <span class="button" title="Chiudi" id='close'>x</span>
                                                    </p>
                    </div>
                    </fieldset>
            `;
 //////////////////////////////
            //aggiunta span close per chiudere il box direttamente
            var Close=document.querySelector('#close');
            Close.addEventListener('click',provag,false);
})();
////////////////////////////////