Outlook: block tracking pixels
Detects and removes the tiny one-pixel tracking images hidden inside the message body.
Code to copy
// Blank out 1x1 tracking pixels inside the open email body
function killPixels() {
const body = document.querySelector('div[aria-label="Message body"]');
if (!body) { return; }
body.querySelectorAll('img').forEach(function (img) {
const w = img.width || parseInt(img.getAttribute('width') || '0', 10);
const h = img.height || parseInt(img.getAttribute('height') || '0', 10);
if ((w <= 2 && h <= 2) || /open|track|pixel|beacon/i.test(img.src)) {
img.removeAttribute('src');
img.style.display = 'none';
}
});
}
killPixels();
const obs = new MutationObserver(killPixels);
obs.observe(document.body, { childList: true, subtree: true });
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Paste the code into the rule's JavaScript panel and save — it runs on every page visit.
Rate this example
No ratings yet — be the first.