Do the context check here in network.js instead of xhr.js, this makes more sense to me.