Hmm surely if the browser is running on a device such as Android or IOS then as a browser (well website code) can detect the OS then it may be possible to detect a OS designed for mobile and do this that way.
I am just guessing so maybe someone else can add to this.