Fix localhost errors in background.js