Skip to content

Instantly share code, notes, and snippets.

@neodigm
Last active January 17, 2021 03:31
Show Gist options
  • Save neodigm/9111451fa4b73fd53f1826dd6433c1cf to your computer and use it in GitHub Desktop.
Save neodigm/9111451fa4b73fd53f1826dd6433c1cf to your computer and use it in GitHub Desktop.
Remove unwanted inline stylesheets by selector
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