How to disable websockets in browser for testing?

Would it work for you if you blocked requests to a specific URL or URL pattern?

If that’s the case, then you can simply right click a URL in the “Network” tab of the Chrome dev tools and select “Block request URL”.

You can also add URLs and URL patterns manually on the “Network request blocking” tab.