Time again for looking at the latest progress with Firefox. These posts are part of our Bleeding Edge and Firefox Development Highlights series – take note that most examples only work in Firefox Nightly (and could be subject to change).
WebRTC enabled by default
Previously, you needed to go to about:config in Firefox and set the media.peerconnection.enabled
option to true
, but now it’s enabled by default. This is a huge step forward, to be able to run WebRTC directly in a web browser without it needing any special settings or configuration.
For more details behind this decision, please read Pref on WebRTC by default.
Want to get started with WebRTC? Then we recommend our article Cross-browser camera capture with getUserMedia/WebRTC.
Metro UI
The new Firefox User Interface for Windows 8 has landed (if you had Firefox Nightly as your default browser, reset that permission to see the new UI).
There are more screenshots available too.
H.264 & MP3 support enabled by default in Windows 7
We talked about H.264 & MP3 support before, and now that support is activated by default.
We are still working on supporting Mac OS X and Linux.
WebAudio API progress
We are working on implementing the WebAudio API, and the first parts of support has just started appearing.
It’s available in about:config in the media.webaudio.enabled
preference – set it to true
to enable it and be able to access things such as AudioContext.decodeAudioData
.
Crypto API: window.crypto.getRandomValues
If you provide an integer-based TypedArray (i.e. Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, or Uint32Array), window.crypto.getRandomValues is going fill the array with cryptographically random numbers:
/* assuming that window.crypto.getRandomValues is available */
var array = new Uint32Array(10);
window.crypto.getRandomValues(array);
console.log("Your lucky numbers:");
for (var i = 0; i < array.length; i++) {
console.log(array[i]);
}
canvas: ctx.isPointInStroke
This has been uplifted to Firefox 19 Beta.
From the WHATWG mailing list:
"We have recently implemented isPointInStroke(x,y) in Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=803124). This is a parallel to isPointInPath(x,y) and returns true if the point is inside the area contained by the stroking of a path."
JavaScript: Math.imul
Math.imul allows for fast 32-bit integer multiplication with C-like semantics. This feature is useful for projects like Emscripten.
Polyfill:
function imul(a, b) {
var ah = (a >>> 16) & 0xffff;
var al = a & 0xffff;
var bh = (b >>> 16) & 0xffff;
var bl = b & 0xffff;
// the shift by 0 fixes the sign on the high part
return (al * bl) + (((ah * bl + al * bh) << 16) >>> 0);
}
About Paul Rouget
Paul is a Firefox developer.
About Robert Nyman [Editor emeritus]
Technical Evangelist & Editor of Mozilla Hacks. Gives talks & blogs about HTML5, JavaScript & the Open Web. Robert is a strong believer in HTML5 and the Open Web and has been working since 1999 with Front End development for the web - in Sweden and in New York City. He regularly also blogs at http://robertnyman.com and loves to travel and meet people.
21 comments