User:Aesulus/common.js: Difference between revisions

remove redundant check
No edit summary
(remove redundant check)
Line 69:
else if (node.nodeType === Node.ELEMENT_NODE) { // check if it's an element node
if (node.tagName == "STYLE") { // don't pekofy yourself
return;
}
if (node.tagName == "A" && node.getAttribute('href') == node.textContent) { // don't pekofy links
return;
}
Line 130 ⟶ 127:
}
 
// Begin here. Only run pekofy script while *viewing* (i.e. not editing) wiki subject pages and only if cookies are enabled
function onLoadCheck() {
if(document.body.classList.contains('ns-subject') && document.body.classList.contains('action-view') && navigator.cookieEnabled) {
Line 136 ⟶ 134:
}
 
// Begin here. Only run pekofy script while *viewing* (i.e. not editing) wiki subject pages and only if cookies are enabled
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', onLoadCheck);