Last active
January 17, 2021 03:31
-
-
Save neodigm/9111451fa4b73fd53f1826dd6433c1cf to your computer and use it in GitHub Desktop.
Remove unwanted inline stylesheets by selector
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
var doRemoveSS = ( (_d, _q)=>{ | |
let aS = [ ... _d.styleSheets]; | |
aS.forEach( (oS)=>{ | |
if( !oS.href ){ | |
let aCSSR = [ ... oS.cssRules]; | |
aCSSR.forEach( (oR)=>{ | |
if( typeof oR.selectorText != "undefined"){ | |
if( oR.selectorText.indexOf( _q ) != -1){ | |
console.log( oR.selectorText ); | |
oS.disabled = true; | |
} | |
} | |
}); | |
} | |
}); | |
})( document, [".l-productthumb .product__fbt-c2a"]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment