style cleanups, don't call userWindow for non-HTML pages Fixes #3798