Internet Browser
Internet Browser is a web browser preloaded on the Wii U. It is based on NetFront Browser NX v2.1, which uses the WebKit rendering engine.
Known User Agent Strings
Region | Release Date | UA String |
---|---|---|
US | Nov 18, 2012 | Mozilla/5.0 (Nintendo WiiU) AppleWebKit/534.52 (KHTML, like Gecko) NX/2.1.0.8.21 NintendoBrowser/1.0.0.7494.US |
EU | Nov 30, 2012 | Mozilla/5.0 (Nintendo WiiU) AppleWebKit/534.52 (KHTML, like Gecko) NX/2.1.0.8.21 NintendoBrowser/1.0.0.7494.EU |
AU | Nov 30, 2012 | TODO |
JP | Dec 8, 2012 | TODO |
Multimedia Support
Internet Browser supports HTML5 audio and video. The only video format supported is H.264 either in an MPEG-4 container or in an MPEG-2 transport stream with a M3U8 index according to the HTTP Live Streaming specification. The only audio format supported is AAC in an MPEG-4 container.
The browser can display BMP, PNG, GIF, JPEG, and SVG images, but Image Preview mode only supports JPEG images.
Other HTML5 features supported include canvas, web storage, web messaging, server-sent events, device orientation, and WOFF.
External plugins, such as Flash and Java, are not supported.
Controls
Under normal circumstances, Internet Browser uses the following controls:
Some of these functions can be disabled by markup on a web page.
Wii U Scripting Functionality
In addition to W3C standard touch screen functionality, Internet Browser exposes many Wii U input and output functions to Javascript through the wiiu object.
wiiu.gamepad
The wiiu.gamepad object allows Javascript functions to read the current state of the primary GamePad.
Reading values
In order to read any values from the GamePad, the function wiiu.gamepad.update() must be invoked. This will populate all of the properties on the wiiu.gamepad object with the current information about the sticks, accelerometers, gyroscopes, buttons, and touch screen. It is safe to invoke this function in a timer for real-time updates.
After a successful update, wiiu.gamepad.isDataValid will be set to 1. If no update has happened yet, or if the GamePad is not connected, it will be set to 0.
If the GamePad is connected wiiu.gamepad.isEnabled will be set to 1, else it will be set to 0.
Touch Screen
The wiiu.gamepad.tpTouch variable indicates whether or not there is currently an active touch on the screen. If this variable is 1, the following variables will be set:
Variable | Value |
---|---|
wiiu.gamepad.tpX | X position in screen coordinates |
wiiu.gamepad.tpY | Y position in screen coordinates |
wiiu.gamepad.contentX | X position in page coordinates |
wiiu.gamepad.contentY | Y position in page coordinates |
TODO: Determine meaning of tpValidity. It has a value of 3 when there is no touch and a value of 0 when there is a touch.
In addition to these proprietary methods, the Gamepad delivers W3C-standard touch events.
Analog Sticks
The following variables store the current state of the left and right analog sticks. Each value ranges from -1.0 to +1.0.
Variable | Value |
---|---|
wiiu.gamepad.lStickX | ![]() |
wiiu.gamepad.lStickY | ![]() |
wiiu.gamepad.rStickX | ![]() |
wiiu.gamepad.rStickY | ![]() |
Buttons
The variable wiiu.gamepad.hold is a bitmask indicating all buttons currently being depressed on the GamePad, including the click states of the analog sticks. Almost all buttons are represented by in this bitmask although the browser's default behaviors may cause some values to be unusable.
The Power button does not appear in the hold variable in the browser, probably 0x01.
Pressing the Home button closes the browser but triggers the event with keycode 2, So you can see that by going back to the browser after pressing it (The Power button doesn't trigger the event).
Accelerometer
The following variables hold the current state of the GamePad's accelerometers.
Variable | Value |
---|---|
wiiu.gamepad.accX | Force on X (horizontal) axis |
wiiu.gamepad.accY | Force on Y (depth) axis |
wiiu.gamepad.accZ | Force on Z (vertical) axis |
These variables form a vector showing the current acceleration forces on the GamePad, measured in Gs. When held level and motionless, the force of gravity will cause these variables to contain the vector (0.0, -1.0, 0.0).
Gyroscope
The following variables hold the current state of the GamePad's gyroscopes.
Variable | Value |
---|---|
wiiu.gamepad.gyroX | Rotation speed around X (horizontal) axis |
wiiu.gamepad.gyroY | Rotation speed around Y (depth) axis |
wiiu.gamepad.gyroZ | Rotation speed around Z (vertical) axis |
When the GamePad is motionless these values hover around 0.0.
Angle
The following variables hold the current angle of rotation of the GamePad.
Variable | Value |
---|---|
wiiu.gamepad.angleX | Rotation around X (horizontal) axis |
wiiu.gamepad.angleY | Rotation around Y (depth) axis |
wiiu.gamepad.angleZ | Rotation around Z (vertical) axis |
A change of 1.0 in these values represents a complete revolution around the specified axis. These variables do not appear to wrap around; multiple revolutions around the same axis will cause the value to continuously increase or decrease.
If properly calibrated, angleX and angleZ should hover around 0.0 when the GamePad is held level, but as the gyroscopes have limited range and resolution the alignment will drift with use.
Orientation
There are nine variables that tie into the GamePad's orientation tracking, organized into three three-dimensional vectors:
Axis | X | Y | Z |
---|---|---|---|
X (horizontal) axis | wiiu.gamepad.dirXx | wiiu.gamepad.dirXy | wiiu.gamepad.dirXz |
Y (depth) axis | wiiu.gamepad.dirYx | wiiu.gamepad.dirYy | wiiu.gamepad.dirYz |
Z (vertical) axis | wiiu.gamepad.dirZx | wiiu.gamepad.dirZy | wiiu.gamepad.dirZz |
This is a basis of three perpendicular unit vectors; that is, each vector has length 1.0 and points along the relevant axis of the GamePad relative to an arbitrary starting orientation in three-dimensional space.
wiiu.remote
While Internet Browser exposes a wiiu.remote object, at the present time no way is known how to activate it. Presumedly it would allow Javascript functions to read the current state of the primary Wii Remote and its Motion Plus accessory.
All subsequent documentation is only a best guess at functionality based on the property names and how it worked on the Wii.
Reading values
In order to read any values from the Wii Remote, the function wiiu.remote.update() must be invoked. If the function call were to be successful, this would populate all of the properties on the wiiu.remote object with the current information about the pointer, accelerometers, gyroscopes, and buttons of the primary Wii Remote. It is safe to invoke this function in a timer for real-time updates.
After a successful update, wiiu.remote.isDataValid will be set to 1. If no update has happened yet, or if no Wii Remotes are not connected, it will be set to 0.
Buttons
The variable wiiu.remote.held is a bitmask indicating all buttons currently being depressed on the Wii Remote.
Button | Decimal | Hex |
---|---|---|
![]() |
4096 | 0x00001000 |
![]() |
2048 | 0x00000800 |
![]() |
1024 | 0x00000400 |
![]() |
512 | 0x00000200 |
![]() |
256 | 0x00000100 |
![]() |
128 | 0x00000080 |
![]() |
16 | 0x00000010 |
![]() |
8 | 0x00000008 |
![]() |
4 | 0x00000004 |
![]() |
2 | 0x00000002 |
![]() |
1 | 0x00000001 |
Accelerometer
The following variables hold the current state of the Wii Remote's accelerometers.
Variable | Value |
---|---|
wiiu.remote.accX | Force on X (horizontal) axis |
wiiu.remote.accY | Force on Y (depth) axis |
wiiu.remote.accZ | Force on Z (vertical) axis |
These variables form a vector showing the current acceleration forces on the Wii Remote, measured in Gs. When held level and motionless, the force of gravity will cause these variables to contain the vector (0.0, -1.0, 0.0).
Pointer
The following variables track the Wii Remote's cursor on the screen.
Variable | Value |
---|---|
wiiu.remote.dpdX | X position in screen coordinates |
wiiu.remote.dpdY | X position in screen coordinates |
wiiu.remote.dpdDistance | Distance between Wii Remote and Sensor Bar |
wiiu.remote.contentX | X position in page coordinates |
wiiu.remote.contentY | X position in page coordinates |
wiiu.remote.isCursorViewable | 1 if cursor display is enabled |
wiiu.remote.dpdValidity | TODO: ? |
Additionally, the function wiiu.remote.setCursorViewable() will enable or disable the display of the Wii Remote's cursor.
Motion Plus
There are nine variables that tie into the Motion Plus orientation tracking, organized into three three-dimensional vectors:
Axis | X | Y | Z |
---|---|---|---|
X (horizontal) axis | wiiu.remote.mplsDirXx | wiiu.remote.mplsDirXy | wiiu.remote.mplsDirXz |
Y (depth) axis | wiiu.remote.mplsDirYx | wiiu.remote.mplsDirYy | wiiu.remote.mplsDirYz |
Z (vertical) axis | wiiu.remote.mplsDirZx | wiiu.remote.mplsDirZy | wiiu.remote.mplsDirZz |
This is a basis of three perpendicular unit vectors; that is, each vector has length 1.0 and points along the relevant axis of the GamePad relative to an arbitrary starting orientation in three-dimensional space.
The following variables are also available to track the motion of the Wii Remote:
Variable | Value |
---|---|
wiiu.remote.mplsAngX | Rotation around X (horizontal) axis |
wiiu.remote.mplsAngY | Rotation around Y (depth) axis |
wiiu.remote.mplsAngZ | Rotation around Z (vertical) axis |
wiiu.remote.mplsVelX | Movement speed along X (horizontal) axis |
wiiu.remote.mplsVelY | Movement speed along Y (depth) axis |
wiiu.remote.mplsVelZ | Movement speed along Z (vertical) axis |
wiiu.remote.mplsRollX | TODO: ? |
wiiu.remote.mplsRollY | TODO: ? |
wiiu.videoplayer
The wiiu.videoplayer object exposes the property viewMode and the functions setViewMode() and end(). setViewMode() accepts either 0 (windowed?) or 1 (full-screen?) as parameter.
TODO: Figure out what this is and how to use it.
wiiu.imageview
The wiiu.videoplayer object exposes the property viewMode and the functions end() and getErrorCode().
TODO: Figure out what this is and how to use it.