how to disable srcset in Google Chrome

738 Views Asked by At

Is there any way to disable srcset support in Chrome for testing? I'd like to use the Chrome dev tools, and want to simulate a browser that doesn't support srcset.

2

There are 2 best solutions below

0
Yoav Weiss On

After features in Blink (the rendering engine behind Chrome & Opera) reach a certain stable stage, the feature flags that are used to introduce them are removed from the code. Srcset's feature flags have been removed, so there's certainly no way to turn it off in Chrome, without building your own binary.

Even before the flags are removed, I don't know of an easy way to turn on/off a specific feature (they're usually categorized to experimental and stable, and turned on/off in bulk).

0
Nelson Menezes On

It's not quite what you're looking for (support will still be present) but you can maybe fake lack of support by changing the attributes. With jQuery:

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