Created
April 18, 2025 17:36
-
-
Save RedcoatAsher/e010c97cf2404ef7dde92dae56fcdf13 to your computer and use it in GitHub Desktop.
Arc Boost JS to hide Google "sponsored" emails
This file contains hidden or 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
function hideTRWithClasses() { | |
document.querySelectorAll("tr").forEach(tr => { | |
const classAttr = tr.getAttribute("class"); // safely get class as string | |
if (!classAttr) return; // skip if there's no class | |
const classes = classAttr.trim().split(/\s+/); // Split classes into an array | |
// Check if the <tr> has both zA and zE classes | |
const hasClasses = classes.includes("zA") && classes.includes("zE"); | |
// Check if the <tr> contains a nested element with the class 'FFM8Yd' | |
const hasNestedFFM8Yd = tr.querySelector(".FFM8Yd"); | |
// If it has both zA, zE and a nested element with class 'FFM8Yd', hide it | |
if (hasClasses && hasNestedFFM8Yd) { | |
tr.style.display = "none"; | |
} | |
}); | |
} | |
// Run the function every 5 seconds | |
setInterval(hideTRWithClasses, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment