Greasy Fork is available in English.

new Facebook figuccio

new facebook con ora click sull ora e attiva facebook recenti

As of 14.09.2020. See ბოლო ვერსია.

// ==UserScript==
// @name          new Facebook figuccio
// @namespace     https://greasyfork.org/users/237458
// @version       0.4
// @author        figuccio
// @description   new facebook con ora click sull ora e attiva facebook recenti
// @include       https://*.facebook.com/*
// @grant         GM_addStyle
// @grant         GM_setValue
// @grant         GM_getValue
// @noframes
// ==/UserScript==
//false visibile true nascosta
let processOptions = true

let options = {
  hideWatch: true,//amici barra facebook 1
  hideGaming: true,//videogiochi barra facebook 2
  hideLeftSideBar: false, ////3
  hideRightSideBar: false,//4
  hideMarketplace: true,//5
  hideCovid: true,//6
  hideCreatePostTypes: true, ////7
  hideStories: true, ////8
  hideVideoChat: true, ////9
  hideSuggestedGroups: true, ////10
  hideSuggestedForYouPosts: false,//contatti chat 11
  hideCovidPosts: true,//12
  hideSponsored: true,//13
  hidePaidPartnerships: true,//14
  hideFooter: true,//15
  hideLoopInterval: 1000
}

let hideClass = 'displayNoneImportant'

let onDocReady = function(){
  //console.log('domain: ' + document.domain)
  if (processOptions) {
    switch (document.domain) {
      case "facebook.com":

        addCSSClasses()
        removeOnce()

        removeLoop()
        setInterval(removeLoop, options.hideLoopInterval)
        break;
    }
  }
}


function removeLoop() {
  if(options.hideCovid) { removeCovid() }
  if(options.hideSuggestedForYouPosts) { removeSuggestedForYouPosts() }
  if(options.hideCovidPosts) { removeCovidPosts() }
  if(options.hideSponsored) { removeSponsored() }
  if(options.hidePaidPartnerships) { removePaidPartnerships() }
}

function removeSponsored() {
  hideXPath("//div[@aria-label='Sponsored']/ancestor::div[starts-with(@data-pagelet,'FeedUnit')]")
  hideXPath("//a[@aria-label='Sponsored']/ancestor::div[starts-with(@data-pagelet,'FeedUnit')]")
  hideXPath("//div[text()='Sponsored']/ancestor::div[starts-with(@data-pagelet,'FeedUnit')]")
}

function removePaidPartnerships() {
  hideXPath("//span[text()='Suggested Groups']/ancestor::div[starts-with(@data-pagelet,'FeedUnit')]")
}

function removeSuggestedForYouPosts() {
  hideXPath("//span[text()='Suggested for You']/ancestor::div[starts-with(@data-pagelet,'FeedUnit')]")
}

function removeCovidPosts() {
  hideXPath("//span[text()='Coronavirus (COVID-19) Information']/ancestor::div[starts-with(@data-pagelet,'FeedUnit')]")
}

function removeSuggestedGroups() {
  hideXPath("//div[text()='Paid Partnership']/ancestor::div[starts-with(@data-pagelet,'FeedUnit')]")
}

function removeCovid() {
  hideXPath("//span[text()='COVID-19 Information Center']/ancestor::li")
}

function removeOnce() {
  let cssWatch = `
    div[role="navigation"][aria-label="Facebook"]>ul>li:nth-child(2) { /* watch */
      display: none !important;
    }
  `;
  let cssMarketplace = `
    div[role="navigation"][aria-label="Facebook"]>ul>li:nth-child(3) { /* gaming */
      display: none !important;
    }
  `;
  let cssGaming = `
    div[role="navigation"][aria-label="Facebook"]>ul>li:nth-child(5) { /* gaming */
      display: none !important;
    }
  `;
  let cssLeftSideBar = `
    div[data-pagelet="LeftRail"] {  /* left side bar */
      visibility: hidden !important;
    }
  `;
  let cssRightSideBar = `
    div[role="complementary"] { /* right side bar */
      visibility: hidden !important;
    }
  `;
  let cssFooter = `
    footer {
      visibility: hidden !important;
    }
  `;
  let cssCreatePostTypes = `
    div[aria-label="Create a post"]>div:nth-child(2) {
      display: none !important;
    }
  `;
  let cssStories = `
    div[aria-label="Stories"] {
      display: none !important;
    }
  `;
  let cssVideoChat = `
    div[data-pagelet="VideoChatHomeUnit"] {
      display: none !important;
    }
  `;

  if(options.hideWatch) { GM_addStyle(cssWatch); }
  if(options.hideMarketplace) { GM_addStyle(cssMarketplace); }
  if(options.hideGaming) { GM_addStyle(cssGaming); }
  if(options.hideLeftSideBar) { GM_addStyle(cssLeftSideBar); }
  if(options.hideRightSideBar) { GM_addStyle(cssRightSideBar); }
  if(options.hideFooter) { GM_addStyle(cssFooter); }
  if(options.hideCreatePostTypes) { GM_addStyle(cssCreatePostTypes); }
  if(options.hideStories) { GM_addStyle(cssStories); }
  if(options.hideVideoChat) { GM_addStyle(cssVideoChat); }
  if(options.hideSuggestedGroups) { removeSuggestedGroups() }

}

function addCSSClasses() {
  let css = `
    .displayNoneImportant {
      display: none !important;
    }
    .visibilityHiddenImportant {
      visibility: hidden !important;
    }
  `;

  GM_addStyle(css);
}

function hideXPath(xPathStr) {
  let matchingElement = document.evaluate(xPathStr, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null)
  if(matchingElement) {
    for(var i = 0; i < matchingElement.snapshotLength; i++) {
      let curElement = matchingElement.snapshotItem(i)
      if(!curElement.classList.contains(hideClass)) {
        curElement.className += ' ' + hideClass
      }
    }
  }
}

if (document.readyState === "complete" || (document.readyState !== "loading" && !document.documentElement.doScroll)) {
  onDocReady()
} else {
  document.addEventListener("DOMContentLoaded", onDocReady)
}
/////////////////////////////////////////////////////////////////
function updateClock() {
let time = new Date().toLocaleTimeString();
let d = new Date();
let ms = d.getMilliseconds()
node.innerHTML = time+ ":" +ms
}
let node = document.createElement('div');
node.setAttribute("style", "padding:14px;color:red;font-family:sans-serif;font-size:14px;top:0;right:760px;position:fixed;text-align:center;z-index:999999;");
document.body.appendChild(node);
setInterval(() => updateClock(), 70);
node.title = 'passa ha facebook + recenti';
node.addEventListener('click', function(){ window.location.href = "https://www.facebook.com/?sk=h_chr";});
/////////////////////////////////////////////////
 //nasconde pop up notifica a sinistra
GM_addStyle('ul[data-gt*=\"\\\"ref\\\":\\\"beeper\\\"\"] {display:none !important;}');
//nascondi blocco publicita app giochi facebook
GM_addStyle('div._1k76,div._pagelet_ego_pane { display:none;}');
 // ti piace questo gioco popup
GM_addStyle('._3mqg {display:none!important}');
///////////////////////crea una storia e pass con immagine dalla sez centrale rimosse
GM_addStyle('.sbcfpzgs.k4urcfbm.stjgntxs.ni8dbmo4.l82x9zwi.uo3d90p7.pw54ja7n.ue3kfks5.hybvsw6c.du4w35lb.l9j0dhe7.rq0escxv > .k4urcfbm{display:none!important}');
GM_addStyle('.gs1a9yip.j83agx80.btwxx1t3.owycx6da.jifvfom9.dlv3wnog.rl04r1d5.ni8dbmo4.stjgntxs.jbae33se.cxgpxx05.l9j0dhe7 {display:none!important}');
GM_addStyle('.m9osqain.m7msyxje.tmrshh9y.m7zwrmfr.taijpn5t.sk4xxmp2.agehan2d.n8ej3o3l.rt8b4zig.spb7xbtv.bkmhp75w.emlxlaya.s45kfl79.bp9cbjyn.p8dawk7l.abiwlrkh.l9j0dhe7.lzcic4wl.f1sip0of.esuyzwwr.i1ao9s8h.a8nywdso.qt6c0cv9.rz4wbd8a.jb3vyjys.hcukyx3x.oygrvhab.cxmmr5t8.kvgmc6g5.p7hjln8o.j83agx80.nhd2j8a9.rq0escxv.r7d6kgcz.e9989ue4.esr5mh6w.qu0x051f.hn33210v.oajrlxb2{display:none!important}');
//persone che potresti conoscere
GM_addStyle('.k4urcfbm.l9j0dhe7.jktsbyx5.dy7m38rt.stjgntxs.ni8dbmo4.o7xrwllt.c8r2yrt7{display:none!important}');
GM_addStyle('.bp9cbjyn.j83agx80.jnigpg78.taijpn5t.ecm0bbzt.hv4rvrfc.a5h7je3r.dati1w0a{display:none!important}');
GM_addStyle('.j83agx80.btwxx1t3.i1fnvgqd.pybr56ya.hv4rvrfc.e5nlhep0.dati1w0a{display:none!important}');
//sponsorizzato sopra la chat
GM_addStyle('.cxgpxx05 > div:nth-of-type(1) > div > .l9j0dhe7 > .sj5x9vvc.cxgpxx05{display:none!important}');
GM_addStyle('.hzawbc8m.m9osqain.lrazzd5p.g1cxx5fr.a5q79mjw.ew0dbk1b.s89635nw.c1et5uql.qv66sw1b.hpfvmrgz.d2edcug0.ik7dh3pa.oi732d6d.l9j0dhe7.stjgntxs.ni8dbmo4.a8c37x1j{display:none!important}');
// Verifica che l'URL principale sia il più recente
if (document.URL == "https://www.facebook.com/") window.location.href = "https://www.facebook.com/?sk=h_chr";
if (document.URL == "https://www.facebook.com/?ref=tn_tnmn") window.location.href = "https://www.facebook.com/?sk=h_chr";
if (document.URL == "https://www.facebook.com/?sk=h_nor") window.location.href = "https://www.facebook.com/?sk=h_chr";

//zona+crea .messaggi notifiche cerchi colorati
GM_addStyle('.tdjehn4e {background-color:blue!important}');
//link
GM_addStyle('.oo9gr5id {color:red!important}');
//zona scrivi un commento sui post
GM_addStyle('._71pn ._129h {background-color:green!important}');

//gruppi sulla barra
GM_addStyle('li.hw7htvoc.h676nmdw.dawyy4b1.jrc8bbd0.o5zgeu5y.to382e16.buofh1pr:nth-of-type(4) > .iyyx5f41.dhp61c6y.dp1hu0rb.owwhemhu.qowsmv63.cebpdrjk.bipmatt0.pk4s997a.q3lfd5jv.k5wvi7nf.t1p8iaqh.a8s20v7p.abs2jz4q.a6sixzi8.tojvnm2t > .l9j0dhe7.byvelhso.j83agx80.bp9cbjyn > .k4urcfbm.taijpn5t.pi1r6xr4.cbu4d94t.bp9cbjyn.p8dawk7l.abiwlrkh.l9j0dhe7.lzcic4wl.f1sip0of.esuyzwwr.i1ao9s8h.a8nywdso.qt6c0cv9.rz4wbd8a.jb3vyjys.hcukyx3x.oygrvhab.cxmmr5t8.kvgmc6g5.p7hjln8o.j83agx80.nhd2j8a9.rq0escxv.r7d6kgcz.e9989ue4.esr5mh6w.qu0x051f.g5ia77u1.oajrlxb2 > .l9j0dhe7 > .em6zcovv.b7h9ocf4.hwsy1cff.ms05siws.a8c37x1j{display:none!important}');
GM_addStyle('li.hw7htvoc.h676nmdw.dawyy4b1.jrc8bbd0.o5zgeu5y.to382e16.buofh1pr:nth-of-type(4) > .iyyx5f41.dhp61c6y.dp1hu0rb.owwhemhu.qowsmv63.cebpdrjk.bipmatt0.pk4s997a.q3lfd5jv.k5wvi7nf.t1p8iaqh.a8s20v7p.abs2jz4q.a6sixzi8.tojvnm2t > .l9j0dhe7.byvelhso.j83agx80.bp9cbjyn > .k4urcfbm.taijpn5t.pi1r6xr4.cbu4d94t.bp9cbjyn.p8dawk7l.abiwlrkh.l9j0dhe7.lzcic4wl.f1sip0of.esuyzwwr.i1ao9s8h.a8nywdso.qt6c0cv9.rz4wbd8a.jb3vyjys.hcukyx3x.oygrvhab.cxmmr5t8.kvgmc6g5.p7hjln8o.j83agx80.nhd2j8a9.rq0escxv.r7d6kgcz.e9989ue4.esr5mh6w.qu0x051f.g5ia77u1.oajrlxb2{display:none!important}');
//crea 1 storia
GM_addStyle('.ejjq64ki.v8c10jal.e3xpq0al.d2edcug0{display:none!important}');
////////////////////////////////////////////////////////////////////////////////////
//logout facebook
var f = document.createElement('span');
f.innerHTML = "logout";
var c ='position:fixed;text-align:right;top:0;right:200px;padding:3px 6px;z-index:50000;color:red!important;background-color:green;border:1px solid blue;line-height:19px;font-size:11pt;cursor:pointer;font-weight:bold;text-decoration:none;border-radius:12px;';
f.style.cssText = c;
f.title = 'logout facebook';
f.addEventListener('click', function(){var click1 = "oajrlxb2 tdjehn4e qu0x051f esr5mh6w e9989ue4 r7d6kgcz rq0escxv nhd2j8a9 j83agx80 p7hjln8o kvgmc6g5 cxmmr5t8 oygrvhab hcukyx3x jb3vyjys rz4wbd8a qt6c0cv9 a8nywdso i1ao9s8h esuyzwwr f1sip0of lzcic4wl l9j0dhe7 abiwlrkh p8dawk7l bp9cbjyn s45kfl79 emlxlaya bkmhp75w spb7xbtv rt8b4zig n8ej3o3l agehan2d sk4xxmp2 taijpn5t qypqp5cg q676j6op";
var click2 = "oajrlxb2 gs1a9yip g5ia77u1 mtkw9kbi tlpljxtp qensuy8j ppp5ayq2 goun2846 ccm00jje s44p3ltw mk2mc5f4 rt8b4zig n8ej3o3l agehan2d sk4xxmp2 rq0escxv nhd2j8a9 a8c37x1j mg4g778l btwxx1t3 pfnyh3mw p7hjln8o kvgmc6g5 cxmmr5t8 oygrvhab hcukyx3x tgvbjcpo hpfvmrgz jb3vyjys rz4wbd8a qt6c0cv9 a8nywdso l9j0dhe7 i1ao9s8h esuyzwwr f1sip0of du4w35lb lzcic4wl abiwlrkh p8dawk7l ue3kfks5 pw54ja7n uo3d90p7 l82x9zwi";

function sleep (time) { return new Promise((resolve) => setTimeout(resolve, time)); }

sleep(1500).then(() => // Attendere circa 1,5 secondi per caricare FB
{
    document.getElementsByClassName(click1)[1].click(); // Fai clic sul menu "Account" nell'angolo in alto a destra

    sleep(500).then(() => // Attendi circa 0,5 secondi per esaurire le opzioni
    {
        document.getElementsByClassName(click2)[6].click(); // test esci
    });
});
});
document.body.appendChild(f);