Pro Yearly is on sale from $80 to $50! »

Weird Browsers @ WebPerfDays

Weird Browsers @ WebPerfDays

Now that everybody builds responsive sites and mobile has become the new normal, are there still any weird browsers left? The latest generation of Smart TV's run on the same operating systems as our mobile devices. How weird can these browsers be? Perhaps Smart TV's aren't as smart as we all would like to think. But there are more weird browsers. How do game console handle your websites and are set top boxes really capable of browsing the web?

De023a9aff4c7a5ede3a81e8c76f17b5?s=128

Niels Leenheer

October 31, 2015
Tweet

Transcript

  1. ?weird browsers? webperfdays amsterdam — october 31st 2015

  2. None
  3. None
  4. 402 
 Edge 12 400 
 Safari 9 521 


    Chrome 46 466 
 Firefox 41 555 0 desktop browsers results on html5test.com
  5. 402 
 Edge 12 400 
 Safari 9 466 


    Firefox 41 555 0 desktop browsers results on html5test.com 521 
 Chrome 46
  6. 402 
 Edge 12 400 
 Safari 9 521 


    Chrome 46 466 
 Firefox 41 555 0 desktop browsers results on html5test.com 16 
 Internet Explorer 6 458 
 Edge 13 336 
 Internet Explorer 11
  7. None
  8. ?weird browsers?

  9. browsers and devices that do not
 adhere to current expectations

  10. if ('ontouchstart' in window) { element.addEventListener(‘touchstart’, function(e) {
 ...
 });

    }
 else {
 element.addEventListener(‘click’, function(e) {
 ...
 }); }
  11. None
  12. ?weird browsers?

  13. ?weird browsers?

  14. game consoles

  15. portable game consoles

  16. smart tvs

  17. e-readers

  18. smartwatches

  19. photo cameras

  20. cars Andre Jay Meissner

  21. None
  22. smart tvs, set-top boxes and consoles

  23. “big screen browsers”

  24. None
  25. television browsers are pretty good the last generation of television

    sets use operating systems that originate from mobile
  26. 418 
 LG WebOS 281 
 Google TV 238 


    LG Netcast 465 
 Samsung Tizen 449 
 Opera Devices 301 
 Panasonic
 Viera smart tv results on html5test.com 555 0 414 
 Panasonic
 Firefox OS 407 
 Samsung
 2014
  27. 328 
 Playstation 4 53 
 Playstation 3 309 


    Playstation TV 98 
 Xbox 360 286 
 Xbox One 311 
 Wii U 66 
 Wii 555 0 console results on html5test.com
  28. None
  29. 1 control

  30. the biggest challenge of 
 of television browsers

  31. navigation (without mouse or touchscreen)

  32. d-pad

  33. navigation with the d-pad

  34. but it can be worse: moving the cursor with the

    arrow keys
  35. alternatives

  36. analog controllers

  37. remotes with trackpad

  38. remotes with airmouse

  39. second screen

  40. many manufacturers also create apps for controlling the smart tv,

    console or set-top box
  41. None
  42. None
  43. text input (without keyboard)

  44. d-pads

  45. text input with the d-pad

  46. alternatives

  47. remotes with keyboards

  48. wireless keyboards

  49. and apps

  50. None
  51. gesture control (throw your hands up in the air,
 and

    wave ’em like you just don’t care)
  52. navigation with gesture control

  53. can we control these input methods 
 directly from javascript?

  54. the d-pad maybe

  55. keyboard events window.addEventListener("keypress", function(e) {
 e.preventDefault(); // no navigation
 ...

    }); 1
  56. the gamepad maybe

  57. the gamepad api var gamepads = navigator.getGamepads();
 for (var i

    = 0; i < gamepads.length; i++) {
 ...
 } 1
  58. wii u api window.setInterval(function() {
 var state = window.wiiu.gamepad.update();
 ...

    }, 100); 2
  59. the webcam no*

  60. 2 the difference between 
 a television and a monitor

  61. overscan (let’s make it a bit more complicated)

  62. due to historical reasons televisions will 
 not show the

    borders of the image
  63. the television enlarges all images 
 from the hdmi input

    by 5% 1920 pixels
  64. the television enlarges all images 
 from the hdmi input

    by 5% 1920 pixels
  65. the image is then cropped to 
 1920 by 1080

    pixels
  66. the image is then cropped to 
 1920 by 1080

    pixels
  67. overscan causes blurry output +5%

  68. solution 1 overscan correction

  69. the browser does not use
 the edges of the image

    1920 pixels
  70. the television will enlarge 
 the image by 5% 1920

    pixels
  71. and the content is now fully visible, the unused border

    is cropped out of the final image
  72. but not every television set enlarges the 
 image by

    exactly 5%, this can vary between manufacturers and models
  73. configure the correct overscan correction 
 in the system preferences

  74. the playstation 4 will always show the browser without overscan

    correction in full screen mode
  75. the playstation 4 will always show the browser without overscan

    correction in full screen mode
  76. solution 2 no overscan

  77. it is possible to disable overscan 
 on many television

    sets ‘screen fit’, ‘pixel perfect’ or ‘just scan’
  78. the playstation 3 always shows the 
 browser with overscan

    correction
  79. the viewport (i really need some aspirin!)

  80. the visual viewport determines which part of the website will

    be visible measured in 
 device pixels the visual viewport
  81. the visual viewport determines which part of the website will

    be visible measured in 
 device pixels the visual viewport
  82. the visual viewport the visual viewport determines which part of

    the website will be visible measured in 
 device pixels
  83. the layout viewport the layout viewport determines the width in

    css pixels on which the site will be rendered
  84. the layout viewport the layout viewport determines the width in

    css pixels on which the site will be rendered
  85. the layout viewport the layout viewport determines the width in

    css pixels on which the site will be rendered
  86. the default layout viewport is different on 
 every smart

    tv, console or set-top box between 800 and 1920 css pixels
  87. it is possible to change the width of the 


    layout viewport with the ‘meta viewport’ tag <meta name="viewport" content=“width=device-width"> <meta name="viewport" content="width=1024"> physical device pixels device scale factor
  88. complication:
 meta viewport is not supported it is not possible

    to get the same layout viewport 
 width in all of the different browsers
  89. complication:
 device pixel ratio is not supported there is no

    proper way to show images with the same resolution as the physical screen
  90. nintendo wii 800 pixels

  91. nintendo wii u 980 pixels

  92. lg webos 960 pixels

  93. microsoft xbox 360 1041 of 1050 pixels

  94. microsoft xbox one 1200 of 1236 pixels

  95. sony playstation 3 1824 pixels

  96. sony playstation 4 1920 pixels

  97. Nintendo Wii 800 LG WebOS 960 Nintendo Wii U 980

    Philips 2014 series 980 Google TV 1024 Playstation TV 1024 Samsung Tizen 1024 Xbox 360 1051 Xbox One 1200 LG Netcast 1226 Panasonic Viera 1256 Opera Devices 1280 Samsung 2014 series 1280 Panasonic Firefox OS 1536 Playstation 3 1824 Playstation 4 1920
  98. device pixels != device pixels (of course not)

  99. sometimes devices pixels are not 
 physical devices pixels, but

    virtual device pixels the browser renders in a lower resolution 
 which is upscaled to the resolution of the display
  100. 3 distance to the screen

  101. “Make fonts and graphics on the site larger to account

    for viewing distance. People sit proportionally farther from a TV than from a computer monitor of the same size.” 
 – Internet Explorer for Xbox One Developer Guide https://msdn.microsoft.com/en-us/library/dn532261(v=vs.85).aspx
  102. responsive design the size of the contents is determined 


    by the width of the viewport
  103. use percentages for positioning .left { width: 60%; }
 .right

    { left: 60%; width: 40%; } 1
  104. base the fontsize on the viewport document.body.style.fontSize = 
 ((window.innerWidth

    / 1920) * 300) + '%'; 2
  105. or maybe use viewport units – with polyfill body {

    font-size: 3vw; }
 .left { width: 60vw; height: 100vh; }
 .right { width: 40vw; height: 100vh; } 3
  106. use a safe margin around the contents body {
 padding:

    5%;
 } 4
  107. youtube tv website

  108. identifying smart tv’s (css for televisions)

  109. css media types @media tv {
 body {
 font-size: 300%;

    } } 1 ×
  110. css media types all television browsers use the 
 css

    media type ‘screen’ 1
  111. screen size if (screen.width == 1920 && screen.height == 1080)

    {
 document.body.className += " television";
 } 2 ×
  112. screen size monitors and phones often use 
 hd resolutions,

    television browsers often use other resolutions 2
  113. useragent sniffing if (navigator.userAgent.search(/TV/i) >= 0) {
 document.body.className += "

    television";
 } 3 ×
  114. useragent sniffing not all smart tv’s are recognisable Mozilla/5.0 (X11;

    Linux; ko-KR) 
 AppleWebKit/534.26+ (KHTML, like Gecko) 
 Version/5.0 Safari/534.26+ 3
  115. couch mode the only reliable way to optimise a website

    
 for television is to make two different websites… or give the user the ability to switch on 
 couch mode 4
  116. 4 be careful with
 feature detection

  117. “Basically every feature that talks to the 
 operating system

    or hardware, is suspect.” 
 – Me http://blog.html5test.com/2015/08/the-problems-with-feature-detection/
  118. if (!!navigator.geolocation) { navigator.geolocation.getCurrentPosition(
 success, failure
 ); }
 else {


    // alternative
 }
  119. if (!!navigator.geolocation) { navigator.geolocation.getCurrentPosition(
 success, failure
 ); } 1 failure

    is called with a “permission denied” error code 2 no callback at all to success or failure
  120. if (!!navigator.geolocation) { navigator.geolocation.getCurrentPosition(
 success, failure
 ); } 3 success

    is called with longitude = 0 and latitude = 0 4 success is called with the coordinates of 
 Mountain View, USA
  121. is there a future for web apps 
 on the

    big screen?
  122. None
  123. the new apple tv does not ship 
 with a

    browser by default
  124. android tv does not ship 
 with a browser by

    default
  125. None
  126. ?weird browsers!

  127. “We cannot predict future behavior 
 from a current experience

    that sucks” 
 – Jason Grigsby http://blog.cloudfour.com/on-the-device-context-continuum/
  128. but wait…

  129. browsers! weird

  130. browsers! weird

  131. browsers! browsers browsers browser browsers! browsers rowsers browsers browsers brows

    browsers wsers! browsers
  132. one arm arm injury new parent permanent situational https://www.microsoft.com/en-us/design/practice

  133. None
  134. thank you niels leenheer
 @html5test