Created
December 19, 2023 20:20
-
-
Save prednaz/9893a253ca908023f8e9b00c2e1b4ae1 to your computer and use it in GitHub Desktop.
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_requests_with_posts_only | |
// @match https://www.facebook.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
const key = (event) => ["f", "ƒ"].includes(event.key) && event.ctrlKey && event.altKey; | |
let filtering = false; | |
document.addEventListener( | |
"keydown", | |
event => | |
{ | |
if (event.target instanceof HTMLInputElement) {return;} | |
if (!key(event)) {return;} | |
filtering = !filtering; | |
for (request of document.querySelector(".x1k70j0n:nth-of-type(2)").children) { | |
if (!request.textContent.includes("Preview")) { | |
request.style.display = filtering ? "none" : ""; | |
} | |
} | |
}, | |
true | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment