
Device Detection With Devicedetect.js In Salesforce
A good responsive design in UI can render behaviour across different screen sizes. Though there are few edge cases in Salesforce development, especially where you want to redirect traffic to a mobile-specific page, detect the device and even detect Salesforce1 Application itself.
You can probably do this with the help of a library known as DeviceDetect.js Inspired by isMobile.js. Upload it as a static Resource and then refer it in your Visualforce Page.<apex:includeScript value="{!URLFOR($Resource.DeviceDetect, '/js/deviceDetect.min.js')}" />
1.) Opened in Phone Check:
2.) Opened in Tablet Check:
3.) Opened in Desktop Device Check:
4.) Opened in Salesforce1 Check:
Call the methods as shown below to detect devices and context:
“What are your super powers again? – I can Detect Devices"