75. battery consumption
Amazon consumes 17% energy
in a non used JS
jQuery.js ~ 4 joules (0,02%)
~5000 jQuery parsings per charge
Who Killed My Battery ~ mobilexweb.com/go/battery
Tomorrow, 1.45pm @ Fluent
Tuesday, May 28, 13
117. full screen
var body = document.documentElement;
if (body.requestFullScreen) {
body.requestFullScreen();
}
Tuesday, May 28, 13
118. full screen
var body = document.documentElement;
if (body.requestFullScreen) {
body.requestFullScreen();
} else if (body.webkitRequestFullScreen) {
body.webkitRequestFullScreen();
}
Tuesday, May 28, 13
119. full screen
var body = document.documentElement;
if (body.requestFullScreen) {
body.requestFullScreen();
} else if (body.webkitRequestFullScreen) {
body.webkitRequestFullScreen();
} else if (body.mozRequestFullScreen) {
body.mozRequestFullScreen();
}
Tuesday, May 28, 13
146. hi res canvas
<canvas width="300" height="200">
</canvas>
300px
Tuesday, May 28, 13
147. hi res canvas
var devPxRatio = window.devicePixelRatio;
var canvasPxRatio =
document.querySelector("canvas")
.getContext("2d")
.webkitBackingStorePixelRatio;
Tuesday, May 28, 13
148. hi res canvas
<canvas width="300" height="200">
</canvas>
300px
devPxRatio = 2
canvasPxRatio = 1
Tuesday, May 28, 13
149. hi res canvas
<canvas width="300" height="200">
</canvas>
300px
devPxRatio >= 1
canvasPxRatio = undefined
Tuesday, May 28, 13