Whenever you work with any kind of a REST API the CORS issue comes and haunts you. You don’t know if your code isn’t working or if your browser is having some problems but when you debug using the web inspector tools you see an error like this:
So how do you get around it, well thankfully there are plugins for that but sometimes the plugins don’t work so I will show you both how to disable it manually.
But before we disable it lets take a moment to know what CORS is.
But for an API that doesn’t make any sense as APIs by nature have to provide data across various domains. Enter Cross-origin resource sharing (CORS), CORS allows the server to do just that, but it has to be enabled on the server. But may APIs don’t have it enabled.
But this post is not about to teach you CORS but to bypass it.
Let’s see how you can do that using plugins
Plugin Name: Allow-Control-Allow-Origin: *
Link: Download here
Plugin Name: cors everywhere
You need to search firefox add-on section to get this plugin.
This plugins are great and they get the job done and i love using them but at times you might to do things manually so the following are some ways you can do it manually
Using the command prompt first navigate to the directory where chrome is installed and issue the following command:
Open your Firefox and type about:config into the URL bar. Agree to the statement about risk and do a search for:
And change it to false.