NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name remove-fb-vaccine-covid-warnings // @namespace https://openuserjs.org/scripts/itwascovidrelated // @version 0.9 // @author - // @description Cleans the Facebook from vaccine warnings (maybe more covid related) // @copyright skip // @license MIT; https://opensource.org/licenses/MIT // @include https://www.facebook.com/* // @include https://facebook.com/* // @grant GM_addStyle // ==/UserScript== var frequency = 6 * 1000; // smaller number will stress the computer, but update faster var vaxinterval=window.setInterval( function() { var spans=document.querySelectorAll('div > div > span'); for(var span of spans) { var s=span.textContent; if(s=='Get Vaccine Info' || s=='מידע על החיסון') span.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.remove(); } }, frequency ); function hideXPath(xPathStr) { let matchingElement = document.evaluate(xPathStr, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null) if(matchingElement) { matchingElement.remove(); } } let onDocReady = function(){ //console.log('domain: ' + document.domain) if (processOptions) { if (document.domain.indexOf("facebook.com") !== -1) { addCSSClasses() removeOnce() removeLoop() setInterval(removeLoop, options.hideLoopInterval) } } } function removeSponsored() { var spans = document.querySelectorAll('div > div > span'); for(var span of spans) { var s=span.textContent; if(s=='Get Vaccine Info' || s=='מידע על החיסון') span.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.remove(); } hideXPath("//span[text()='COVID-19 Information Center']/ancestor::li") hideXPath("//span[contains(text(),'Spread of COVID-19')]/ancestor::div[starts-with(@data-pagelet,'FeedUnit')]") hideXPath("//div[@aria-label='Sponsored']/ancestor::div[starts-with(@data-pagelet,'FeedUnit')]") hideXPath("//a[@aria-label='Sponsored']/ancestor::div[starts-with(@data-pagelet,'FeedUnit')]") hideXPath("//div[text()='Sponsored']/ancestor::div[starts-with(@data-pagelet,'FeedUnit')]") } if (document.readyState === "complete" || (document.readyState !== "loading" && !document.documentElement.doScroll)) { onDocReady() } else { document.addEventListener("DOMContentLoaded", onDocReady) }