If you're attempting to make a cross-domain request to localhost (with a port) from your background.js file, you'll need to update your local machine's host file with a pseudo-hostname, as demonstrated below. Chrome extensions don't like playing around with localhost for some reason, so you need to trick the extension into believing it's an actual domain.
etc/hosts file
127.0.0.1 localhost.com
manifest.json
"permissions": ["http://localhost.com/*"]
background.js (using jQuery)
$.post('http://localhost.com:5000/some-endpoint');
You can use custom ports.
You can use custom ports.
manifest.json
"permissions": ["http://localhost/*"]
background.js (using jQuery)
$.post('http://localhost:5000/some-endpoint');