You can't do that in C2, and you can't do that in any javascript application because at this moment when the javascript is executed, it's too late and you can't intercept and modify the header sent by the server to allow CORS.
The chrome extension is working because it can intercept the header and modify it before it is parsed by the browser.
In fact, what do you want to do with that ? If you want to access a server on an other domain you own, you can configure the server to allow CORS.