Facebook most recent figuccio

reindirizza ha facebook recent 2023

目前为 2023-03-13 提交的版本。查看 最新版本

// ==UserScript==
// @name          Facebook most recent figuccio
// @namespace     https://greasyfork.org/users/237458
// @version       0.2
// @author        figuccio
// @description   reindirizza ha facebook recent 2023
// @match         https://*.facebook.com/*
// @run-at        document-start
// @icon          https://www.google.com/s2/favicons?domain=facebook.com
// @grant         GM_registerMenuCommand
// @grant         GM_addStyle
// @noframes
// @license        MIT
// ==/UserScript==
window.setTimeout(fixbacktotoppostslink,1000);
window.setTimeout(fixbacktotoppostslink,7000);
window.setTimeout(fixbacktotoppostslink,9000);

  // Verifica che l'URL principale sia il più recente
  if (document.URL == "https://www.facebook.com/home.php") window.location.href = "/?sk=h_chr";//log in da google
///////////////////////////////////////////////
//torna ai post piu popolari reinderizza ha topstorie
  function fixbacktotoppostslink() {
// correggi il collegamento alle storie principali per un nuovo design
  var y,x;
  x=document.querySelector('div[role="main"] a[href="/"][aria-label]');
  if(!x){
	if(debug)
	  console.log('didnt find (plain) top stories link');
	return;
  }
//////////////////////////messaggio console colorato
  var consoleStyling = 'background: #0f0; color: #ff0; font-weight: bold;';
  console.log('%c fixing top stories link ', consoleStyling);
      ///////////////////////
 // console.log('fixing top stories link');
  x.id="aa";
  y=x.cloneNode(true);
  y.id="topstorieslink";
  y.title="Post popolari";
  if(!document.querySelector('#topstorieslink'))
  x.parentNode.insertBefore(y,x.nextSibling);
  document.getElementById("aa").style="display:none!important";
  document.getElementById("topstorieslink").href="/?sk=h_nor#topstories";
  if(x.style && x.style.display=='none')
  x.style="block";
  x=y=null;
}

GM_registerMenuCommand("mostra popolari",fixbacktotoppostslink);
(function recent() {
    window.setTimeout(fixbacktotoppostslink,1000);
    window.setTimeout(recent,1000);
    var currentURL = window.location.href;
    if (currentURL == "https://www.facebook.com/"){window.location.replace("/?sk=h_chr");
                      }
	var title=document.querySelectorAll("div[role='banner'] a[role='link'][href='/'],div[role='banner']+div[data-isanimatedlayout] a[role='link'][href='/']");
	if(title && title.length>1)

    title=document.querySelectorAll("a[role='link'][href='/']");
	if(title && title.length>1)
	  for(i=0;i<3;i++){
	    title[i].href="https://www.facebook.com/?sk=h_chr"
          title[i].title="Most Recent"

	  }

  })();
//nasconde il vecchio torna ai post popolari
GM_addStyle(' div._4-u2.mvm._495i {position:relative; top:-21px; width:138px; height:10px; overflow:hidden !important; padding :0px; padding-top:1px; padding-bottom:6px; margin-top:0px; margin-bottom:-17px} /*Nascondi il link Torna allinizio dei post(new design) finché non è pronto*/ div[role="main"] a[href="/"][aria-label]{display:none!important;}');