JavaScript Articles
-
PlayCanvas Goes Open Source
This is a guest post by Will Eastcott of the PlayCanvas engine. As outlined in What Mozilla Hacks is, we constantly cover interesting information about open source and the Open Web, both from external as well as Mozilla authors, so feel free to share with us! On March 22nd 2011, Mozilla released Firefox 4.0 which […]
-
Compiling to JavaScript, and Debugging with Source Maps
Update 2013/05/29: I have updated the article to reflect recent changes in the source map specification where the //@ syntax for linking a source map to a script has been deprecated in favor of //# due to problems with Internet Explorer. This is a tutorial on how to write a compiler which generates JavaScript as […]
-
Zooming and rotating for video in HTML5 and CSS3
The source of the code examples in this post is available on GitHub and you can see the demo in action. There are dozens of video players that allow you to do all the normal things with videos: play, pause, jump to a certain time and so on. More advanced ones also allow you to […]
-
better security and performance with native JSON
The JavaScript Object Notation (JSON) mechanism for representing data has rapidly become an indispensable part of the web developer’s toolkit, allowing JavaScript applications to obtain and parse data intuitively, within scripts, with lightweight data encapsulation. Firefox 3.5 includes support for JSON natively by exposing a new primitive — window.JSON — to the top level object. […]
-
Improved Process Isolation in Firefox 100
Firefox uses a multi-process model for additional security and stability while browsing: Web Content (such as HTML/CSS and Javascript) is rendered in separate processes that are isolated from the rest of the operating system and managed by a privileged parent process. This way, the amount of control gained by an attacker that exploits a bug in a content process is limited. In this article, we would like to dive a bit further into the latest major milestone we have reached: Win32k Lockdown, which greatly reduces the capabilities of the content process when running on Windows.
-
Safely reviving shared memory
At Mozilla, we want the web to be capable of running high-performance applications so that users and content authors can choose the safety, agency, and openness of the web platform. Shared-memory multi-threading is an essential low-level building block for high-performance applications. However, keeping users safe is paramount, which is why shared memory and high-resolution timers were effectively disabled at the start of 2018, in light of Spectre. Until now...
-
A New RegExp Engine in SpiderMonkey
Regular expressions – commonly known as RegExps – are a powerful and heavily used tool for manipulating strings in JavaScript. This post describes how we updated the RegExp engine in SpiderMonkey, Firefox's JavaScript engine, by building a shim layer to V8's Irregexp. The outcome: reduced maintenance and stronger collaboration among the browsers, full support for all the new RegExp features, and compatibility with the latest ECMAScript standard.
-
Firefox 76: Audio worklets and other tricks
Firefox 76 delivers great new features for web platform support, such as Audio Worklets and
Intl
improvements, on the JavaScript side. Also, we’ve added a number of topnotch improvements to Firefox DevTools to make JavaScript debugging and development easier and quicker. -
Avoiding race conditions in SharedArrayBuffers with Atomics
This is the third article in a 3-part series of code cartoons that explore SharedArrayBuffers in JavaScript and how they are used.
-
TypedArray or DataView: Understanding byte order
Depending on how you access an ArrayBuffer you get different byte order on the same machine. So long story short: it makes a difference if you use a TypedArray or the setters from a DataView.