Skip to content

Instantly share code, notes, and snippets.

@RedcoatAsher
Created April 18, 2025 17:36
Show Gist options
  • Save RedcoatAsher/e010c97cf2404ef7dde92dae56fcdf13 to your computer and use it in GitHub Desktop.
Save RedcoatAsher/e010c97cf2404ef7dde92dae56fcdf13 to your computer and use it in GitHub Desktop.
Arc Boost JS to hide Google "sponsored" emails
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