How to disable CSS in Browser for testing purposes

后端 未结 16 1520
自闭症患者
自闭症患者 2020-11-28 23:05

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

相关标签:
16条回答
  • 2020-11-28 23:46

    As most answers seem to be pretty old here, referencing menu items I can't seem to find in the current versions of popular browsers, here's how to do it in the current version in Firefox Developer Edition:

    • Open Developer Tools (CTRL + SHIFT + I)
    • Select the Style Editor tab
    • There you should see all sources of CSS in your document. You can disable each of them by clicking the eye icon next to them.

    0 讨论(0)
  • 2020-11-28 23:46

    While inspecting HTML with the Browser Development tool you prefer (eg Chrome Devtools) find the <head> element and delete it at all.

    Notice that this will also remove js but for me it is the fastest way to get the page naked.

    0 讨论(0)
  • 2020-11-28 23:47

    Install Adblock Plus, then add *.css rule in Filters options (custom filters tab). The method affect only on external stylesheets. It doesn't turn off inline styles.

    Disable all external CSS

    This method does exactly what you asked.

    0 讨论(0)
  • 2020-11-28 23:48

    This script works for me (hat tip to scrappedcola)

    var el=document.getElementsByTagName('*');for(var i=0;i<el.length; i++){if (el[i].getAttribute("type")=="text/css") el[i].parentNode.removeChild(el[i]); };
    

    inline style stays intact, though

    0 讨论(0)
提交回复
热议问题