3

I know that I can disable the downloading of external JS files on the Firefox browser (using either about:config or certain add-ons (e.g. QuickJava)).

Is there some way to block the downloading of external CSS files in a similar manner?

Please Note: What I need is NOT to disable CSS from getting applied to web pages, but to prevent external CSS files from getting downloaded altogether when visiting a web page.

I already have the QuickJava add-on installed. Although it has a "CSS blocker" option, I have observed that external CSS files still get downloaded while the option is turned on. (On the contrary, when QuickJava's JS blocker is enabled, external JS files do not get downloaded.)

2
  • Not possible. If something is part of a web page it must be downloaded (to the cache at least). if it is blocked from downloading then it won't be applied (which is not what you want)
    – DavidPostill
    Oct 6, 2014 at 11:13
  • @DavidPostill Thanks; what I actually need is to stop the CSS file from getting downloaded (I thought it was possible because it's possible with JS files, as I have mentioned regarding the QuickJava add-on). (I know that a browser cannot apply external stylesheets unless the corresponding CSS files get downloaded; but applying is out of the question here.) Oct 6, 2014 at 11:39

2 Answers 2

1

You can use uMatrix to whitelist the download and use of CSS files only from the current domain (first-party requests) or selected external domains. If you don't want it to block other types of requests (like scripts and plugins), make sure to whitelist them universally.

uMatrix

Point & click to forbid/allow any class of requests made by your browser. Use it to block scripts, iframes, ads, facebook, etc.

uMatrix

1

Using Adblock Plus, you can write a filter like ||*$stylesheet which will block all stylesheets (unless they've been whitelisted by an exception). The same can be done for scripts with ||*$script

See https://adblockplus.org/filter-cheatsheet for more examples.

2
  • Thanks! I ended up writing something similar on my own, to internally block requests matching the regex \b\.css\b, but this seems to be a better option. And +1 for the great cheatsheet! :) Jan 9, 2016 at 12:44
  • This doesn't seem to work for styles defined in the head of the document itself. Any idea how to do that with ABP? Jul 5, 2016 at 15:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .