Improve confirmOriginIsEnabled

See commit messages for details.