Internet Browser: Difference between revisions
Tonyzamboney (talk | contribs) →Gamepad: Formatting and performance hint |
m Update link to ImageShare |
||
(4 intermediate revisions by one other user not shown) | |||
Line 456: | Line 456: | ||
| 9 || Start | | 9 || Start | ||
|- | |- | ||
| 10 || | | 10 || Unused | ||
|- | |- | ||
| 11 || | | 11 || Unused | ||
|- | |- | ||
| 12 || Up | | 12 || Up | ||
Line 469: | Line 469: | ||
|} | |} | ||
Each | Each button's value is 0 while the button is not pressed, and 1 while the button is pressed. | ||
Based on the Gamepad API's specifications, buttons 10 and 11 are reserved for left stick presses and right stick presses respectively, which the 3DS does not support. | |||
==== Notes ==== | ==== Notes ==== | ||
Line 481: | Line 481: | ||
* Favicons can be changed using Javascript, but they become unchangeable once the document's <em>readystatechange</em> event finishes firing with a ready state of "complete". | * Favicons can be changed using Javascript, but they become unchangeable once the document's <em>readystatechange</em> event finishes firing with a ready state of "complete". | ||
* Focusing on text-editable elements via Javascript will always open the keyboard. | * Focusing on text-editable elements via Javascript will always open the keyboard. | ||
* Webpage content is usually rendered at 30 FPS despite the <code>webkitRequestAnimationFrame</code> function allowing code to run at a rate of 60 FPS. | |||
** As a result, display-related routines may only show half of their intended updates. | |||
** This issue can be mitigated by rendering on every other frame. However, various factors (such as touchscreen input and sleep mode) make this fairly inconsistent. | |||
== Old3DS browser == | == Old3DS browser == | ||
Line 878: | Line 881: | ||
* HTML5Test.com say that Drag and drop is supported but it's not (code on WebKit is ready, but it's not implemented on interface of browser) | * HTML5Test.com say that Drag and drop is supported but it's not (code on WebKit is ready, but it's not implemented on interface of browser) | ||
* Webpages are rendered with the RGB565 color format. | * Webpages are rendered with the RGB565 color format. | ||
==Tips== | ==Tips== | ||
Line 884: | Line 886: | ||
=== 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 === | ||
Line 978: | Line 983: | ||
<!-- If you have a website that demonstrates these techniques, place it here! --> | <!-- If you have a website that demonstrates these techniques, place it here! --> | ||
* [http://www.nintendo.com/3ds/internetbrowser/bookmarks Nintendo 3DS Bookmarks]: This is the first bookmark pre-installed in the browser. | * [http://www.nintendo.com/3ds/internetbrowser/bookmarks Nintendo 3DS Bookmarks]: This is the first bookmark pre-installed in the browser. | ||
* [ | * [http://theimageshare.com ImageShare]: Image uploader for the 3DS ([https://github.com/corbindavenport/imageshare source code]) | ||
* [http://3ds.andysmith.co.uk/jFox.html jFox] (Short URL: http://bit.ly/iB7FqW) | * [http://3ds.andysmith.co.uk/jFox.html jFox] (Short URL: http://bit.ly/iB7FqW) | ||
* [http://ditto3d.com/3ds Ditto3D (Dead Link)] (Short URL: http://bit.ly/oVreWA) | * [http://ditto3d.com/3ds Ditto3D (Dead Link)] (Short URL: http://bit.ly/oVreWA) |