Internet Browser: Difference between revisions
Tonyzamboney (talk | contribs) →Gamepad: Formatting and performance hint |
Tonyzamboney (talk | contribs) →Detect User Agent: Mobile site mode, misc. improvements |
||
Line 884: | Line 884: | ||
=== Detect User Agent === | === Detect User Agent === | ||
To detect if the user agent is Nintendo 3DS Browser : | To detect if the user agent is the Nintendo 3DS Internet Browser (not including mobile site mode): | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
if (navigator.userAgent.indexOf( | if(navigator.userAgent.indexOf("Nintendo 3DS") == -1) { // If the user agent does not contain "Nintendo 3DS" | ||
location.replace( | location.replace("http://www.3dbrew.org"); // Redirect to another page | ||
} | } | ||
</script> | </script> | ||
* You can check < | * You can check using <code>navigator.platform.indexOf("Nintendo 3DS") > -1</code> as well. | ||
* The New 3DS Internet Browser's "Request Mobile Sites" setting affects the user agent. To detect if the New 3DS Internet Browser is being used with this option enabled, use <code>screen.pixelDepth == 16 && navigator.platform == "iPhone"</code>. | |||
** This relies on the fact that the internet browser renders its webpages in 16-bit color, which is (hopefully?) not possible with a real iPhone. | |||
** Keep in mind that the previous browser-detection examples do not account for this setting. | |||
=== Scrolling === | === Scrolling === |