// ==UserScript==
// @name Hide EPF Error Message (Advanced)
// @namespace http://tampermonkey.net/
// @version 2.0
// @match *://passbook.epfindia.gov.in/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const DEBUG = true; // Set to false to disable console logs
function log(...args) {
if (DEBUG) console.log('[EPF Script]', ...args);
}
function removeError() {
// Target 1: By exact element with error icon
const errorIcon = document.querySelector('.fa-info-circle');
if (errorIcon) {
errorIcon.parentElement.style.display = 'none';
log('✓ Removed error icon container');
}
// Target 2: By element ID (if it has one)
const errorElements = document.querySelectorAll('[id*="error"], [id*="Error"]');
errorElements.forEach(el => {
el.style.display = 'none';
log('✓ Removed element:', el.id);
});
// Target 3: Remove specific text
const walker = document.createTreeWalker(
document.body,
NodeFilter.SHOW_TEXT,
null,
false
);
let node;
while (node = walker.nextNode()) {
if (node.textContent.includes('Error-NO')) {
node.parentElement.style.display = 'none';
log('✓ Removed text node parent');
}
}
}
// Run on page load
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', removeError);
} else {
removeError();
}
// Watch for dynamic changes
new MutationObserver(removeError).observe(document.body, {
childList: true,
subtree: true
});
log('Script initialized');
})();3 views