[homepage|cv] WM-020 [text|html] [remarks]
              
Document: WM-020                                                 P. Webb
Category: Research                                            2017.11.14

                  Nintendo Switch browser capabilities

Abstract

   Don’t get your hopes up

Body

   Before the Switch, Nintendo had a nifty HTML5 framework for game
   development called Nintendo Web Framework. It used to have its own
   page on Wikipedia, no idea where it disappeared to.

   Anyhoo, I was looking forward to its return so I could make games for
   the Switch using my existing skillset. Due to Nintendo’s enthusiasm
   for the Unity and Unreal game engines, it doesn’t seem like that’s
   happening anytime soon if ever, much to the chagrin of aspiring game
   developers (and Switch owners) like myself. However, I was curious to
   know what the built-in browser is capable of. Here’s what I found[1],
   with my Switch’s OS on version 4.0.1:

   1. Parsing Rules

      - βœ… <!DOCTYPE html> triggers standards mode
      - βœ… HTML5 tokenizer
      - βœ… HTML5 tree building
      - βœ… Parsing inline SVG
      - βœ… Parsing inline MathML

   2. Elements

      - βœ… Embedding custom non-visible data

   2.1. New or modified elements

      - βœ… Section elements
        - βœ… section element
        - βœ… nav element
        - βœ… article element
        - βœ… aside element
        - βœ… header element
        - βœ… footer element
      - βœ… Grouping content elements
        - βœ… main element
        - βœ… figure element
        - βœ… figcaption element
        - βœ… reversed attribute on the ol element
      - βšͺ️ Text-level semantic elements
        - ❌ download attribute on the a element
        - βœ… ping attribute on the a element
        - βœ… mark element
        - βœ… ruby, rt, and rp elements
        - ❌ time element
        - ❌ data element
        - ❌ wbr element
      - βšͺ️ Interactive elements
        - βœ… details element
        - βœ… summary element
        - ❌ menu element of type toolbar
        - ❌ menu element of type context
        - ❌ dialog element

   2.2. Global attributes or methods

      - βœ… hidden attribute
      - βœ… Dynamic markup insertion
        - βœ… outerHTML property
        - βœ… insertAdjacentHTML function



   3. Forms

   3.1. Field types

      - βœ… input type=text
        - βœ… Minimal element support
        - βœ… Selection Direction
      - βœ… input type=search
        - βœ… Minimal element support
      - βœ… input type=tel
      - βœ… Minimal element support
      - βœ… input type=url
        - βœ… Minimal element support
        - βœ… Field validation
      - βœ… input type=email
        - βœ… Minimal element support
        - βœ… Field validation
      - ❌ input type=date
        - ❌ Minimal element support
        - ❌ Custom user-interface
        - ❌ Value sanitization
        - ❌ min attribute
        - ❌ max attribute
        - ❌ step attribute
        - ❌ stepDown() method
        - ❌ stepUp() method
        - ❌ valueAsDate() method
        - ❌ valueAsNumber() method
      - ❌ input type=month
        - ❌ Minimal element support
        - ❌ Custom user-interface
        - ❌ Value sanitization
        - ❌ min attribute
        - ❌ max attribute
        - ❌ step attribute
        - ❌ stepDown() method
        - ❌ stepUp() method
        - ❌ valueAsDate() method
        - ❌ valueAsNumber() method
      - ❌ input type=week
        - ❌ Minimal element support
        - ❌ Custom user-interface
        - ❌ Value sanitization
        - ❌ min attribute
        - ❌ max attribute
        - ❌ step attribute
        - ❌ stepDown() method
        - ❌ stepUp() method
        - ❌ valueAsDate() method
        - ❌ valueAsNumber() method
      - ❌ input type=time
        - ❌ Minimal element support
        - ❌ Custom user-interface
        - ❌ Value sanitization
        - ❌ min attribute
        - ❌ max attribute
        - ❌ step attribute
        - ❌ stepDown() method
        - ❌ stepUp() method
        - ❌ valueAsDate() method
        - ❌ valueAsNumber() method
      - ❌ input type=datetime-local
        - ❌ Minimal element support
        - ❌ Custom user-interface
        - ❌ Value sanitization
        - ❌ min attribute
        - ❌ max attribute
        - ❌ step attribute
        - ❌ stepDown() method
        - ❌ stepUp() method
        - ❌ valueAsNumber() method
      - βœ… input type=number
        - βœ… Minimal element support
        - βœ… Custom user-interface
        - βœ… Value sanitization
        - βœ… Field validation
        - βœ… min attribute
        - βœ… max attribute
        - βœ… step attribute
        - βœ… stepDown() method
        - βœ… stepUp() method
        - βœ… valueAsNumber() method
      - βœ… input type=range
        - βœ… Minimal element support
        - βœ… Custom user-interface
        - βœ… Value sanitization
        - βœ… min attribute
        - βœ… max attribute
        - βœ… step attribute
        - βœ… stepDown() method
        - βœ… stepUp() method
        - βœ… valueAsNumber() method
      - βœ… input type=color
        - βœ… Minimal element support
        - βœ… Custom user-interface
        - βœ… Value sanitization
      - βœ… input type=checkbox
        - βœ… Minimal element support
        - βœ… indeterminate property
      - βœ… input type=image
        - βœ… Minimal element support
        - βœ… width property
        - βœ… height property
      - βšͺ️ input type=file
        - βœ… Minimal element support
        - βœ… files property
        - ❌ Directory upload support
      - βœ… textarea
        - βœ… Minimal element support
        - βœ… maxlength attribute
        - βœ… wrap attribute
      - βœ… select
        - βœ… Minimal element support
        - βœ… required attribute
      - βœ… fieldset
        - βœ… Minimal element support
        - βœ… elements attribute
        - βœ… disabled attribute
      - ❌ datalist
        - ❌ Minimal element support
        - ❌ list attribute for fields
      - βœ… output
        - βœ… Minimal element support
      - βœ… progress
        - βœ… Minimal element support
      - βœ… meter
        - βœ… Minimal element support

   3.2. Fields

      - βœ… Field validation
        - βœ… pattern attribute
        - βœ… required attribute
      - βœ… Association of controls and forms
        - βœ… control property on labels
        - βœ… form property on fields
        - βœ… formAction property on fields
        - βœ… formEnctype property on fields
        - βœ… formMethod property on fields
        - βœ… formNoValidate property on fields
        - βœ… formTarget property on fields
        - βœ… labels property on fields
      - βœ… Other attributes
        - βœ… autofocus attribute
        - βœ… autocomplete attribute
        - βœ… placeholder attribute
        - βœ… multiple attribute
        - βœ… dirname attribute
      - βœ… CSS selectors
        - βœ… :valid selector
        - βœ… :invalid selector
        - βœ… :optional selector
        - βœ… :required selector
        - βœ… :in-range selector
        - βœ… :out-of-range selector
        - βœ… :read-write selector
        - βœ… :read-only selector
      - βœ… Events
        - βœ… oninput event
        - βœ… onchange event
        - βœ… oninvalid event

   3.3. Forms

      - βœ… Form validation
        - βœ… checkValidity method
        - βœ… noValidate attribute

   4. Web Components

      - ❌ Custom elements
      - ❌ Shadow DOM
      - βœ… HTML templates
      - ❌ HTML imports

   5. Location and Orientation

      - ❌ Geolocation
      - βœ… Device Orientation
      - βœ… Device Motion

   6. Output

      - βœ… Full screen support (prefixed)
      - ❌ Web Notifications

   7. Input

      - βœ… Gamepad control
      - ❌ Pointer Events
      - ❌ Pointer Lock support

   8. Communication

      - βœ… Server-Sent Events
      - ❌ Beacon
      - ❌ Fetch

   8.1. XMLHttpRequest Level 2

      - βœ… Upload files
      - βœ… Response type support
        - βœ… Text response type
        - βœ… Document response type
        - βœ… ArrayBuffer response type
        - βœ… Blob response type

   8.2. WebSocket

      - βœ… Basic socket communication
      - βœ… ArrayBuffer and Blob support

   9. Streams

      - ❌ Readable streams
      - ❌ Writable streams

   10. Peer to Peer

   10.1. Connectivity

      - βœ… WebRTC 1.0 (prefixed)
      - ❌ ObjectRTC API for WebRTC
      - ❌ Data channel

   10.2. Input

      - βœ… Access the webcam
      - ❌ Screen Capture
      - ❌ Enumerate devices

   10.3. Recording

      - ❌ Media Stream recorder

   11. User Interaction

   11.1. Drag and drop

      - ❌ Attributes
        - ❌ draggable attribute
        - ❌ dropzone attribute
      - ❌ Events
        - ❌ ondrag event
        - ❌ ondragstart event
        - ❌ ondragenter event
        - ❌ ondragover event
        - ❌ ondragleave event
        - ❌ ondragend event
        - ❌ ondrop event

   11.2. HTML editing

      - ❌ Editing elements
        - ❌ contentEditable attribute
        - ❌ isContentEditable property
      - ❌ Editing documents
        - ❌ designMode attribute
      - ❌ CSS selectors
        - ❌ :read-write selector
        - ❌ :read-only selector
      - ❌ APIs
        - ❌ execCommand method
        - ❌ queryCommandEnabled method
        - ❌ queryCommandIndeterm method
        - ❌ queryCommandState method
        - ❌ queryCommandSupported method
        - ❌ queryCommandValue method

   11.3. Clipboard

      - ❌ Clipboard API and events

   11.4. Spellcheck

      - βœ… spellcheck attribute

   12. Performance

      - βœ… Workers
      - ❌ Web Workers
      - ❌ Shared Workers

   12.1. Other

      - ❌ window.requestIdleCallback

   13. Security

      - βœ… Web Cryptography API
      - βœ… Content Security Policy 1
      - βœ… Content Security Policy 2
      - βœ… Cross-Origin Resource Sharing
      - ❌ Subresource Integrity
      - βœ… Cross-document messaging

   13.1. Authentication

      - ❌ Web Authentication / FIDO 2
      - ❌ Credential Management

   13.2. Iframes

      - βœ… Sandboxed iframe
      - βœ… iframe with inline contents

   14. Payments

      - ❌ Web payments

   15. Video

      - βœ… video element
      - βœ… Subtitles
      - βœ… Audio track selection
      - βœ… Video track selection
      - βœ… Poster images
      - βœ… Codec detection

   15.1. Video codecs

      - ❌ MPEG-4 ASP support
      - βœ… H.264 support
      - ❌ H.265 support
      - ❌ Ogg Theora support
      - ❌ WebM with VP8 support
      - ❌ WebM with VP9 support

   16. Audio

      - βœ… audio element
      - βœ… Loop audio
      - βœ… Preload in the background

   16.1. Advanced

      - βœ… Web Audio API (prefixed)
      - ❌ Speech Recognition
      - ❌ Speech Synthesis

   16.2. Audio codecs

      - ❌ PCM audio support
      - ❌ MP3 support
      - ❌ AAC support
      - ❌ Dolby Digital support
      - ❌ Dolby Digital Plus support
      - ❌ Ogg Vorbis support
      - ❌ Ogg Opus support
      - ❌ WebM with Vorbis support
      - ❌ WebM with Opus support

   17. Streaming

      - ❌ Media Source extensions
      - ❌ DRM support

   17.1. Adaptive bit rate

      - ❌ Dynamic Adaptive Streaming / MPEG-DASH
      - βœ… HTTP Live Streaming / HLS

   17.2. Codecs

      - ❌ Video codecs
        - ❌ MP4 with H.264 support
        - ❌ MP4 with H.265 support
        - ❌ TS with H.264 support
        - ❌ TS with H.265 support
        - ❌ WebM with VP8 support
        - ❌ WebM with VP9 support
      - ❌ Audio codecs
        - ❌ MP4 with AAC support
        - ❌ MP4 with Dolby Digital support
        - ❌ MP4 with Dolby Digital Plus support
        - ❌ TS with AAC support
        - ❌ TS with Dolby Digital support
        - ❌ TS with Dolby Digital Plus support
        - ❌ WebM with Vorbis support
        - ❌ WebM with Opus support

   18. Responsive Images

      - βœ… picture element
      - βœ… srcset attribute
      - βœ… sizes attribute

   19. 2D Graphics

      - βœ… Canvas 2D graphics

   19.1. Drawing primitives

      - βœ… Text support
      - βœ… Path support
      - βœ… Ellipse support
      - βœ… Dashed line support
      - βœ… System focus ring support

   19.2. Features

      - ❌ Hit testing support
      - βœ… Blending modes

   19.3. Image export formats

      - βœ… PNG support
      - βœ… JPEG support
      - ❌ JPEG-XR support
      - βœ… WebP support

   20. 3D and VR

   20.1. 3D Graphics

      - ❌ WebGL
      - ❌ WebGL 2

   20.2. VR Headset

      - ❌ WebVR

   21. Animation

      - ❌ Web Animations API
      - βœ… window.requestAnimationFrame

   22. Web Applications

   22.1. Offline resources

      - βœ… Application Cache
      - ❌ Service Workers
      - ❌ Push Messages

   22.2. Content and Scheme handlers

      - ❌ Custom scheme handlers
      - ❌ Custom content handlers

   23. Storage

   23.1. Key-value storage

      - βœ… Session Storage
      - βœ… Local Storage

   23.2. Database storage

      - ❌ IndexedDB
      - ❌ Objectstore Blob support
      - ❌ Objectstore ArrayBuffer support

   24. Files

   24.1. Reading files

      - βœ… Basic support for reading files
      - βœ… Create a Blob from a file
      - βœ… Create a Data URL from a Blob
      - βœ… Create an ArrayBuffer from a Blob
      - βœ… Create a Blob URL from a Blob

   24.2. Accessing the file system

      - ❌ FileSystem API

   25. Scripting

   25.1. Script execution

      - βœ… Asynchronous script execution
      - βœ… Deferred script execution
      - ❌ Script execution events
      - βœ… Runtime script error reporting

   25.2. ECMAScript 5

      - βœ… JSON encoding and decoding

   25.3. ECMAScript 6

      - ❌ Modules
      - βœ… Classes
      - βœ… Arrow functions
      - βœ… Promises
      - βœ… Template strings
      - βœ… Typed arrays
      - βœ… Internationalization

   25.4. ECMAScript 7

      - ❌ Async and Await

   25.5. Other APIs

      - βœ… Base64 encoding and decoding
      - βœ… Mutation Observer
      - βœ… URL API
      - ❌ Encoding API

   26. Other

      - βœ… Session history
      - βœ… Page Visibility
      - βœ… Text selection
      - βœ… Scroll into view

   And so…

      The Nintendo Switch browser scored 339 out of 555 potential
      points. Not bad for browsing but it certainly isn’t equipped for
      game development. Lack of support for WebGL, WebM, the Web
      Animations API, and IndexedDB certainly inhibits the kinds of
      games you could make, so this might explain their silence on the
      NWF front.

      Oh well.

      If you have a Switch and want to see these results for yourself,
      here are the steps needed to access the web browser:

      1. Go to System Settings > Internet > Internet Settings
      2. Select the network you want to join or are already connected to
      3. Select Change Settings
      4. Select DNS Settings and choose Manual
      5. Under DNS Settings, select Primary DNS
      6. Replace the contents with 045.055.142.122 and hit OK
      7. Save!
      8. Connect to the network you just modified DNS settings for, and
         you should see a message saying "Registration is required to
         use this network"
      9. Proceed and you’ll be redirected to Google, where you can
         search for DuckDuckGo and use that search engine instead

   Extra stuff

      The useragent Nintendo is going with is Mozilla/5.0 (Nintendo
      Switch; WifiWebAuthApplet) AppleWebKit/601.6 (KHTML, like Gecko)
      NF/4.0.0.7.9 NintendoBrowser/5.1.0.15785. I am SO glad their
      useragent isn’t the usual fugly spaghetti soup that most browsers
      come up with. The screen size is 1280 by 720.

      I remember when people made websites for the Nintendo DS, back
      when the browser (made by Opera) came in a cartridge[2]. I still
      have mine btw. It also came with RAM ("Memory Expansion Pak") you
      put in the GBA slot for a whopping 8MB. IGN gave it a 3.5 out of
      10. HAHAHAHAHAHA

      Good times. πŸ•Έ