Is there any way I can disable all external CSS in a browser (Firefox, Chrome...)?
When using slower internet connection, sometimes only the bare HTML is loaded by t
I tried in Chrome Developer tools and the method is valid only if the CSS are included as external files and it won't work for inline styles.
Array.prototype.forEach.call(document.querySelectorAll('link'), (element)=>element.remove());
Or
var linkElements = document.querySelectorAll('link');
Array.prototype.forEach.call(linkElements, (element)=>element.remove());
Explanations
document.querySelectorAll('link')
gets all the link nodes. This will return array of DOM elements. Note that this is not Array object of javascript. Array.prototype.forEach.call(linkElements
loops through the link elements element.remove()
removes the element from the DOMResulting in plain HTML page