For starters one might ask why would anyone want to switch CORS off?
Cross-Origin Resource Sharing (CORS) is a part of HTTP header that indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources.
It’s security measure against plenty of web attack vectors. In simple terms CORS (Cross-Origin Resource Sharing) mean you can’t get web resource from different domain, only from the same domain from which your original resource is loaded. Practically, if your web page is on domain xy.com then some JavaScript inside your page will only be allowed to get resources from xy.com. But what if you still want CORS switched off?