Some way to detect my environment is parametric model maker

I’d like to be able to upload OpenSCAD scripts that are usable in the online Customize function, but that can also detect whether they’re being run in the OpenSCAD client and take advantage of the client’s additional features, without having to write two separate scripts.

For instance, I often like to check the $preview built-in to decide whether to orient parts based on a user selection, or to orient them for export in a printable orientation. I don’t really want people to be able to export the cross-section view I provide to let them determine whether their parameters have resulted in overlapping parts.

Or, if they’re trying to use an option I know doesn’t work online, I’d like to put up some text to let them know what exactly the problem is and what to do about it (download script and run in the client) as opposed to their just getting cryptic error messages.