How to disable srcset in Google Chrome

Is there a way to disable srcset support in Chrome for testing? I would like to use the Chrome dev tools and want to simulate a browser that does not support srcset.

+3


source to share


2 answers


Once functions in Blink (Chrome and Opera's rendering engine) reach a certain stable stage, the function flags that are used to represent them are removed from the code. The Srcset feature flags have been removed, so there is no way to disable it in Chrome without generating your own binary.



Even before the flags are removed, I don't know of an easy way to enable / disable a particular feature (they are usually classified as experimental and stable, and also enabled / disabled in bulk).

+2


source


This is not exactly what you are looking for (support will still be there), but you can fake the lack of support by changing the attributes. With jQuery:



$('[srcset]').each(function(idx, el) {
    $(el).attr('not-srcset', $(el).attr('srcset'));
    $(el).removeAttr('srcset');
});

      

+1


source







All Articles