Skip to content

Instantly share code, notes, and snippets.

@Mackaber
Last active March 17, 2019 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mackaber/5771230bb95d2c6a80d017eb602b0057 to your computer and use it in GitHub Desktop.
Save Mackaber/5771230bb95d2c6a80d017eb602b0057 to your computer and use it in GitHub Desktop.
Facebook Block Infinitescroll
// ==UserScript==
// @name Facebook Block Infinitescroll
// @namespace https://mackaber.me/
// @version 0.1
// @description Blocks Facebook to infinite scroll
// @author Mackaber
// @match https://m.facebook.com/
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.counter = 0;
document.getElementById("MNewsFeed").addEventListener("DOMNodeInserted", function(){
window.counter++;
if(window.counter > 15){
var warning = document.createElement("div");
warning.innerHTML = "TIME TO DO SOMETHING USEFUL!";
warning.style.fontSize = "50px";
warning.style.position = "relative";
warning.style.textAlign = "center";
warning.style.top = "20px";
warning.style.height = "50px";
warning.style.color = "red";
document.getElementById("MNewsFeed").lastElementChild.remove();
document.getElementById("m_newsfeed_stream").appendChild(warning);
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment