Fix domain property not being set in generateFrontendUrl

The fix for #3765 relies on the domain property. Without the above fix that property may not be set when it should have been.