How to prevent redirecting to HTTPS when fetching local address from a background script?

Does this fix the problem?