Facebook recent dinamic figuccio

button passa a feed recenti senza ricaricare solo lingua italiano facebook 2023

当前为 2023-05-21 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name          Facebook recent dinamic figuccio
// @namespace     https://greasyfork.org/users/237458
// @version       0.2
// @author        figuccio
// @description   button passa a feed recenti senza ricaricare solo lingua italiano facebook 2023
// @match         https://*.facebook.com/*
// @grant         GM_addStyle
// @grant         GM_registerMenuCommand
// @run-at        document-start
// @icon          https://facebook.com/favicon.ico
// @noframes
// @license        MIT
// ==/UserScript==
window.addEventListener('load', function() {

var recent = function() {
var facebook = document.getElementById('facebook');
if (facebook !== null) {
    // Questa è una vera e propria pagina Facebook principale

const main = facebook.querySelector('[role="main"]');

    //Trova il feed di notizie
const newsfeed = facebook.querySelector('[role="feed"]');

const hider = document.getElementById('hideFeed')

    if (main && newsfeed && !hider) {
      // Questa è una vera e propria pagina principale che non abbiamo ancora realizzato

      // Crea un modo per creare button feed nelle notizie
      var button = document.createElement('button');
      button.id = 'hideFeed'
      button.title="Più recenti senza reflesh";
      button.setAttribute('style',"z-index:9999;background:red;color:lime;padding:3px 6px;border:1px solid yellow;border-radius:9px;cursor:pointer;");

      newsfeed.parentNode.insertBefore(button, newsfeed)
        //////////////////////////////////////////////////
      // mostra button feed delle notizie recenti
      var feedShown = true
      var Feed = function() {
      if (feedShown) {
      button.innerText = 'Feed + Recenti';

        }
      }

         /////////////////////////
  button.onclick = function modifylink() {
  var link = Array.from(document.querySelectorAll('.x1iyjqo2'));
  for (let i = 0; i < link.length; i++) {
  if (link[i].textContent === 'Più recenti') {
  link[i].click();
  }
  }

}

/////////////////////////////
      Feed();

    }
  }
}

recent();

})();