User modules are transported as a string that is invoked with globalEval. Previews are called the same way by OutputPage in case of previews.
This used to be consistent. 9272bc6c4721225 temporarily made it inconsistent by wrapping them normally (but forgot about preview). However various problems with this kind of conditional wrapping were discovered in 2015 which is why I reverted my commit and gave up on this idea.
Conditional wrapping was admittedly a bad idea because conditionally executing code that is potentially incompatible with the current browser is next to impossible. We since solved this problem by instead making the download itself conditional. This was done sometime in 2016.