Board Thread:General Coding Help/@comment-31714129-20170701215236/@comment-26402117-20170702145021

Interesting. Yet it would not be possible to implement such JS in Mercury.

AFAIK, the closest to a pure solution is something using template types, as I suggested over at CC. But I guess that only prevents the desktop template from loading on mobile, and doesn't prevent the mobile template from loading on desktop.