[cssom] Factor out fetching and fix referrer to use the real address rather than base URL