Last active
March 17, 2019 16:18
-
-
Save Mackaber/5771230bb95d2c6a80d017eb602b0057 to your computer and use it in GitHub Desktop.
Facebook Block Infinitescroll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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