AppSuite:Browserdetection: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
[[File:loginpage.png|thumb|250px|This warning is not shown to a user if you use the form-login]] | [[File:loginpage.png|thumb|250px|This warning is not shown to a user if you use the form-login]] | ||
AppSuite detects the client browser and collects some information about the current device the visitor is using. | AppSuite detects the client browser and collects some information about the current device the visitor is using. This information is used to serve the appropriate UI and enable/disable certain features for the visitor's device. | ||
The browser detection is done by a standalone, dependency free lib that can be included via script-tag to other sites. The original AppSuite login page performs this browser detection. But if you use a form-login and jump directly into AppSuite, the user will miss the warning where AppSuite statesthat an unsupported browser is used. | |||
To show the same warning to a user without using the original AppSuite login page you should include the browser detection lib in your own login page | To show the same warning to a user without using the original AppSuite login page, you should include the browser detection lib in your own login page. That way you can show a warning to the user if they do not use a supported browser. | ||
=== Including the browser.js lib === | === Including the browser.js lib === | ||
Line 15: | Line 15: | ||
In your page <tt>onLoad</tt> you can then call the the global function <tt>isBrowserSupported</tt> which returns a boolean. If <tt>false</tt> is returned by the function you should show a warning to the user that his browser is not supported. | In your page <tt>onLoad</tt> you can then call the the global function <tt>isBrowserSupported</tt> which returns a boolean. If <tt>false</tt> is returned by the function you should show a warning to the user that his browser is not supported. | ||
[[Category:Custom development]] | |||
[[Category:Administrator]] | |||
[[Category:Developer]] | |||
[[Category:UI]] | |||
[[Category:AppSuite]] |
Revision as of 10:00, 9 January 2014
Browser detection outside AppSuite
AppSuite detects the client browser and collects some information about the current device the visitor is using. This information is used to serve the appropriate UI and enable/disable certain features for the visitor's device.
The browser detection is done by a standalone, dependency free lib that can be included via script-tag to other sites. The original AppSuite login page performs this browser detection. But if you use a form-login and jump directly into AppSuite, the user will miss the warning where AppSuite statesthat an unsupported browser is used.
To show the same warning to a user without using the original AppSuite login page, you should include the browser detection lib in your own login page. That way you can show a warning to the user if they do not use a supported browser.
Including the browser.js lib
You can easily include the browser detection via script-tag to your own login page. It's small, dependency free peace of Javascript code which adds a function to the global scope called
isBrowserSuppported()
The lib is located in the AppSuite UI under
http://somedomain.com/appsuite/src/browser.js
. Add this script tag to your page head
<script src="http://somedomain.com/appsuite/src/browser.js" type="text/javascript" charset="UTF-8"></script>
In your page onLoad you can then call the the global function isBrowserSupported which returns a boolean. If false is returned by the function you should show a warning to the user that his browser is not supported.