Search completed in 0.88 seconds.
1726 results for "MODULE":
Your results are loading. Please wait...
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.
... 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.
...And 107 more matches
Using JavaScript code modules
javascript code modules are a concept introduced in gecko 1.9 and can be used for sharing code between different privileged scopes.
... modules can also be used to create global javascript singletons that previously required using javascript xpcom objects.
... a javascript code module is simply some javascript code located in a registered location.
...And 29 more matches
Modules - Archive of obsolete content
a module is a self-contained unit of code, which is usually stored in a file, and has a well defined interface.
... the use of modules greatly improves the maintainability of code, by splitting it up into independent components, and enforcing logical boundaries between them.
... unfortunately, javascript does not yet have native support for modules: it has to rely on the host application to provide it with functionality such as loading subscripts, and exporting/ importing names.
...And 24 more matches
Module structure of the SDK - Archive of obsolete content
a commonjs module is 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.
...And 20 more matches
Chrome Worker Modules
the preferred way to define and load modules for chrome workers is to use the chrome worker module loader.
... this module loader should not surprise developers familiar with commonjs, as it implements a minimal commonjs require().
... loading modules loading a module is simple.
...And 15 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 includes compiled wasm modules (webassembly.module javascript objects).
...And 15 more matches
nsIModule
xpcom/components/nsimodule.idlscriptable this interface must be implemented by each xpcom component.
...f aclass, in nsiidref aiid, [retval, iid_is(aiid)] out nsqiresult aresult); void registerself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr, in string atype); void unregisterself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr); methods canunload() this method may be queried to determine whether or not the component module can be unloaded by xpcom.
... return value indicates to the caller whether or not the component module can be unloaded.
...And 12 more matches
Creating Reusable Modules - Archive of obsolete content
you can split your code into separate modules with clearly defined interfaces between them.
... you then import and use these modules from other parts of your add-on using the require() statement, in exactly that same way that you import core sdk modules like page-mod or panel.
... it can often make sense to structure a larger or more complex add-on as a collection of modules.
...And 9 more matches
PKCS #11 Module Specs
pkcs #11 module specs the following is a proposal to the pkcs #11 working group made in august 2001 for configuring pkcs #11 modules.
... these modules specs can be passed by the application directly to nss via the secmod_loadusermodule() call.
... to initialize a pkcs #11 module 'on-the-fly'.
...And 9 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.
...And 8 more matches
Using third-party modules (jpm) - Archive of obsolete content
this article describes how you can use third-party modules with jpm.
... the add-on sdk is extensible by design: you can use the modules that ship inside firefox, but you can also create your own modules and make them available for anyone else to use.
... before the jpm tool was available, there wasn't any package manager for these community-developed modules, so it wasn't obvious where to find community-developed modules, or how to install and update them.
...And 7 more matches
JavaScript code modules
note: these are not the same thing as standard javascript modules.
... see export and import to learn more about how to use standard modules.
... javascript code modules let multiple privileged javascript scopes share code.
...And 7 more matches
PKCS11 module installation
pkcs #11 modules are external modules which add to firefox support for smartcard readers, biometric security devices, and external certificate stores.
... this article covers the two methods for installing pkcs #11 modules into firefox.
... users can use the preferences dialog to install or remove pkcs #11 module.
...And 6 more matches
NSPR LOG MODULES
this environment variable specifies which log modules have logging enabled.
... syntax modulename:level[, modulename:level]* modulename is the name specified in a pr_newlogmodule call or one of the handy magic names listed below.
... description specify a modulename that is associated with the name argument in a call to pr_newlogmodule and a non-zero level value to enable logging for the named modulename.
...And 5 more matches
WebAssembly.Module.customSections() - JavaScript
the webassembly.customsections() function returns a copy of the contents of all custom sections in the given module with the given string name.
... syntax webassembly.module.customsections(module, sectionname); parameters module the webassembly.module object whose custom sections are being considered.
... exceptions if module is not a webassembly.module object instance, a typeerror is thrown.
...And 5 more matches
Worklet.addModule() - Web APIs
WebAPIWorkletaddModule
the addmodule() method of the worklet interface loads the module in the given javascript file and adds it to the current worklet.
... syntax addpromise = worklet.addmodule(moduleurl); addpromise = worklet.addmodule(moduleurl, options); parameters moduleurl a string containing the url of a javascript file with the module to add.
...cookies and http authentification) when loading the module.
...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().
...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.
...And 4 more matches
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.
...And 4 more matches
NSS cryptographic module
this chapter describes the data types and functions that one can use to perform cryptographic operations with the nss cryptographic module.
... the nss cryptographic module uses the industry standard pkcs #11 v2.20 as its api with some extensions.
... therefore, an application that supports pkcs #11 cryptographic tokens can be easily modified to use the nss cryptographic module.
...And 3 more matches
PR_NewLogModule
creates a new log module.
... syntax #include <prlog.h> prlogmoduleinfo* pr_newlogmodule(const char *name); parameters the function has this parameter: name the name to be assigned to the prlogmoduleinfo structure.
... returns a pointer to a prlogmoduleinfo structure.
...And 2 more matches
nsGetModuleProc
summary this function prototype provides the xpcom entry-point into a module.
... #include "nsxpcom.h" typedef nsresult (pr_callback *nsgetmoduleproc)( nsicomponentmanager *acompmgr, nsifile* alocation, nsimodule** aresult ); parameters acompmgr [in] the xpcom component manager.
... alocation [in] the location of the module if any.
...And 2 more matches
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
the rss content module fills this gap.
... an example using the most popular element of the rss content module is shown below: <?xml version="1.0"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" > <channel> <title>example</title> <description>an rss example with slash</description> <lastbuilddate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate> <link>http://www.example.com</link> <item> ...
...<guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/112</guid> <pubdate>sun, 15 may 2005 08:14:11 -0500</pubdate> <link>http://www.example.com/blog/2005/05/15/112</link> <content:encoded><![cdata[this is <b>bold</b>.]]></content:encoded> </item> </channel> </rss> the <content:encoded> element is the reason that the rss content module is popular.
... note: strictly speaking, the rss content module and <content:encoded> are not quite being used correctly.
Compiling a New C/C++ Module to WebAssembly - WebAssembly
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.
... -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 you to load the resulting hello.html in a browser that supports webassembly.
... <button class="mybutton">run myfunction</button> now add the following code at the end of the first <script> element: document.queryselector('.mybutton') .addeventlistener('click', function() { alert('check console'); var result = module.ccall( 'myfunction', // name of c function null, // return type null, // argument types null // arguments ); }); this illustrates how ccall() is used to call the exported function.
Modules - Archive of obsolete content
some simple code to turn a javascript module into non-mozilla-specific code (e.g., if porting to the browser).
... function importmodule (thatobj) { thatobj = thatobj || window; var exported_symbols = [ // put the symbols here ]; // your code here...
... // at the end of your code: (assuming neither 'i' nor 'thatobj' is being exported!) for (var i=0; i < exported_symbols.length; i++) {thatobj[exported_symbols[i]] = eval(exported_symbols[i]);} } or for one-time-only usage of a module: (function (thatobj) { thatobj = thatobj || window; var exported_symbols = [ // put the symbols here ]; // your code here...
Why Well-Formed Web RSS Module is Popular - Syndicating Your Comments - Archive of obsolete content
the rss well-formed web module exists to fill this gap.
... an example using the most popular element of the well-formed web rss module is shown below: <?xml version="1.0"> <rss version="2.0" xmlns:wfw="http://wellformedweb.org/commentapi/" > <channel> <title>example</title> <description>an rss example with wfw</description> <lastbuilddate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate> <link>http://www.example.com</link> <item> <title>i like root beer</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54321</guid> <pubdate>sun, 15 may 2005 13:02:08 -0500</pubdate> <link>http://www.example.com/article/54321</link> <wfw:commentrss>http://www.example.com/feed/rss/54321/comments</wfw:commentrss> </item> <item> <title>rain is wet</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54320</guid>...
...item> <item> <title>huh?!</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54319</guid> <pubdate>sun, 15 may 2005 08:14:11 -0500</pubdate> <link>http://www.example.com/article/54319</link> <wfw:commentrss>http://www.example.com/feed/rss/54319/comments</wfw:commentrss> </item> </channel> </rss> the <wfw:commentrss> element is the reason that the well-formed web rss module is popular.
Measuring performance using the PerfMeasurement.jsm code module
the perfmeasurement.jsm javascript code module lets you take detailed performance measurements of your code.
... note: the perfmeasurement.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on.
... the first thing you need to do is to import the module into your scope: components.utils.import("resource://gre/modules/perfmeasurement.jsm") you can then create a perfmeasurement object.
PRLogModuleInfo
the prlogmoduleinfo structure controls logging from within your application.
... to log your program's activity, create a prlogmoduleinfo structure using pr_newlogmodule .
... syntax #include <prlog.h> typedef struct prlogmoduleinfo { const char *name; prlogmodulelevel level; struct prlogmoduleinfo *next; } prlogmoduleinfo; ...
nsIAboutModule
netwerk/protocol/about/nsiaboutmodule.idlscriptable this interface is implemented to add an 'about:' page.
...the uri passed in is guaranteed to be one of the uris that this module registered to deal with.
...newchannel() constructs a new channel for the about protocol module.
nsStaticModuleInfo
summary this data structure is used by ns_initxpcom3 to specify static xpcom modules.
... #include "nsxpcom.h" struct nsstaticmoduleinfo { const char* name; nsgetmoduleproc getmodule; }; members name this member provides the name of the module as a null-terminated, ascii-valued character array.
... getmodule this member provides a function pointer of type nsgetmoduleproc that returns a nsimodule instance.
Compiling an Existing C Module to WebAssembly - WebAssembly
now you only need some html and javascript to load your new module: <script src="./a.out.js"></script> <script> module.onruntimeinitialized = async _ => { const api = { version: module.cwrap('version', 'number', []), }; console.log(api.version()); }; </script> and you will see the correct version number in the output: note: libwebp returns the current version a.b.c as a hexadecimal number 0xabc.
...after exposing the function to javascript using cwrap, you can use that number to find the start of our buffer and copy the image data: const api = { version: module.cwrap('version', 'number', []), create_buffer: module.cwrap('create_buffer', 'number', ['number', 'number']), destroy_buffer: module.cwrap('destroy_buffer', '', ['number']), }; const image = await loadimage('./image.jpg'); const p = api.create_buffer(image.width, image.height); module.heap8.set(image.data, p); // ...
... { return result[1]; } now with all of that in place, you can call the encoding function, grab the pointer and image size, put it in a javascript buffer of your own, and release all the wasm buffers allocated in the process: api.encode(p, image.width, image.height, 100); const resultpointer = api.get_result_pointer(); const resultsize = api.get_result_size(); const resultview = new uint8array(module.heap8.buffer, resultpointer, resultsize); const result = new uint8array(resultview); api.free_result(resultpointer); note: new uint8array(somebuffer) will create a new view onto the same memory chunk, while new uint8array(sometypedarray) will copy the data.
Module - Archive of obsolete content
rss module list rss modules are microformats injected into an rss document through the use of xml namespaces.
...below is a list of the popular rss modules.
XForms Switch Module - Archive of obsolete content
introduction xforms switch module define a switch construct that allows the creation of user interfaces where the user interface can be varied based on user actions and events.
... the module defines for this switch, case and toggle elements.
Creating a Login Manager storage module
const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); function sampleloginmanagerstorage() {} sampleloginmanagerstorage.prototype = { classdescription: "sample nsiloginmanagerstorage implementation", contractid: "@example.com/login-manager/storage/sample;1", classid: components.id("{364a118c-747a-4f6d-ac63-2d2998e5a5c1}"), queryinterface: xpcomutils.generateqi([ci.nsiloginmanagerstorage]), // this registers the categor...
...ostname) { this.stub(arguments); }, setloginsavingenabled: function slms_setloginsavingenabled(hostname, enabled) { this.stub(arguments); }, findlogins: function slms_findlogins(count, hostname, formsubmiturl, httprealm) { this.stub(arguments); }, countlogins: function slms_countlogins(ahostname, aformsubmiturl, ahttprealm) { this.stub(arguments); } }; function nsgetmodule(compmgr, filespec) xpcomutils.generatemodule([sampleloginmanagerstorage]); sample c++ implementation bug 309807 contains a complete example.
PRLogModuleLevel
the enumerated type prlogmodulelevel defines levels of logging available to application programs.
... syntax #include <prlog.h> typedef enum prlogmodulelevel { pr_log_none = 0, pr_log_always = 1, pr_log_error = 2, pr_log_warning = 3, pr_log_debug = 4, pr_log_notice = pr_log_debug, pr_log_warn = pr_log_warning, pr_log_min = pr_log_debug, pr_log_max = pr_log_debug } prlogmodulelevel; ...
nsIAuthModule
netwerk/base/public/nsiauthmodule.idlscriptable this interface is intended to be used as server and client authentication service.
... init() this method is called to initialize an auth module.
The libmime module
pizzarro <rhp@netscape.com> this module, libmime, implements a general-purpose mime parser.
... typedef struct foobarclass foobarclass; typedef struct foobar foobar; class declaration theis structure defines the callback routines and other per-class data of the class defined in this module.
Link types: modulepreload - HTML: Hypertext Markup Language
the modulepreload keyword for the rel attribute of the <link> element provides a declarative way to preemptively fetch a module script and its dependencies, and store them in the document's module map for later evaluation.
... specifications specification status comment html living standardthe definition of 'modulepreload' in that specification.
Using workers in JavaScript code modules
note: as of gecko 8.0, the nsiworkerfactory interface has been removed starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), you can use workers in javascript code modules (jsms).
The Necko HTTP module
notes class overview this document provides an overview of the classes used to implement the http module.
Index
nss offers lots of functionality; we'll walk through the list of modules, design principles, and important relevant standards.
...(note that it's important to look at the number 11, as there are other pkcs standards with different numbers that define quite different topics.) a software or hardware module conforming to the pkcs#11 standard implements an interface of c calls, which allow querying the characteristics and offered services of the module.
... multiple elements of nss's own modules have been implemented with this interface, and nss makes use of this interface when talking to those modules.
...And 121 more matches
NSS tools : modutil
name modutil - manage pkcs #11 module information within the security module database.
...please contribute to the initial review in mozilla nss bug 836477[1] description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens.
... modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations.
...And 71 more matches
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
name modutil — manage pkcs #11 module information within the security module database.
... synopsis modutil [options] arguments description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens.
... modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations.
...And 70 more matches
/loader - Archive of obsolete content
create commonjs module loaders.
... it can be loaded as a regular script tag in documents that have system principals (note: this does not appear to work as of 02.2016 due to "use strict" being added to the file): <script type='application/javascript' src='resource://gre/modules/commonjs/toolkit/loader.js'></script> this will expose a single loader object containing all of the api functions described in this document.
... it can be loaded as a javascript code module: let { loader, require, unload } = components.utils.import('resource://gre/modules/commonjs/toolkit/loader.js'); it can be required as a commonjs module from a module loaded in the loader itself: let { loader, require, unload } = require('toolkit/loader'); what is it good for ?
...And 61 more matches
NSS Tools modutil
using the security module database (modutil) newsgroup: mozilla.dev.tech.crypto the security module database tool is a command-line utility for managing pkcs #11 module information within secmod.db files or within hardware tokens.
... you can use the tool to add and delete pkcs #11 modules, change passwords, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations.
... the tasks associated with security module database management are part of a process that typically also involves managing key databases (key3.db files) and certificate databases (cert8.db files).
...And 55 more matches
CSS3 - Archive of obsolete content
modules and the standardization process css level 2 needed 9 years, from august 2002 to june 2011 to reach the recommendation status.
...in order to accelerate the standardization of non-problematic features, the css working group of the w3c, in a decision referred as the beijing doctrine, divided css in smaller components called modules .
... each of these modules is now an independent part of the language and moves towards standardization at its own pace.
...And 51 more matches
Index - Learn web development
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.
...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.
... 4 assessment: accessibility troubleshooting accessibility, assessment, beginner, css, codingscripting, html, javascript, learn, wai-aria in the assessment for this module, we present to you a simple site with a number of accessibility issues that you need to diagnose and fix.
...And 44 more matches
Index - Archive of obsolete content
27 modules add-ons, extensions a module is a self-contained unit of code, which is usually stored in a file, and has a well defined interface.
... the use of modules greatly improves the maintainability of code, by splitting it up into independent components, and enforcing logical boundaries between them.
... unfortunately, javascript does not yet have native support for modules: it has to rely on the host application to provide it with functionality such as loading subscripts, and exporting/ importing names.
...And 39 more matches
Understanding WebAssembly text format - WebAssembly
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 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.
...And 34 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.
... 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.
... preparing the example first we need a wasm module!
...And 30 more matches
Creating the Component Code
specifically, the component library has to contain implementations for the component-related interfaces described in this chapter: nsimodule and nsifactory, which are entry points for your implementation code.
... overview of the weblock module source as we mentioned in the previous section, components have layers.
...in a way, the factory and module layers are glue to plug the xpcom object into the larger xpcom system.
...And 29 more matches
import - JavaScript
the static import statement is used to import read only live bindings which are exported by another module.
... imported modules are in strict mode whether you declare them as such or not.
... the import statement cannot be used in embedded scripts unless such script has a type="module".
...And 29 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = myextension dirs = public src xpi_name = myextension install_extension_id = myextension@mycompany.com xpi_pkgname = myextension dist_files = install.rdf include $(topsrcdir)/config/rules.mk a detailed description of the make process, describing the key features of this makefile, can be found here.
... module and xpi_name are both set to the name of your extension; they should be repeated in all project makefiles so that all of the files land in the same place in the xpi staging area (see below).
... public interfaces the public/ directory contains any interfaces that need to be accessed by other modules.
...And 27 more matches
JavaScript Object Management - Archive of obsolete content
in case you're using javascript code modules or xpcom objects, where a window object is not readily available, use an nsitimer instead.
...two other ways are javascript code modules (firefox 3 and above), and xpcom.
... javascript code modules javascript code modules (also known as jsm) are new to firefox 3, and they're the best tool for keeping everything in sync between windows.
...And 24 more matches
Low-Level APIs - Archive of obsolete content
modules in this section implement low-level apis.
... these modules fall roughly into three categories: fundamental utilities such as collection.
... many add-ons are likely to want to use modules from this category.
...And 19 more matches
XPCOMUtils.jsm
the xpcomutils.jsm javascript code module offers utility routines for javascript components loaded by the javascript component loader.
... to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/xpcomutils.jsm"); using xpcomutils exposing a javascript class as a component using these utility methods requires four key steps: import xpcomutils.jsm, as explained previously.
... define the nsgetfactory() or nsgetmodule() entry point.
...And 19 more matches
NSS PKCS11 Functions
pkcs #11 functions this chapter describes the core pkcs #11 functions that an application needs for communicating with cryptographic modules.
...secmod_loadusermodule secmod_unloadusermodule secmod_openuserdb secmod_closeuserdb pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc secmod_loadusermodule load a new pkcs #11 module based on a modulespec.
... syntax #include "secmod.h" extern secmodmodule *secmod_loadusermodule(char *modulespec, secmodmodule *parent, prbool recurse); parameters this function has the following parameters: modulespec is a pkcs #11 modulespec.
...And 19 more matches
Python binding for NSS
every module, class, function, and method has associated documentation and is exposed via the standard python methodology.
... enumerated constants used in the nss/nspr api's are available in the python module under the exact same name as they appear in the c header files of nss/nspr.
... deprecated elements of the python-nss api are marked with python deprecation warnings as well as being documented in the nss module documentation.
...And 18 more matches
Using XPCOM Utilities to Make Things Easier
generic xpcom module macros the work in the previous chapter was useful in setting up the generic component code.
...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.
... the module macros include one set of macros that define the exported nsgetmodule entry point, the required nsimodule implementation code and another that creates a generic factory for your implementation class.
...And 18 more matches
remote/parent - Archive of obsolete content
enables you to load modules, and privileged parts of your add-on in general, into child processes.
... 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 content scripts, and have their own module loader so they can load other sdk modules.
...And 17 more matches
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
pkcs11 faq questions and answers general questions after plugging in an external pkcs #11 module, how do you use the certificate available on the token?
... nss searches all the installed pkcs #11 modules when looking for certificates.
... once you've installed the module, the module's certificates simply appear in the list of certificates displayed in the certificate window.
...And 17 more matches
Index
MozillaTechXPCOMIndex
15 language bindings embedding, landing, mozilla, xpcom, xpcom:language bindings an xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings.
...this method calls through to that thusly: 47 components.utils.unload modules components.utils.unload was introduced in firefox 7 and is used to unload javascript code modules.
... this can be particularly handy with restartless (boostrapped) extensions, so that you can unload an old version of a code module when a new version of your add-on is installed.
...And 17 more matches
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
element notes structure module svg implemented.
... conditional processing module switch implemented.
... image module image implemented.
...And 17 more matches
Appendix D: Loading Scripts - Archive of obsolete content
the examples below which make use of the services global assume that you're previously imported the services.jsm module.
... as this module only exists on firefox 4 and other gecko 2-based platforms, the services in question will have to be manually loaded on other platforms.
...this is the method used by jetpack's securable module system to load nearly all executable code.
...And 16 more matches
Front-end web developer - Learn web development
if you are not sure if front-end web development is for you, and/or you want a gentle introduction before starting a longer and more complete course, work through our getting started with the web module first.
... the assessments in each module are designed to test your knowledge of the subject matter.
... completing the assessments confirms that you are ready to move on to the next module.
...And 16 more matches
gtstd.html
before running the sample programs, it's important to understand the relationships between the ssl interface, the pkcs #11 interface, pkcs #11 modules, and the default netscape security databases.
... a pkcs #11 module (also called a cryptographic module) manages cryptographic services such as encryption and decryption via the pkcs #11 interface.
... pkcs #11 modules can be thought of as drivers for cryptographic devices that can be implemented in either hardware or software.
...And 16 more matches
Shell global objects
parsemodule(code) parses source text as a module and returns a module object.
... setmoduleresolvehook(function(module, specifier) {}) set the hostresolveimportedmodule hook to function.
... this hook is used to look up a previously loaded module object.
...And 16 more matches
Handling Mozilla Security Bugs
first, mozilla.org is appointing a security module owner charged with primary responsibility for coordinating the investigation and resolution of reported mozilla security vulnerabilities.
... the security module owner will have one or more peers to assist in this task.
... organizational structure for handling security bugs we are organizing the investigation and fixing of mozilla security vulnerabilities similar to the way mozilla project activities are handled in general: there will be a security module owner, a small core of active contributors who can act as peers to the module owner, a larger group of less active participants, and other people who may become involved from time to time.
...And 16 more matches
Index - Web APIs
WebAPIIndex
122 audiocontext api, audio, audiocontext, interface, reference, web audio api, sound the audiocontext interface represents an audio-processing graph built from audio modules linked together, each represented by an audionode.
... 123 audiocontext() audio, audio context, audio graph, audiocontext, constructor, context, media, media graph, reference, web audio, web audio api the audiocontext() constructor creates a new audiocontext object which represents an audio-processing graph, built from audio modules linked together, each represented by an audionode.
... 156 audionode api, audionode, interface, reference, web audio api the audionode interface is a generic interface for representing an audio processing module.
...And 16 more matches
cfx - Archive of obsolete content
-o, --overload-modules in early versions of the sdk, the sdk modules used by an add-on were themselves included in the add-on.
... the sdk modules now ship as part of firefox.
... from firefox 21 onwards, sdk add-ons built with sdk 1.14 or higher will use the sdk modules that are built into firefox, even if the add-on includes its own copies of the sdk modules.
...And 15 more matches
SDK API Lifecycle - Archive of obsolete content
it has two main components: a stability index that defines how stable each module is a deprecation process that defines when and how stable sdk apis can be changed or removed from future versions of the sdk while giving developers enough time to update their code.
...the sdk uses only four of the six values defined by node.js: experimental the module is not yet stabilized.
...if we do have to make backwards-incompatible changes, we will not guarantee the module will go through the formal deprecation process.
...And 14 more matches
Chrome Authority - Archive of obsolete content
using chrome authority the most powerful low-level modules are run with "chrome privileges", which gives them access to the infamous components object, which grants unfettered access to the host system.
... from this, the module can do pretty much anything the browser is capable of.
... to obtain these privileges, the module must declare its intent with a statement like the following: var {cc, ci} = require("chrome"); the "chrome" built-in pseudo module is provided by the "toolkit/loader" module.
...And 14 more matches
Gecko Logging
logging framework declaring a log module lazylogmodule defers the creation the backing logmodule in a thread-safe manner and is the preferred method to declare a log module.
... multiple lazylogmodules with the same name can be declared, all will share the same backing logmodule.
... this makes it much simpler to share a log module across multiple translation units.
...And 14 more matches
Component Internals
in this diagram, the outer boundary is that of the module, the shared library in which a component is defined.
... a component in the xpcom framework when you build a component or module and compile it into a library, it must export a single method named nsgetmodule.
... this nsgetmodule function is the entry point for accessing the library.
...And 14 more matches
PKCS11 Implement
this document supplements the information in pkcs #11: cryptographic token interface standard, version 2.0 with guidelines for implementors of cryptographic modules who want their products to work with mozilla client software: how nss calls pkcs #11 functions.
...installing modules and informing the user of changes in the cryptographic modules settings.
...miscellaneous nss semantics that affect module implementation.
...And 13 more matches
Background audio processing using AudioWorklet - Web APIs
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.
... create module that defines a audio worklet processor class, based on audioworkletprocessor which takes audio from one or more incoming sources, performs its operation on the data, and outputs the resulting audio data.
...And 13 more matches
mach
mach itself is python 3 compliant, but modules used by mach likely are not python 3 compliant - so stick to python 2.7.
... how does mach fit into the modules system?
... mozilla operates with a modules governance system where there are different components with different owners.
...And 12 more matches
WebAssembly.instantiate() - JavaScript
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.
...And 12 more matches
XUL Migration Guide - Archive of obsolete content
next, we'll look at some of the main tasks involved in migrating: working with content scripts using the sdk's supported apis how to go beyond the supported apis when necessary, by: using third party modules using the sdk's low-level apis getting direct access to xpcom finally, we'll walk through a simple example.
...in order of complexity, the main options are: the sdk includes modules that implement some basic user interface components including buttons, dialogs, and context menu items.
... there is a collection of community-developed modules that includes various user interface components.
...And 11 more matches
Creating Event Targets - Archive of obsolete content
for example, you can listen to the tabs module's ready event or the panel object's show event.
...this is especially useful if you want to build your own modules, either to organize your add-on better or to enable other developers to reuse your code.
... if you use the sdk's event framework for your event targets, users of your module can listen for events using the sdk's standard event api.
...And 11 more matches
Unit Testing - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm and followed 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.
...to demonstrate how it works we'll write some unit tests for a simple base64 encoding module.
...And 11 more matches
XPJS Components Proposal - Archive of obsolete content
just as with native component modules each of these .js files will be expected to have the functions: nsregisterself nsgetfactory nsunregisterself (optional) nscanunload (optional) each .js file might implement one or more components.
... we will have one native module - called the xpjsmanager - which holds this system together.
...each .js file (let's call it a module) is started up and run in the context of a relatively 'raw' js global object.
...And 11 more matches
export - JavaScript
the export statement is used when creating javascript modules to export live bindings to functions, objects, or primitive values from the module so they can be used by other programs with the import statement.
... bindings that are exported can still be modified locally; when imported, although they can only be read by the importing module the value updates whenever it is updated by the exporting module.
... exported modules are in strict mode whether you declare them as such or not.
...And 11 more matches
An overview of NSS Internals
nss offers lots of functionality; we'll walk through the list of modules, design principles, and important relevant standards.
...(note that it's important to look at the number 11, as there are other pkcs standards with different numbers that define quite different topics.) a software or hardware module conforming to the pkcs#11 standard implements an interface of c calls, which allow querying the characteristics and offered services of the module.
... multiple elements of nss's own modules have been implemented with this interface, and nss makes use of this interface when talking to those modules.
...And 10 more matches
nsIErrorService
inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xpcom/error-service;1 method overview string geterrorstringbundle(in short errormodule); string geterrorstringbundlekey(in nsresult error); void registererrorstringbundle(in short errormodule, in string stringbundleurl); void registererrorstringbundlekey(in nsresult error, in string stringbundlekey); void unregistererrorstringbundle(in short errormodule); void unregistererrorstringbundlekey(in nsresult error);...
... methods geterrorstringbundle() retrieves a string bundle url for an error module.
... string geterrorstringbundle( in short errormodule ); parameters errormodule the module for which the string bundle is registered.
...And 10 more matches
jpm - Archive of obsolete content
installing jpm globally npm install jpm --global depending on your setup, you might need to run this as an administrator: sudo npm install jpm --global installing jpm locally if you do not wish to, or are unable to, install jpm globally, you may instead install it locally: cd $home && npm install jpm to run jpm from a terminal when installed locally, you must add the directory "$home/node_modules/.bin/" to your terminal's path first.
... add the following line to the end of the file $home/.profile to add it to your path permanently (as the file .profile is executed every time a new terminal is opened): export path="$home/node_modules/.bin/:$path" installing jpm from git alternatively, you can also get the latest version of jpm using git: git clone https://github.com/mozilla-jetpack/jpm.git cd jpm npm install npm link after installing jpm after installation, at the command prompt, type: jpm you should see a screen summarizing the available jpm commands.
... -o --overload path rather than use the sdk modules built into firefox, use the modules found at path.
...And 9 more matches
Source code directories overview - Archive of obsolete content
at the second level is the name of the module (e.g.
...if files can be grouped into submodules, they are usually put in their own third level directory and given a unique name (e.g.
...thus, the scheme is recursive; it can apply to submodules, sub-submodules and so on.
...And 9 more matches
Examples
components.utils.import("resource://gre/modules/osfile.jsm") let path = os.path.join(os.constants.path.tmpdir, "file.txt"); let promise = os.file.exists(path); let newpromise = promise.then(function onfulfill(aexists) { if (aexists) { console.log("you have file.txt in your temporary directory."); } else { throw new error("you don't have file.txt in your temporary directory."); } }); // unexpected errors should always be reported at the end of a promise chain.
... components.utils.import("resource://gre/modules/osfile.jsm") let path = os.path.join(os.constants.path.tmpdir, "file.txt"); let promise = os.file.exists(path); let newpromise = promise.then(function onfulfill(aexists) { if (aexists) { console.log("you have file.txt in your temporary directory."); } else { console.log("you don't have file.txt in your temporary directory."); } }); // unexpected errors should always be reported at the end of a promise chain.
... using a promise returned by a function (compact) the same code as the previous example is usually written with a more compact syntax: components.utils.import("resource://gre/modules/osfile.jsm") let path = os.path.join(os.constants.path.tmpdir, "file.txt"); os.file.exists(path).then(exists => { console.log(exists ?
...And 9 more matches
NSS_Initialize
syntax secstatus nss_initialize(const char *configdir, const char *certprefix, const char *keyprefix, const char *secmodname, pruint32 flags); parameters nss_initialize has five parameters: configdir [in] the directory where the certificate, key, and module databases live.
...secmodname [in] name of the security module database, usually "secmod.db".
...nss_init_nomoddb - don't open the security module db, just initialize the pkcs #11 module.
...And 9 more matches
Tutorials
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.
... 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.
...this module covers basic table markup, along with more complex features such as implementing captions and summaries.
...And 9 more matches
WebAssembly
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.
... compiling a new c/c++ module to webassembly when you’ve written code in c/c++, you can then compile it into .wasm using a tool like emscripten.
... compiling an existing c module to 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.
...And 9 more matches
Common causes of memory leaks in extensions - Extensions
a similar problem is holding onto window objects or dom nodes (such as window.document) for too long by storing them in a javascript module.
... for example: var windows = []; function injavascriptcodemodule(window) { // forgetting or failing to pop the window again windows.push(window); } both of these cases can happen if you forget to declare local variables with var or let, which means they end up belonging to the global scope.
...if you put a reference to anything within this compartment into a long-lived window object (such as browser.xul), javascript module or xpcom component, the bootstrap.js compartment will become a zombie.
...And 8 more matches
XPCOM changes in Gecko 2.0
chrome.manifest: # the {classid} here must match the classid in mycomponent.js component {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} components/mycomponent.js contract @foobar/mycomponent;1 {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} category profile-after-change mycomponent @foobar/mycomponent;1 the javascript code no longer exports a nsgetmodule() function.
...for example, in your component's javascript code : components.utils.import("resource://gre/modules/xpcomutils.jsm"); function mycomponent() { } mycomponent.prototype = { // this must match whatever is in chrome.manifest!
...* xpcomutils.generatensgetmodule was introduced in mozilla 1.9 (firefox 3.0).
...And 8 more matches
Starting WebLock
we have already created a module that implements most of the generic component functionality (e.g.
... getting access to the category manager two fields in the nsmodulecomponentinfo structure introduced in the last section are addresses for registration and unregistration callbacks.
... the first callback is called when the component's nsimodule::registerself method is called.
...And 8 more matches
dev/panel - Archive of obsolete content
this module is new in firefox 34.
...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.
... you can set the constructor up manually if you like, or you can use the add-on sdk core/heritage module to simplify the mechanics of inheriting from panel.
...And 7 more matches
JavaScript Daemons Management - Archive of obsolete content
ript timers (both setinterval and settimeout) optimisation (avoiding closures) modularity the code the code of this framework is split into three files: daemon.js (the core) daemon-safe.js (an extension of the core which adds a replacement of setinterval with a recursive invocation of settimeout) daemon-methods.js (a wide and highly scalable collection of methods) the only independent module is daemon.js: both the daemon-safe.js module and the daemon-methods.js module require daemon.js to work.
...l in order to make this framework compatible with internet explorer (which doesn't support sending additional parameters to timers' callback function, neither with settimeout() or setinterval()) we included the ie-specific compatibility code (commented code), which enables the html5 standard parameters' passage functionality in that browser for both timers (polyfill), at the end of the daemon.js module.
... daemon.js what follows is the module that declares the daemon constructor (the core of this framework).
...And 7 more matches
Getting started with React - Learn web development
use cases unlike the other frameworks covered in this module, react does not enforce strict rules around code conventions or file organization.
...its initial file structure looks like this: moz-todo-react ├── readme.md ├── node_modules ├── package.json ├── package-lock.json ├── .gitignore ├── public │ ├── favicon.ico │ ├── index.html │ └── manifest.json └── src ├── app.css ├── app.js ├── app.test.js ├── index.css ├── index.js ├── logo.svg └── serviceworker.js the src directory is where we'll spend ...
... exploring our first react component — <app/> in react, a component is a reusable module that renders a part of our app.
...And 7 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.
... usage to import webrequest, use code like: let {webrequest} = cu.import("resource://gre/modules/webrequest.jsm", {}); the webrequest object has the following properties, each of which corresponds to a specific stage in executing a web request: onbeforerequest onbeforesendheaders onsendheaders onheadersreceived onresponsestarted oncompleted each of these objects defines two functions: addlistener(callback, filter, opt_extrainfospec) removelistener(callback) adding listeners...
...And 7 more matches
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
for module scripts, if the async attribute is present then the scripts and all their dependencies will be executed in the defer queue, therefore they will get fetched in parallel to parsing and evaluated as soon as they are available.
... the defer attribute has no effect on module scripts — they defer by default.
... nomodule this boolean attribute is set to indicate that the script should not be executed in browsers that support es2015 modules — in effect, this can be used to serve fallback scripts to older browsers that do not support modular javascript code.
...And 7 more matches
WebAssembly - JavaScript
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).
...And 7 more matches
WebAssembly Concepts - WebAssembly
webassembly modules can be imported into a web (or node.js) app, exposing webassembly functions for use via javascript.
...in fact, the basic unit of webassembly code is called a module and webassembly modules are symmetric in many ways to es2015 modules.
... module: represents a webassembly binary that has been compiled by the browser into executable machine code.
...And 7 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.
... 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.
...And 7 more matches
Two Types of Scripts - Archive of obsolete content
your add-on is implemented as a collection of one or more commonjs modules.
... each module is supplied as a script stored under the lib directory under your add-on's root directory.
... minimally you'll have a single module implemented by a script called "main.js", but you can include additional modules in lib, and import them using the require() function.
...And 6 more matches
cfx to jpm - Archive of obsolete content
for example: addons.mozilla.org uses it to distinguish between new add-ons and updates to existing add-ons, and the simple-storage module uses it to figure out which stored data belongs to which add-on.
... loading modules the jpm tool uses the same logic as node.js to determine how to resolve the argument to require().
... requiring local modules suppose your add-on is structured into separate modules: my-addon lib main.js utils.js when you want to use the "utils" module in "main.js", you should use a path relative to "main.js", and prefix the path with "./" to indicate that it's a relative path: var utils = require("./utils"); however, with cfx you are also allowed to omit the "./": var utils = require("utils"); // this will not work with jpm!
...And 6 more matches
File I/O - Archive of obsolete content
creating an nsifile object components.utils.import("resource://gre/modules/fileutils.jsm"); var file = new fileutils.file("/home"); or the same without using fileutils.jsm: var file = components.classes["@mozilla.org/file/local;1"].
... getting files in special directories components.utils.import("resource://gre/modules/fileutils.jsm"); // get the "data.txt" file in the profile directory var file = fileutils.getfile("profd", ["data.txt"]); or the same without using fileutils.jsm: // get profile directory.
...however, you can enumerate available drives using the following code: components.utils.import("resource://gre/modules/fileutils.jsm"); var root = new fileutils.file("\\\\."); var drivesenum = root.directoryentries, drives = []; while (drivesenum.hasmoreelements()) { drives.push(drivesenum.getnext().
...And 6 more matches
Finding window handles - Archive of obsolete content
recall that nsibasewindow -> nativehandle returns the following in the different operating systems: windows - hwnd mac os x - nswindow* linux - gdkwindow* (it will be gdkwindow* no matter what desktop/window manager) is in use, for explanation why 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.nsiwebnavigation) .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.dll'); /* http://msdn.microsoft.com/en-us/library/ms633539%28v=vs.85%29.aspx * bool winapi setforegroundwindow( * __in_ hwnd hwnd * ); */ var setforegroundwindow = user32.declare('setforegroundwindow', ctypes.winapi_abi, ctypes.bool, // return bool ctypes.voidptr_t // hwnd ); var hwnd = ctypes.voidptr_t(ctypes.uint64(hwndstring)); var rez_setforegroundwindow = setforegroundwindow(hwnd); console.log('rez_setforegroundwindow:', rez_setforegroundwindow, rez_setforegroundwindow.tostring()); user32.c...
...lose(); mac os x objective-c 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.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var nswindowstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var objc = ctypes.open(ctypes.libraryname('objc')); // types let id ...
...And 6 more matches
Promises - Archive of obsolete content
a task example like the following: components.utils.import("resource://gre/modules/task.jsm"); task.spawn(function* () { var response = yield request("login", { username: user, password: password }); if (response.messages) { try { yield publish({ username: user, messages: response.messages }); } catch (e) { self.reporterror("publication failed", e); } } }); can be converted to a pure promise-based equivalent...
... this interface replaces the previous, complicated xpcom nsifile and streams apis, and their related javascript helper modules.
... representative example usage components.utils.import("resource://gre/modules/osfile.jsm"); task.spawn(function* () { // retrieve file metadata to check modification time.
...And 6 more matches
Using Dependent Libraries In Extension Components - Archive of obsolete content
srcdir = @srcdir@ topsrcdir = @top_srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = bsmedberg library_name = bsmedberg_stub is_component = 1 force_shared_lib = 1 requires = \ xpcom \ string \ $(null) cppsrcs = bdsstubloader.cpp extra_dso_ldopts += \ $(dist)/lib/$(lib_prefix)xpcomglue_s.$(lib_suffix) \ $(xpcom_frozen_ldopts) \ $(nspr_libs) \ $(null) include $(topsrcdir)/config/rules.mk defines += -dmoz_dll_prefix=\"$(dll_prefix)\" extensions/stub/bdsstubloade...
...r.cpp // copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> #include "nscore.h" #include "nsmodule.h" #include "prlink.h" #include "nsilocalfile.h" #include "nsstringapi.h" #include "nscomptr.h" static char const *const kdependentlibraries[] = { // dependent1.dll on windows, libdependent1.so on linux moz_dll_prefix "dependent1" moz_dll_suffix, moz_dll_prefix "dependent2" moz_dll_suffix, nsnull // note: if the dependent libs themselves depend on other libs, the subdependencies // should be listed first.
... }; // component.dll on windows, libcomponent.so on linux static char krealcomponent[] = moz_dll_prefix "component" moz_dll_suffix; nsresult nsgetmodule(nsicomponentmanager* acompmgr, nsifile* alocation, nsimodule* *aresult) { nsresult rv; // this is not the real component.
...And 6 more matches
JavaScript crypto - Archive of obsolete content
*/); loading pkcs #11 modules long deletemodule(domstring modulename); long addmodule(domstring modulename, domstring libraryfullpath, long cryptomechanismflags, long cipherflags); loads or removes a new pkcs #11 module.
... in the add case, the module will be placed in the nss secmod.db database and will be loaded automatically on application restart.
... in the delete case, the module is removed from the nss secmod.db.
...And 6 more matches
Learn to style HTML using CSS - Learn web development
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 modules javascript, and how to use it to add dynamic functionality to 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.
...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 6 more matches
sslerr.html
sec_internal_only -8153 internal-only module.
... sec_error_no_module -8128 security library: no security module can perform the requested operation.
... sec_error_cannot_move_sensitive_key -8087 "a sensitive key cannot be moved to the slot where it is needed." sec_error_js_invalid_module_name -8086 invalid module name.
...And 6 more matches
NSS tools : signtool
-m lists the pkcs #11 modules available to signtool, including smart cards.
... modules same as -m option.
... using the -m option to list smart cards you can use the -m option to list the pkcs #11 modules, including smart cards, that are available to signtool: signtool -d "c:\netscape\users\jsmith" -m using certificate directory: c:\netscape\users\username listing of pkcs11 modules ----------------------------------------------- 1.
...And 6 more matches
Setting up the Gecko SDK
when you extract the sdk, it should have the layout seen below: layout of the extracted sdk the directories represent different modules in the sdk.
... each module directory is divided into three subdirectories: module subdirectories the bin directory contains static libraries, dynamic libraries, and in some cases tools that may be useful in development.
... the idl directory contains the public idl files exported by the module.
...And 6 more matches
Components.utils.import
see using javascript code modules for more details.
... note: prior to gecko 2.0, javascript code modules could only be loaded using file: or resource: urls.
... gecko 2.0 adds support for loading modules from chrome: urls, even those inside jar archives.
...And 6 more matches
Web Audio API - Web APIs
d and start building things with the advance tutorial and others as a guide (the above linked tutorial covers scheduling notes, creating bespoke oscillators and envelopes, as well as an lfo among other things.) if you aren't familiar with the programming basics, you might want to consult some beginner's javascript tutorials first and then come back here — see our beginner's javascript learning module for a great place to begin.
... audiocontext the audiocontext interface represents an audio-processing graph built from audio modules linked together, each represented by an audionode.
... audionode the audionode interface represents an audio-processing module like an audio source (e.g.
...And 6 more matches
Content Scripts - Archive of obsolete content
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 strin...
...its "main.js" attaches a content script to the current tab using the tabs module.
...the content script simply replaces the content of the page: // main.js var tabs = require("sdk/tabs"); var contentscriptstring = 'document.body.innerhtml = "<h1>this page has been eaten</h1>";' tabs.activetab.attach({ contentscript: contentscriptstring }); the following high-level sdk modules can use content scripts to modify web pages: page-mod: enables you to attach content scripts to web pages that match a specific url pattern.
...And 5 more matches
simple-storage - Archive of obsolete content
this module works similarly to dom storage on the web, except that it's only available for add-ons.
... usage the simple storage module exports an object called storage that is persistent and scoped to your add-on.
... be careful to set properties on the storage object and not the module itself, as demonstrated below: // this is not good!
...And 5 more matches
platform/xpcom - Archive of obsolete content
usage the xpcom module makes it simpler to perform three main tasks: implement xpcom object interfaces implement and register xpcom factories implement and register xpcom services if all you need to do is use xpcom objects that someone else has implemented, then you don't need to use this module.
... implementing xpcom interfaces this module exports a class called unknown which implements the fundamental xpcom interface nsisupports.
... by subclassing unknown, either using standard javascript inheritance or using the sdk's heritage module, you can provide your own implementations of xpcom interfaces.
...And 5 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
step 1: use services.jsm if you load one of mozilla's internal jsm files, for example services.jsm, you'll do so via privileged javascript code like this: components.utils.import("resource://gre/modules/services.jsm"); from here on out, it is assumed you've imported services.jsm somewhere at the top of whatever file you're in and will be using it in all code examples.
... how to get and load the data of of your add-on's files using the add-on manager api: // this is the old way of getting one of your files const myaddonid = ...; // just store a constant with your id components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid(myaddonid,function(addon) { var file = services.io.newuri("resource://myaddon/filename.ext",null,null) .queryinterface(components.interfaces.nsifileurl) .file; var stream = components.classes["@mozilla.org/network/file-input-stream;1"] .createinstance(components.in...
...for packed extensions (the default), you can either load a module similar to firebug’s prefloader.js or load this workaround module (n.b.
...And 5 more matches
Search Extension Tutorial (Draft) - Archive of obsolete content
the following example bootstrap.js file illustrates the method: const { classes: cc, interfaces: ci, utils: cu, results: cr } = components; // import the services module.
... cu.import("resource://gre/modules/services.jsm"); // keep track of whether this is the first run.
...an example bootstrap.js file illustrating the simple method follows: const { classes: cc, interfaces: ci, utils: cu, results: cr } = components; // import the services module.
...And 5 more matches
A bird's-eye view of the Mozilla framework
the mozilla xptoolkit module provides a similar set of facilities for building cross-platform ui controls implemented as xml user interface language (xul) packages.
... core services modules such as the nglayout engine comprise the core application services available to other core modules, and xul packages core application modules are implemented as a set of one or more xpcom (cross-platform com) objects.
...mozilla architectural modules are comprised of groups of related xpcom objects that provide services to and access services from each other through dynamically queryable interfaces.
...And 5 more matches
Localization and Plurals
y 0.2: use pluralform.numforms() to get the number of forms instead of figuring out locally to better support future rules - requires build from 2007/01/27 or later 0.3: generate a list of what numbers fall into which plural form to minimize the sample output to at most 3 of each form developing with pluralform the functionality for getting the correct plural forms is provided by a javascript module, pluralform.jsm.
... this module provides a couple methods for localizing to the browser's current locale as well as getting methods to localize to a desired plural rule.
... loading pluralform.jsm loading the pluralform module from javascript is simple with components.utils.import.
...And 5 more matches
NSS API Guidelines
specifically, this library provides nss_init() for establishing default certificate, key, module databases, and initializing a default random number generator.
... above high cert, high key lib/nss nss.h pk11wrap provides access to pkcs #11 modules, through a unified interface.
... the pkcs11wrap library provides functions for selecting/finding pkcs #11 modules and slots.
...And 5 more matches
nss tech note2
using the pkcs #11 module logger nss technical note: 2 modes of operation extracting output from log files the logger displays all activity between nss and a specified pkcs #11 module.
... it works by inserting a special set of entry points between nss and the module.
... to enable the module logger, you must set the environment variable nss_debug_pkcs11_module to the name of the target module.
...And 5 more matches
Components.utils.unload
components.utils.unload was introduced in firefox 7 and is used to unload javascript code modules.
... this can be particularly handy with restartless (boostrapped) extensions, so that you can unload an old version of a code module when a new version of your add-on is installed.
... once this method has been called, references to the module will continue to work but any subsequent import of the module will reload it and give a new reference.
...And 5 more matches
Standard OS Libraries
components.utils.import("resource://gre/modules/ctypes.jsm"); var lib = ctypes.open("user32.dll"); /* note: if you go to getcursorpos page on msdn, it says first argument is of structure point, so lets create that structure, * the link here shows that that x and y are type long which is ctypes.long */ // https://msdn.microsoft.com/en-us/library/windows/desktop/dd162805%28v=vs.85%29.aspx var point = new ctypes.structtype("tagpoint", [ { "...
... components.utils.import('resource://gre/modules/ctypes.jsm'); var gdk = ctypes.open('libgdk-x11-2.0.so.0'); // types var gint = ctypes.int; var gdkdevice = ctypes.structtype('gdkdevice'); var gdkmodifiertype = ctypes.int; var gdkwindow = ctypes.structtype('gdkwindow'); var void = ctypes.void_t; // https://developer.gnome.org/gdk3/stable/gdk3-windows.html#gdk-get-default-root-window var gdk_get_default_root_window = gdk.declare('gdk_get_def...
....tostring()); console.info('y:', y, y.tostring()); console.info('mask:', mask, mask.tostring()); gdk.close(); example: gdk_window_get_device_position this example works only for gdk3, as the function gdk_window_get_device_position was not available in gdk2, for gdk2 equivalent see above warning this example does not work yet it needs some bug fixing components.utils.import('resource://gre/modules/ctypes.jsm'); var gdk = ctypes.open('libgdk-x11-2.0.so.0'); var gdk3 = ctypes.open('libgdk-3.so.0'); // types var gint = ctypes.int; var gdkdevice = ctypes.structtype('gdkdevice'); var gdkdevicemanager = ctypes.structtype('gdkdevicemanager'); var gdkdisplay = ctypes.structtype('gdkdisplay'); var gdkmodifiertype = ctypes.int; var gdkwindow = ctypes.structtype('gdkwindow'); // https://developer.
...And 5 more matches
Using the CSS Painting API - Web APIs
using the paint worklet to use the paint worklet, we need to register it using addmodule() and include it in our css, ensuring the css selector matches a dom node in our html registering the worklet the setup and design of our paint worklet took place in the external script shown above.
... css.paintworklet.addmodule('nameofpaintworkletfile.js'); this can be done using the paint worklet's addmodule() method in a <script> within the main html or in an external javascript file linked to from the document.
... css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/01partone/header-highlight.js'); reference the paint worklet in css once we have a registered paint worklet, we can use it in css.
...And 5 more matches
<color> - CSS: Cascading Style Sheets
red #ff0000 purple #800080 fuchsia #ff00ff green #008000 lime #00ff00 olive #808000 yellow #ffff00 navy #000080 blue #0000ff teal #008080 aqua #00ffff css level 2 (revision 1) orange #ffa500 css color module level 3 aliceblue #f0f8ff antiquewhite #faebd7 aquamarine #7fffd4 azure #f0ffff beige #f5f5dc bisque #ffe4c4 blanchedalmond #ffebcd blueviolet #8a2be2 brown #a52a2a burlywood #deb887 cadetblue #5f9ea0 chartreuse #7fff...
...slategrey #708090 snow #fffafa springgreen #00ff7f steelblue #4682b4 tan #d2b48c thistle #d8bfd8 tomato #ff6347 turquoise #40e0d0 violet #ee82ee wheat #f5deb3 whitesmoke #f5f5f5 yellowgreen #9acd32 css color module level 4 rebeccapurple #663399 transparent keyword the transparent keyword represents a fully transparent color.
... functional notation: hsl[a](h, s, l[, a]) h (hue) is an <angle> of the color circle given in degs, rads, grads, or turns in css color module level 4.
...And 5 more matches
Getting started (cfx) - Archive of obsolete content
it uses two sdk modules: the action button module, which enables you to add buttons to the browser, and the tabs module, which enables you to perform basic operations with tabs.
... the add-on code itself uses two sdk modules, action button and tabs.
... advanced techniques overriding the built-in modules the sdk modules you use to implement your add-on are built into firefox.
...And 4 more matches
Localization - Archive of obsolete content
import the l10n module, and assign its get function to "_" (underscore).
... note that because you can't require() modules in content scripts, you can't yet reference localized strings from content scripts.
... plurals the l10n module supports plural forms.
...And 4 more matches
JavaScript — Dynamic client-side scripting - Learn web development
start by working through the following modules: getting started with the web introduction to html introduction to css having previous experience with other programming languages might also help.
... after getting familiar with the basics of javascript, you should be in a position to learn about more advanced topics, for example: javascript in depth, as taught in our javascript guide web apis modules this topic contains the following modules, in a suggested order for working through them.
... javascript first steps 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.
...And 4 more matches
Server-side website programming - Learn web development
the dynamic websites – server-side programming topic is a series of modules that show how to create dynamic websites; websites that deliver customised information in response to http requests.
... the modules provide a general introduction to server-side programming.
... with that basic understanding, you'll be ready to work your way through the modules in this section.
...And 4 more matches
Package management basics - Learn web development
writing the code to include the package(s) in your application (this tends to be done using javascript modules, another subject that is worth reading up on and understanding).
...many projects will use npm, and we’ll stick to this in our examples throughout the rest of the module.
...parcel has spotted that you need the module, searched for it in the npmjs.com package registry, and installed it locally for us, automatically.
...And 4 more matches
Installing headers using EXPORTS
this is accomplished by setting make variables telling the build system which module the headers are for (since headers are organized by module under <tt>dist/include</tt>), and which headers need to be created from idl files by xpidl.
... for all <tt>makefile.in</tt>s which export public headers, you should set module to the module name where the files should be copied to in <tt>dist/include</tt>.
...they will be copied to <tt>dist/include/$(module)</tt>.
...And 4 more matches
PromiseWorker.jsm
promiseworker module consists of two javascript files, promiseworker.jsm and promiseworker.js.
... promiseworker.jsm path: resource://gre/modules/promiseworker.jsm a javascript code module used by the main thread to create a worker thread and communicate with it.
... promiseworker.js path: resource://gre/modules/workers/promiseworker.js a javascript file used by the worker thread, which is created by promiseworker.jsm in main thread, to communicate with the main thread.
...And 4 more matches
NSS 3.21 release notes
il now supports a --rename option to change a nickname (bug 1142209) tls extended master secret extension (rfc 7627) is supported (bug 1117022) new info functions added for use during mid-handshake callbacks (bug 1084669) new functions in nss.h nss_optionset - sets nss global options nss_optionget - gets the current value of nss global options in secmod.h secmod_createmoduleex - create a new secmodmodule structure from module name string, module parameters string, nss specific parameters string, and nss configuration parameter string.
... the module represented by the module structure is not loaded.
... the difference with secmod_createmodule is the new function handles nss configuration parameter strings.
...And 4 more matches
NSS tools : certutil
for information on the security module database management, see the modutil manpage.
... -u list all available modules or print a single named module.
... creating new security databases certificates, keys, and security modules related to managing certificates are stored in three related databases: * cert8.db or cert9.db * key3.db or key4.db * secmod.db or pkcs11.txt these databases must be created before certificates or keys can be generated.
...And 4 more matches
certutil
for information security module database management, see the modutil manpages.
... -u list all available modules or print a single named module.
... creating new security databases certificates, keys, and security modules related to managing certificates are stored in three related databases: o cert8.db or cert9.db o key3.db or key4.db o secmod.db or pkcs11.txt these databases must be created before certificates or keys can be generated.
...And 4 more matches
How to build an XPCOM component in JavaScript
if you are looking for add-on sdk solution for xpcom javascript components then check out platform/xpcom module first.
...depth = @depth@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk # module specifies where header files from this makefile are installed # use dom if your component implements a dom api module = dom # name of the typelib xpidl_module = dom_apps # set to 1 if the module should be part of the gecko runtime common to all applications gre_module = 1 # the idl sources xpidlsrcs = \ helloworld.idl \ $(null) include $(topsrcdir)/config/rules.mk xpidl_flags += \ -i$(top...
...the imported library contains functions for generating the module, factory, and the nsgetmodule and queryinterface functions for you.
...And 4 more matches
NS_InitXPCOM3
« xpcom api reference summary the ns_initxpcom3 function initiates use of xpcom in the calling process with support for statically defined xpcom modules.
... #include "nsxpcom.h" nsresult ns_initxpcom3( nsiservicemanager** aresult, nsifile* abindirectory, nsidirectoryserviceprovider* aappfilelocationprovider, nsstaticmoduleinfo const* astaticmodules, pruint32 astaticmodulecount ); parameters aresult [out] the resulting xpcom service manager.
... astaticmodules [in] an array of nsstaticmoduleinfo objects.
...And 4 more matches
CSS: Cascading Style Sheets
WebCSS
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 effective to develop and release recommendations separately per module.
... get started tutorials our css learning area features multiple modules that teach css from the ground up — no previous knowledge required.
...this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html.
...And 4 more matches
Compiling from Rust to WebAssembly - WebAssembly
in this case, we're importing everything in the wasm_bindgen::prelude module.
... runs wasm-bindgen on that webassembly, generating a javascript file that wraps up that webassembly file into a module npm can understand.
...create webpack.config.js and put the following in it: const path = require('path'); module.exports = { entry: "./index.js", output: { path: path.resolve(__dirname, "dist"), filename: "index.js", }, mode: "development" }; now we need an html file; create index.html and give it the following contents: <!doctype html> <html> <head> <meta charset="utf-8"> <title>hello-wasm example</title> </head> <body> <script src="./index.js"></script> </body> </html...
...And 4 more matches
page-mod - Archive of obsolete content
if you supply the scripts as separate files in the "data" directory, you specify them using with a url, typically constructed using the url() method of the self module's data object: var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: data.url("my-script.js") }); var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: [data.url("jquery-1.7.min.js"), data.url("m...
... to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module.
... var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: /.*developer.*/, contentscript: 'window.alert("matched!");' }); to specify multiple patterns, pass an array of match patterns: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: ["*.foo.org", "*.bar.com"], contentscript: 'window.alert("matched!");' }); see the match-pattern module for a detailed description of match pattern syntax.
...And 3 more matches
tabs - Archive of obsolete content
tabs.on('ready', function(tab) { console.log('tab is loaded', tab.title, tab.url); }); access tabs the module itself can be used as a list of all opened tabs across all windows.
... tabs hosted by private browser windows won't be seen if you enumerate the tabs module itself, and you won't receive any events for them.
... to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module.
...And 3 more matches
windows - Archive of obsolete content
usage the windows module provides basic functions for working with browser windows.
... with this module, you can: enumerate the currently opened browser windows open new browser windows listen for common window events such as open and close private windows if your add-on has not opted into private browsing, then you won't see any private browser windows.
... to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module.
...And 3 more matches
Tutorials - Archive of obsolete 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.
...And 3 more matches
Index of archived content - Archive of obsolete content
omain content scripts interacting with page scripts loading content scripts reddit example port self contributor's guide classes and inheritance content processes getting started modules private properties firefox compatibility module structure of the sdk porting the library detector program id sdk api lifecycle sdk and xul comparison testing the add-on sdk two types of scripts working with events ...
... adding a button to the toolbar annotator creating annotations displaying annotations implementing the widget overview storing annotations chrome authority 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 notifications autocomplete bookmarks boxes canvas code snippets cookies customizing the download progress bar delayed execution dialogs and prompts downloading files drag & drop embedding svg examples and demos from articles file i/o finding window handles forms related code snippets ...
...And 3 more matches
Mac stub installer - Archive of obsolete content
alternative to steps 3 and 4 copy the "installer modules" folder from the "mozilla installer" folder into the "macbuild" folder that contains the build debug or non-debug installer binary next to miw.mcp.
... adding a package involves a few steps: add a section named for your <component> to the packages-mac manifest that describes which files from dist belong to which module.
...then add the componentx into the appropriate setup types so the installer module installs when users select the setup types you choose it to be in.
...And 3 more matches
The First Install Problem - Archive of obsolete content
for mozilla-based browsers, this system would be on a per-module basis, and instead of a uuid, we'll use a uri nomenclature that gives us the desired uniqueness.
...if the hkey_local_machine\software\mozillaplugins key doesn't exist, create it, and write the vendor-determined plid for each module that the vendor wishes to install.
... "path" -- string value -- this would be the absolute path to the plugin module.
...And 3 more matches
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
rss does not have any facilites for including this information in an <item>, so the rss slash module exists to fill in this gap.
... an example using the most popular element of the rss slash module is shown below: <?xml version="1.0"> <rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" > <channel> <title>example</title> <description>an rss example with slash</description> <lastbuilddate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate> <link>http://www.example.com</link> <item> <title>review of sin city</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid> <pubdate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate></pubdate> <link>http://www.example.com/blog/2005/05/15/114</link> <slash:comments>43</slash:comments> </item> ...
...tle> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/112</guid> <pubdate>sun, 15 may 2005 08:14:11 -0500</lastbuilddate></pubdate> <link>http://www.example.com/blog/2005/05/15/112</link> <slash:comments>118</slash:comments> </item> </channel> </rss> the <slash:comments> element is it reason that the rss slash module is popular.
...And 3 more matches
CSS building blocks - Learn web development
this module carries on where css first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper.
... this module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more.
... get started prerequisites before starting this module, you should have: basic familiarity with using computers, and using the web passively (i.e.
...And 3 more matches
What is CSS? - Learn web development
in the introduction to html module we covered what html is, and how it is used to mark up documents.
... css modules as there are so many things that you could style using css, the language is broken down into modules.
... you'll see reference to these modules as you explore mdn and many of the documentation pages are organized around a particular module.
...And 3 more matches
Structuring the web with HTML - Learn web development
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 are parts of our getting started with the web complete beginner's module.
... it is recommended that you work through getting started with the web before attempting this topic, however, it isn't absolutely necessary; much of what is covered in the html basics article is also covered in our introduction to html module, albeit in a lot more detail.
...r your text size and fonts used, add borders and drop shadows, layout your page with multiple columns, add animations and other visual effects.) javascript, and how to use it to add dynamic functionality to web pages (for example find your location and plot it on a map, make ui elements appear/disappear when you toggle a button, save users' data locally on their computers, and much much more.) modules this topic contains the following modules, in a suggested order for working through them.
...And 3 more matches
Asynchronous JavaScript - Learn web development
in this module we take a look at 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.
... 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.
... if you are not familiar with the concept of asynchronous programming, you should definitely start with the general asynchronous programming concepts article in this module.
...And 3 more matches
Introduction to client-side frameworks - Learn web development
as you read through this module, we will be working with that colloquial understanding.
...if the curly braces and v- attributes here are unfamiliar to you, that's okay; you’ll learn about vue-specific syntax later on in the module.
... tooling because each of the frameworks in this module have a large, active community, each framework's ecosystem provides tooling that improves the developer experience.
...And 3 more matches
Framework main features - Learn web development
domain-specific languages all of the frameworks discussed in this module are powered by javascript, and all allow you to use domain-specific languages (dsls) in order to build your applications.
...with the addition of some helper modules, you can style your framework apps in sass or less, or transpile your css stylesheets with postcss.
...components tend to import components into other components using the standard javascript module syntax, or at least something similar.
...And 3 more matches
Working with Svelte stores - Learn web development
sometimes, your app state will need to be accessed by multiple components that are not hierarchically related, or by a regular javascript module.
... svelte provides functions for creating readable, writable, and derived stores in the svelte/store module.
...svelte provides a whole module to define transitions and animations so we can make our user interfaces more appealing.
...And 3 more matches
Deploying our app - Learn web development
note: cache busting is a new term that we haven't met before in the module.
...also see our cross browser testing module for a bunch of useful testing information remember also that tests are not limited to javascript; tests can be run against the rendered dom, user interactions, css, and even how a page looks.
...to do anything else would be beyond the scope of this module — testing is a huge subject that really requires its own separate module.
...And 3 more matches
Mozilla accessibility architecture
intro this document is for people who wish to understand the architecture of mozilla's accessibility api module, which provides support for platform accessibility apis.
...accessibility api module directory structure general rules for the directory structure: interfaces, both internally-used cross-platform and toolkit-specific interfaces exist in accessible/public.
...accessibility cache the accessibility module maintains a cache implemented as a series of hash tables -- one per document.
...And 3 more matches
Logging
you can select events to be logged by module or level.
... a module is a user-defined class of log events.
...you can combine module and level criteria to get highly selective logging.
...And 3 more matches
JSS
MozillaProjectsNSSJSS
nss is the cryptographic module where all cryptographic operations are performed.
...when nss is put in fips mode, jss ensures fips compliance by ensuring that all cryptographic operations are performed by the nss cryptographic module.
... java provides a jce provider called sunpkcs11 (see java pkcs#11 reference guide.) sunpkcs11 can be configured to use the nss module as the crytographic provider.
...And 3 more matches
sslfnc.html
syntax #include "nss.h" secstatus nss_init(char *configdir); parameter this function has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside.
... syntax #include "nss.h" secstatus nss_initreadwrite(char *configdir); parameter this function has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside.
... description nss_nodb_init opens only the temporary database and the internal pkcs #112 module.
...And 3 more matches
An Overview of XPCOM
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.
...when two or more related components are grouped together in a binary library, the library is referred to as a module.
... performance when code is modularized, modules that are not necessary right away can be "lazy loaded", or not loaded at all, which can improve the performance of your application.
...And 3 more matches
Troubleshooting XPCOM components registration
set nspr_log_modules=nsnativemoduleloader:5 set nspr_log_file=c:\path\to\logfile "c:\program files\mozilla firefox\firefox.exe" examining this log for warning and errors may provide valuable clues why the component failed to load.
... registration failure if the module is loading correctly but doesn't register its components, try adding calls to components.utils.reporterror("debug me!"); in nsgetmodule() and other functions to try and find any errors.
... in dependency walker, open the options menu and select configure module search order....
...And 3 more matches
Mailnews and Mail code review requirements
rules for all patches affecting mailnews/ and mail/ wherever possible, significant patches in a certain area should be reviewed by one of the listed sub-module owner/reviewers.
... sub-module peers may only grant review in the listed sub-module.
... super-review is required in certain situations: significant architectural refactoring, any change to any api, all changes that affect how code modules interact.
...And 3 more matches
Using js-ctypes
before you can use js-ctypes, you need to import the ctypes.jsm code module.
... this is as simple as including the following line of code in the desired javascript scope: components.utils.import("resource://gre/modules/ctypes.jsm") loading a native library once you've imported the code module, you can call the ctypes.open() method to load each native library you wish to use.
... components.utils.import("resource://gre/modules/ctypes.jsm"); var lib = ctypes.open("c:\\windows\\system32\\user32.dll"); /* declare the signature of the function we are going to call */ var msgbox = lib.declare("messageboxw", ctypes.winapi_abi, ctypes.int32_t, ctypes.int32_t, ctypes.jschar.ptr, ctypes.jschar.ptr, ...
...And 3 more matches
Mozilla
creating a login manager storage module the login manager manages and stores user passwords.
... javascript code modules javascript code modules let multiple privileged javascript scopes share code.
... for example, a module could be used by firefox itself as well as by extensions, in order to avoid code duplication.
...And 3 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
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.
... there's movement towards adopting the use of hsl color values rather than rgb values is css color module 3 (see section 4.2.4), the rationale being that rgb is hardware-oriented, reflecting the use of crts, and that rgb is non-intuitive.
... note that in that same section of the css color module 3, there are algorigthms available to translate the hsl to rgb.
...And 3 more matches
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
in this article we will take a look at how flexbox fits in with all the other css modules.
... we’ll find out which specifications you also need to take notice of if you want to learn flexbox, and find out why flexbox is different to some other modules.
...css was therefore modularised, and the various css specifications are different modules that make up css today.
...And 3 more matches
CSS values and units - CSS: Cascading Style Sheets
it's background color), and is defined in the css color module.
... image the <image> value specifies all the different types of image that can be used in css, and is defined in the css image values and replaced content module.
... specifications specification status comment css values and units module level 4 editor's draft adds the vi, vb, ic, cap, lh and rlh units.
...And 3 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.
...And 3 more matches
WebAssembly.instantiateStreaming() - JavaScript
the webassembly.instantiatestreaming() function compiles and instantiates a webassembly module directly from a streamed underlying source.
... 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.
...there must be one matching property for each declared import of the compiled module or else a webassembly.linkerror is thrown.
...And 3 more matches
import.meta - JavaScript
the import.meta object exposes context-specific metadata to a javascript module.
... it contains information about the module, like the module's url.
... examples using import.meta given a module my-module.js <script type="module" src="my-module.js"></script> you can access meta information about the module using the import.meta object.
...And 3 more matches
core/promise - Archive of obsolete content
module exports promised function to do exactly that: const { promised } = require('sdk/core/promise'); function sum(x, y) { return x + y }; var asyncsum = promised(sum); var c = sum(a, b); var casync = asyncsum(aasync(), basync()); promised takes normal function and composes new promise-aware version of it.
...add-on sdk's promise module provides an api for doing that.
... defer module exports defer function, which is where all promises ultimately come from.
...And 2 more matches
package.json - Archive of obsolete content
it looks like this (assuming the add-on's directory is "my-addon"): { "name": "my-addon", "title": "my-addon", "id": "jid1-1fergv45e4f4f@jetpack", "description": "a basic add-on", "author": "", "license": "mpl-2.0", "version": "0.1" } if you are using the new jpm tool, you can easily access manifest data from package.json by requiring it like any other module: var title = require("./package.json").title; key reference package.json may contain the following keys: author the name of the package's original author; this could be the name of a person or a company.
... lib string representing the top-level module directory provided in this add-on.
... main a string representing the name of a program module that is located in one of the top-level module directories specified by lib.
...And 2 more matches
Displaying annotations - Archive of obsolete content
please see the ui module for replacements.
...if it finds any it binds functions to that element's mouseenter and mouseleave events to send messages to the main module, asking it to show or hide the annotation.
... like the selector, the matcher also listens for the window's unload event and on unload sends a detach message to the main module, so the add-on can clean it up.
...And 2 more matches
Overview - Archive of obsolete content
please see the ui module for replacements.
... meanwhile the main module contains the application logic and mediates interactions between the different sdk objects.
... we could represent the basic interactions between the main module and the various content scripts like this: user interface the annotator's main user interface consists of a widget and three panels.
...And 2 more matches
Storing annotations - Archive of obsolete content
please see the ui module for replacements.
... now we are able to create annotations, let's store them using the simple-storage module.
... first, import the simple-storage module with a declaration like: var simplestorage = require('sdk/simple-storage'); in the module scope, initialize an array which will contain the stored annotations: if (!simplestorage.storage.annotations) simplestorage.storage.annotations = []; now we'll add a function to the module scope which deals with a new annotation.
...And 2 more matches
Miscellaneous - Archive of obsolete content
var osstring = services.appinfo.os; detecting the host application and version // get the name of the application running us services.appinfo.name; // returns "firefox" for firefox services.appinfo.version; // returns "2.0.0.1" for firefox version 2.0.0.1 retrieving the version of an extension as specified in the extension's install.rdf components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("extension-guid@example.org", function(addon) { // this is an asynchronous callback function that might not be called immediately alert("my extension's version is " + addon.version); }); restarting firefox/thunderbird/seamonkey_2.0 for firefox 3 see onwizardfinish around here: http://mxr.mozilla.org/seamonkey/sou...pdates.js#1639 for firefox...
...put this code in the components/certsservice.js file: const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); const gobserver = cc['@mozilla.org/observer-service;1'].getservice(ci.nsiobserverservice); const gioservice = cc["@mozilla.org/network/io-service;1"].getservice(ci.nsiioservice); function certsservice() {} certsservice.prototype = { observe: function(asubject, atopic, adata) { switch(atopic) { case "app-startup": gobserver.addobserver(...
...th, end); certdb.addcertfrombase64(cert, certtrust, ""); }, classdescription: "certificate service", contractid: "@mozilla.org/certs-service;2", classid: components.id("{e9d2d37c-bf25-4e37-82a1-16b8fa089939}"), queryinterface: xpcomutils.generateqi([ci.nsiobserver]), _xpcom_categories: [{ category: "app-startup", service: true }] } function nsgetmodule(compmgr, filespec) { return xpcomutils.generatemodule([certsservice]); } you need to delete your existing profile, otherwise the xpcom service is not used.
...And 2 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
aultpref("mail.accountmanager.defaultaccount", "account1" ); defaultpref("mail.smtp.defaultserver", "smtp1" ); defaultpref("mail.smtpservers", "smtp1" ); // close the try, and call the catch() } catch(e) { displayerror("lockedpref", e); } test autoconfig debug to check that our autoconfig works fine, we just set to env variable to check the read of thunderbird.cfg file: $ export nspr_log_modules=mcd:5 $ export nspr_log_file=/tmp/thunderbird-log.txt when thunderbird has started, you should read: $ cat /tmp/thunderbird-log.txt -1209403040[808a788]: general.config.filename = thunderbird.cfg -1209403040[808a788]: evaluating .cfg file thunderbird.cfg with obscurevalue 0 clean then, to be sure to start with a fresh thunderbird account, don't do this if you already have one and want to...
...pref("mcd.logging.console", "all"); pref("mcd.logging.dump", "all"); components.utils.import("resource:///modules/gloda/log4moz.js"); var log = log4moz.getconfiguredlogger("mcd"); // enable alerts.
... 2 10:45 modules drwxr-xr-x 2 root root 4096 juil.
...And 2 more matches
JavaScript Client API - Archive of obsolete content
have a look at one of the following files: services/sync/modules/engines/bookmarks.js services/sync/modules/engines/history.js setting up a js module the code for your custom sync engine should live in a js module.
... the base record objects are defined in services/sync/modules/record.js.
...ters and setters, you can also use utils.defergetset: function foorecord(collection, id) { cryptowrapper.call(this, collection, id); } foorecord.prototype = { __proto__: cryptowrapper.prototype, _logname: "record.foo", ttl: foo_ttl // optional }; utils.defergetset(foorec, "cleartext", ["bar", "baz"]); the store object the store object (which extends store, as defined in services/sync/modules/engines.js) has the job of creating and maintaining a set of record objects from the underlying data.
...And 2 more matches
The new nsString class implementation (1999) - Archive of obsolete content
justification the nsstring class is a wide character string class used throughout all of gecko (and other modules) as the default implementation.
...usage patterns how to use these classes to increase the portability, thread and process safety of gecko, i suggest the following rules regarding the use of each of our string class derivatives: <center> string class</center> <center> where to use</center> nsstrimpl use to pass strings between modules who have linked the nsstrimpl function library.
...these should typically not be exposed to objects in other modules.
...And 2 more matches
Introduction to CSS layout - Learn web development
overview: css layout next 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.
... 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 its uses, advantages, and disadvantages, and no technique is designed to be used in isolation.
... flexbox flexbox is the short name for the flexible box layout module, designed to make it easy for us to lay things out in one dimension — either as a row or as a column.
...And 2 more matches
Fundamental text and font styling - Learn web development
this is a little bit more complex, and we will be discussing this in a separate article later on in the module.
...but it was a rare occasion such as this that he did.</p> font size in our previous module's css values and units article, we reviewed length and size units.
...you can find an assessment to verify that you've retained this information at the end of the module — see typesetting a community school homepage.
...And 2 more matches
Multimedia and Embedding - Learn web development
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 webpages.
... 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.
... if you've not worked through this module (or something similar), work through it first, then come back!
...And 2 more matches
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.
... 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 (which includes a really basic javascript introduction).
...And 2 more matches
Learning area release notes - Learn web development
may 2020 our understanding client-side javascript frameworks module is now available.
... 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!
...And 2 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?".
... 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.
... with that basic understanding, you'll be ready to work your way through the modules in this section.
...And 2 more matches
Getting started with Svelte - Learn web development
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.
...your browser will display something like this: application structure the starter template comes with the following structure: moz-todo-svelte ├── readme.md ├── package.json ├── package-lock.json ├── rollup.config.js ├── .gitignore ├── node_modules ├── public │ ├── favicon.ico │ ├── index.html │ ├── global.css │ └── build │ ├── bundle.css │ ├── bundle.css.map │ ├── bundle.js │ └── bundle.js.map └── src ├── app.svelte └── main.js the contents are as follows: package.json and package-lock.json: contains informat...
... node_modules: this is where node saves the project dependencies.
...And 2 more matches
Introducing a complete toolchain - Learn web development
next up, we’ll configure eslint — create another file in the root of your will-it-miss directory called .eslintrc.json, and give it the following contents: { "env": { "es6": true, "browser": true }, "extends": "eslint:recommended", "parseroptions": { "ecmaversion": 6, "sourcetype": "module" }, "rules": { "no-console": 0 } } the above eslint configuration says that we want to use the "recommended" eslint settings, that we're going to allow usage of es6 features (such as map() or set()), that we can use module import statements, and that using console.log() is allowed.
... the final config file should look like this — add in the bolded parts and save it: { "env": { "es6": true, "browser": true }, "extends": ["eslint:recommended", "plugin:react/recommended"], "parseroptions": { "ecmaversion": 6, "sourcetype": "module", "ecmafeatures": { "jsx": true } }, "plugins": ["react"], "rules": { "semi": "error", "no-console": 0, "react/jsx-uses-vars": "error" } } as the configuration now uses a plugin called "react", this development dependency also needs to be installed, so that the code is there to actually run that part of the linting process.
...modules are correctly imported, nested css is correctly transformed to "regular css", and our development is unimpeded by the build process.
...And 2 more matches
Tools and testing - Learn web development
in addition, you should start with the first module in this topic, which gives a useful overview of the general area.
... modules understanding client-side web development tools client-side tooling can be intimidating, but this series of articles aims to illustrate the purpose of some of the most common client-side tool types, explain the tools you can chain together, how to install them using package managers, and control them using the command line.
...this module gives you some fundamental background knowledge about how client-side frameworks work and how they fit into your toolset, before moving on to tutorial series covering some of today's most popular ones.
...And 2 more matches
What to do and what not to do in Bugzilla
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.
...And 2 more matches
HTTP logging
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).
... (unknown modules are ignored, so it's ok to use 'rotate' in your environment even if you're running firefox <= 50: it will do nothing).
... using the rotate module automatically adds timestamps to the log, so it’s always easy to recognize which file keeps the most recent data.
...And 2 more matches
Makefile - variables
extra_components nsdefaultclh.manifest, javascript xpcomm files extra_dso_libs extra_dso_ldopts extra_js_modules extra_pp_components xpcomm files to pre-process before installation.
... module module_name no_dist_install inhibit generating and copying exports/install targets into $(moz_objdir)/dist/install.
... module instructs the build system where to install exported headers.
...And 2 more matches
How Mozilla's build system works
moz.build files cannot do the following: import modules.
... moz.build uppercase variables and functions the set of special symbols available to moz.build files is centrally defined and is under the purview of the build configuration module.
... topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = msgbaseutil library_name = msgbaseutil export_library = 1 short_libname = msgbsutl notice that the only change from the component example above is that is_component is not set.
...And 2 more matches
How to add a build-time test
for example, to add an xpcshell test to a module, do the following: copy tools/test-harness/xpcshell-simple/example to yourmoduledir/tests_type, wheretests_type is something that describes your tests.
... in <tt>yourmoduledir/tests_type/makefile.in</tt> change depth, module, and xpcshell_tests appropriately: depth should be a relative path pointing to <tt>mozilla/</tt>, e.g.
... module should be defined to test_yourmodule or just yourmodule -- either will work fine.
...And 2 more matches
CustomizableUI.jsm
this module is only available from firefox 29 onwards.
... the customizableui.jsm javascript code module allows you to interact with customizable buttons and items in firefox's main window ui.
...if you want to use it from a jsm or another context without a window reference, you need to import it yourself: components.utils.import("resource:///modules/customizableui.jsm"); introduction the module is intended for two primary purposes: allow adding, moving and removing customizable widgets.
...And 2 more matches
Downloads.jsm
the downloads.jsm javascript code module provides a single entry point to interact with the downloading capabilities of the platform, including starting new downloads, controlling ongoing downloads, and retrieving download-related configuration.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/downloads.jsm"); method overview promise<download> createdownload(object aproperties); promise<void> fetch(asource, atarget, [optional] object aoptions); promise<downloadlist> getlist(atype); promise<downloadsummary> getsummary(atype); constants constant description public work on downloads that were not started from a private browsing window.
... components.utils.import("resource://gre/modules/downloads.jsm"); components.utils.import("resource://gre/modules/osfile.jsm") components.utils.import("resource://gre/modules/task.jsm"); task.spawn(function () { yield downloads.fetch("http://www.mozilla.org/", os.path.join(os.constants.path.tmpdir, "example-download.html")); console.log("example-download.html has been download...
...And 2 more matches
JNI.jsm
the jni.jsm javascript code module abstracts all of the js-ctypes required for writing jni code.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/jni.jsm"); this module was available in firefox since version 17.
...the most common use for this module is in add-ons and other works on firefox for android (fennec).
...And 2 more matches
Promise.jsm
the promise.jsm javascript code module implements the promises/a+ proposal as known in april 2013.
... this module was used before dom promises were made globally available in gecko 29.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/promise.jsm"); note: a preliminary promise module is also available starting from gecko 17, though it didn't conform to the promises/a+ proposal until gecko 25: components.utils.import("resource://gre/modules/commonjs/promise/core.js"); // gecko 17 to 20 components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js"); // gecko 21 to 24 this implementation also includes helper functions that are speci...
...And 2 more matches
Sqlite.jsm
the sqlite.jsm javascript code module is a promise-based wrapper around the storage/sqlite interface.
...sqlite.jsm feels like a pure javascript module.
... note: the sqlite.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on.
...And 2 more matches
NSS environment variables
3.12.3 nss_debug_pkcs11_module string (module name) name the pkcs#11 module to be traced.
... pkcs #11 module logger 3.6 nss_default_db_type string ("dbm", "sql", or "extern") determines the default database type to open if the app does not specify.
... 3.11.8 nss_enable_audit boolean (1 to enable) enable auditing of activities of the nss cryptographic module in fips mode.
...And 2 more matches
NSS tools : pk12util
cbc o pkcs12 v2 pbe with sha1 and 2key triple des-cbc o pkcs12 v2 pbe with sha1 and 128 bit rc2 cbc o pkcs12 v2 pbe with sha1 and 40 bit rc2 cbc pkcs#5 pbe ciphers o pkcs #5 password based encryption with md2 and des cbc o pkcs #5 password based encryption with md5 and des cbc o pkcs #5 password based encryption with sha1 and des cbc with pkcs#12, the crypto provider may be the soft token module or an external hardware module.
... if the cryptographic module does not support the requested algorithm, then the next best fit will be selected (usually the default).
... if no suitable replacement for the desired algorithm can be found, the tool returns the error no security module can perform the requested operation.
...And 2 more matches
NSS tools : pk12util
pkcs12 v2 pbe with sha1 and 128 bit rc2 cbc o pkcs12 v2 pbe with sha1 and 40 bit rc2 cbc pkcs#5 pbe ciphers pkcs #5 password based encryption with md2 and des cbc o pkcs #5 password based encryption with md5 and des cbc o pkcs #5 password based encryption with sha1 and des cbc with pkcs#12, the crypto provider may be the soft token module or an external hardware module.
... if the cryptographic module does not support the requested algorithm, then the next best fit will be selected (usually the default).
... if no suitable replacement for the desired algorithm can be found, the tool returns the error no security module can perform the requested operation.
...And 2 more matches
XML Extras
the xml extras module contains several features that allow developers to treat xml as data i.e.
...the module is structured as a drop-in component and exposes 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.
...And 2 more matches
Components.utils.importGlobalProperties
example components.utils.import("resource://gre/modules/devtools/console.jsm"); components.utils.importglobalproperties(["atob", "btoa"]); var encoded = btoa("hello"); console.log(encoded); // "sgvsbg8=" console.log(atob(encoded)); // "hello" alternative methods if importglobalproperties does not support the targeted firefox version, here are some alternative methods to import these objects.
... import from jsm this method worked until blob and file were no longer apart of jsm modules.
...the reason this works is because js code modules actually have blob and file.
...And 2 more matches
nsILoginManagerStorage
toolkit/components/passwordmgr/public/nsiloginmanagerstorage.idlscriptable this interface is implemented by modules that wish to provide storage mechanisms for the login manager.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) for example, if you wish to provide operating system integration with a native password manager system, implementing and registering a storage module for the login manager is how you do it.
... see creating a login manager storage module for details.
...And 2 more matches
nsIPushService
void subscribe( in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback ); parameters scope the serviceworkerregistration.scope for a service worker subscription, or a unique url (for example, chrome://my-module/push) for a system subscription.
... example const { classes: cc, interfaces: ci, utils: cu } = components; const scriptsecuritymanager = cc["@mozilla.org/scriptsecuritymanager;1"] .getservice(ci.nsiscriptsecuritymanager); const pushservice = cc["@mozilla.org/push/service;1"] .getservice(ci.nsipushservice); pushservice.subscribe( "chrome://my-module/push", scriptsecuritymanager.getsystemprincipal(), (code, subscription) => { if (!components.issuccesscode(code)) { cu.reporterror("error creating subscription: " + code); return; } // `subscription` implements `nsipushsubscription`.
... example pushservice.getsubscription( "chrome://my-module/push", scriptsecuritymanager.getsystemprincipal(), (code, subscription) => { if (!components.issuccesscode(code)) { cu.reporterror("error fetching subscription: " + code); return; } // `subscription == null` if the `(scope, principal)` pair doesn't have a // push subscription.
...And 2 more matches
Working with windows in chrome code
from xpcom components and modules if the window object is unavailable (for example, when opening a window from xpcom component code), you might want to use nsiwindowwatcher interface.
... using javascript code modules javascript code modules is a simple method for creating shared global singleton objects that can be imported into any other javascript scope.
... the importing scope will have access to the objects and data in the code module.
...And 2 more matches
Debugger.Source - Firefox Developer Tools
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.
... the url may be the name of a xpcom javascript module or subscript.
...And 2 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
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.
... 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.
...And 2 more matches
HTML: Hypertext Markup Language
WebHTML
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.
...And 2 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.
...And 2 more matches
x - SVG: Scalable Vector Graphics
WebSVGAttributex
specifications specification status comment filter effects module level 1the definition of 'x' in that specification.
... working draft definition for <filter> filter effects module level 1the definition of 'x' in that specification.
... working draft definition for <fespotlight> filter effects module level 1the definition of 'x' in that specification.
...And 2 more matches
y - SVG: Scalable Vector Graphics
WebSVGAttributey
specifications specification status comment filter effects module level 1the definition of 'y' in that specification.
... working draft definition for <filter> filter effects module level 1the definition of 'y' in that specification.
... working draft definition for <fespotlight> filter effects module level 1the definition of 'y' in that specification.
...And 2 more matches
Index - WebAssembly
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.
... 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.
... 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 2 more matches
Communicating using "port" - Archive of obsolete content
accessing port accessing port in the content script note that the global self object is completely different from the self module, which provides an api for an add-on to access its data files and id.
... however, the worker is not exposed to add-on code in quite the same way in all modules.
...but some modules, such as page-mod, might need to handle multiple pages, each with its own context in which the content scripts are executing, so it needs a separate channel (worker) for each page.
...lick', function(html) { worker.port.emit('warning', 'do not click this again'); }); } }); in the add-on above there are two user-defined messages: click is sent from the page-mod to the add-on, when the user clicks an element in the page warning sends a silly string back to the page-mod port.emit() the port.emit() function sends a message from the "main.js", or another add-on module, to a content script, or vice versa.
Content Processes - Archive of obsolete content
since both add-on modules and content scripts are currently loaded in sandboxes rather than separate processes, and sandboxes can communicate with each other directly (using imports/exports), you might be wondering why we have to go through all the trouble of passing messages between add-on and content scripts.
... the reason for this extra complexity is that the code for add-on modules and content scripts have different privileges.
... every add-on module can get chrome privileges simply by asking for them, whereas content scripts have the same privileges as the page it is running on.
...by only passing messages between add-on modules and content scripts, these problems can be avoided, making your add-on both easier to debug and to maintain.
Testing the Add-on SDK - Archive of obsolete content
cfx testpkgs --filter <file_name>:<test_name>: a suite of tests which run sdk module unit tests.
... the majority of the tests run here are module unit tests, but there are various other tests included here as well.
... with gulp installed, and after installing the addon-sdk's npm dependencies, we can run the latter three test suites mentioned for cfx with jpm using the following commands: gulp test:examples --filter <addon_example_folder_name> gulp test:addons --filter <addon_folder_name> gulp test:modules --filter <file_name>:<test_name> or run all of the tests with gulp test.
... ./mach mochitest -f jetpack-package <optional_file_path>: this runs the module unit tests mentioned for cfx testpkgs and gulp test:modules but in this case with the newer toolkit/loader used with jpm.
Working with Events - Archive of obsolete content
for example, the following add-on registers a listener with the tabs module to listen for the ready event, and logs a string to the console reporting the event: var tabs = require("sdk/tabs"); tabs.on("ready", function () { console.log("tab loaded"); }); it is not possible to enumerate the set of listeners for a given event.
...s.panel({ contenturl: self.data.url("panel.html") }); panel.on("*", function(e) { console.log("event " + e + " was emitted"); }); var button = ui.actionbutton({ id: "my-button", label: "my button", icon: "./icon-16.png", onclick: handleclick }); function handleclick(state) { panel.show({ position: button }); } this wildcard feature does not yet work for the tabs or windows modules.
... adding listeners in constructors event emitters may be modules, as is the case for the ready event above, or they may be objects returned by constructors.
... in the following add-on, we add two listeners to the tabs module's ready event.
page-worker - Archive of obsolete content
usage the module exports a constructor function page, which constructs a new page worker.
...to do this, save the file in your add-on's data directory and create the url using the data.url() method of the self module: pageworker = require("sdk/page-worker").page({ contentscript: "console.log(document.body.innerhtml);", contenturl: require("sdk/self").data.url("myfile.html") }); from firefox 34, you can use "./myfile.html" as an alias for self.data.url("myfile.html").
...you construct the url using the data.url() method of the self module.
... see the match-pattern module for a detailed description of match pattern syntax.
private-browsing - Archive of obsolete content
opting into private browsing add-ons built using the sdk must opt into private browsing by setting the following key in their package.json file: "permissions": {"private-browsing": true} if an add-on has not opted in, then the high-level sdk modules will not expose private windows, or objects (such as tabs) that are associated with private windows: the windows module will not list any private browser windows, generate any events for private browser windows, or let the add-on open any private browser windows the tabs module will not list any tabs that belong to private browser windows, and the add-on won't receive any events for ...
...such tabs any ui components will not be displayed in private browser windows any menus or menu items created using the context-menu will not be shown in context menus that belong to private browser windows the page-mod module will not attach content scripts to documents belonging to private browser windows any panel objects will not be shown if the active window is a private browser window the selection module will not include any selections made in private browser windows add-ons that have opted in will see private windows, so they will need to use the private-browsing module to check whether objects are private, so as to avoid storing data derived from such objects.
... additionally, add-ons that use low-level modules such as window/utils may see private browser windows with certain functions, even if they have not explicitly opted into private browsing.
... respecting private browsing the private-browsing module exports a single function isprivate() that takes an object, which may be a browserwindow, tab, or worker, as an argument.
self - Archive of obsolete content
note that the self module is completely different from the global self object accessible to content scripts, which is used by a content script to communicate with the add-on code.
...this uri can be used for apis which require a valid uri string, such as the passwords module.
...each package that uses the self module will see its own data directory.
...each package that uses the self module will see its own data directory.
content/loader - Archive of obsolete content
provides one of the building blocks for those modules that use content scripts to interact with web content, such as panel and page-mod.
... 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.
... the loader 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.
core/heritage - Archive of obsolete content
class module exports class utility function for making constructor functions with a proper prototype chain setup in declarative manner: var { class } = require('sdk/core/heritage'); var dog = class({ initialize: function initialize(name) { this.name = name; }, type: 'dog', bark: function bark() { return 'ruff!
...type.initialize.call(this, color); point.prototype.initialize.call(this, x, y); }, tostring: function tostring() { return this.hex() + '@' + point.prototype.tostring.call(this) } }); var pixel = pixel(11, 23, 'cc3399'); pixel.tostring(); // => #cc3399@11:23 pixel instanceof pixel // => true pixel instanceof point // => true extend module exports extend utility function, that is useful for creating objects that inherit from other objects, without associated classes.
... var { extend } = require('sdk/core/heritage'); var base = { a: 1 }; var derived = extend(base, { b: 2 }); derived.a // => 1 derived.b // => 2 base.isprototypeof(derived) // => true mix module exports mix utility function that is useful for mixing properties of multiple objects into a single one.
... var { mix } = require('sdk/core/heritage'); var object = mix({ a: 1, b: 1 }, { b: 2 }, { c: 3 }); json.stringify(object) // => { "a": 1, "b": 2, "c": 3 } obscure module exports obscure utility function that is useful for defining non-enumerable properties.
event/target - Archive of obsolete content
with this module you can create your own objects that emit events.
... this module provides an exemplar eventtarget object, that implements an interface for adding and removing event listeners of a specific type.
...in order to emit events one needs to use event/core module instead: let { emit } = require('sdk/event/core'); target.on('hi', function(person) { console.log(person + ' says hi'); }); emit(target, 'hi', 'mark'); // info: 'mark says hi' for more details see event/core documentation.
...events on these objects may be emitted via emit function exported by event/core module.
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.
system/unload - Archive of obsolete content
experimental register callbacks that are called when a module is unloaded.
... it ensures that this wrapper method is called when the object's module is unloaded.
... when(callback) registers a function to be called when the module is unloaded.
... parameters callback : function a function that will be called when the module is unloaded.
Developing for Firefox Mobile - Archive of obsolete content
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.
... running add-ons on android you can develop your add-on as normal, as long as you restrict yourself to the supported modules.
... afterwards you can delete it using adb as follows: adb shell cd /mnt/sdcard rm my-addon.xpi module compatibility modules not supported in firefox mobile are marked in the tables below.
Using XPCOM without chrome - Archive of obsolete content
using sdk xpcom with the low-level module sdk/platform/xpcom , it's possible to exclude chrome and xpcomutils in some cases.
... however, with the sdk module , we can remove this need.
... below is an example, where we extend the xpcom module's unknown class with an nsinavbookmarkobserverinterface and one of its optional interface methods (onitemchanged).
... // this removes the need to import ci and the xpcomutils const { class } = require("sdk/core/heritage"); const { unknown } = require('sdk/platform/xpcom'); const { placesutils } = require("resource://gre/modules/placesutils.jsm"); let bmlistener = class({ extends: unknown, interfaces: [ "nsinavbookmarkobserver" ], //this event most often handles all events onitemchanged: function(bid, prop, an, nv, lm, type, parentid, aguid, aparentguid) { console.log("onitemchanged", "bid: "+bid, "property: "+prop, "isanno: "+an, "new value: "+nv, "lastmod: "+lm, "type: "+type, "parentid:"+parentid, "aguid:"+aguid);0 // code to handle the event here } }); //we just have a class, but need an object.
XPCOM Objects - Archive of obsolete content
in this case you may also find it easier to implement your component using jsm and the xpcomutils module.
... function nsgetmodule(acompmgr, afilespec) { return countermodule; } this piece of code is the first one that firefox looks for in all implementation files in the components directory.
... var countermodule = { // registerself, unregisterself, getclassobject, canunload }; the only thing you may need to change here is when you need to use the category manager.
...the c-types module is also available as a bridge to load and use shared libraries from extension code.
Performance best practices in extensions - Archive of obsolete content
use javascript code modules you can create your own javascript code modules incorporating sets of features that are only needed under specific circumstances.
... while javascript modules can be extremely useful, and provide significant performance benefits, they should be used wisely.
... loading modules incurs a small cost, so breaking code up to an unnecessary degree can be counter-productive.
... lazily load services the xpcomutils javascript module provides two methods for lazily loading things: definelazygetter() defines a function on a specified object that acts as a getter which will be created the first time it's used.
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
the data loader module and the data binder module.
... the data loader module is responsible for the requests and retrieves the stock data information from the web.
... it also sends an event to the data binder module.
... the data binder module is responsible for the binding of the data with the html interface.
Modularization techniques - Archive of obsolete content
introduction the purpose of this document is provide all the information you need to create a new mozilla module or break existing code into a module.
... the basics interfaces the basic building blocks of modules are c++ pure virtual interfaces.
... a pure virtual interface is simply a class where every method is defined as pure virtual, that is: virtual int foo(int bar) = 0; pure virtual interfaces provide an easy mechanism for passing function tables between modules that may reside in separate, possibly dynamically loaded, libraries.
...so how do you find a module if you've never linked with it?
Mozilla Crypto FAQ - Archive of obsolete content
new contributions of crypto code should also be reviewed and approved by the appropriate mozilla module owners, just as with any other mozilla contributions.
...see the mozilla open source pki projects pages for the names and email addresses of the mozilla module owners for crypto-related code.
...based on statements made in various internet forums it appears that the developers of gnu privacy guard may create a plugin module to support invocation of gnupg functionality from mozilla; network associates may also create a commercial pgp plugin for mozilla.
... however, as with apis internal to mozilla modules, mozilla.org cannot guarantee that the format of the key and certificate database will remain unchanged over time; in particular, changes may be introduced at some point that break compatibility with existing applications.
Content - Archive of obsolete content
otherwise, just comment it out getting started a guided tutorial that will help you get started with the rss content module.
... the rss content module provides facilities to include content for an <item>.
... documentation selected articles why rss content module is popular - including html contents charles iliya krempeaux talks about the rss content module, why it is popular among some, and how it is used to include html contents.
... references rss content module element list examples none available at this time community none available at this time tools none available at this time other resources rss content module spec rss, rdf, xml ...
Slash - Archive of obsolete content
ArchiveRSSModuleSlash
getting started a guided tutorial that will help you get started with the rss slash module.
... the rss slash module is popular among slash based blogs and blogs imitating the feel for slashdot.
... documentation selected articles up to 10 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 (2005-08-22).
... references rss slash module element list examples none available at this time community none available at this time tools none available at this time other resources rss slash module slash slashdot rss, rdf, xml ...
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).
... references rss well-formed web module element list examples none available at this time community none available at this time tools none available at this time other resources well-formed web spec rss, rdf, xml ...
Implementation Status - Archive of obsolete content
292333; 3.4 extension module unsupported 300760; 3.5 mustunderstand module unsupported 300757; 4.
...core form controls section title status notes bugs 8.1 the xforms core form controls module supported 8.1.1 common requirements n/a 8.1.2 input supported 8.1.3 secret supported 8.1.4 textarea supported 8.1.5 output supported 8.1.6 ...
...container form controls section title status notes bugs 9.1.1 group supported 9.2.1 switch partial @selected not working inside repeats 339937; 9.2.2 case partial 302497; 329143; 9.3 repeat module partial 264329; 273706; 9.3.1 repeat partial we do not support number attribute 302026; 9.3.2 nested repeats supported 9.3.3 repeat processing partial we currently obey the 1.0 rules for repeat 9.3.4 user interface interaction ...
...xforms actions section title status notes bugs 10 xforms action module n/a 10.1 action supported 10.2 setvalue supported 10.3 insert partial we need to better handle when @at evaluates to nan, and we do not generate unique values for xsd:id nodes.
Index - MDN Web Docs Glossary: Definitions of Web-related terms
the items then participate in flex layout, and all of the properties defined in the css flexible box layout module may be applied.
... 156 flexbox css, glossary, intro, flexbox flexbox is the commonly-used name for the css flexible box layout module, a layout model for displaying items in a single dimension — as a row or as a column.
... 318 parser codingscripting, glossary a parser is the module of a compiler or interpreter that parses a source code file.
... 462 tree shaking javascript, modules, statement, web performance, export, import, tree shaking tree shaking is a term commonly used within a javascript context to describe the removal of dead code.
Accessibility - Learn web development
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.
... get started prerequisites to get the most out of this module, it would be a good idea to either work through at least the first two modules of the html, css, and javascript topics, or perhaps even better, work through the relevant parts of the accessibility module as you work through the related technology topics.
... this article starts off the module with a good look at what accessibility is — this 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.
... assessments accessibility troubleshooting in the assessment for this module, we present to you a simple site with several accessibility issues that you need to diagnose and fix.
Using your new knowledge - Learn web development
prerequisites: before attempting this assessment you should have worked through the rest of the css basics module, and also have an understanding of html basics (study introduction to html).
... congratulations on finishing this first module.
...in the next module, css building blocks, we will go on to look at a number of key areas in depth.
... previous overview: first steps in this module what is css?
CSS first steps - Learn web development
this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html.
... get started prerequisites before starting this module, you should have: basic familiarity with using computers, and using the web passively (i.e.
... basic familiarity with html, as discussed in the introduction to html module.
... guides this module contains the following articles, which will take you through all the basic theory of css, and provide opportunities for you to test out some skills.
Styling links - Learn web development
you can find an assessment to verify that you've retained this information 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.
...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 ...
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.
...you can find an assessment to verify that you've retained this information at the end of the module — see typesetting a community school homepage.
... summary now that you have worked through our articles on text styling fundamentals, it is time to test your comprehension with our assessment for the module, typesetting a community school homepage.
... previous overview: styling text next in this module fundamental text and font styling styling lists styling links web fonts typesetting a community school homepage ...
Your first form - Learn web development
we'll expand on each of these subtopics in more detail later on in the module.
...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).
...forms have way more power than what we saw here and the other articles in this module will help you to master the rest.
... overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for form widgets ...
Introduction to HTML - Learn web development
this module will introduce the first two of these and introduce fundamental concepts and syntax you need to know to understand html.
... 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).
...both are parts of our getting started with the web complete beginner's module.
... guides this module contains the following articles, which will take you through all the basic theory of html and provide ample opportunity for you to test out some skills.
HTML table basics - Learn web development
LearnHTMLTablesBasics
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 the default you get without any styling.
...you can find more details and an example at page layouts in our accessibility learning module.
... overview: tables next in this module html table basics html table advanced features and accessibility structuring planet data ...
HTML Tables - Learn web development
LearnHTMLTables
this module takes you through all you need to know about structuring tabular data using html.
... get started prerequisites before starting this module, you should already have covered the basics of html — see introduction to html.
... guides this module contains the following articles: html table basics this article gets you started with html tables, covering the very basics such as rows and cells, headings, making cells span multiple columns and rows, and how to group together all the cells in a column for styling purposes.
... html table advanced features and accessibility this module looks at some more advanced features of html tables — such as captions/summaries and grouping your rows into table head, body and footer sections — as well as looking at the accessibility of tables for visually impaired users.
Introducing asynchronous JavaScript - Learn web development
a lot of the functionality we have looked at in previous learning area modules is synchronous — you run some code, and the result is returned as soon as the browser can do so.
... note: you'll learn a lot more about promises later on in the module, so don't worry if you don't understand them fully yet.
...you can also find a lot more information on promises in our graceful asynchronous programming with promises guide, later on in the module.
... previous overview: asynchronous next in this module general asynchronous programming concepts introducing asynchronous javascript cooperative asynchronous javascript: timeouts and intervals graceful asynchronous programming with promises making asynchronous programming easier with async and await choosing the right approach ...
What is JavaScript? - Learn web development
note: these apis are advanced, and we'll not be covering any of these in this module.
... you can find out much more about these in our client-side web apis module.
...in this module we are explicitly talking about client-side javascript.
... overview: first steps next in this module what is javascript?
Introducing JavaScript objects - Learn web development
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.
... 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.
...before attempting this module, work through javascript first steps and javascript building blocks.
Server-side web frameworks - Learn web development
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.
...deno modules restrict permissions to file, network, or environment access unless explicitly allowed.
... for the next article in this module we'll change direction slightly and consider web security.
... previous overview: first steps next in this module introduction to the server side client-server overview server-side web frameworks website security ...
Introduction to automated testing - Learn web development
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.
...there are two main ways in which we can automate the tests we've been talking about in this module: use a task runner such as grunt or gulp, or npm scripts to run tests and clean up code during your build process.
...inside this file, put the following: const gulp = require('gulp'); gulp.task('default', function() { console.log('gulp running'); }); this requires the gulp module we installed earlier, and then runs a basic task that does nothing except for printing a message to the terminal — this is useful for letting us know that gulp is working.
... previous overview: cross browser testing next in this module introduction to cross browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
Introduction to cross browser testing - Learn web development
overview: cross browser testing next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages.
... note: we'll cover defensive coding later in the module too.
...you should split the different parts of the development into modules, for example you might split the different site areas up — home page, product page, shopping cart, payment workflow, etc.
... overview: cross browser testing next in this module introduction to cross browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
Setting up your own test automation environment - Learn web development
starting a new test to start up a new test, you need to include the selenium-webdriver module like this: const webdriver = require('selenium-webdriver'), by = webdriver.by, until = webdriver.until; next, you need to create a new instance of a driver, using the new webdriver.builder() constructor.
... let's update our bstack_google_test.js demo, to show how these features work: first, we'll need to import the node request module, so we can use it to send requests to the rest api.
... summary this module should have proven fun, and should have given you enough of an insight into writing and running automated tests for you to get going with writing your own automated tests.
... previous overview: cross browser testing in this module introduction to cross browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
Client-side tooling overview - Learn web development
we'll be using github in this module.
... prettier is a very popular example of a code formatter, which we’ll make use of later on in the module.
...you'll see this tool in action and learn more about package managers in general in chapter 3 of this module.
... overview: understanding client-side tools next in this module client-side tooling overview command line crash course package management basics introducing a complete toolchain deploying our app ...
ChromeWorker
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 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.
How to implement a custom autocomplete search component
the simplest way to make an xpcom component is to build an xpcom javascript component (this cannot be done with a javascript module).
... const ci = components.interfaces; const cu = components.utils; cu.import('resource://gre/modules/xpcomutils.jsm'); const class_id = components.id('x753d830-ba1e-11e0-962b-0800200c9a66'); // ← change this const class_name = "basic autocomplete"; const contract_id = '@mozilla.org/autocomplete/search;1?name=basic-autocomplete'; /** * @constructor * * @implements {nsiautocompleteresult} * * @param {string} searchstring * @param {number} searchresult * @param {number} defaultindex * ...
...nts.results.ns_error_no_interface; return this; } }; // factory var simpleautocompletesearchfactory = { singleton: null, createinstance: function (aouter, aiid) { if (aouter != null) throw components.results.ns_error_no_aggregation; if (this.singleton == null) this.singleton = new simpleautocompletesearch(); return this.singleton.queryinterface(aiid); } }; // module var simpleautocompletesearchmodule = { registerself: function(acompmgr, afilespec, alocation, atype) { acompmgr = acompmgr.queryinterface(components.interfaces.nsicomponentregistrar); acompmgr.registerfactorylocation(class_id, class_name, contract_id, afilespec, alocation, atype); }, unregisterself: function(acompmgr, alocation, atype) { acompmgr = acompmgr.queryinterface(compo...
...actorylocation(class_id, alocation); }, getclassobject: function(acompmgr, acid, aiid) { if (!aiid.equals(components.interfaces.nsifactory)) throw components.results.ns_error_not_implemented; if (acid.equals(class_id)) return simpleautocompletesearchfactory; throw components.results.ns_error_no_interface; }, canunload: function(acompmgr) { return true; } }; // module initialization function nsgetmodule(acompmgr, afilespec) { return simpleautocompletesearchmodule; } starting in gecko 2.0, component registration has been changed, so you need to make the following changes: add an nsgetfactory() function: function nsgetfactory(cid) { if (cid.tostring().touppercase() != class_id.tostring().touppercase()) { throw components.results.ns_er...
PerfMeasurement.jsm
the perfmeasurement.jsm javascript code module lets you take detailed performance measurements of your code.
... note: the perfmeasurement.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on.
... before you can use this module, you need to import it into your scope: components.utils.import("resource://gre/modules/perfmeasurement.jsm") see measuring performance using the perfmeasurement.jsm code module for details on how to use this api.
...methods canmeasuresomething() indicates whether or not the platform on which your code is running supports this code module.
PopupNotifications.jsm
the popupnotifications.jsm javascript code module provides a popup notification box service.
... to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/popupnotifications.jsm"); once you've imported the module, you can then use the popupnotifications object it exports; this object provides methods for creating and displaying popup notification panels.
... note: this code module is imported by firefox chrome windows, so you don't have to do it yourself in most extensions.
... methods locationchange() the consumer can call this method to let the popup notification module know that the current browser's location has changed.
Task.jsm
the task.jsm javascript code module implements a subset of task.js to make sequential, asynchronous operations simple, using the power of javascript's yield operator.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/task.jsm"); introduction for an introduction to tasks, you may start from the task.js documentation, keeping in mind that only the core subset is implemented in this module.
... examples general example cu.import("resource://gre/modules/task.jsm"); task.spawn(function* () { // this is our task.
... }); exception handling components.utils.import("resource://gre/modules/osfile.jsm") components.utils.import("resource://gre/modules/task.jsm") task.spawn(function* () { let currentdir = yield os.file.getcurrentdirectory(); let path = os.path.join(currentdir, ".mozconfig"); try { let info = yield os.file.stat(path); console.log("the .mozconfig file is " + info.size + " bytes long."); } catch (ex if ex instanceof os.file.error && ex.becausenosuchfil...
source-editor.jsm
the source-editor.jsm javascript code module implements an editor specifically tailored for editing source code; its primary purpose is to provide support for web developer tools to display and edit web site code.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource:///modules/source-editor.jsm"); warning: much of the functionality of the source editor is implemented by a secondary code module (by default, source-editor-orion.jsm).
... you must not directly import that code module; it is essentially an implementation detail.
...the source editor code module loads a module by the name "source-editor-<component>.jsm" and exposes its api as part of the sourceeditor object.
PR_LOG_TEST
determines if logging is enabled for a module and level.
... syntax #include <prlog.h> prbool pr_log_test ( prlogmoduleinfo *_module, prlogmodulelevel _level); parameters the macro has these parameters: _module a pointer to a log module structure.
...possible values are: pr_log_none = 0 pr_log_always = 1 pr_log_error = 2 pr_log_warning = 3 pr_log_debug = 4 pr_log_notice = pr_log_debug pr_log_warn = pr_log_warning pr_log_min = pr_log_debug pr_log_max = pr_log_debug returns pr_true when logging is enabled for the given module and level, otherwise pr_false.
... description this macro tests whether logging is enabled for the specified module and level.
NSS 3.12.4 release notes
new functions in the nss shared library: pk11_isinternalkeyslot (see pk11pub.h) secmod_opennewslot (see pk11pub.h) new error codes (see secerr.h): sec_error_bad_info_access_method sec_error_crl_import_failed new oids (see secoidt.h) sec_oid_x509_any_policy the nssckbi pkcs #11 module's version changed to 1.75.
...bug 488550: crash in certutil or pp when printing cert with empty subject name bug 488992: fix lib/freebl/win_rand.c warnings bug 489010: stop exporting mktemp and dbopen (again) bug 489287: resolve a few remaining issues with nss's new revocation flags bug 489710: byteswap optimize for msvc++ bug 490154: cryptokey framework requires module to implement generatekey when they support keypairgeneration bug 491044: remove support for vms (a.k.a., openvms) from nss bug 491174: cert_pkixverifycert reports wrong error code when ee cert is expired bug 491919: cert.h doesn't have valid functions prototypes bug 492131: a failure to import a cert from a p12 file leaves error code set to zero bug 492385: crash freeing named crl entry on shutdo...
...[[@isspace - secmod_argisblank - secmod_arghasblanks - secmod_formatpair - secmod_mknewmodulespec] bug 498509: produce debuggable optimized builds for mozilla on macosx bug 498511: produce debuggable optimized nss builds for mozilla on linux bug 499385: drbg reseed function needs to be tested on post bug 499825: utilrename.h is missing from solaris packages bug 502961: allocator mismatch in pk11mode bug 502965: allocator mismatch in sdrtest bug 502972: another allocator mismatch in sdrtes...
...bug 505561: need a generic function a la secmod_openuserdb() that can be used on non-softoken modules.
Overview of NSS
server products from red hat: red hat directory server, red hat certificate system, and the mod_nss ssl module for the apache web server.
... suse linux enterprise server supports nss and the mod_nss ssl module for the apache web server.
... fips 140 validation and niscc testing the nss software crypto module has been validated three times for conformance to fips 140 at security levels 1 and 2.
... complete software development kit in addition to libraries and apis, nss provides security tools required for debugging, diagnostics, certificate and key management, cryptography module management, and other development tasks.
FC_Initialize
description fc_initialize initializes the nss cryptographic module for the fips mode of operation.
...' librarydescription='psm internal crypto services' cryptotokendescription='generic crypto services' dbtokendescription='software security device' cryptoslotdescription='psm internal cryptographic services' dbslotdescription='psm private keys' fipsslotdescription='psm internal fips-140-1 cryptographic services' fipstokendescription='psm fips-140-1 user private key services' minps=0" see pkcs #11 module specs for complete documentation of the library parameters string.
...the nss cryptographic module always uses os locking and doesn't know how to use the lock functions provided by the application.
...the nss cryptographic module is in a fatal error state.
NSS functions
pk11_getkeygen mxr 3.4 and later pk11_getkeylength mxr 3.2 and later pk11_getkeystrength mxr 3.2 and later pk11_getmechanism mxr 3.2 and later pk11_getminimumpwdlength mxr 3.4 and later pk11_getmodinfo mxr 3.6 and later pk11_getmodule mxr 3.3 and later pk11_getmoduleid mxr 3.2 and later pk11_getnextgenericobject mxr 3.9.2 and later pk11_getnextsafe mxr 3.4 and later pk11_getnextsymkey mxr 3.4 and later pk11_getpadmechanism mxr 3.4 and later pk11_getpbecryptomech...
...ter seckey_destroyencryptedprivatekeyinfo mxr 3.2 and later seckey_destroyprivatekeyinfo mxr 3.2 and later seckey_destroypublickey mxr 3.2 and later seckey_publickeystrength mxr 3.2 and later seckey_updatecertpqg mxr 3.2 and later secmod_addnewmodule mxr 3.3 and later secmod_addnewmoduleex mxr 3.4 and later secmod_deletemoduleex mxr 3.12 and later secmod_cancelwait mxr 3.9.3 and later secmod_candeleteinternalmodule mxr 3.5 and later secmod_createmodule mxr 3.4 and later secmod_...
...deletemodule mxr 3.4 and later secmod_findmodule mxr 3.4 and later secmod_findslot mxr 3.4 and later secmod_freemodulespeclist mxr 3.4 and later secmod_getdbmodulelist mxr 3.9 and later secmod_getdeadmodulelist mxr 3.9 and later secmod_getmodulespeclist mxr 3.4 and later secmod_hasremovableslots mxr 3.9.3 and later secmod_ismodulepresent mxr 3.2 and later secmod_loadmodule mxr 3.4 and later secmod_loadusermodule mxr 3.4 and later secmod_lookupslot mxr 3.2 and later ...
...secmod_pubcipherflagstointernal mxr 3.4 and later secmod_pubmechflagstointernal mxr 3.4 and later secmod_unloadusermodule mxr 3.4 and later secmod_updatemodule mxr 3.4 and later secmod_updateslotlist mxr 3.9.3 and later secmod_waitforanytokenevent mxr 3.9.3 and later secoid_addentry mxr 3.10 and later secoid_comparealgorithmid mxr 3.2 and later secoid_copyalgorithmid mxr 3.2 and later secoid_destroyalgorithmid mxr 3.2 and later secoid_findoid mxr 3.2 and later secoid_findoidbytag mxr ...
Finishing the Component
before attempting to use unfrozen interfaces, you should contact the developers who are responsible for the code you're trying to use (i.e., module owners) and ask them how best to do what you are trying to do.
...an interface reaches this state when a group of module owners and peers are actively engaged in discussion about how best to expose it.
...even with interfaces marked "under review," however, it's still a good idea to contact the module owners responsible for the interfaces you are interested in using.
...ponent to this category, modify the weblockregistration callback function so that it looks like this: static ns_method weblockregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info) { nsresult rv; nscomptr<nsiservicemanager> servman = do_queryinterface((nsisupports*)acompmgr, &rv); if (ns_failed(rv)) return rv; nscomptr<nsicategorymanager> catman; servman->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), getter_addrefs(catman)); if (ns...
How to build a binary XPCOM component using Visual Studio
recap: use the right gecko sdk for your xulrunner release use a microsoft compiler use pre-built glib-1.2.dll & libidl-0.6.dll libraries from wintools.zip download the sample project here is what the folder structure looks like: create a vc++ project visual studio project and file templates (or wizards) for creating xpcom modules and components do not currently exist.
... component factory module, also in c++.
... astring name; */ ns_imethodimp cspecialthing::getname(nsastring & aname) { aname.assign(mname); return ns_ok; } ns_imethodimp cspecialthing::setname(const nsastring & aname) { mname.assign(aname); return ns_ok; } /* long add (in long a, in long b); */ ns_imethodimp cspecialthing::add(print32 a, print32 b, print32 *_retval) { *_retval = a + b; return ns_ok; } lastly, we need to create the module implementation.
... i put this together from some samples i found on the mdc site: #include "nsigenericfactory.h" #include "comp-impl.h" ns_generic_factory_constructor(cspecialthing) static nsmodulecomponentinfo components[] = { { specialthing_classname, specialthing_cid, specialthing_contractid, cspecialthingconstructor, } }; ns_impl_nsgetmodule("specialthingsmodule", components) assuming you have the right sdk and setup the include and lib folders correctly, the project should build your xpcom component.
Language bindings
an xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings.
... exposes modules written in the bound language as xpcom objects, thereby enabling all other languages for which xpcom bindings exist to access these modules.
...this method calls through to that thusly:components.utils.unloadcomponents.utils.unload was introduced in firefox 7 and is used to unload javascript code modules.
... this can be particularly handy with restartless (boostrapped) extensions, so that you can unload an old version of a code module when a new version of your add-on is installed.components.utils.unwaivexraysundo a previous call to components.utils.waivexrays(), restoring xray vision for the caller.components.utils.waivexrayswaives xray vision for an object, giving the caller a transparent wrapper to the underlying object.javaxpcomjavaxpcom allows for communication between java and xpcom, such that a java application can access xpcom objects, and xpcom can access any java class that implements an xpcom interface.
nsIPlacesImportExportService
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) in the past, this interface also offered methods for importing places data, but those methods are now part of the bookmarkhtmlutils.jsm javascript code module.
... importhtmlfromfile() obsolete since gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) note: this method has been removed; use the bookmarkhtmlutils.jsm javascript code module instead.
... importhtmlfromfiletofolder() obsolete since gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) note: this method has been removed; use the bookmarkhtmlutils.jsm javascript code module instead.loads the given bookmarks.html file and puts it in the given folder.
... note: this method has been removed; use the bookmarkhtmlutils.jsm javascript code module instead.
Mail client architecture overview
gecko (xul and html rendering) rdf (dynamic widgets) js (menus, events) libmime mail datasources mail javascript folder/message management msgdb imap/nntp/pop3 necko (networking) sections in grey refer to modules outside of mail/news the base module the base module provides a generic interface to a set of protocol-independant messaging services.
... the base module consists of the following basic building blocks account management - the account manager is the root object of the server/folder/message hierarchy.
... finally, there are larger modules outside of the mail client that are mail-oriented.
... most of these modules have little dependancy on the mail reader itself: compose - the mail compose module is responsible for anything that has to do with sending mail.
libmime content type handlers
pizzarro <rhp@netscape.com> contents overview api's plugin location/installation sample content type handler plugin overview the libmime module implements a general-purpose mime parser and one of the primary methods provided by the parser is the ability to emit an html representation of an input stream.
... a necessary capability of this module is to dynamically add the ability to decode and render various content types.
...libmime has a homegrown object system written in c, and since the content type handler plugins need to exist in this module, a description of the libmime object system should be reviewed and understood.
...ns_imethod getcontenttype(char **contenttype) = 0; ns_imethod createcontenttypehandlerclass(const char *content_type, contenttypehandlerinitstruct *initstruct, mimeobjectclass **objclass) = 0; }; #endif /* nsimimecontenttypehandler_h_ */ plugin installation/location the installation of these modules will be similar to the that of any xpcom component (i.e.
Using popup notifications
creating a popup notification popup notifications can be created using the popupnotifications.jsm javascript code module.
... this code module is imported by the browser, so you don't need to do it explicitly yourself.
...the popupnotifications.jsm code module adds a popupid attribute to the notification object's icon element.
... components.utils.import('resource://gre/modules/popupnotifications.jsm'); var notify = new popupnotifications(gbrowser, document.getelementbyid("notification-popup"), document.getelementbyid("notification-popup-box")); var notification = notify.show( // browser gbrowser.selectedbrowser, // popup id "pdes-popup", // message "hi, there!, i'm gonna show you something today!!", // anchor id null, // main...
Plug-in Basics - Plugins
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.
... understanding the runtime model plug-ins are dynamic code modules that are associated with one or more mime types.
... plug-ins and platform independence a plug-in is a dynamic code module that is native to the specific platform on which the browser is running.
Debugger.Script - Firefox Developer Tools
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.
<custom-ident> - CSS: Cascading Style Sheets
specifications specification status comment css values and units module level 4the definition of '<custom-ident>' in that specification.
... editor's draft css will change module level 1the definition of '<custom-ident> for will-change' in that specification.
... css lists module level 3the definition of '<custom-ident> for counter-*' in that specification.
... css values and units module level 3the definition of '<custom-ident>' in that specification.
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.
WebAssembly.validate() - JavaScript
the webassembly.validate() function validates a given typed array of webassembly binary code, returning whether the bytes form a valid wasm module (true) or not (false).
... 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.
..."" : "not ") + "a valid wasm module"); }); specifications specification webassembly javascript interfacethe definition of 'validate()' in that specification.
Lexical grammar - JavaScript
and is only valid at the absolute start of a script or module.
... these are always reserved: enum the following are only reserved when they are found in strict mode code: implements interface let package private protected public static the following are only reserved when they are found in module code: await future reserved keywords in older standards the following are reserved as future keywords by older ecmascript specifications (ecmascript 1 till 3).
... `string text` `string text line 1 string text line 2` `string text ${expression} string text` tag `string text ${expression} string text` automatic semicolon insertion some javascript statements must be terminated with semicolons and are therefore affected by automatic semicolon insertion (asi): empty statement let, const, variable statement import, export, module declaration expression statement debugger continue, break, throw return the ecmascript specification mentions three rules of semicolon insertion.
...these statements with "no lineterminator here" rules are: postfixexpressions (++ and --) continue break return yield, yield* module return a + b // is transformed by asi into return; a + b; specifications specification ecmascript (ecma-262)the definition of 'lexical grammar' in that specification.
Exported WebAssembly functions - WebAssembly
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.
... by accessing a function exported from a wasm module instance via instance.exports.
... we then get the function exported from the module, retrieve the functions it references via tbl.get() and log the result of invoking each one to the console.
... their name property is the tostring() result of the function's index in the wasm module.
Communicating using "postMessage" - Archive of obsolete content
as an alternative to port, content modules support the built-in message event.
...however, the context-menu module does not support port, so to send messages from a content script to the add-on via a context menu object, you must use message events.
...to simplify this most content modules provide an onmessage property as an argument to the constructor: panel = require("sdk/panel").panel({ onmessage: function(contentscriptmessage) { // handle message from the content script } }); message events versus user-defined events you can use message events as an alternative to user-defined events: var pagemodscript = "window.addeventlistener('mouseover', function(event) {" + ...
Contributor's Guide - Archive of obsolete content
modules a module is a self-contained unit of code, which is usually stored in a file, and has a well defined interface.
... the use of modules greatly improves the maintainability of code, by splitting it up into independent components, and enforcing logical boundaries between them.
... unfortunately, javascript does not yet have native support for modules: it has to rely on the host application to provide it with functionality such as loading subscripts, and exporting/ importing names.
Guides - Archive of obsolete content
modules learn about the module system used by the sdk (which is based on the commonjs specification), how sandboxes and compartments can be used to improve security, and about the built-in sdk module loader, known as cuddlefish.
... 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 how the sdk's module tree is structured.
addon-page - Archive of obsolete content
note: this module has no effect on fennec.
...the addon-page module provides a simple way to have a page which excludes these elements.
... to use the module import it using require().
notifications - Archive of obsolete content
see the self module documentation for more information.
...so you can rewrite the above code like this: var notifications = require("sdk/notifications"); var myiconurl = "./myicon.png"; notifications.notify({ text: "i have an icon!", iconurl: myiconurl }); this module depends on the underlying system's notification service.
...it may be a remote url, a data uri, or a url returned by the self module.
widget - Archive of obsolete content
please see the ui module for replacements.
...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...
... to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module.
chrome - Archive of obsolete content
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.
event/core - Archive of obsolete content
the event/core module allows the creation of apis to broadcast and subscribe to events.
... usage many modules in the sdk can broadcast events.
... for example, the tabs module emits an open event when a new tab is opened.
fs/path - Archive of obsolete content
experimental provides access to the local filesystem with the nodejs path module api.
... usage this module attempts to implement the nodejs path module api.
... please refer the nodejs path module api documentation for this module.
loader/cuddlefish - Archive of obsolete content
the toolkit/loader module should be used instead.
... the sdk's module loader.
... this module still needs to be documented.
places/bookmarks - Archive of obsolete content
usage this module exports: three constructors: bookmark, group, and separator, corresponding to the types of objects, referred to as bookmark items, in the bookmarks database in firefox two additional functions, save() to create, update, and remove bookmark items, and search() to retrieve the bookmark items that match a particular set of criteria.
...the module does not automatically sync up a bookmark instance with ongoing changes to that item in the database from the same add-on, other add-ons, or the user.
... placesemitter the placesemitter is not exported from the module, but returned from the save and search functions.
system/child_process - Archive of obsolete content
this module enables you to execute a child program in a new process.
...however, there are a few differences to be aware of: you need to require() the module using require("sdk/system/child_process") fork() is not supported gid and uid are not supported in node.js, spawn() and exec() inherit the environment variables from the parent process, by default.
... const { emit } = require('sdk/event/core'); const { spawn } = require('sdk/system/child_process'); var proc = spawn("/bin/cat"); emit(proc.stdin, 'data', "hello from add-on code"); emit(proc.stdin, 'end'); using child_process in non-jpm extensions // import sdk stuff const commonjs_uri = 'resource://gre/modules/commonjs'; const { require } = cu.import(commonjs_uri + '/toolkit/require.js', {}); var child_process = require('sdk/system/child_process'); // use it in the same way as in the example above ...
Add a Context Menu Item - Archive of obsolete content
to add items and submenus to the firefox context menu, use the context-menu module.
...the context-menu module provides a number of simple built-in contexts, including this selectioncontext(), which means: display the item when something on the page is selected.
...selection", context: contextmenu.selectioncontext(), contentscript: 'self.on("click", function () {' + ' var text = window.getselection().tostring();' + ' self.postmessage(text);' + '});', accesskey: "l", onmessage: function (selectiontext) { console.log(selectiontext); } }); learning more to learn more about the context-menu module, see the context-menu api reference.
Creating annotations - Archive of obsolete content
please see the ui module for replacements.
... at the top of the file import the page-mod module and declare an array for the workers: var pagemod = require('sdk/page-mod'); var selectors = []; add detachworker(): function detachworker(worker, workerarray) { var index = workerarray.indexof(worker); if(index != -1) { workerarray.splice(index, 1); } } edit toggleactivation() to notify the workers of a change in activation state: function activateselectors() { selectors.foreach...
...first, import the panel module: var panels = require('sdk/panel'); then add the following code to the main() function: var annotationeditor = panels.panel({ width: 220, height: 220, contenturl: data.url('editor/annotation-editor.html'), contentscriptfile: data.url('editor/annotation-editor.js'), onmessage: function(annotationtext) { if (annotationtext) { console.log(this.annotationanchor); console.
Add-on SDK - Archive of obsolete content
development techniques learn about common development techniques, such as unit testing, logging, creating reusable modules, localization, and mobile development.
... guides contributor's guide learn how to start contributing to the sdk and about the most important idioms used in the sdk code such as modules, classes and inheritance, private properties, and content processes.
... sdk infrastructure aspects of the sdk's underlying technology: modules, the program id and the rules defining firefox compatibility.
Downloading Files - Archive of obsolete content
components.utils.import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); 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 ur...
... downloading binary files with a progress listener to download a binary file with custom progress listener: components.utils.import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist(); var targetfile = services.dirsvc.get("desk", ci.nsifile); targetfile.append("file.bin"); var obj_uri = services.io.newuri(aurltodownload, null, null); ...
... components.utils.import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist(); // obtain the privacy context of the browser window that the url // we are downloading comes from.
JS XPCOM - Archive of obsolete content
components.utils.import("resource://gre/modules/services.jsm"); components.utils.import("resource://gre/modules/xpcomutils.jsm"); const cc = components.classes; const ci = components.interfaces; function abouthandler() {} abouthandler.prototype = { newchannel: function(uri) { var channel = services.io.newchannel("chrome://mystuff/content/mystuff.xul", null, null); channel.originaluri = uri; return channel; }, ...
... geturiflags: function(uri) { // do not return ci.nsiaboutmodule.uri_safe_for_untrusted_content unless // you make sure to set a non-system principal in newchannel.
... return 0; }, classdescription: "about mystuff page", classid: components.id("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"), contractid: "@mozilla.org/network/protocol/about;1?what=mystuff", queryinterface: xpcomutils.generateqi([ci.nsiaboutmodule]) } var nsgetmodule = xpcomutils.generatensgetmodule([abouthandler]); } ...
Preferences - Archive of obsolete content
switch (adata) { case "pref1": // extensions.myextension.pref1 was changed break; case "pref2": // extensions.myextension.pref2 was changed break; } } } myprefobserver.register(); and next, here is a more evolved version of the previous code better fit for code reuse both within a project and across projects (for example, using javascript code modules): /** * @constructor * * @param {string} branch_name * @param {function} callback must have the following arguments: * branch, pref_leaf_name */ function preflistener(branch_name, callback) { // keeping a reference to the observed preference branch or it will get // garbage collected.
... javascript wrappers for preferences system there are a few javascript wrappers to make your life easier: http://mozilla.doslash.org/prefutils chrome://global/content/nsusersettings.js https://wiki.mozilla.org/labs/js_modules how to save preferences to save preferences into the default location: var prefservice = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice); prefservice.savepreffile(null); checking for existence of a key if you try to get the value of a nonexistent preference, an error will be thrown: error: ns_error_...
...of the preferences system most used interfaces (these are frozen and will not change): nsiprefbranch and nsiprefservice nsiprefbranch2 interface (before gecko 1.8 it was called nsiprefbranchinternal) preferences system - an easy way to create a xul options window for your extension or application syncing preferences across clients using sync lxr pages for libpref, the source code module that implements the preferences system a javascript wrapper for preferences api adding preferences to an extension — a simple tutorial with a working extension that illustrates the use of preference observers inline options - how to use the new preference ui that appears inline in the add-on manager window starting in firefox 7 .
Appendix: What you should know about open-source software licenses - Archive of obsolete content
however, if you develop an original module as an addition to it, that restriction does not apply.
...almost all module files will give the license text or license declaration at the top.
...despite the fact that different modules have different copyright holders, and overall license management is complicated, by taking this contract as a kind of proxy letter, sun is able to make changes to the openoffice.org license by itself.
Appendix A: Add-on Performance - Archive of obsolete content
javascript code modules.
...jsm provide the cleanest way to separate js into modules that can be loaded on request, unlike chrome scripts which are generally loaded with the overlay at startup.
... keep as much of your code in jsm, make it as modular as you can, and only load modules as you require them.
Tabbed browser - Archive of obsolete content
xul: <menuitem oncommand="myextension.foo(event)" onclick="checkformiddleclick(this, event)" label="click me"/> js: var myextension = { foo: function(event) { openuilink("http://www.example.com", event, false, true); } } opening a url in an on demand tab cu.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.definelazyservicegetter(this, "gsessionstore", "@mozilla.org/browser/sessionstore;1", "nsisessionstore"); // create new tab, but don't load the content.
... components.utils.import('resource://gre/modules/services.jsm'); services.obs.addobserver(httpobs, 'http-on-modify-request', false); //services.obs.removeobserver(httpobs, 'http-on-modify-request'); //uncomment this line, or run this line when you want to remove the observer var httpobs = { observe: function (asubject, atopic, adata) { if (atopic == 'http-on-modify-request') { /*start - do not edit here*/ v...
...but if its an ajax call you may end up here } } } }; here's a cleaner example of the same thing: cu.import('resource://gre/modules/services.jsm'); var httprequestobserver = { observe: function (subject, topic, data) { var httpchannel, requesturl; if (topic == "http-on-modify-request") { httpchannel = subject.queryinterface(ci.nsihttpchannel); requesturl = httpchannel.uri.spec; var newrequesturl, i; if (/someurl/.test(requesturl)) { var g...
Using microformats - Archive of obsolete content
to use the api, you need to first load the object: components.utils.import("resource://gre/modules/microformats.js"); once you've loaded the microformats api, you can manage microformats using the methods listed here; for information about parsing microformats, see parsing microformats in javascript.
... methods add() adds a new microformat to the microformat module.
... add(name, definition); parameters name the name of the microformat to add to the microformat module.
Mozilla Application Framework in Detail - Archive of obsolete content
modular, embeddable: gecko's modular architecture enables developers to add or remove modules with little effort, fitting the software to the available hardware and adjusting functionality to match product requirements.
...furthermore, when embedding gecko, developers are free to choose what modules to include.
... more information using the mozilla soap api (an article written for the apple developer connection) xml extras (the home page for the xml extras code module, which contains mozilla's web services support) soap scripts in mozilla (documentation on soap in mozilla from the engineer who implemented it) xpinstall, mozilla's cross platform installation technology one of the many things that makes the mozilla platform easy for both users and developers is that applications can be installed, extended, or upgraded with simple web page links.
PyDOM - Archive of obsolete content
globals and namespaces this is taken from a mail to the pyxpcom list - it should be expanded, but a copy-paste will do for now normal module semantics don't exist here.
... the globals are 'bound' to the global object (i.e., the window), instead of to a module's __dict__ as you expect in the python world.
... note that we don't actually 'import' anything here - the scripts and event handlers do not exist in a python module.
Supporting per-window private browsing - Archive of obsolete content
detecting private browsing mode determining whether or not a given dom window is private is simple: import resource://gre/modules/privatebrowsingutils.jsm and use privatebrowsingutils.iswindowprivate(window).
... try { // firefox 20+ components.utils.import("resource://gre/modules/privatebrowsingutils.jsm"); if (!privatebrowsingutils.iswindowprivate(window)) { ...
...to do this, import resource://gre/modules/privatebrowsingutils.jsm and use privatebrowsingutils.getprivacycontextfromwindow(win), passing a window object that is related to the content in question.
Building XULRunner with Python - Archive of obsolete content
this gives access to python features and modules and builds on mark hammond's pyxpcom work from active state.
...for example def onload(): btntest = document.getelementbyid("btntest") btntest.addeventlistener('command', ontest, false) def ontest(): window.alert('button activated') window.addeventlistener('load', onload, false) one possible gotcha is that the default python path used to find modules that areimported explicitly includes the xulrunner executable directory and the directory that is current when xulrunner launches.
...don't copy any.pyo files that exist for python modules in the application or errors will occur on the target machine.
CommandLine - Archive of obsolete content
erfaces.nsisupports; const nsicategorymanager = components.interfaces.nsicategorymanager; const nsicomponentregistrar = components.interfaces.nsicomponentregistrar; const nsicommandline = components.interfaces.nsicommandline; const nsicommandlinehandler = components.interfaces.nsicommandlinehandler; const nsifactory = components.interfaces.nsifactory; const nsimodule = components.interfaces.nsimodule; const class_id = components.id("178cfbb6-503c-11dc-8314-0800200c9a66"); const class_name = "applicationnameclh"; const contract_id = "@example.com/applicationname/clh;1"; const cld_category = "m-applicationname"; var apphandler = { /* nsisupports */ queryinterface : function clh_qi(aiid) { if (aiid.equals(nsicommandlinehandler) || ...
...s(acmdline, "commandline-args-changed", null); }, helpinfo : " -test <value> a test attribute\n", /* nsifactory */ createinstance : function mdh_ci(aouter, aiid) { if (aouter != null) { throw components.results.ns_error_no_aggregation; } return this.queryinterface(aiid); }, lockfactory : function mdh_lock(alock) { /* no-op */ } }; var apphandlermodule = { /* nsisupports */ queryinterface : function mod_qi(aiid) { if (aiid.equals(nsimodule) || aiid.equals(nsisupports)) return this; throw components.results.ns_error_no_interface; }, /* nsimodule */ getclassobject : function mod_gch(acompmgr, acid, aiid) { if (acid.equals(class_id)) return apphandler.queryinterface(aiid); throw components.resul...
...mpreg = acompmgr.queryinterface(nsicomponentregistrar); compreg.unregisterfactorylocation(class_id, alocation); var catman = components.classes["@mozilla.org/categorymanager;1"] .getservice(nsicategorymanager); catman.deletecategoryentry("command-line-handler", cld_category); }, canunload : function (acompmgr) { return true; } }; function nsgetmodule(acompmgr, afilespec) { return apphandlermodule; } create an observer that will get notified when arguments change: chrome/content/cmdline.js function commandlineobserver() { this.register(); } commandlineobserver.prototype = { observe: function(asubject, atopic, adata) { var cmdline = asubject.queryinterface(components.interfaces.nsicommandline); var test = cmdline.handleflagwi...
Using LDAP XPCOM with XULRunner - Archive of obsolete content
srcdir = @srcdir@ topsrcdir = @top_srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = mozldapstub library_name = mozldap_stub is_component = 1 force_shared_lib = 1 requires = \ xpcom \ string \ $(null) cppsrcs = ldapstubloader.cpp extra_dso_ldopts += \ $(dist)/lib/$(lib_prefix)xpcomglue_s.$(lib_suffix) \ $(xpcom_frozen_ldopts) \ $(nspr_libs) \ $(null) include $(topsrcdir)/config/rules.mk defines += -dmoz_dll_prefix=\"$(dll_prefix)\" ldapstubloader.cpp: // cop...
...yright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> #include "nscore.h" #include "nsmodule.h" #include "prlink.h" #include "nsilocalfile.h" #include "nsstringapi.h" #include "nscomptr.h" static char const *const kdependentlibraries[] = { #ifdef ns_win32 moz_dll_prefix "nsldap32v50" moz_dll_suffix, moz_dll_prefix "nsldappr32v50" moz_dll_suffix, #endif //ns_win32 #ifdef ns_unix moz_dll_prefix "ldap50" moz_dll_suffix, moz_dll_prefix "prldap50" moz_dll_suffix, #endif //ns_unix nsnull }; // component.dll on windows, libcomponent.dll on linux static char krealcomponent[] = moz_dll_prefix "mozldap" moz_dll_suffix; nsresult nsgetmodule(nsicomponentmanager* acompmgr, nsifile* alocation, nsimodule* *aresult) { nsresult rv; nscomptr<nsifile> libraries; rv ...
... } library->setnativeleafname(ns_literal_cstring(krealcomponent)); prlibrary *lib; rv = library->load(&lib); if (ns_failed(rv)) return rv; nsgetmoduleproc getmoduleproc = (nsgetmoduleproc) pr_findfunctionsymbol(lib, ns_get_module_symbol); if (!getmoduleproc) return ns_error_failure; return getmoduleproc(acompmgr, alocation, aresult); } then change your .mozconfig to add this line: ac_add_options --enable-extensions=ldapstub rebuild xulrunner.
Mozilla release FAQ - Archive of obsolete content
the old layout engine, networking engine, and several of the older modules were gutted, and much later, the sources reached the point where netscape was comfortable making a release, and so netscape 6.0 was released.
...on www.mozilla.org, there is a list of module 'owners'.
...check for for the module owner, and contact him/her.
Adobe Flash - Archive of obsolete content
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.
Proposal - Archive of obsolete content
spec exists itunes rss itunes extension modules used for ipradio/podcasting.
... spec exists media rss rss extension module used for iptv and ipradio/podcasting.
...in development rsshints a module that adds elements to a feed that help an aggregator process them.
RSS - Archive of obsolete content
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 elements.
Tree shaking - MDN Web Docs Glossary: Definitions of Web-related terms
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.
... 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 ...
Accessible multimedia - Learn web development
multimedia and accessibility so far in this module we have looked at a variety of content and what needs to be done to ensure its accessibility, ranging from simple text content to data tables, images, native controls such as form elements and buttons, and even more complex markup structures (with wai-aria attributes).
... we've not written a new set of assessments for this article, because there are already assessments available in our html multimedia and embedding module that test your knowledge of the information presented here.
... previous overview: accessibility next in this module what is accessibility?
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.
... the way this usually affects web development work is the requirement that controls be accessible by the keyboard — we'll discuss keyboard accessibility in later articles in the module, but it is a good idea to try out some websites using just the keyboard to see how you get on.
... overview: accessibility next in this module what is accessibility?
Fundamental CSS comprehension - Learn web development
you've covered a lot in this module, so it must feel good to have reached the end!
... the final step before you move on is to attempt the assessment for the module — this involves a number of related exercises that must be completed in order to create the final design — a business card/gamer card/social media profile.
... prerequisites: before attempting this assessment you should have already worked through all the articles in this module.
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.
...one way is to use an online testing tool such as sauce labs, as detailed in the cross browser testing module.
... cascading web design with feature queries using feature queries (video) 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 methods supporting older browsers fundamental layout comprehension assessment ...
CSS layout - Learn web development
get started prerequisites before starting this module, you should already: have basic familiarity with html, as discussed in the introduction to html module.
... 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.
... supporting older browsers in this module we recommend using flexbox and grid as the main layout methods for your designs.
How CSS is structured - Learn web development
note: you will learn more about selectors in the next module: css selectors.
...the cascade and inheritance section in the next module explains this in detail, including how to calculate specificity.
... previous overview: first steps next in this module what is css?
How CSS works - Learn web development
the updated output is as follows: in our debugging css article in the next module we will be using browser devtools to debug css problems, and will learn more about how the browser interprets css.
... and finally you've nearly finished this module; we only have one more thing to do.
... previous overview: first steps next in this module what is css?
Typesetting a community school homepage - Learn web development
previous overview: styling text in this assessment we'll test your understanding of all the text styling techniques we've covered throughout this module by getting you to style the text for a community school's homepage.
... prerequisites: before attempting this assessment you should have already worked through all the articles in this module.
... previous overview: styling text in this module fundamental text and font styling styling lists styling links web fonts typesetting a community school homepage ...
Styling text - Learn web development
we round off the module by looking at applying custom fonts to your page, and styling lists and links.
... 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.
... guides this module contains the following articles, which will teach you all of the essentials behind styling html text content.
Client-side form validation - Learn web development
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.
... different types of client-side validation there are two different types of client-side validation that you'll encounter on the web: built-in form validation uses html5 form validation features, which we've discussed in many places throughout this module.
... previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for form widgets ...
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.
... get started prerequisites before starting this module, you should at least work through our introduction to html.
... 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.
Mozilla splash page - Learn web development
previous overview: multimedia and embedding in this assessment, 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.
... 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 ...
From object to iframe — other embedding technologies - Learn web development
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.
...we'll look at svg in the next article of the module.
... previous overview: multimedia and embedding next 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 ...
Responsive images - Learn web development
css arguably has better tools for responsive design than html, and we'll talk about those in a future css module.
...you can find a detailed assessment that tests these skills at the end of the module; see mozilla splash page.
... this also draws to a close the entire multimedia and embedding module!
HTML table advanced features and accessibility - Learn web development
previous overview: tables next in the second article in this module, we look at some more advanced features of html tables — such as captions/summaries and grouping your rows into table head, body and footer sections — as well as looking at the accessibility of tables for visually impaired users.
...you'll learn more about this when you go through our css modules (introduction to css is a good place to start; we also have an article specifically on styling tables).
... previous overview: tables next in this module html table basics html table advanced features and accessibility structuring planet data ...
General asynchronous programming concepts - Learn web development
you should understand these concepts before working through the other articles in the module.
...in the rest of this module, we'll explore further why asynchronous code matters and how to design code that avoids some of the problems described above.
... in this module general asynchronous programming concepts introducing asynchronous javascript cooperative asynchronous javascript: timeouts and intervals graceful asynchronous programming with promises making asynchronous programming easier with async and await choosing the right approach ...
Introduction to web APIs - Learn web development
common browser apis in particular, the most common categories of browser apis you'll use (and which we'll cover in this module in greater detail) are: apis for manipulating documents loaded into the browser.
... note: if you are not already familiar with how objects work, you should go back and work through our javascript objects module before continuing.
... overview: client-side web apis next in this module introduction to web apis manipulating documents fetching data from the server third-party apis drawing graphics video and audio apis client-side storage ...
Client-side web APIs - Learn web development
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.
... 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, and javascript objects).
... those modules typically involve simple api usage, as it is often difficult to write client-side javascript examples without them.
Arrays - Learn web development
previous overview: first steps next in the final article of this module, we'll look at arrays — a neat way of storing a list of data items under a single variable name.
...we'll be teaching you all the useful basics there are to know about loops in the next module, but for now you should give yourself a clap and take a well-deserved break; you've worked through all the articles in this module!
... the only thing left to do is work through this module's assessment, which will test your understanding of the articles that came before it.
Silly story generator - Learn web development
previous overview: first steps in this assessment you'll be tasked with taking some of the knowledge you've picked up in this module's articles and applying it to creating a fun app that generates random silly stories.
... prerequisites: before attempting this assessment you should have already worked through all the articles in this module.
... previous overview: first steps in this module what is javascript?
Web performance - Learn web development
this is known as web performance, and in this module you'll focus on the fundamentals of how to create performant websites.
...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, 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.
Client-Server Overview - Learn web development
the first pattern ensures that an http request with a resource url of /best will be passed to a function named index() in the views module.
... in a following module we'll help you choose the best web framework for your first site.
... previous overview: first steps next in this module introduction to the server side client-server overview server-side web frameworks website security ...
Getting started with Ember - Learn web development
a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them.
... in ember-cli-build.js, find the following code: let app = new emberapp(defaults, { // add options here }); add the following lines underneath it before saving the file: app.import('node_modules/todomvc-common/base.css'); app.import('node_modules/todomvc-app-css/index.css'); for more information on what ember-cli-build.js does, and for other ways in which you can customize your build / pipeline, the ember guides have a page on addons and dependencies.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Ember interactivity: Events, classes and state - Learn web development
a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them.
...nds component { @action onkeydown({ target, key }) { let text = target.value.trim(); let hasvalue = boolean(text); if (key === 'enter' && hasvalue) { alert(text); target.value = '' } } } the @action decorator is the only ember-specific code here (aside from extending from the component superclass, and the ember-specific items we are importing using javascript module syntax) — the rest of the file is vanilla javascript, and would work in any application.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Routing in Ember - Learn web development
a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them.
... creating the "index" route did not add a route definition line to router.js, because like with url navigation and javascript module loading, "index" is a special word that indicates the default route to render, load, etc.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
React resources - Learn web development
create-react-app makes it possible to import css files into javascript modules, so that css is only sent to your user when the corresponding component is rendered.
... for this app, we could have for example written a dedicated form.css file to house the styles of those respective components, then imported the styles into their respective modules like this: import form from './form'; import './form.css' this approach makes it easy to identify and manage the css that belongs to a specific component.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Deployment and next steps - Learn web development
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.
...in our case we will tell git to exclude files in the node_modules directory by creating a .gitignore file in the root folder of your local project, with the following content: node_modules/ now let's go back to gitlab.
... previous overview: client-side javascript frameworks in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Handling common accessibility problems - Learn web development
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.
...we've already talked about other spheres such as responsive design and performance in other places in the module.
... previous overview: cross browser testing next in this module introduction to cross browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
Handling common JavaScript problems - Learn web development
note: feature detection will be covered in a lot more detail in its own dedicated article, later in the module.
...via a <script> element), although there are normally many other usage options for such libraries, like installing them as bower components, or including them as dependencies via the webpack module bundler.
... previous overview: cross browser testing next in this module introduction to cross browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
Strategies for carrying out testing - Learn web development
previous overview: cross browser testing next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross-browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross-browser testing.
... we will look at how to use such tools later on in the module.
... previous overview: cross browser testing next in this module introduction to cross-browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
Learn web development
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 you have a bit of knowledge already, the next step is to learn html and css in detail: start with our introduction to html module and move on to our css first steps module.
...begin with our javascript first steps and server-side first steps modules.
ChromeWorkers and the Chrome worker loader
this documentation covers chrome workers and the chrome worker module loader.
... chrome worker modulesthe preferred way to define and load modules for chrome workers is to use the chrome worker module loader.
... this module loader should not surprise developers familiar with commonjs, as it implements a minimal commonjs require().
Debugging JavaScript
you can also start the browser console when you launch firefox, by launching firefox from the command line and passing --jsconsole as a flag: /path/to/firefox --jsconsole log to the browser console using the standard console api after importing console.jsm: let console = (cu.import("resource://gre/modules/console.jsm", {})).console; console.log("hello from firefox code"); error console this is obsolete and is no longer enabled in firefox by default.
... console.log in browser console you can dump variables in the browser console from addon code, by adding this line to import the console utility: const { console } = components.utils.import("resource://gre/modules/devtools/console.jsm", {}); this has an advantage over dump in that you can list out properties of an object logged with console.log.
... components.utils.import("resource://gre/modules/log.jsm"); "debugger" keyword you can halt venkman or chromebug at a line using the keyword debugger.
ESLint
prior to firefox 55 the location for the eslint binary used to be tools/lint/eslint/node_modules/.bin, since bug 1305023, node_modules is now located in the top-level directory, and should need no special set-up.
... more information: outline details of the rules rule source code common issues and how to solve them my editor says that "mozilla/whatever" is unknown run ./mach eslint --setup restart your editor if that doesn't work, check that you have your editor pointing to the correct node_modules folder.
... foo.jsm exports a symbol, but that is not recognised by eslint check it is listed correctly in tools/lint/eslint/modules.json using services.scriptloader.loadsubscript?
Limitations of chrome scripts
nsiaboutmodule by default, custom about: pages registered using nsiaboutmodule are loaded in the chrome process.
... javascript code modules (jsms) in single-process firefox, you can use javascript code modules (jsms) to maintain global state.
...you can do this by loading a frame script or, with the add-on sdk, you can use remoterequire() in the "remote/parent" module.
Limitations of frame scripts
nsiaboutmodule by default, custom about: pages registered using nsiaboutmodule are loaded in the chrome process.
... to avoid the shim: if you need to access the content of your about page from the content process, you need to register the nsiaboutmodule in the content process as well as the chrome process.
... javascript code modules (jsms) in multiprocess firefox, a jsm loaded into the content process does not share any state with the same jsm loaded into the chrome process.
Performance
better: addon.js as above // framescript.js components.utils.import("resource://my-addon/processmodule.jsm", {}).addframe(this) // processmodule.jsm const exported_symbols = ['addframe']; const precomputedconstants = // ...
...do some work on the window } function dosomething(message) { frameglobal = message.target result = helper(frameglobal.content, message.data) frameglobal.sendasyncmessage("my-addon:response-from-child", {something: result}) } function addframe(frameglobal) { frameglobal.addmessagelistener("my-addon:request-from-parent", dosomething) } javascript modules are per-process singletons and thus all their objects are only initialized once, which makes them suitable for stateless callbacks.
... better: // addon.js var main = new myaddonservice(); main.onchange(statechange); function statechange() { services.ppmm.broadcastasyncmessage("my-addon:update-configuration", {newconfig: main.serialize()}) } // processmodule.jsm const exported_symbols = ['getmaincopy']; var maincopy; services.cpmm.addmessagelistener("my-addon:update-configuration", function(message) { maincopy = message.data.newconfig; }) funtion getmaincopy() { return maincopy; } // framescript.js components.utils.import("resource://my-addon/processmodule.jsm") // getmaincopy() used by other functions don't register observers (and oth...
Code Samples
components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("yourextensionid", function(addon) { var addonlocation = addon.getresourceuri("").queryinterface(components.interfaces.nsifileurl).file.path; }); accessing file and version information components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("my-addon@foo.com", function(addon) { alert("my extension's version is " + addon.version); alert("did i remember to include that file.txt file in my xpi?
..."yes!" : "no"); alert("let's pretend i did, it's available from the url " + addon.getresourceuri("file.txt").spec); }); uninstall an add-on components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("youraddon@youraddon.com", function(addon) { addon.uninstall(); }); disable an add-on components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("youraddon@youraddon.com", function(addon) { if (addon.isactive) addon.userdisabled = addon.isactive; }); listening for add-on uninstall this example sets a variable beinguninstalled that you can check when you get a profile-before-change message to do cleanup for your add-on on uninstall.
...uninstalled; let listener = { onuninstalling: function(addon) { if (addon.id == "youraddon@youraddon.com") { beinguninstalled = true; } }, onoperationcancelled: function(addon) { if (addon.id == "youraddon@youraddon.com") { beinguninstalled = (addon.pendingoperations & addonmanager.pending_uninstall) != 0; } } } try { components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.addaddonlistener(listener); } catch (ex) {} ...
Add-on Manager
for example: components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getalladdons(function(aaddons) { // here aaddons is an array of addon objects }); // this code will execute before the code inside the callback notifications about changes to installed add-ons are dispatched to any registered addonlisteners.
...these will pass an addoninstall instance to the callback, which can then be used to install the add-on: components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getinstallforurl("http://www.foo.com/test.xpi", function(ainstall) { // ainstall is an instance of addoninstall ainstall.install(); }, "application/x-xpinstall"); the progress of addoninstalls can be monitored using an installlistener.
... for example, to take a look at the add-ons that were disabled at startup: components.utils.import("resource://gre/modules/addonmanager.jsm"); let addonids = addonmanager.getstartupchanges(addonmanager.startup_change_disabled); if (addonids.length > 0) { // addonids is now an array of the add-on ids that have been disabled alert("note: " + addonids.length + " add-ons have been disabled."); } open add-on manager tab the add-on manager tab can be opened programatically with the function browseropenaddonsmgr whic...
Assert.jsm
the assert.jsm javascript code module implements the commonjs unit testing specification version 1.1, which provides a basic, standardized interface for performing in-code logical assertions with optional, customizable error reporting.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://testing-common/assert.jsm"); the assert class offers methods for performing common logical assertions.
... this report method only throws errors on assertion failures, as per spec, but consumers of this module (think: xpcshell-test, mochitest) may want to override this default implementation.
FxAccountsProfileClient.jsm
the fxaccountsprofileclient.jsm javascript module provides a way to fetch firefox accounts profile information.
... the modules uses the firefox profiler server api.
... components.utils.import("resource://gre/modules/fxaccountsprofileclient.jsm"); creating a new fxaccountsprofileclient new fxaccountsprofileclient(object options); method overview fetchprofile(); attributes serverurl url profiler server url.
Geometry.jsm
the geometry.jsm javascript code module provides routines for performing common geometry operations on points and rectangles.
...to use these routines, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/geometry.jsm"); once you've imported the module, you can then use the point and rect classes.
... note: although this module is usable from mobile, and is present in firefox 4, it's currently not used in firefox 4 and attempting to use it may produce unreliable results there.
Interfacing with the Add-on Repository
the add-on repository javascript code module makes it easy for your extension to interface with the amo repository.
... you an use the code module to get lists of add-ons and even install new add-ons.
... importing the repository code module before you can use the add-on repository api, you need to import the code module: components.utils.import("resource://gre/modules/addonrepository.jsm"); having done this, you can then access the api through the resulting addonrepository object.
JavaScript OS.Constants
javascript module os.constants contains operating system-specific constants.
... this module is largely a companion to js-ctypes.
...module os.constants is always available for chrome workers.
Log.jsm
this module is still under development.
... the log.jsm javascript code module (formerly named log4moz.js) provides a log4j style api for logging log messages to various endpoints, such as the browser console or a file on disk.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/log.jsm"); basic usage components.utils.import("resource://gre/modules/log.jsm"); // get a logger, give it a name unique to this chunk of code.
NetUtil.jsm
the netutil.jsm javascript code module provides easy-to-use apis for performing common network related tasks.
... to use these utilities, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/netutil.jsm"); once you've imported the module, you can then use its methods.
... example this example writes a string to a file; it comes from the test suite for the netutil module.
openLocationLastURL.jsm
(bug 953124) the openlocationlasturl.jsm javascript code module lets you set and retrieve the url most recently opened using the "open location" option in the file menu.
... to use this, you first need to import the code module into your javascript scope: components.utils.import("resource:///modules/openlocationlasturl.jsm"); once you've imported the module, you can then use the openlocationlasturl object it exports.
... note: this module automatically handles private browsing mode for you.
Creating a Cookie Log
change to your firefox directory (usually c:\program files\mozilla firefox) type "set nspr_log_file=c:\temp\cookie-log.txt", enter type "set nspr_log_modules=cookie:4" and press enter run firefox by typing "firefox.exe" and pressing enter.
... type "export nspr_log_modules=cookie:4" and press enter.
... type "export nspr_log_modules=cookie:4" and press return.
PR_LOG
syntax #include <prlog.h> void pr_log ( prlogmoduleinfo *_module, prlogmodulelevel _level ...
... _args); parameters the macro has these parameters: _module a pointer to a log module structure.
... returns nothing description this macro formats the specified arguments and writes the output to the log file, if logging is enabled for the specified module and level.
NSS_3.12_release_notes.html
bject (see pk11pub.h) pk11_createpbev2algorithmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11pub.h) pk11_getpbecryptomechanism (see pk11pub.h) pk11_isremovable (see pk11pub.h) pk11_mergetokens (see pk11pub.h) pk11_writerawattribute (see pk11pub.h) seckey_ecparamstobasepointorderlen (see keyhi.h) seckey_ecparamstokeysize (see keyhi.h) secmod_deletemoduleex (see secmod.h) sec_getregisteredhttpclient (see ocsp.h) sec_pkcs5isalgorithmpbealgtag (see secpkcs5.h) vfy_createcontextdirect (see cryptohi.h) vfy_createcontextwithalgorithmid (see cryptohi.h) vfy_verifydatadirect (see cryptohi.h) vfy_verifydatawithalgorithmid (see cryptohi.h) vfy_verifydigestdirect (see cryptohi.h) vfy_verifydigestwithalgorithmid (see cryptohi.h) new macros for camellia sup...
...m_continue_testing_on_fresh_info cert_rev_mi_test_each_method_separately cert_rev_mi_test_all_local_information_first cert_rev_mi_no_overall_info_requirement cert_rev_mi_require_some_fresh_info_available cert_policy_flag_no_mapping cert_policy_flag_explicit cert_policy_flag_no_any cert_enable_ldap_fetch cert_enable_http_fetch new macro in utilrename.h: smime_aes_cbc_128 the nssckbi pkcs #11 module's version changed to 1.70.
... bug 412906: remove sha.c and sha.h from lib/freebl bug 353543: valgrind uninitialized memory read in nsspkiobjectcollection_addinstances bug 377548: nss qa test program certutil's default dsa prime is only 512 bits bug 333405: item cleanup is unused deadcode in secitem_allocitem loser bug 288730: compiler warnings in certutil bug 337251: warning: /* within comment bug 362967: export secmod_deletemoduleex bug 389248: nss build failure when nss_enable_ecc is not defined bug 390451: remembered passwords lost when changing master password bug 418546: reference leak in cert_pkixverifycert bug 390074: os/2 sign.cmd doesn't find sqlite3.dll bug 417392: certutil -l -n reports bogus trust flags documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation.
Utilities for nss samples
get a module password.
...in the single password * case a line would just have the passord whereas in the multi- * password variant they could be of the form * * token_1_name:its_password * token_2_name:its_password * */ extern char * filepasswd(pk11slotinfo * slot, prbool retry, void *arg); /* * getmodulepassword */ extern char * getmodulepassword(pk11slotinfo *slot, int retry, void *pwdata); /* * generaterandom */ extern secstatus generaterandom(unsigned char *rbuf, int rsize); /* * filetoitem */ extern secstatus filetoitem(secitem *dst, prfiledesc *src); /* * seedfromnoisefile */ extern secstatu...
...kenname) break; if (port_strncmp(phrase, tokenname, tokenlen)) continue; phraselen = port_strlen(phrase); if (phraselen < (tokenlen+1)) continue; if (phrase[tokenlen] != ':') continue; phrase = &phrase[tokenlen+1]; break; } while (i<nb); phrase = port_strdup((char*)phrase); port_free(phrases); return phrase; } /* * getmodulepassword */ char* getmodulepassword(pk11slotinfo *slot, int retry, void *arg) { char prompt[255]; secupwdata *pwdata = (secupwdata *)arg; char *pw; if (pwdata == null) { return null; } if (retry && pwdata->source != pw_none) { pr_fprintf(pr_stderr, "incorrect password/pin entered.\n"); return null; } switch (pwdata->source) { case pw_...
nss tech note7
rsa key pairs may be generated inside a crypto module (also known as a token).
... use pk11_generatekeypair() to generate a key pair in a crypto module.
... key pairs may be generated elsewhere, exported in encrypted form, and imported into a crypto module.
NSS tools : vfychain
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations.
... this tool can also create certificate, key, and module security database files.
... the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases.
Utility functions
ter seckey_destroyencryptedprivatekeyinfo mxr 3.2 and later seckey_destroyprivatekeyinfo mxr 3.2 and later seckey_destroypublickey mxr 3.2 and later seckey_publickeystrength mxr 3.2 and later seckey_updatecertpqg mxr 3.2 and later secmod_addnewmodule mxr 3.3 and later secmod_addnewmoduleex mxr 3.4 and later secmod_deletemoduleex mxr 3.12 and later secmod_cancelwait mxr 3.9.3 and later secmod_candeleteinternalmodule mxr 3.5 and later secmod_createmodule mxr 3.4 and later secmod_...
...deletemodule mxr 3.4 and later secmod_findmodule mxr 3.4 and later secmod_findslot mxr 3.4 and later secmod_freemodulespeclist mxr 3.4 and later secmod_getdbmodulelist mxr 3.9 and later secmod_getdeadmodulelist mxr 3.9 and later secmod_getmodulespeclist mxr 3.4 and later secmod_hasremovableslots mxr 3.9.3 and later secmod_ismodulepresent mxr 3.2 and later secmod_loadmodule mxr 3.4 and later secmod_loadusermodule mxr 3.4 and later secmod_lookupslot mxr 3.2 and later ...
...secmod_pubcipherflagstointernal mxr 3.4 and later secmod_pubmechflagstointernal mxr 3.4 and later secmod_unloadusermodule mxr 3.4 and later secmod_updatemodule mxr 3.4 and later secmod_updateslotlist mxr 3.9.3 and later secmod_waitforanytokenevent mxr 3.9.3 and later secoid_addentry mxr 3.10 and later secoid_comparealgorithmid mxr 3.2 and later secoid_copyalgorithmid mxr 3.2 and later secoid_destroyalgorithmid mxr 3.2 and later secoid_findoid mxr 3.2 and later secoid_findoidbytag mxr ...
NSS Tools pk12util
pbe with sha1 and 2key triple des-cbc" "pkcs12 v2 pbe with sha1 and 128 bit rc2 cbc" "pkcs12 v2 pbe with sha1 and 40 bit rc2 cbc" pkcs #5 pbe ciphers: "pkcs #5 password based encryption with md2 and des cbc" "pkcs #5 password based encryption with md5 and des cbc" "pkcs #5 password based encryption with sha1 and des cbc" it should be noted that the the crypto provider may be the softtoken module or an external hardware module.
... it may be the case that the cryptographic module does not support the requested algorithm and a best fit will be selected, likely to be the default.
... if no suitable replacement for the desired algorithm can be found a "no security module can perform the requested operation" will appear on the error message.
NSS tools : vfychain
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations.
... this tool can also create certificate, key, and module security database files.
... the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases.
FOSS
includes a js shell that allows you to use cpan modules from javascript.
... http://code.google.com/p/gpsee/ - commonjs platform, native-language module interoperability methods, modules, etc.
...bundled modules include support for bytearray, bytestring, cgi, posix signals, ffi, and more.
Bytecode Descriptions
dynamicimport stack: moduleid ⇒ promise dynamic import of the module specified by the string value on the top of the stack.
...this must be used only in module code.
...format: jof_envcoord, jof_name, jof_typeset, jof_ic getimport operands: (uint32_t nameindex) stack: ⇒ val get the value of a module import by name and pushes it onto the stack.
XPCOM Stream Guide
MozillaTechXPCOMGuideStreams
var converter = components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(components.interfaces.nsiscriptableunicodeconverter); converter.charset = "utf-8"; var stream = converter.converttoinputstream(string); javascript modules are your friends there are several useful javascript modules at your disposal.
...the io service is available through the services.jsm module as the .io property.
... "nsistringinputstream", "setdata"); var inputstream = components.constructor("@mozilla.org/scriptableinputstream;1", "nsiscriptableinputstream", "init"); function buildstream(data) { return new stringstream(data, data.length); } components.utils.import("resource://gre/modules/netutil.jsm"); function run_test() { var check = "we will rock you!"; var baseinputstream = buildstream(check); var store = components.classes["@mozilla.org/storagestream;1"] .createinstance(components.interfaces.nsistoragestream); /* in practice, your storage streams shouldn't be this small.
HOWTO
using js modules and non-ui javascript chrome files problem you want to write a javascript file, and run it in xpcshell.
... the file uses js modules.
...e.g., you use: components.utils.import("resource://app/modules/gloda/log4moz.js"); however, you get (for that particular line, which is the first import): uncaught exception: [exception...
IJSDebugger
you should usually interface with this using the javascript code module instead of directly.
... inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) implemented by: @mozilla.org/jsdebugger;1 as a service: var jsdebugger = components.classes["@mozilla.org/jsdebugger;1"] .createinstance(components.interfaces.ijsdebugger); note: you should almost never directly use this service; instead, you should use the javascript code module that does this for you.
... the only time you should directly use this interface to create the debugger object is if you need to debug chrome; due to bug 707237, the javascript code module doesn't work in that case.
nsIComponentRegistrar
for example, if the given file is a native library, it must export the symbol nsgetmodule.
...this value is passed into the nsimodule.registerself() callback and must be forwarded unmodified when registering factories via their location.
...this value is passed into thensimodule.registerself() callback and must be forwarded unmodified when registering factories via their location.
nsIZipWriter
modules/libjar/zipwriter/public/nsizipwriter.idlscriptable this interface provides an easy way for scripts to archive data in the zip file format.
... var {cc: classes, ci: interfaces, cu: utils} = components; var zw = cc['@mozilla.org/zipwriter;1'].createinstance(ci.nsizipwriter); var pr = {pr_rdonly: 0x01, pr_wronly: 0x02, pr_rdwr: 0x04, pr_create_file: 0x08, pr_append: 0x10, pr_truncate: 0x20, pr_sync: 0x40, pr_excl: 0x80}; //https://developer.mozilla.org/docs/pr_open#parameters var fu = cu.import('resource://gre/modules/fileutils.jsm').fileutils; var fp = cc['@mozilla.org/filepicker;1'].createinstance(ci.nsifilepicker); fp.init(window, 'select directory to compile', ci.nsifilepicker.modegetfolder); fp.appendfilters(ci.nsifilepicker.filterall | ci.nsifilepicker.filtertext); var rv = fp.show(); if (rv == ci.nsifilepicker.returnok) { var dir = fp.file; //dir must exist, as the user selected it.
... saveinzipas = saveinzipas.replace(/\\/g,'/'); //remember must use forward slash (/) cu.reporterror('--' + saveinzipas); zw.addentryfile(saveinzipas, ci.nsizipwriter.compression_none, entry, false); } } zw.close() } other examples for other examples, take a look at the unit tests in the source tree: modules/libjar/zipwriter/test/unit see also nsizipreader nsifile nsichannel nsiinputstream ...
XPCOM Interface Reference
oragefunctionmozistoragependingstatementmozistorageprogresshandlermozistorageresultsetmozistoragerowmozistorageservicemozistoragestatementmozistoragestatementcallbackmozistoragestatementparamsmozistoragestatementrowmozistoragestatementwrappermozistoragevacuumparticipantmozistoragevaluearraymozitxttohtmlconvmozithirdpartyutilmozivisitinfomozivisitinfocallbackmozivisitstatuscallbacknsiabcardnsiaboutmodulensiabstractworkernsiaccelerometerupdatensiaccessnodensiaccessibilityservicensiaccessiblensiaccessiblecaretmoveeventnsiaccessiblecoordinatetypensiaccessibledocumentnsiaccessibleeditabletextnsiaccessibleeventnsiaccessiblehyperlinknsiaccessiblehypertextnsiaccessibleimagensiaccessibleprovidernsiaccessiblerelationnsiaccessibleretrievalnsiaccessiblerolensiaccessiblescrolltypensiaccessibleselectablensiac...
...nsialertsservicensiannotationobservernsiannotationservicensiappshellnsiappshellservicensiappstartupnsiappstartup_mozilla_2_0nsiapplicationcachensiapplicationcachechannelnsiapplicationcachecontainernsiapplicationcachenamespacensiapplicationcacheservicensiapplicationupdateservicensiarraynsiasyncinputstreamnsiasyncoutputstreamnsiasyncstreamcopiernsiasyncverifyredirectcallbacknsiauthinformationnsiauthmodulensiauthpromptnsiauthprompt2nsiauthpromptadapterfactorynsiauthpromptcallbacknsiauthpromptprovidernsiauthpromptwrappernsiautocompletecontrollernsiautocompleteinputnsiautocompleteitemnsiautocompletelistenernsiautocompleteobservernsiautocompleteresultnsiautocompletesearchnsibadcertlistener2nsibidikeyboardnsibinaryinputstreamnsibinaryoutputstreamnsiblocklistpromptnsiblocklistservicensiboxobjectnsibrows...
...cksupportnsimarkupdocumentviewernsimemorynsimemorymultireporternsimemorymultireportercallbacknsimemoryreporternsimemoryreportermanagernsimenuboxobjectnsimessagebroadcasternsimessagelistenernsimessagelistenermanagernsimessagesendernsimessagewakeupservicensimessengernsimicrosummarynsimicrosummarygeneratornsimicrosummaryobservernsimicrosummaryservicensimicrosummarysetnsimimeconverternsimimeheadersnsimodulensimsgaccountnsimsgaccountmanagerextensionnsimsgcompfieldsnsimsgcustomcolumnhandlernsimsgdbhdrnsimsgdbviewnsimsgdbviewcommandupdaternsimsgdatabasensimsgfilternsimsgfiltercustomactionnsimsgfilterlistnsimsgfoldernsimsgheaderparsernsimsgidentitynsimsgincomingservernsimsgmessageservicensimsgprotocolinfonsimsgruleactionnsimsgsearchcustomtermnsimsgsearchnotifynsimsgsearchscopetermnsimsgsearchsessionnsim...
XPCOM reference
if you're working on a module in the mozilla codebase that's compiled with the mozilla_internal_api flag set, some of these apis -- the string functions and classes in particular -- are not the ones you should be using.
...this macro is meant for critical errors; like assertions, ns_errors should not be reachable.ns_if_addrefmacrons_if_releasemacrons_releasemacrons_warningmacronsgetmoduleprocthis function prototype provides the xpcom entry-point into a module.nsiabcard/thunderbird3the nsiabcard interface is used to represent and manipulate cards in the address book.
...for example, to request the 'show all threads' view use the constant:nsstaticmoduleinfothis data structure is used by ns_initxpcom3 to specify static xpcom modules.standard xpcom componentsthere are a number of components provided in the standard implementation of xpcom; these are as follows.xpcom glue classesthese "glue" classes are provided to make it easier to use xpcom from c++ code.xpcom interface referencethis is a reference to the xpcom interfaces provided by the mozilla ...
Using the clipboard
// import the services module for future use, if we're not in // a browser window where it's already loaded.
... components.utils.import('resource://gre/modules/services.jsm'); // create a constructor for the built-in supports-string class.
... 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.nsiwebnavigation); 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.
XPCOM
if you have a class that you think is involved in a cyclical-ownership leak, this page is for you.introduction to xpcom for the domwarning: this document has not yet been reviewed by the dom gurus, it might contain some errors.language bindingsan xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings.monitoring http activitygecko includes the nsihttpactivityobserver interface, which you can implement in your code to monitor http transactions in real time, receiving a callback as the transactions take place.nscomptr versus refptrgecko code uses both nscomptr and refptr as smart pointers...
...if the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull.working with multiple versions of interfacesin this short note we illustrate how one can update an xpcom module in order for it to work in both firefox 2 and firefox 3, even if the interfaces have changed in the interim.working with out parameterswrappedjsobjectwrappedjsobject is a property sometimes available on xpconnect wrappers.
...the contents herein are oriented primarily toward extension developers and people embedding xpcom in other projects.xpcom tasksthe xpcom module roughly parallels the c/c++ standard libraries.
Mozilla technologies
these services include:viewing and searching mozilla source code onlinesource code for all mozilla projects hosted in the mercurial repositories can be searched and viewed online using searchfox, a fast indexed search engine that runs on aws.xml extrasthe xml extras module contains several features that allow developers to treat xml as data i.e.
...the module is structured as a drop-in component and exposes 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.xpcomxpcom is a cross platform component object model, similar to microsoft com.
XPI
cross-platform installer module (xpi) is a zip file used to install packages, utilizing the xpinstall technology.
... xpi modules (so called "bundles") are employed to install a wide variety of software, including plugins, extensions, themes, and thunderbird dictionaries.
... see also bundles xpinstall creating xpi installer modules ...
Debugging Tips
let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p); let pp = p.address(); console.log(pp); the result will be as following: cdata { value: 10 } cdata { x: 10, y: 20 } cdata { contents: cdata } to see more descriptive information, you can use .tosource().
... let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i.tosource()); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p.tosource()); let pp = p.address(); console.log(pp.tosource()); the result will be : ctypes.int32_t(10) point(10, 20) point.ptr(ctypes.uint64("0x15fdafb08")) to see the complete type information, you can use .constructor.tosource(), to print the source of ctype.
... let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i.constructor.tosource()); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p.constructor.tosource()); let pp = p.address(); console.log(pp.constructor.tosource()); the result will be as per the following: ctypes.int32_t ctypes.structtype("point", [{ "x": ctypes.int32_t }, { "y": ctypes.int32_t }]) ctypes.structtype("point", [{ "x": ctypes.int32_t }, { "y": ctypes.int32_t }]).ptr ...
Browser Console - Firefox Developer Tools
console.jsm to use the console api from a traditional or bootstrapped add-on, get it from the console module.
... components.utils.import("resource://gre/modules/console.jsm"); console.log("hello from firefox code"); //output messages to the console learn more: console api reference console.jsm source code in the mozilla dxr hudservice there is also the hudservice which allows access to the browse console.
... the module is available at mozilla dxr.
DevTools API - Firefox Developer Tools
to use the gdevtools api from an add-on, it can be imported with following snippet const { gdevtools } = require("resource:///modules/devtools/gdevtools.jsm"); methods registertool(tooldefinition) registers a new tool and adds a tab to each existing toolbox.
... note: some components use add-on sdk event module instead of the devtools eventemitter.
...the main differences between the two modules are that the first parameter for add-on sdk events is the first payload argument instead of the event name and the once method does not return a promise.
Document.implementation - Web APIs
syntax domimpobj = document.implementation; example var modname = "html"; var modver = "2.0"; var conformtest = document.implementation.hasfeature( modname, modver ); alert( "dom " + modname + " " + modver + " supported?: " + conformtest ); // alerts with: "dom html 2.0 supported?: true" if dom level 2 html module is supported.
... a list of module names (e.g., core, html, xml, etc.) is available in the dom level 2 conformance section.
... notes the w3c's dom level 1 recommendation only specified the hasfeature method, which is one way to determine if a dom module is supported by a browser (see example above and what does your user agent claim to support?).
MouseEvent.pageX - Web APIs
WebAPIMouseEventpageX
the cssom view module redefined it as a double float.
... this property was originally specified in the touch events specification as a long integer, but was redefined in the cssom view module to be a double-precision floating-point number to allow for subpixel precision.
... .box { width: 400px; height: 250px; border: 2px solid darkblue; background-color: blue; color: white; font: 16px "zilla", "open sans", "helvetica", "arial", sans-serif; } result try this out here: specifications specification status comment css object model (cssom) view modulethe definition of 'pagex' in that specification.
PaintWorklet.registerPaint - Web APIs
examples the following shows registering an example worklet module.
...the file itself is loaded through css.paintworklet.addmodule() (documented here on the parent class of paintworklet, at worklet.addmodule().
...to use it, you register it with the css.paintworklet.addmodule() method: <script> css.paintworklet.addmodule('checkboardworklet.js'); </script> you can then use the paint() css function in your css anywhere an <image> value is valid.
PaintWorklet - Web APIs
css.paintworklet.addmodule() the addmodule() method, inhertied from the worklet interface loads the module in the given javascript file and adds it to the current paintworklet.
... create a paintworklet the following shows an example worklet module.
... <script> if ('paintworklet' in css) { css.paintworklet.addmodule('checkerboard.js'); } </script> use a paintworklet this example shows how to use a paintworklet in a stylesheet, including the simplest way to provide a fallback if paintworklet isn't supported.
Window.window - Web APIs
WebAPIWindowwindow
yet another reason to use this property, is for libraries which wish to offer oop-versions, and non-oop versions (especially javascript modules).
... for example, if we refer to "this.window.location.href", a javascript module could define a property called "window" inside of a class it defined (since no global "window" variable exists for it by default) which could be created after passing in a window object to the module class' constructor.
...another advantage, is that the objects of such a class (even if the class were defined outside of a module) could change their reference to the window at will, they would not be able to do this if they had hard-coded a reference to "window".
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
example: how gecko and mozilla implement msaa the accessible module is where the mozilla msaa implementation lives.
... feel free to peruse the source code in the accessible module whenever you want to see how something can be implemented.
... the accessible module is also where support for sun's atk accessibility api for linux and unix is implemented.
CSS Box Alignment - CSS: Cascading Style Sheets
the css box alignment module specifies css features that relate to the alignment of boxes in the various css box layout models: block layout, table layout, flex layout, and grid layout.
... the module aims to create a consistent method of alignment across all of css.
...alignment of text is now covered by the inline layout and css text modules, and for the first time in box alignment we have full horizontal and vertical alignment capabilities.
CSS Color - CSS: Cascading Style Sheets
WebCSSCSS Color
css color is a css module that deals with colors, color types, color blending, opacity, and how you can apply these colors and effects to html content.
... not all css properties that take a <color> as a value are part of this module, but they do depend upon it.
... specifications specification status comment css color module level 4 working draft css color module level 3 recommendation css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
CSS Fonts - CSS: Cascading Style Sheets
WebCSSCSS Fonts
css fonts is a module of css that defines font-related properties and how font resources are loaded.
... specifications specification status comment css fonts module level 4 working draft adds font-variation-settings (and related higher-level properties) and font-optical-sizing.
... css fonts module level 3 candidate recommendation adds font-feature-settings (and related higher-level properties) css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
CSS Images - CSS: Cascading Style Sheets
css images is a module of css that defines what types of images can be used (the <image> type, containing urls, gradients and other types of images), how to resize them and how they, and other replaced content, interact with the different layout models.
... specifications specification 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.
CSS Scroll Snap - CSS: Cascading Style Sheets
css scroll snap is a module of css that introduces scroll snap positions, which enforce the scroll positions that a scroll container’s scrollport may end at after a scrolling operation has completed.
... note: the previous version of this module was called scroll snap points and has been deprecated.
...l-margin-top scroll-margin-right scroll-margin-bottom scroll-margin-left scroll-margin-inline scroll-margin-inline-start scroll-margin-inline-end scroll-margin-block scroll-margin-block-start scroll-margin-block-end guides basic concepts of css scroll snap browser compatibility and scroll snap specification specification status comment css scroll snap module level 1 candidate recommendation initial definition ...
break-after - CSS: Cascading Style Sheets
e> css html { font-family: helvetica, arial, sans-serif; } h1 { font-size: 3rem; letter-spacing: 2px; column-span: all; } h2 { font-size: 1.2rem; color: red; letter-spacing: 1px; } p { line-height: 1.5; break-after: column; } article { column-width: 200px; gap: 20px; } result specifications specification status comment css fragmentation module level 3the definition of 'break-after' in that specification.
... css regions module level 1the definition of 'break-after' in that specification.
... css multi-column layout modulethe definition of 'break-after' in that specification.
break-before - CSS: Cascading Style Sheets
> css html { font-family: helvetica, arial, sans-serif; } h1 { font-size: 3rem; letter-spacing: 2px; column-span: all; } h2 { font-size: 1.2rem; color: red; letter-spacing: 1px; break-before: column; } p { line-height: 1.5; } article { column-width: 200px; gap: 20px; } result specifications specification status comment css fragmentation module level 3the definition of 'break-before' in that specification.
... css regions module level 1the definition of 'break-before' in that specification.
... css multi-column layout modulethe definition of 'break-before' in that specification.
break-inside - CSS: Cascading Style Sheets
h1 + p { margin-top: 0; } p { line-height: 1.5; break-after: column; } figure { break-inside: avoid; } img { max-width: 70%; display: block; margin: 0 auto; } figcaption { font-style: italic; font-size: 0.8rem; width: 70%; } article { column-width: 200px; gap: 20px; } result specifications specification status comment css fragmentation module level 3the definition of 'break-inside' in that specification.
... css regions module level 1the definition of 'break-inside' in that specification.
... css multi-column layout modulethe definition of 'break-inside' in that specification.
display - CSS: Cascading Style Sheets
WebCSSdisplay
specifications specification status comment css display module level 3the definition of 'display' in that specification.
... css ruby layout module level 1the definition of 'display' in that specification.
... css flexible box layout modulethe definition of 'display' in that specification.
min-width - CSS: Cascading Style Sheets
WebCSSmin-width
lute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting minimum element width table { min-width: 75%; } form { min-width: 0; } specifications specification status comment css box sizing module level 4the definition of 'min-width' in that specification.
... editor's draft css box sizing module level 3the definition of 'min-width' in that specification.
... css flexible box layout modulethe definition of 'min-width' in that specification.
<position> - CSS: Cascading Style Sheets
examples valid positions center left center top right 8.5% bottom 12vmin right -6px 10% 20% 8rem 14px invalid positions left right bottom top 10px 15px 20px 15px specifications specification status comment css values and units module level 3the definition of '<position>' in that specification.
... candidate recommendation relists links to both definitions: if css backgrounds and borders module level 3 is supported, its definition of <position> must also be used.
... css backgrounds and borders module level 3the definition of '<bg-position>' in that specification.
text-shadow - CSS: Cascading Style Sheets
: 1px 1px 2px black, 0 0 1em blue, 0 0 0.2em blue; color: white; font: 1.5em georgia, serif; } <p class="white-text-with-blue-shadow">sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore.</p> specifications specification status comment css text decoration module level 3the definition of 'text-shadow' in that specification.
...the css text module level 3 spec refined the syntax.
... later it was moved to css text decoration module level 3.
HTTP Public Key Pinning (HPKP) - HTTP
this requires the ngx_http_headers_module.
... setenv.add-response-header = ( "public-key-pins" => "pin-sha256=\"base64+primary==\"; pin-sha256=\"base64+backup==\"; max-age=5184000; includesubdomains") note: this requires the mod_setenv server.module loaded which can be included by the following if not already loaded.
... server.modules += ( "mod_setenv" ) iis add the following line to the web.config file to send the public-key-pins header: <system.webserver> ...
WebAssembly.Global() constructor - JavaScript
a webassembly.global() constructor creates a new global object representing 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.
... 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).
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.
... 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).
WebAssembly.Instance - JavaScript
a webassembly.instance object is a stateful, executable instance of a webassembly.module.
... 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.
... examples synchronously instantiating a webassembly module the webassembly.instance() constructor function can be called to synchronously instantiate a given webassembly.module object, for example: const importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => { let mod = new webassembly.module(bytes); let instance = new webassembly.instance(mod, importobject); instance.exports.exported_func(); }) the preferred way to get an instance is asynchronously, for example using the webassembly.instantiatestreaming() function like this: const importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; webassembly.in...
Statements and declarations - JavaScript
export used to export functions to make them available for imports in external modules, and other scripts.
... import used to import functions exported from an external module, another script.
... import.meta an object exposing context-specific metadata to a javascript module.
Strict mode - JavaScript
" + nested(); } function notstrict() { return "i'm not strict."; } strict mode for modules ecmascript 2015 introduced javascript modules and therefore a 3rd way to enter strict mode.
... the entire contents of javascript modules are automatically in strict mode, with no statement needed to initiate it.
... function strict() { // because this is a module, i'm strict by default } export default strict; changes in strict mode strict mode changes both syntax and runtime behavior.
JavaScript
the complete modules available there are as follows: javascript first steps answers some fundamental questions such as "what is javascript?", "what does it look like?", and "what can it do?", along with discussing key javascript features such as variables, strings, numbers, and arrays.
... introducing javascript objects the object-oriented nature 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.
...this module gives you some fundamental background knowledge about how client-side frameworks work and how they fit into your toolset, before moving on to tutorial series covering some of today's most popular ones.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
the web-push module is used to set the vapid keys, and optionally generate them if they are not available yet.
...you can use the following ones:"); console.log(webpush.generatevapidkeys()); return; } webpush.setvapiddetails( 'https://serviceworke.rs/', process.env.vapid_public_key, process.env.vapid_private_key ); next, a module defines and exports all the routes an app needs to handle: getting the vapid public key, registering, and then sending notifications.
... module.exports = function(app, route) { app.get(route + 'vapidpublickey', function(req, res) { res.send(process.env.vapid_public_key); }); app.post(route + 'register', function(req, res) { res.sendstatus(201); }); app.post(route + 'sendnotification', function(req, res) { const subscription = req.body.subscription; const payload = req.body.payload; const options = { ttl: req.body.ttl }; settimeout(function() { webpush.sendnotification(subscription, payload, options) .then(function() { res.sendstatus(201); }) .catch(function(error) { console.log(error); res.sendstatus(500); }); }, req.body.delay * 1000); }...
height - SVG: Scalable Vector Graphics
WebSVGAttributeheight
specifications specification status comment filter effects module level 1the definition of 'height' in that specification.
... working draft definition for <filter> filter effects module level 1the definition of 'height' in that specification.
... working draft definition for filter primitives css masking module level 1the definition of 'height' in that specification.
in2 - SVG: Scalable Vector Graphics
WebSVGAttributein2
value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes specifications specification status comment filter effects module level 1the definition of 'in2 for <fedisplacementmap>' in that specification.
... working draft no change filter effects module level 1the definition of 'in2 for <fecomposite>' in that specification.
... working draft no change filter effects module level 1the definition of 'in2 for <feblend>' in that specification.
kernelUnitLength - SVG: Scalable Vector Graphics
value <number-optional-number> default value pixel in offscreen bitmap animatable yes specifications specification status comment filter effects module level 1the definition of 'kernelunitlength for <fespecularlighting>' in that specification.
... filter effects module level 1the definition of 'kernelunitlength for <fediffuselighting>' in that specification.
... filter effects module level 1the definition of 'kernelunitlength for <feconvolvematrix>' in that specification.
width - SVG: Scalable Vector Graphics
WebSVGAttributewidth
specifications specification status comment filter effects module level 1the definition of 'width' in that specification.
... working draft definition for <filter> filter effects module level 1the definition of 'width' in that specification.
... working draft definition for filter primitives css masking module level 1the definition of 'width' in that specification.
Loading Content Scripts - Archive of obsolete content
to supply the file "my-content-script.js", located in the /data subdirectory under your add-on's root directory, use a line like: // "data" is supplied by the "self" module var data = require("sdk/self").data; ...
... contentscriptfile: data.url("my-content-script.js") both contentscript and contentscriptfile accept an array of strings, so you can load multiple scripts, which can also interact directly with each other in the content process: // "data" is supplied by the "self" module var data = require("sdk/self").data; ...
self - Archive of obsolete content
note that the self object in content scripts is completely different from the self module, which provides an api for an add-on to access its data files and id.
...the exception is the context-menu module, which still uses postmessage.
Porting the Library Detector - Archive of obsolete content
implementing the user interface showing the library array the widget module is a natural fit for displaying the library list.
...e + "&lt;br&gt;version: " + library.version); }); widgetcontent += htmlcontentpostamble; return widgetcontent; } function updatewidgetview(tab) { var widgetview = widget.getview(tab.window); if (!tab.libraries) { tab.libraries = []; } widgetview.content = buildwidgetviewcontent(tab.libraries); widgetview.width = tab.libraries.length * icon_width; } main.js will use the tabs module to update the widget's content when necessary (for example, when the user switches between tabs): tabs.on('activate', function(tab) { updatewidgetview(tab); }); tabs.on('ready', function(tab) { tab.libraries = []; }); showing the library detail the xul library detector displayed the detailed information about each library on mouseover in a tooltip: we can't do this using a widget, so ins...
SDK and XUL Comparison - Archive of obsolete content
low-level apis and third-party modules that's not the whole story.
... alternatively, you can load third-party modules, which extend the sdk's core apis.
context-menu - Archive of obsolete content
to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module.
... it is easy to find out which menu items are constructed by the addon-sdk module because they have the class addon-context-menu-item.
indexed-db - Archive of obsolete content
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"); }; most of the objects that implement the indexeddb api, such as idbtransaction, idbopendbrequest, and idbobjectstore, are accessible through the indexe...
...the module cannot be used to interact with a given website database.
panel - Archive of obsolete content
usage this module exports a single constructor function panel() which constructs a new panel.
...to do this, save the html in your add-on's data directory and load it using the data.url() method exported by the self module, like this: var mypanel = require("sdk/panel").panel({ contenturl: require("sdk/self").data.url("myfile.html") }); mypanel.show(); from firefox 34, you can use "./myfile.html" as an alias for self.data.url("myfile.html").
passwords - Archive of obsolete content
using this module you can: search for credentials which have been stored in the password manager.
...however, you can use it to work out which stored credentials belong to your add-on by comparing it with the uri property of the self module.
selection - Archive of obsolete content
selection.removelistener('select', mylistener); iterating over discontiguous selections discontiguous selections can be accessed by iterating over the selection module itself.
... to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module.
High-Level APIs - Archive of obsolete content
modules listed on this page implement high-level apis for building add-ons: creating user interfaces, interacting with the web, and interacting with the browser.
... unless the documentation explicitly says otherwise, all these modules are "stable": we'll avoid making incompatible changes to them.
console/traceback - Archive of obsolete content
experimental functionality similar to python's traceback module.
... funcname the name of the function being executed at the stack frame, or null if the function is anonymous or the stack frame is being executed in a top-level script or module.
content/content - Archive of obsolete content
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
used by sdk modules that can load web content and attach content scripts to it.
... this._frame = getmyframe(); this._init(options) } }); see the panel module for a real-world example of usage of this module.
frame/hidden-frame - Archive of obsolete content
usage the module exports a constructor function, hiddenframe, and two other functions, add and remove.
...e: var hiddenframes = require("sdk/frame/hidden-frame"); let hiddenframe = hiddenframes.add(hiddenframes.hiddenframe({ onready: function() { this.element.contentwindow.location = "http://www.mozilla.org/"; let self = this; this.element.addeventlistener("domcontentloaded", function() { console.log(self.element.contentdocument.title); }, true, true); } })); see the panel module for a real-world example of usage of this module.
loader/sandbox - Archive of obsolete content
evaluate code module provides evaluate function that lets you execute code in the given sandbox: evaluate(scope, 'var a = 5;'); evaluate(scope, 'a + 2;'); //=> 7 more details about evaluated script may be passed via optional arguments that may improve exception reporting: // evaluate code as if it was loaded from 'http://foo.com/bar.js' and // start from 2nd line.
... load scripts this module provides a limited api for loading scripts from local urls.
places/history - Archive of obsolete content
usage this module exports a single function, search(), which synchronously returns a placesemitter object which then asynchronously emits data and end or error events that contain information about the state of the operation.
... placesemitter the placesemitter is not exposed in the module, but returned from the search functions.
window/utils - Archive of obsolete content
usage private windows with this module your add-on will see private browser windows even if it has not explicitly opted into private browsing, so you need to take care not to store any user data derived from private browser windows.
... to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module.
Release notes - Archive of obsolete content
firefox 29 highlights added new ui modules for australis: actionbutton, togglebutton, frame and toolbar.
... deprecated widget in favor of the new ui modules.
jpmignore - Archive of obsolete content
for example: .* * !/data/** !/lib/** !/locale/** !/node_modules/** !/package.json !/icon.png !/icon64.png !/copying !/bootstrap.js !/install.rdf this would include all editor backup files and similar in the whitelisted subdirectories, to avoid that you can append another blacklist after the whitelist.
... this one would work for xemacs: .* * !/data/** !/lib/** !/locale/** !/node_modules/** !/package.json !/icon.png !/icon64.png !/copying !/bootstrap.js !/install.rdf *~ \#* ...
Add a Menu Item to Firefox - Archive of obsolete content
but it's extensible by design, so anyone can build and publish modules for add-on developers to use.
... to see how to use third-party modules to add a new menu item, see the tutorial on using third-party modules with jpm.
Display a Popup - Archive of obsolete content
to display a popup dialog, use the panel module.
... learning more to learn more about the panel module, see the panel api reference.
Getting Started (jpm) - Archive of obsolete content
it uses two sdk modules: the action button module, which enables you to add buttons to the browser, and the tabs module, which enables you to perform basic operations with tabs.
... the add-on code itself uses two sdk modules, action button and tabs.
Custom about: URLs - Archive of obsolete content
const {classes: cc, interfaces: ci, manager: cm, results: cr, utils: cu, constructor: cc} = components; cm.queryinterface(ci.nsicomponentregistrar); components.utils.import("resource://gre/modules/services.jsm"); // globals const aboutpage_description = 'this is my custom about page'; const aboutpage_id = 'aa132730-2278-11e5-867f-0800200c9a66'; // make sure you generate a unique id from https://www.famkruithof.net/uuid/uuidgen const aboutpage_word = 'myaboutpage' const aboutpage_uri = 'data:text/html,hi this is the page that is shown when navigate to about:myaboutpage'; // const aboutpag...
...e_uri = 'chrome://myaboutaddon/content/index.html'; class aboutpage { static get classid() { return components.id(`{${aboutpage_id}}`); } static get classdescription() { return aboutpage_description; } static get contractid() { return `@mozilla.org/network/protocol/about;1?what=${aboutpage_word}`; } static get queryinterface() { return xpcomutils.generateqi([ci.nsiaboutmodule]); } constructor() { object.freeze(this); } geturiflags(auri) { return ci.nsiaboutmodule.allow_script; } newchannel(auri, asecurity_or_aloadinfo) { let channel; if (services.vc.compare(services.appinfo.version, '47.*') > 0) { const uri = services.io.newuri(aboutpage_uri, null, null); // greater than or equal to firefox48 so asecurity_or_aloadinfo is aloadinfo ch...
Custom XUL Elements with XBL - Archive of obsolete content
you can do almost anything from xbl code, including using xpcom components, js code modules and available chrome scripts.
...on the other hand, a binding is really just a presentation module.
Local Storage - Archive of obsolete content
the logger is called log4moz and it is implemented as a javascript code module, so it only works on firefox 3 and above.
... to use this logger, you need to copy the log4moz.js file to your modules directory.
Observer Notifications - Archive of obsolete content
by non-chrome we mean javascript code modules or xpcom.
... as we saw in previous sections, you can use javascript code module and xpcom objects very easily from the chrome.
Overlay extensions - Archive of obsolete content
this page contains links to documentation for the approach to developing extensions for gecko-based applications which uses: xul overlays to specify the interface apis available to privileged code, such as tabbrowser and javascript modules, to interact with the application and content.
... javascript code modules javascript modules available to extension developers.
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
but each table ensured the flexibility we needed if certain modules and pieces of content appeared or disappeared.
...besides the five minutes it recently took for one of our developers to rearrange a module when he thought it would take him an hour or two?
Building TransforMiiX standalone - Archive of obsolete content
add tx_exe=1 mk_add_options build_modules="xpcom transformiix" ac_add_options --enable-standalone-modules="xpcom transformiix" to your .mozconfig, and use client.mk to pull as usual.
... this will pull the necessary subtree with mozilla/client.mk mozilla/build/unix/modules.mk mozilla/build mozilla/config mozilla/expat mozilla/extensions/transformiix mozilla/include mozilla/allmakefiles.sh mozilla/client.mk mozilla/aclocal.m4 mozilla/configure mozilla/configure.in mozilla/makefile.in plus nspr and xpcom from the cvs repository.
JavaScript OS.Shared - Archive of obsolete content
module os.shared contains tools to interact with the operating system (and, more generally, in c) in javascript.
...for the moment, module os.shared is accessible only from chrome workers.
Space Manager Detailed Design - Archive of obsolete content
the class is only used in the layout module and cannot be exported outside of that module (nor does it need to be).
...it is meant to be called only when the layout module is being terminated.
Standalone XPCOM - Archive of obsolete content
building standalone xpcom here are the instructions for building the standalone xpcom on unix or windows: step 1 : pull the sources cvs -z 3 co mozilla/client.mk cd mozilla gmake -f client.mk pull_all build_modules=xpcom step 2 : build xpcom standalone ./configure --enable-standalone-modules=xpcom --enable-application=standalone gmake testing standalone xpcom xpcom/sample contains a sample application and a component.
...make sure you did configure --enable-standalone-modules=xpcom.
Venkman Introduction - Archive of obsolete content
fortunately, the xpinstall technology makes it possible to install new application modules in firefox by just clicking a hyperlink.
...the debugger is built on top of an application framework that allows you to drag and drop, resize, and toggle all the available views, and even to create new views or modules for the debugger if you choose—though this latter is an advanced topic and a subject for a future article.
XML in Mozilla - Archive of obsolete content
recommendation xpointer xmlns() scheme obsolete since gecko 1.9.1 w3c recommendation xpointer fixptr() scheme obsolete since gecko 1.9.1 this scheme is simply a wrapper for fixptr xpointer xpath1() scheme obsolete since gecko 1.9.1 internet-draft document.load(), document.async part of dom level 3 load & save module, a w3c working draft xhtml we have reasonable xhtml support, most things should work.
...add this line: pref("layout.selectanchor", true); dom load and save methods document.load() is a part of an old version of the w3c dom level 3 load & save module.
Unix stub installer - Archive of obsolete content
adding a package involves a few steps: add a section named for your <component> to the packages-unix manifest that describes which files from dist belong to which module.
...then add the componentx into the appropriate setup types so the installer module installs it when users select the setup types you choose it to be in.
Windows stub installer - Archive of obsolete content
adding a package involves a few steps: add a section named for your <component> to the packages-win manifest that describes which files from dist belong to which module.
...then add the component <component> into the appropriate setup types so the installer module installs it when users select the setup types you choose it to be in.
XPInstall - Archive of obsolete content
an xpi (pronounced "zippy" and derived from xpinstall) installer module is a zip file that contains an install script or manifest (entitled install.js or install.rdf) at the root of the file.
... creating xpi installer modules this article describes the packaging scheme of the mozilla and offers a tutorial for creating a new package that can then be redistributed, installed, and made available to users.
How to implement a custom XUL query processor component - Archive of obsolete content
here is our sample javascript xpcom query processor: components.utils.import("resource://gre/modules/xpcomutils.jsm"); // basic wrapper for nsixultemplateresult function templateresult(adata) { this._data = adata; // just make a random number for the id this._id = math.random(100000).tostring(); } templateresult.prototype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsixultemplateresult]), // private storage _data: null, // right now our results are flat l...
... compareresults: function(aleft, aright, avar) { // -1 less, 0 ==, +1 greater var leftvalue = aleft.getbindingfor(avar); var rightvalue = aright.getbindingfor(avar); if (leftvalue < rightvalue) { return -1; } else if (leftvalue > rightvalue) { return 1; } else { return 0; } } }; var components = [templatequeryprocessor]; function nsgetmodule(compmgr, filespec) { return xpcomutils.generatemodule(components); } our sample query processor is very simple.
Debugging a XULRunner Application - Archive of obsolete content
add the following code to your xul app: components.utils.import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.initialized) { debuggerserver.init(); // don't specify a window type parameter below if "navigator:browser" // is suitable for your app.
... debuggerserver.addbrowseractors("myxulrunnerappwindowtype"); } debuggerserver.openlistener(6000); for xulrunner version 37+ the code to enable the debugger has changed: components.utils.import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.initialized) { debuggerserver.init(); debuggerserver.addbrowseractors(); debuggerserver.allowchromeprocess = true; } let dbglistener=debuggerserver.createlistener(); dbglistener.portorpath=6000; dbglistener.open(); add the following to your prefs.js: (in recent ffox, edit about:config instead) pref("devtools.debugger.remote-enabled", true); in firefox, go to tools > web developer > connect...
XULRunner tips - Archive of obsolete content
ulrunner-based application after any change (installation, removal, enabling, disabling) in the extensions' list: copy files fuelapplication.js and fuelapplication.manifest from browser/fuel/src for instance into your components/ directory tweak the line #include ../../../toolkit/components/exthelper/extapplication.js in your copy of fuelapplication.js as needed make sure to declare the fuel module and the two files in your components/makefile.in as in browser/fuel/src/makefile.in rebuild...
...there are two approaches to display the branding of your application instead: when compiling xulrunner yourself: create a file module.ver in the directory mozilla/xulrunner/app with the contents: win32_module_description=myapplication myapplication should be replaced by whatever you want to see as title of the button.
Logging Multi-Process Plugins - Archive of obsolete content
from within a command prompt: c:\> set nspr_log_modules=ipcplugins:5 c:\> set nspr_log_file=c:\plugins.log c:\> cd c:\program files\mozilla firefox c:\> firefox.exe the log file will be saved to c:\plugins.log (or wherever nspr_log_file is set).
...from within a bash shell: $ export nspr_log_modules=ipcplugins:5 $ export nspr_log_file=~/plugins.log $ /usr/bin/firefox the file will be saved to ~/plugins.log (or wherever nspr_log_file is set).
Atomic RSS - Archive of obsolete content
ArchiveRSSModuleAtom
atomic rss uses atom as an rss module.
... documentation selected articles 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 elements.
Element - Archive of obsolete content
ArchiveRSSModuleSlashElement
rss slash module elements note: in the list of elements below the slash xml namespace prefix is used (since it is a popular choice).
... a b c <slash:comments> (rss slash module comments element) d <slash:department> (rss slash module department element) e f g h <slash:hit_parade> (rss slash hit parade department element) i j k l m n o p q r s <slash:section> (rss slash module section element) t u v w x y z ...
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).
... a b c <wfw:comment> (rss well-formed web module comment element) <wfw:commentrss> (rss well-formed web module comment rss element) d e f g h i j k l m n o p q r s t u v w x y z ...
XUL Parser in Python - Archive of obsolete content
i will make these adjustments and change it into a real module when i get a second, so that someone can instantiate the parser from their own scripts and use it more flexibly: >>> import xultool >>> myxp = xulparser() >>> chrome_dir = 'd:\src\mozilla\xpfe' >>> res = myxp.parsexul(chrome_dir, 'window', 'id') where something like the above would write out all the xul window ids in the build.
...the first level of support for python in mozilla will apparently be for python modules made available as xpcom objects.
Visual JS GE - Game development
installing modules navigate to server_instance/, then in the node.js command prompt or console enter the following installation commands: npm install mysql npm install delivery npm install express npm install mkdirp npm install socket.io npm install nodemailer@0.7.0 setting up config.js you will find config.js in the server_instance folder: all node.js applications use the same folder — server_instance.
...you need to edit the config file to include the correct paths to the node app and project instance, as indicated below: module.exports = { version : "0.5", path_of_node_app : "d:/path_to_server_instance_folder/server/" , // edit here path_of_www : "d:/xamp/htdocs/project_instance/", // path_to_www edit here editor_port : "1013", reg_path : "users/", account_port : 3666 , destroy_session_after_x_mseconds : 20000, }; local node.js application tools (uses in developer mode only) the following section provides information about the tools involved in visual-js game engine.
Flex - MDN Web Docs Glossary: Definitions of Web-related terms
the items then participate in flex layout, and all of the properties defined in the css flexible box layout module may be applied.
... learn more property reference align-content align-items align-self flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap justify-content order further reading css flexible box layout module level 1 specification css flexbox guide: basic concepts of flexbox css flexbox guide: relationship of flexbox to other layout methods css flexbox guide: aligning items in a flex container css flexbox guide: ordering flex items css flexbox guide: controlling ratios of flex items along the main axis css flexbox guide: mastering wrapping of flex items css flexbox guide: typical use cases of flex...
Flexbox - MDN Web Docs Glossary: Definitions of Web-related terms
flexbox is the commonly-used name for the css flexible box layout module, a layout model for displaying items in a single dimension — as a row or as a column.
... learn more property reference align-content align-items align-self flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap justify-content order further reading css flexible box layout module level 1 specification css flexbox guide: basic concepts of flexbox css flexbox guide: relationship of flexbox to other layout methods css flexbox guide: aligning items in a flex container css flexbox guide: ordering flex items css flexbox guide: controlling ratios of flex items along the main axis css flexbox guide: mastering wrapping of flex items css flexbox guide: typical use cases of f...
Assessment: Accessibility troubleshooting - Learn web development
previous overview: accessibility in the assessment for this module, we present to you a simple site with a number of accessibility issues that you need to diagnose and fix.
... previous overview: accessibility in this module what is accessibility?
Cascade and inheritance - Learn web development
one situation in which you may have to use it is when you are working on a cms where you can't edit the core css modules, and you really want to override a style that can't be overridden in any other way.
... 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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Handling different text directions - Learn web development
in the next module we will take a good look at overflow in css.
... 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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Images, media, and form elements - Learn web development
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.
... 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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Flexbox - Learn web development
we discuss strategies for overcoming cross browser support issues in our cross browser testing module.
... 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 methods supporting older browsers fundamental layout comprehension assessment ...
Test Your Skills: Fundamental layout comprehension - Learn web development
if you have worked through this module then you will have already covered the basics of what you need to know to do css layout today, and to work with older css as well.
... 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 methods supporting older browsers fundamental layout comprehension assessment ...
Normal Flow - Learn web development
before digging deeper into different layout methods, it is worth revisiting some of the things you will have studied in previous modules with regard to normal document flow.
... 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 methods supporting older browsers fundamental layout comprehension assessment ...
Advanced form styling - Learn web development
in the next article of this module, we will explore the different ui pseudo-classes available to us in modern browsers for styling forms in different states.
... previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for form widgets ...
The HTML5 input types - Learn web development
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.
... previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for form widgets ...
Styling web forms - Learn web development
we already looked at some simple form styling in your first form, and the css building blocks module contains some useful form styling essentials too.
... previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for form widgets ...
UI pseudo-classes - Learn web development
radio and checkbox states — checked, default, indeterminate as we've seen in earlier articles in the module, radio buttons and checkboxes can be checked or unchecked.
... previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for form widgets ...
HTML basics - Learn web development
find out more about accessibility in our accessibility learning module.
... previous overview: getting started with the web next in this module installing basic software what will your website look like?
Debugging HTML - Learn web development
this also marks the end of the introduction to html module learning articles — now you can go on to testing yourself with our assessments: the first one is linked below.
... previous overview: introduction to html next in this module getting started with html what’s in the head?
Document and website structure - Learn web development
you can find a detailed assessment that tests these skills at the end of the module; see structuring a page of content.
...in the last article of this module, we'll study how to debug html.
Assessment: Structuring planet data - Learn web development
prerequisites: before attempting this assessment you should have already worked through all the articles in this module.
... previous overview: tables in this module html table basics html table advanced features and accessibility structuring planet data ...
Choosing the right approach - Learn web development
previous overview: asynchronous to finish this module off, we'll provide a brief discussion of the different coding techniques and features we've discussed throughout, looking at which one you should use when, with recommendations and reminders of common pitfalls where appropriate.
... further information making asynchronous programming easier with async and await async function reference await operator reference previous overview: asynchronous in this module general asynchronous programming concepts introducing asynchronous javascript cooperative asynchronous javascript: timeouts and intervals graceful asynchronous programming with promises making asynchronous programming easier with async and await choosing the right approach ...
Functions — reusable blocks of code - Learn web development
we'll look at using browser apis in more detail in a later module.
...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.
Image gallery - Learn web development
prerequisites: before attempting this assessment you should have already worked through all the articles in this module.
... previous overview: building blocks in this module making decisions in your code — conditionals looping code functions — reusable blocks of code build your own function function return values introduction to events image gallery ...
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.
... 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.
Drawing graphics - Learn web development
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.
... the below example shows a simple 2d canvas-based bouncing balls animation that we originally met in our introducing javascript objects module: around 2006–2007, mozilla started work on an experimental 3d canvas implementation.
Basic math in JavaScript — numbers and operators - Learn web development
we don't cover these in detail in this article because we wanted to keep it as a simple introduction and only cover the real basic essentials for now; however, once you've read through this module a couple of times it is worth going to the object reference pages and learning more about what's available.
... previous overview: first steps next in this module what is javascript?
Storing the information you need — Variables - Learn web development
try entering the following line into your console: let dog = { name : 'spot', breed : 'dalmatian' }; to retrieve the information stored in the object, you can use the following syntax: dog.name we won't be looking at objects any more for now — you can learn more about those in a future module.
... previous overview: first steps next in this module what is javascript?
Adding features to our bouncing balls demo - Learn web development
prerequisites: before attempting this assessment you should have already worked through all the articles in this module.
... previous overview: objects in this module object basics object-oriented javascript for beginners object prototypes inheritance in javascript working with json data object building practice adding features to our bouncing balls demo ...
HTML performance features - Learn web development
this module intends to walk you through the key html performance features that can drastically improve the quality of your webpage.
... elements & attributes impacting performance the <picture> element the <video> element the <source> element the <img> srcset attribute responsive images preloading content with rel="preload" - (https://w3c.github.io/preload/ ) async / defer attributes <iframe> <object> <script> rel attribute conclusion previous overview: performance next in this module the "why" of web performance what is web performance?
What is web performance? - Learn web development
this involves a number of metrics (measurable indicators that can indicate success or failure) and tools to meaure those metrics, which we will discuss throughout this module.
... previous overview: performance next in this module the "why" of web performance what is web performance?
JavaScript performance - Learn web development
module bundlers like webpack support code-splitting.
... previous overview: performance next in this module the "why" of web performance what is web performance?
Website security - Learn web development
with this article, you've come to the end of this module, covering your first steps in server-side website programming.
... previous overview: first steps in this module introduction to the server side client-server overview server-side web frameworks website security ...
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Ember resources and troubleshooting - Learn web development
a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Ember app structure and componentization - Learn web development
a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
React interactivity: Events and state - Learn web development
to use a react hook, we need to import it from the react module.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Dynamic behavior in Svelte: working with variables and props - Learn web development
that's not how export normally works in javascript modules!
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Handling common HTML and CSS problems - Learn web development
the third one has no prefix, and shows the final version of the syntax (included in the css image values and replaced content module level 3 spec, which defines this feature).
... previous overview: cross browser testing next in this module introduction to cross browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
Cross browser testing - Learn web development
this module focuses on testing web projects across different browsers.
... guides introduction to cross browser testing this article starts the module off by providing an overview of the topic of cross browser testing, answering questions such as "what is cross browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" strategies for carrying out testing next, we drill down into carrying out testing, looking at identifying a target audien...
Git and GitHub - Learn web development
this module aims to teach you what you need to know about both of them.
... in terms of prerequisite knowledge, you don't need to know anything about web development, git/github or vcses to start this module.
Command line crash course - Learn web development
be configured to run upon save, as you type, or even before publishing your code (with additional tooling that we’ll see later on in the module).
... previous overview: understanding client-side tools next in this module client-side tooling overview command line crash course package management basics introducing a complete toolchain deploying our app ...
Accessibility/LiveRegionDevGuide
please refer to the liveregions and gecko python modules in orca for a real world example.
... priority queue the heart of any live region support module is the priority queue.
Contributing to the Mozilla code base
the reviewer in those bugs might be another good choice we have a list of modules, which lists peers and owners for the module.
...in a worst case scenario, set the module owner as the reviewer, asking them in the comments to pick someone more suitable please select only one reviewer.
Limitations of frame scripts
nsiaboutmodule by default, custom about: pages registered using nsiaboutmodule are loaded in the chrome process.
... javascript code modules (jsms) in multiprocess firefox, a jsm loaded into the content process does not share any state with the same jsm loaded into the chrome process.
Message manager overview
ess message manager lives in the implements nsimessagelistenermanager nsimessagebroadcaster child process message manager implements nsimessagelistenermanager nsimessagesender loading scripts per child process since the process message managers do not support script loading the only way to implement per-child process code is to use a frame script which imports a custom javascript module (jsm).
... since javascript modules are singletons they will only be executed once per process even when they are loaded in multiple frame scripts.
How to get a stacktrace with WinDbg
once the download is complete, you need to configure windbg to examine child processes, ignore a specific event caused by flash player, and record a log of loaded modules.
...enter these three commands, one at a time, to get the stacktrace, crash/hang analysis and log of loaded modules.
IME handling guide
modules handling ime composition widget each widget handles native ime events and dispatches widgetcompositionevent with mozilla::widget::texteventdispatcher to represent the behavior of ime in the focused editor.
... this is the only module that depends on the users platform.
AsyncShutdown.jsm
examples asyncshutdown.profilebeforechange.addblocker("module: just a promise", promise); // profilebeforechange will not complete until // promise is resolved or rejected asyncshutdown.profilebeforechange.addblocker("module: a callback", function condition() { // ...
... // execute this code during profilebeforechange return promise; // profilebeforechange will not complete until promise // is resolved or rejected }); asyncshutdown.profilebeforechange.addblocker("module: trivial callback", function condition() { // ...
DeferredTask.jsm
the deferredtask.jsm javascript code module offers utility routines for a task that will run after a delay.
...to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/deferredtask.jsm"); use this, for instance, if you write data to a file and you expect that you may have to rewrite data very soon afterwards.
Dict.jsm
the dict.jsm javascript code module offers routines for managing dictionaries of key/value pairs.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/dict.jsm"); creating a dictionary you can create a new, empty dictionary by simply calling the dict() constructor: var newdict = new dict(); if you wish, you may also pass in an object literal of key/value pairs with which to initialize the dictionary: var someobj = {}; var newdict = new dict({key1: "foo", key2: someobj}); note that values may be any javascript object type.
DownloadLastDir.jsm
the downloadlastdir.jsm javascript code module lets you retrieve the path of the last directory into which a download occurred.
... to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/downloadlastdir.jsm"); if you are using addon sdk, you can import the code module as: let { cu } = require("chrome"); let downloadlastdir = cu.import("resource://gre/modules/downloadlastdir.jsm").downloadlastdir; once you've imported the module, you can then use the downloadlastdir object it exports.
FileUtils.jsm
the fileutils.jsm javascript code module offers utility routines dealing with files.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/fileutils.jsm"); the file constructor if you have a path to a file (or directory) you want to obtain an nsifile for, you can do so using the file constructor, like this: var f = new fileutils.file(mypath); method overview nsifile getfile(string key, array patharray, bool followlinks); nsifile getdir(string key, array patharray, bool shouldcreate, bool followlinks); nsifileoutputstream openfileoutputstream(nsifile file, int modeflags); nsifileoutputstream openatomicfileoutputstream(nsifile file, int modeflags); nsifileoutputstream opensafefileoutputstream(nsifile file, int modeflags); void closeatomicfileoutp...
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 launchwebflow(); teardown(); attributes parameters object returns the set of parameters that initialized the firefox accounts oauth flow.
ISO8601DateUtils.jsm
the iso8601dateutils.jsm javascript code module provides methods that make it easy to convert javascript date objects into iso 8601 format date strings and back.
... to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/iso8601dateutils.jsm"); once you've imported the module, you can then use the iso8601dateutils object it exports.
JavaScript OS
the javascript os module contains tools that allow chrome content (i.e.
...at the time of this writing, some of the features of this module are available only to chrome workers.
PromiseUtils.jsm
the promiseutils.jsm javascript code module offers some useful functions related to dom promise.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/promiseutils.jsm"); method overview deferred defer(); methods defer() creates a new pending promise and provides methods to resolve or reject this promise.
Services.jsm
the services.jsm javascript code module offers a wide assortment of lazy getters that simplify the process of obtaining references to commonly used services.
... to use it, you first need to import the code module into your javascript scope: const {services} = chromeutils.import("resource://gre/modules/services.jsm"); then you can obtain references to services by simply accessing them from the services object exported by the code module.
Timer.jsm
the timer.jsm javascript code module contains pure-javascript implementations of settimeout, cleartimeout, setinterval, and clearinterval that are compatible with the dom window functions, but that can be used by code that does not have access to a dom window (for example, javascript code modules or content frame scripts).
... to use timer.jsm, first import it: components.utils.import("resource://gre/modules/timer.jsm"); then call settimeout and cleartimeout just as you would in a dom window, for example: let timeoutid = settimeout(function() { console.log("hello!"); }, 500); cleartimeout(timeoutid); similarly, you can use setinterval and clearinterval like so: let intervalid = setinterval(function() { console.log("happening every 500ms!"); }, 500); clearinterval(intervalid); ...
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.
Webapps.jsm
the webapps.jsm modules exposes the domapplicationregistry, which is responsible for managing all of the open web apps.
... importing components.utils.import("resource://gre/modules/webapps.jsm"); // exported symbol is domapplicationregistry method overview init: function() loadcurrentregistry: function() notifyappsregistrystart: function notifyappsregistrystart() notifyappsregistryready: function notifyappsregistryready() sanitizeredirects: function sanitizeredirects(asource) _savewidgetsfullpath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: function() loadandupdateapps: function() updatedatastore: function(aid, aorigin, amanifesturl, amanifest) _registersystemmess...
Writing localizable code
the addition of new top-level directories is a compromise between module ownership in the cvsroot repository and the ease of localization.
... use a good chrome directory structure for a particular module mod, a target path jar:ab-cd.jar!/locale/ab-cd/mod/foo.dtd has been widely tested and is a good place for your files referenced as chrome://mod/locale/foo.dtd.
Profiling with Xperf
also, when recording the stack, i've found that a heap trace is often missing module information (i believe this is a bug in xperf).
...tips in the summary views, the yellow bar can be dragged left and right to change the grouping -- for example, drag it to the left of the module column to have grouping happen only by process (stuff that's to the left), so that you get symbols in order of weight, regardless of what module they're in.
NSPR Contributor Guide
we (the nspr module owners) sometimes disappoint our contributors when we must reject their contributions.
...[note that the current nspr module owners do not now nor never have been involved with nspr 1.0.].
Process Initialization
identity and versioning initialization and cleanup module initialization identity and versioning name and version constants pr_name pr_version pr_versioncheck initialization and cleanup nspr detects whether the library has been initialized and performs implicit initialization if it hasn't.
... pr_init pr_initialize pr_initialized pr_cleanup pr_disableclockinterrupts pr_blockclockinterrupts pr_unblockclockinterrupts pr_setconcurrency pr_processexit pr_abort module initialization initialization can be tricky in a threaded environment, especially initialization that must happen exactly once.
NSPR API Reference
reads threading types and constants threading functions creating, joining, and identifying threads controlling thread priorities controlling per-thread private data interrupting and yielding setting global thread concurrency getting a thread's scope process initialization identity and versioning name and version constants initialization and cleanup module initialization locks lock type lock functions condition variables condition variable type condition variable functions monitors monitor type monitor functions cached monitors cached monitor functions i/o types directory type file descriptor types file info types network address types types used with socket options functions type used with memory-mapped i/o offset...
... process management and interprocess communication process management types and constants prprocess prprocessattr process management functions setting the attributes of a new process creating and managing processes multiwait receive system information and environment variables logging conditional compilation and execution log types and variables prlogmoduleinfo prlogmodulelevel nspr_log_modules nspr_log_file logging functions and macros pr_newlogmodule pr_setlogfile pr_setlogbuffering pr_logprint pr_logflush pr_log_test pr_log pr_assert pr_assert pr_not_reached use example instrumentation counters named shared memory shared memory protocol named shared memory functions anonymous shared m...
Encrypt Decrypt MAC Keys As Session Objects
*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } rv = encryptfile(slot...
..., dbdir, infilename, headerfilename, encryptedfilename, noisefilename, &pwdata, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "encryptfile : failed\n"); return secfailure; } break; case decrypt: /* open db read only, authenticate to it */ pk11_setpasswordfunc(getmodulepassword); rv = nss_init(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_init failed\n"); return secfailure; } slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate t...
Encrypt and decrypt MAC using token
*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } rv = encryptfile(slot...
..., dbdir, infilename, headerfilename, encryptedfilename, noisefilename, &pwdata, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "encryptfile : failed\n"); return secfailure; } break; case decrypt: /* open db read only, authenticate to it */ pk11_setpasswordfunc(getmodulepassword); rv = nss_init(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_init failed\n"); return secfailure; } slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate t...
Introduction to Network Security Services
the following static libaries are included only in external loadable pkcs #11 modules: libnssckfw.a/nssckfw.lib provides an api for writing pkcs #11 modules.
... the following shared libraries are standalone loadable modules, not meant to be linked with directly: libfort.so/libfort.sl/fort32.dll provides support for hardware fortezza.
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
is it possible to use jss to access cipher functionality from pkcs11 modules?
... cryptomanager.importcertpackage() is it possible to use jss to acces cipher functionality from pkcs11 modules?
Using JSS
MozillaProjectsNSSJSSUsing JSS
nspr/releases plc4 nspr standard c library replacement functions plds4 nspr data structure types nss3 nss crypto, pkcs #11, and utilities http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases ssl3 nss ssl library smime3 nss s/mime functions and types nssckbi pkcs #11 module containing built-in root ca certificates.
...optional swft pkcs #11 module implementing fortezza in software.
NSS 3.14.3 release notes
this attack is mitigated when using nss 3.14.3 with an nss cryptographic module ("softoken") version 3.14.3 or later.
... however, this attack is only partially mitigated if nss 3.14.3 is used with the current fips validated nss cryptographic module, version 3.12.9.1.
NSS 3.19.2 release notes
notable changes in nss 3.19.2 bug 1172128 - in nss 3.19.1, the minimum key sizes that the freebl cryptographic implementation (part of the softoken cryptographic module used by default by nss) was willing to generate or use was increased - for rsa keys, to 512 bits, and for dh keys, 1023 bits.
... note: future versions of nss may increase the minimum keysizes required by the freebl module.
Encrypt Decrypt_MAC_Using Token
*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } rv = encryptfile(slot...
...*/ pk11_setpasswordfunc(getmodulepassword); rv = nss_init(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_init failed\n"); return secfailure; } slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate ...
NSS Sample Code Sample_3_Basic Encryption and MACing
*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } rv = encryptfile(slot...
..., dbdir, infilename, headerfilename, encryptedfilename, noisefilename, &pwdata, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "encryptfile : failed\n"); return secfailure; } break; case decrypt: /* open db read only, authenticate to it */ pk11_setpasswordfunc(getmodulepassword); rv = nss_init(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_init failed\n"); return secfailure; } slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate t...
NSS Sample Code Utilities_1
this code shows the following: extract seed from noise file read der encoding from a file extract the password from a text file get the module password print as ascii or hexadecimal sample code #include <prlog.h> #include <termios.h> #include <base64.h> #include <unistd.h> #include <sys/stat.h> #include <prprf.h> #include "util.h" /* * these utility functions are adapted from those found in * the sectool library used by the nss security tools and * other nss test applications.
...me); } } i = 0; do { int startphrase = i; int phraselen; /* handle the windows eol case */ while (phrases[i] != '\r' && phrases[i] != '\n' && i < nb) i++; /* terminate passphrase */ phrases[i++] = '\0'; /* clean up any eol before the start of the next passphrase */ while ( (i<nb) analyze="" char="" current="" getmodulepassword="" if="" int="" now="" passphrase="" phrase="&amp;phrases[startphrase];" phraselen="" pk11slotinfo="" pwdata="=" pwdata-="" retry="" return="" secupwdata="" the="" void="" while="">source != pw_none) { pr_fprintf(pr_stderr, "incorrect password/pin entered.\n"); return null; } switch (pwdata->source) { case pw_none: sprintf(prompt, "enter password or pi...
EncDecMAC using token object - sample 3
*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } rv = encryptfile(slot, dbdir, infilename, headerfilename, encryptedfilename, noisefilename, &pwdata, ascii); if (rv != secsuccess) { pr_fprintf(pr_s...
...tderr, "encryptfile : failed\n"); return secfailure; } break; case decrypt: /* open db read only, authenticate to it */ pk11_setpasswordfunc(getmodulepassword); rv = nss_init(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_init failed\n"); return secfailure; } slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } rv = decryptfile(slot, dbdir, outfilename, headerfilename, encryptedfilename, &pwdata, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "decryptfile : failed\n"); return secfailure; } break; } cleanup: rvshutdown = nss_shutdown(); if (rvshutdown != secsuccess) { pr_fprintf(pr_stderr, "fa...
FC_InitPIN
in the nss cryptographic module, one uses the empty string password ("") to log in as the pkcs #11 so.
... the module only allows the pkcs #11 so to log in if the normal user's pin has not yet been set or has been reset.
NSS reference
secmod_loadusermodule secmod_unloadusermodule secmod_closeuserdb secmod_openuserdb pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc ssl functions based on "ssl functions" in the ssl reference and "ssl functions" and "deprecated ssl functions" in nss public functions.
... nss environment variables nss cryptographic module nss tech notes nss tech notes nss memory allocation tools based on nss tools documentation.
sslcrt.html
description the cert_verifycertnow function must call one or more pk11 functions to obtain the services of a pkcs #11 module.
... description cert_getcertnicknames must call one or more pk11 functions to obtain the services of a pkcs #11 module.
NSS Tools
source, documentation, dbck 1.0 analyze and repair certificate databases (not working in nss 3.2) source, tasks/plans modutil 1.1 manage the database of pkcs11 modules (secmod.db).
... add modules and modify the properties of existing modules (such as whether a module is the default provider of some crypto service).
NSS Tools certutil
for information security module database management, see using the security module database tool.
... -u list all available modules or print a single named module.
NSS tools : signver
MozillaProjectsNSStoolssignver
the last versions of these legacy databases are: o cert8.db for certificates o key3.db for keys o secmod.db for pkcs #11 module information berkeleydb has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously.
...these new databases provide more accessibility and performance: o cert9.db for certificates o key4.db for keys o pkcs11.txt, which is listing of all of the pkcs #11 modules contained in a new subdirectory in the security databases directory because the sqlite databases are designed to be shared, these are the shared database type.
Parser API
example: > var expr = reflect.parse("obj.foo + 42").body[0].expression > expr.left.property ({loc:null, type:"identifier", name:"foo"}) > expr.right ({loc:{source:null, start:{line:1, column:10}, end:{line:1, column:12}}, type:"literal", value:42}) it is also available since firefox 7; it can be imported into the global object via: components.utils.import("resource://gre/modules/reflect.jsm") or into a specified object via: components.utils.import("resource://gre/modules/reflect.jsm", obj) built-in objects whether in spidermonkey shell or firefox (after importing), the global singleton object reflect currently contains just the parse method.
... target string default: script a type of the parsing target, can be either script or module.
Gecko object attributes
please see the aria states and properties module for more information.
...please see the aria states and properties module for more information.
XForms Accessibility
implementation of accessible objects for xforms elements is based on top of the existing object hierarchy introduced in the mozilla accessibility module.
... forms controls module some of form control elements may be represented in few ways by different widgets.
Places Developer Guide
the apis are available via the placesutils api in the utils.js javascript module.
... var ci = components.interfaces; var cc = components.classes; var cu = components.utils; // import placesutils cu.import("resource://gre/modules/placesutils.jsm"); cu.import("resource://gre/modules/services.jsm"); // create the backup file var jsonfile = services.dirsvc.get("profd", ci.nsilocalfile); jsonfile.append("bookmarks.json"); jsonfile.create(ci.nsilocalfile.normal_file_type, 0600); // export bookmarks in json format to file placesutils.backupbookmarkstofile(jsonfile); // restore bookmarks from the json file // note: this *overwrites* all pre-existing bookmarks placesutils.restorebookmarksfromjsonfile(jsonfile); history the toolkit history service is nsinavhistoryservice: var history = cc["@mozilla.org/browser/nav-history-service;1"] .getservice(ci.nsinavhistoryservice...
Creating a Python XPCOM component
then you can import xpcom in any python module (mostly, in your component).
...generating implementation templates the module xpcom.xpt is used internally to process type information, but it has a nice feature - it can spit out a template for a python implementation of any interface.
XPCOM glue
MozillaTechXPCOMGlue
compiling or linking against xpcom headers there are three ways to compile/link against xpcom headers/libraries: frozen linkage: dependent glue (dependent on xpcom.dll) xpcom modules, i.e.
...at runtime (not compile time) (in debug builds) or your module just won't load (in optimized builds).
Preface
for example, the introduction includes a discussion of components and what they are, and the first chapter - in which you compile the basic code and register it with mozilla - prompts a discussion of the relationship between components and modules, of xpcom interfaces, and of the registration process in general.
... create the generic module code for the component.
Creating XPCOM components
for example, the introduction includes a discussion of components and what they are, and the first chapter - in which you compile the basic code and register it with mozilla - prompts a discussion of the relationship between components and modules, of xpcom interfaces, and of the registration process in general.
...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 xpcom usin...
Components.utils
import() loads a js module into the current script, without sharing a scope.
... unload() unloads a js module loaded with import().
mozIRegistry
one could then make the nsrepository itself a service and permit full (?!) de-coupling of xpcom modules from the xpcom implementation.
... moziregistry this is the new interface that will surface essentially the same function as is currently provided by libreg (aka "netscape registry") as declared in mozilla/modules/libreg/include/nsreg.h.
nsICookieManager2
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsicookiemanager this interface is included in the services.jsm javascript code module.
... to create an object implementing this interface: components.utils.import("resource://gre/modules/services.jsm"); var cookieservice = services.cookies; method overview void add(in autf8string ahost, in autf8string apath, in acstring aname, in acstring avalue, in boolean aissecure, in boolean aishttponly, in boolean aissession, in print64 aexpiry); boolean cookieexists(in nsicookie2 acookie); unsigned long countcookiesfromhost(in autf8string ahost); boolean findmatchingcookie(in nsicookie2 acookie, out unsigned long acountfromhost); obsolete since gecko 1.9 nsisimpleenumerator getcookiesfromhost(in autf8string ahost); void importcookies(in nsifile acookiefile); methods add() adds a cookie.
nsIDOMParser
to create a domparser when the constructor is not available (e.g., from a js xpcom component, a js module, 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.
...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.parsefromstring(astr, "application/xml"); using components.constructor(): const domparser = new components.constructor("@mozilla.org/xmlextras/domparser;1", "nsidomparser"); var parser = new domparser(); parser.init(princi...
Building an Account Manager Extension
components.utils.import("resource://gre/modules/xpcomutils.jsm"); //class constructor function devmoaccountmanagerextension() {}; // class definition devmoaccountmanagerextension.prototype = { name : "devmo-account", chromepackagename : "example@mozilla.org", showpanel: function(server) { //this panel is only shown for imap accounts...
...devmoaccountmanagerextension.prototype.contractid = "@mozilla.org/accountmanager/extension;1?name=example@mozilla.org"; // add the component to the mailnews-accountmanager-extensions category devmoaccountmanagerextension.prototype._xpcom_categories: [{ category: "mailnews-accountmanager-extensions" }], // create entry point for the module if (xpcomutils.generatensgetfactory) var nsgetfactory = xpcomutils.generatensgetfactory([devmoaccountmanagerextension]); else var nsgetmodule = xpcomutils.generatensgetmodule([devmoaccountmanagerextension]); step3: create the new panel as next step we create the xul and the property file for your new panel.
nsIWebContentHandlerRegistrar
cu.import('resource://gre/modules/services.jsm'); var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); var htmlcontentwindow = undefined; var registeruri = 'http://mail.live.com/secure/start?action=compose&to=%s'; var myurihostname = services.io.newuri(registeruri, null, null).host; // this section here is long and daunting, but it...
...tocol handler' when calling method: [nsiwebcontenthandlerregistrar::registerprotocolhandler] if the host names do match then a confirmation like this will be seen: this domain check can be bypassed by setting the preference of gecko.handlerservice.allowregisterfromdifferenthost to true as in this code here: var {classes: cc, interfaces: ci, utils: cu} = components; cu.import("resource://gre/modules/services.jsm"); var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); var allowregisterfromdifferenthost = services.prefs.getboolpref('gecko.handlerservice.allowregisterfromdifferenthost'); if (!allowregisterfromdifferenthost) { services.prefs.setboolpref('gecko.handlerservice.allowregisterfromdiffe...
nsIZipReader
modules/libjar/nsizipreader.idlscriptable this interface provides methods for reading compressed (zip) files.
... var zr = cc["@mozilla.org/libjar/zip-reader;1"].createinstance(ci.nsizipreader); cu.import('resource://gre/modules/osfile.jsm'); cu.import('resource://gre/modules/fileutils.jsm'); var reusablestreaminstance = cc['@mozilla.org/scriptableinputstream;1'].createinstance(ci.nsiscriptableinputstream); var pathtoxpitoread = os.path.join(os.constants.path.profiledir, 'extensions', 'portabletester@jetpack.xpi'); var nsifilexpi = new fileutils.file(pathtoxpitoread); //services.ww.act...
XPCOM Interface Reference by grouping
upportspruint64 nsisupportspruint8 nsisupportsstring nsisupportsvoid nsisupportsweakreference nsivariant do not use nsienumerator nsiinprocesscontentframemessagemanager nsiscriptableio nsixpcscriptable future nsixmlhttprequestupload obsolete nsixmlrpcclient nsixmlrpcfault security auth nsiauthmodule nsiauthprompt nsiauthpromptprovider nsiauthpromptwrapper nsiasyncverifyredirectcallback content nsicontentpolicy credentials nsilogininfo nsiloginmanager using nsiloginmanager nsiloginmanagerstorage nsiloginmetainfo history nsiglobalhistory ns...
... nsithreadinternal nsithreadmanager nsithreadobserver nsithreadpool nsithreadpoollistener nsitoolkit util nsiversioncomparator nsiweakreference nsifactory nsiinterfacerequestor nsijscid nsijsid nsijsiid nsimodule nsiobserver nsiobserverservice nsiproperties nsiproperty nsipropertybag nsipropertybag2 nsipropertyelement nsiserversocket nsiserversocketlistener nsiservicemanager nsisocketprovider nsisocketproviderservice nsisockettransport nsisockettransportservice nsisupports nsiuui...
Setting HTTP request headers
ervice); os.addobserver(this, "http-on-modify-request", false); return; } }, queryinterface: function (iid) { if (iid.equals(components.interfaces.nsiobserver) || iid.equals(components.interfaces.nsisupports)) return this; components.returncode = components.results.ns_error_no_interface; return null; }, }; var mymodule = { registerself: function (compmgr, filespec, location, type) { var compmgr = compmgr.queryinterface(components.interfaces.nsicomponentregistrar); compmgr.registerfactorylocation(this.mycid, this.myname, this.myprogid, filespec, ...
... !aiid.equals(components.interfaces.nsifactory)) throw components.results.ns_error_no_interface; return this; }, createinstance: function (outer, iid) { log("----------------------------> createinstance"); return new myhttplistener(); } }, canunload: function(compmgr) { return true; } }; function nsgetmodule(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.
XPCOM tasks
the role of xpcom the xpcom module roughly parallels the c/c++ standard libraries.
... writing and using components and modules.
Index
35 mail client architecture overview sections in grey refer to modules outside of mail/news 36 mail composition back end by richard h.
... (there is a bug on it.) 51 the libmime module by richard h.
Virtualenv
ypi.python.org/pypi/carton velcro: a script that sets up a python project for local installation; https://bitbucket.org/kumar303/velcro/ virtualenvwrapper: a set of extensions to ian bicking’s virtualenv tool for creating isolated python development environments; http://www.doughellmann.com/projects...tualenvwrapper the mozilla-central virtualenv in order to make use of various python modules located throughout mozilla-central, a virtualenv is created as part of the build process: http://mxr.mozilla.org/mozilla-central/source/js/src/build/autoconf/python-virtualenv.m4 .
... the mozilla build system mostly uses .pth files instead of the more typically used python setup.py develop or python setup.py install to install python modules in to the virtualenv's python path due to performance concerns (although such functionality is available via the setup.py keyword in a packages.txt file).
Using Objective-C from js-ctypes
let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); let id = ctypes.structtype("objc_object").ptr; let sel = ctypes.structtype("objc_selector").ptr; let bool = ctypes.signed_char; let lib = ctypes.open(ctypes.libraryname("objc")); let objc_getclass = lib.declare("objc_getclass", ctypes.default_abi, id, ctypes.char.ptr); let sel_registername = lib.declare("sel_registername", ctypes.default_abi, ...
...eserved: ctypes.int32_t }, { invoke: ctypes.voidptr_t }, { descriptor: block_descriptor_1.ptr } ]); var block_const = { block_has_copy_dispose: 1 << 25, block_has_ctor: 1 << 26, block_is_global: 1 << 28, block_has_stret: 1 << 29, block_has_signature: 1 << 30 }; // based on work from here: https://github.com/trueinteractions/tint2/blob/f6ce18b16ada165b98b07869314dad1d7bee0252/modules/bridge/core.js#l370-l394 var bl = block_literal_1(); // set the class of the instance bl.isa = _nsconcreteglobalblock; // global flags bl.flags = block_const.block_has_stret; bl.reserved = 0; bl.invoke = afunctypeptr; // create descriptor var desc = block_descriptor_1(); desc.reserved = 0; desc.size = block_literal_1.size; // set descriptor into block literal bl.descriptor = des...
js-ctypes reference
it is obtained by by loading the ctypes module: components.utils.import("resource://gre/modules/ctypes.jsm"); you can use the ctypes object to load libraries, construct types, and perform miscellaneous tasks such as type casting.
... types and data to use js-ctypes effectively, it is important to understand the different kinds of objects that the module provides.
AudioNode - Web APIs
WebAPIAudioNode
the audionode interface is a generic interface for representing an audio processing module.
...an html <audio> or <video> element, an oscillatornode, etc.), the audio destination, intermediate processing module (e.g.
AudioWorkletProcessor - Web APIs
processing audio an example algorithm of creating a custom audio processing mechanism is: create a separate file; in the file: extend the audioworkletprocessor class (see "deriving classes" section) and supply your own process() method in it; register the processor using audioworkletglobalscope.registerprocessor() method; load the file using addmodule() method on your audio context's audioworklet property; create an audioworkletnode based on the processor.
... 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.
CSSRule - Web APIs
WebAPICSSRule
css fonts module level 4the definition of 'cssrule' in that specification.
... css conditional rules module level 3the definition of 'cssrule' in that specification.
CSS Object Model (CSSOM) - Web APIs
css object model (cssom) view module working draft defined the screen and mediaquerylist interfaces and the mediaquerylistevent event and mediaquerylistlistener event listener.
... screen orientation api working draft css fonts module level 3 candidate recommendation css animations working draft css transitions working draft css custom properties for cascading variables module level 1 candidate recommendation css conditional rules module level 3 candidate recommendation defined the css interface.
CSS Painting API - Web APIs
examples to draw directly into an element's background using javascript in our css, we define a paint worklet using the registerpaint() function, tell the document to include the worklet using the paintworklet addmodule() method, then include the image we created using the css paint() function.
... <li>item 3</li> <li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7</li> <li>item 8</li> <li>item 9</li> <li>item 10</li> <li>item 11</li> <li>item 12</li> <li>item 13</li> <li>item 14</li> <li>item 15</li> <li>item 16</li> <li>item 17</li> <li>item 18</li> <li>item 19</li> <li>item 20</li> </ul> css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/worklets/hilite.js'); then we can use the <image> with the css paint() function: li { --boxcolor: hsla(55, 90%, 60%, 1.0); background-image: paint(hollowhighlights, stroke, 2px); } li:nth-of-type(3n) { --boxcolor: hsla(155, 90%, 60%, 1.0); background-image: paint(hollowhighlights, filled, 3px); } li:nth-of-type(3n+1) { --...
Document.currentScript - Web APIs
the document.currentscript property returns the <script> element whose script is currently being processed and isn't a javascript module.
... (for modules use import.meta instead.) it's important to note that this will not reference the <script> element if the code in the script is being called as a callback or event handler; it will only reference the element while it's initially being processed.
Encrypted Media Extensions API - Web APIs
interfaces mediakeymessageevent contains the content and related data when the content decryption module (cdm) generates a message for the session.
... mediakeysession represents a context for message exchange with a content decryption module (cdm).
Event - Web APIs
WebAPIEvent
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.
... (for example, a webpage with an advertising-module and statistics-module both monitoring video-watching.) when there are many nested elements, each with its own handler(s), event processing can become very complicated—especially where a parent element receives the very same event as its child elements because "spatially" they overlap so the event technically occurs in both, and the processing order of such events depends on the event bubbling and capture settings of each handler triggered.
FontFace.display - Web APIs
WebAPIFontFacedisplay
specifications specification status comment css font loading module level 3the definition of 'display' in that specification.
... css fonts module level 4the definition of 'font-display' in that specification.
HTMLElement - Web APIs
htmlelement.nomodule is a boolean indicating whether an import script can be executed in user agents that support module scripts.
... specifications specification status comment css object model (cssom) view modulethe definition of 'htmlelement' in that specification.
MediaKeyMessageEvent - Web APIs
the mediakeymessageevent interface of the encryptedmediaextensions api contains the content and related data when the content decryption module generates a message for the session.
... mediakeymessageevent.message read only returns an arraybuffer with a message from the content decryption module.
MediaKeySession - Web APIs
the mediakeysession interface of the encryptedmediaextensions api represents a context for message exchange with a content decryption module (cdm).
... mediakeysession.onmessage sets the eventhandler called when the content decryption module has generated a message for the session.
MimeType - Web APIs
WebAPIMimeType
mimetype.suffixes a string containing valid file extensions for the data displayed by the plugin, or an empty string if an extension is not valid for the particular module.
... for example, a browser's content decryption module may appear in the plugin list but support more file extensions than can be anticipated.
MouseEvent.clientX - Web APIs
syntax var x = instanceofmouseevent.clientx return value a double floating point value, as redefined by the cssom view module.
...sition.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (cssom) view modulethe definition of 'clientx' in that specification.
MouseEvent.clientY - Web APIs
syntax var y = instanceofmouseevent.clienty return value a double floating point value, as redefined by the cssom view module.
...sition.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (cssom) view modulethe definition of 'clienty' in that specification.
MouseEvent.pageY - Web APIs
WebAPIMouseEventpageY
the cssom view module redefined it as a double float.
... examples var pagey = event.pagey; specifications specification status comment css object model (cssom) view modulethe definition of 'pagey' in that specification.
MouseEvent - Web APIs
r canceled = !cb.dispatchevent(evt); if(canceled) { // a handler called preventdefault alert("canceled"); } else { // none of the handlers called preventdefault alert("not canceled"); } } document.getelementbyid("button").addeventlistener('click', simulateclick); result specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent' in that specification.
... css object model (cssom) view modulethe definition of 'mouseevent' in that specification.
Point - Web APIs
WebAPIPoint
although it is not directly related to this defunct interface, you are probably looking for dompoint, which is part of the geometry interfaces module level 1 specification.
... specifications this class was specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3.
PromiseRejectionEvent.promise - Web APIs
examples this example listens for unhandled promises and, if the reason is an object with a code field containing the text "module not ready", it sets up an idle callback that will retry the task that failed to execute correctly.
... window.onunhandledrejection = function(event) { if (event.reason.code && event.reason.code == "module not ready") { window.requestidlecallback(function(deadline) { loadmodule(event.reason.modulename) .then(performstartup); }); event.preventdefault(); } } specifications specification status comment html living standardthe definition of 'promiserejectionevent.promise' in that specification.
Fundamentals of WebXR - Web APIs
the webxr augmented reality module is still in a state of early development and is not yet stable enough for regular use.
... we do not yet include documentation for it here on mdn, but it will come as soon as the module's specification settles down.
Window.convertPointFromNodeToPage() - Web APIs
specifications this method was specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3.
... it is not present in the current css transforms module level 1 working draft.
Window.convertPointFromPageToNode - Web APIs
specifications this method was specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3.
... it is not present in the current css transforms module level 1 working draft.
Window.open() - Web APIs
WebAPIWindowopen
in a few years, the target property of the css3 hyperlink module may be implemented (if css3 hyperlink module as it is right now is approved).
... living standard css object model (cssom) view modulethe definition of 'the features argument to the open() method' in that specification.
Window.pkcs11 - Web APIs
WebAPIWindowpkcs11
for more information on installing pkcs11 modules, see installing pkcs11 modules.
... syntax objref = window.pkcs11 example window.pkcs11.addmodule(smod, secpath, 0, 0); notes see nsidompkcs11 for more information about how to manipulate pkcs11 objects.
XMLDocument.load() - Web APIs
WebAPIXMLDocumentload
document.load() is a part of an old version of the w3c dom level 3 load & save module.
...(to test this functionality, create the files on your local disk or on a webserver rather than loading the load.html file from the lxr-generated page, which will serve the text.xml file as html.) specifications old w3c working draft of the dom level 3 load & save module ...
XRSession.environmentBlendMode - Web APIs
important: environmentblendmode is part of the webxr augmented reality module, which has not yet reached a stable state.
... specifications specification status comment webxr augmented reality modulethe definition of 'xrsession.environmentblendmode' in that specification.
XRSessionMode - Web APIs
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.
... webxr augmented reality modulethe definition of 'xrsessionmode: immersive-ar' in that specification.
-webkit-line-clamp - CSS: Cascading Style Sheets
the css overflow module level 3 specification also defines a line-clamp property, which is meant to replace this property and avoid its issues.
...</p> css p { width: 300px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; } result specifications specification status comment css overflow module level 3the definition of '-webkit-line-clamp' in that specification.
font-stretch - CSS: Cascading Style Sheets
@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.
font-style - CSS: Cascading Style Sheets
@font-face { font-family: garamond; src: url('garamond-italic.ttf'); font-style: italic; } specifications specification status comment css fonts module level 4the definition of 'font-style' in that specification.
... working draft adds oblique keyword with angle value css fonts module level 3the definition of 'font-style' in that specification.
font-weight - CSS: Cascading Style Sheets
@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.
@supports - CSS: Cascading Style Sheets
WebCSS@supports
t will be partially applied in browsers which don't support the `of` argument of :nth-child(…) is supported */ :is(:nth-child(1n of ul, ol) a, details > summary) { … /* css applied when the :is(…) selector and the `of` argument of :nth-child(…) are both supported */ } } specifications specification status comment css conditional rules module level 4the definition of '@supports' in that specification.
... css conditional rules module level 3the definition of '@supports' in that specification.
CSSOM View - CSS: Cascading Style Sheets
cssom view is a module of css that lets you manipulate the visual view of a document, in particular its scrolling behavior.
... specifications specification status comment css object model (cssom) view module working draft initial definition.
CSS Backgrounds and Borders - CSS: Cascading Style Sheets
styles in the css backgrounds and borders module allow filling backgrounds with color or an image (clipped or resized), or modifying them in other ways.
... specifications specification status comment css backgrounds and borders module level 3 candidate recommendation css level 2 (revision 1) recommendation css level 1 recommendation ...
CSS Basic User Interface - CSS: Cascading Style Sheets
css basic user interface is a css module that lets you define the rendering and functionality of features related to the user interface.
... specifications specification status comment css basic user interface module level 4 working draft css basic user interface module level 3 recommendation css level 2 (revision 1) recommendation initial definition.
CSS Multi-column Layout - CSS: Cascading Style Sheets
css multi-column layout is a module of css that adds support for multi-column layouts.
... specifications specification status comment css multi-column layout module working draft initial definition ...
CSS Conditional Rules - CSS: Cascading Style Sheets
css conditional rules is a css module that allows to define a set of rules that will only apply based on the capabilities of the processor or the document the style sheet is being applied to.
... reference at-rules @document @media @supports @import specifications specification status comment css conditional rules module level 3 candidate recommendation initial definition ...
CSS Display - CSS: Cascading Style Sheets
css display is a module of css that defines how the css formatting box tree is generated from the document element tree and defines properties controlling it.
...her layout methods line-based placement grid template areas layout using named grid lines auto-placement in grid layout box alignment in grid layout grids, logical values and writing modes css grid layout and accessibility css grid layout and progressive enhancement realizing common layouts using grids specifications specification status comment css display module level 3the definition of 'display' in that specification.
CSS Flexible Box Layout - CSS: Cascading Style Sheets
css flexible box layout is a module of css that defines a css box model optimized for user interface design, and the layout of items in one dimension.
... backwards compatibility of flexbox browser status of flexbox, interoperability issues and supporting older browsers and versions of the spec specifications specification status comment css flexible box layout module candidate recommendation initial definition.
CSS Fragmentation - CSS: Cascading Style Sheets
css fragmentation is a module of css that defines how content is displayed when it is broken (fragmented) across multiple pages, regions, or columns.
... reference box-decoration-break break-after break-before break-inside orphans widows specifications specification status comment css fragmentation module level 3 candidate recommendation initial definition.
CSS Generated Content - CSS: Cascading Style Sheets
css generated content is a module of css that defines how to add content to an element.
... reference properties content quotes specifications specification status comment css generated content module level 3 working draft css level 2 (revision 1) recommendation initial definition ...
CSS Lists - CSS: Cascading Style Sheets
css lists is a module of css that defines how lists can be laid out and styled.
... specifications specification status comment css lists module level 3 working draft css level 2 (revision 1) recommendation initial definition ...
CSS Logical Properties and Values - CSS: Cascading Style Sheets
css logical properties and values is a module of css introducing logical properties and values that provide the ability to control layout through logical, rather than physical, direction and dimension mappings.
... the module also defines logical properties and values for properties previously defined in css 2.1.
CSS Masking - CSS: Cascading Style Sheets
css masking is a css module that defines means, including masking and clipping, for partially or fully hiding portions of visual elements.
... reference properties clip clip-path clip-rule mask mask-border mask-border-mode mask-border-outset mask-border-repeat mask-border-slice mask-border-source mask-border-width mask-clip mask-composite mask-image mask-mode mask-origin mask-position mask-repeat mask-size mask-type specifications specification status comment css masking module level 1 candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the definition of 'mask' in that specification.
CSS Motion Path - CSS: Cascading Style Sheets
motion path is a css module that allows authors to animate any graphical object along a custom path.
...ion: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } reference properties offset offset-anchor offset-distance offset-path offset-position offset-rotate specifications specification status comment motion path module level 1 working draft initial definition.
CSS Namespaces - CSS: Cascading Style Sheets
css namespaces is a css module that allows authors to specify xml namespaces in css.
... reference at-rules @namespace specifications specification status comment css namespaces module recommendation initial definition ...
CSS Overflow - CSS: Cascading Style Sheets
the css overflow module contains the features of css relating to scrollable overflow handling in visual media.
... 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.
CSS Paged Media - CSS: Cascading Style Sheets
WebCSSCSS Pages
css paged media is a module of css that defines how page switches are handled.
... reference css properties page-break-after page-break-before page-break-inside at-rules @page pseudo-classes :blank :first :left :right specifications specification status comment css paged media module level 3 working draft css fragmentation module level 3 candidate recommendation css level 2 (revision 1) recommendation ...
CSS Positioned Layout - CSS: Cascading Style Sheets
css positioned layout is a module of css that defines how to position elements on the page.
... specifications specification status comment css positioned layout module level 3 working draft css level 2 (revision 1) recommendation ...
CSS Ruby Layout - CSS: Cascading Style Sheets
WebCSSCSS Ruby
css ruby layout is a module of css that provides the rendering model and formatting controls related to the display of ruby annotation.
... reference properties ruby-align ruby-position specifications specification status comment css ruby layout module level 1 working draft initial definition ...
CSS Text - CSS: Cascading Style Sheets
WebCSSCSS Text
css text is a module of css that defines how to perform text manipulation, like line breaking, justification and alignment, white space handling, and text transformation.
... css text module level 3 working draft css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
CSS Text Decoration - CSS: Cascading Style Sheets
css text decoration is a module of css that defines features relating to text decoration, such as underlines, text shadows, and emphasis marks.
... on the underline to denote hyperlinks.</p> <p class="underover">this text has lines above <em>and</em> below it.</p> <p class="thick">this text has a really thick purple underline in supporting browsers.</p> <p class="blink">this text might blink for you, depending on the browser you use.</p> specifications specification status comment css text decoration module level 4 working draft css text decoration module level 3 candidate recommendation css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
CSS Custom Properties for Cascading Variables - CSS: Cascading Style Sheets
css custom properties for cascading variables is a css module that allows for the creation of custom properties that can be used over and over.
... css properties --* specifications specification status comment css custom properties for cascading variables module level 1 candidate recommendation initial definition ...
CSS Writing Modes - CSS: Cascading Style Sheets
css writing modes is a css module that defines various international writing modes, such as left-to-right (e.g.
... reference properties direction glyph-orientation-horizontal text-combine-upright text-orientation unicode-bidi writing-mode specifications specification status comment css writing modes module level 3 proposed recommendation css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
Filter Effects - CSS: Cascading Style Sheets
filter effects is a module of css that defines a way of processing an element’s rendering before it is displayed in the document.
... reference properties backdrop-filter filter data types <filter-function> specifications specification status comment filter effects module level 1the definition of 'filter' in that specification.
align-content - CSS: Cascading Style Sheets
document.getelementbyid('display'); var container = document.getelementbyid('container'); values.addeventlistener('change', function (evt) { container.style.aligncontent = evt.target.value; }); display.addeventlistener('change', function (evt) { container.classname = evt.target.value; }); result specifications specification status comment css box alignment module level 3the definition of 'align-content' in that specification.
... css flexible box layout modulethe definition of 'align-content' in that specification.
align-items - CSS: Cascading Style Sheets
= document.getelementbyid('display'); var container = document.getelementbyid('container'); values.addeventlistener('change', function (evt) { container.style.alignitems = evt.target.value; }); display.addeventlistener('change', function (evt) { container.classname = evt.target.value; }); result specifications specification status comment css box alignment module level 3the definition of 'align-items' in that specification.
... css flexible box layout modulethe definition of 'align-items' in that specification.
align-self - CSS: Cascading Style Sheets
> <div>item #1</div> <div>item #2</div> <div>item #3</div> </section> css section { display: flex; align-items: center; height: 120px; background: beige; } div { height: 60px; background: cyan; margin: 5px; } div:nth-child(3) { align-self: flex-end; background: pink; } result specifications specification status comment css box alignment module level 3the definition of 'align-self' in that specification.
... css flexible box layout modulethe definition of 'align-self' in that specification.
<alpha-value> - CSS: Cascading Style Sheets
ially transparent text: /* <rgba()> */ color: rgba(34, 12, 64, 0.6); color: rgba(34.0 12 64 / 60%); setting shape image threshold here an alpha value is used to determine which parts of an image are considered part of a shape: /* shape-image-threshold */ shape-image-threshold: 70%; shape-image-threshold: 0.7; specifications specification status comment css color module level 4the definition of '<alpha-value>' in that specification.
... css color module level 3the definition of '<alpha-value>' in that specification.
<angle-percentage> - CSS: Cascading Style Sheets
specifications specification status comment css values and units module level 4the definition of '<angle-percentage>' in that specification.
... editor's draft css values and units module level 3the definition of '<angle-percentage>' in that specification.
<angle> - CSS: Cascading Style Sheets
WebCSSangle
g = 100grad = 0.25turn ≈ 1.5708rad setting a flat angle 180deg = 200grad = 0.5turn ≈ 3.1416rad setting a counterclockwise right angle -90deg = -100grad = -0.25turn ≈ -1.5708rad setting a null angle 0 = 0deg = 0grad = 0turn = 0rad specifications specification status comment css values and units module level 4the definition of '<angle>' in that specification.
... editor's draft css values and units module level 3the definition of '<angle>' in that specification.
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
syntax /* css basic user interface module level 4 values */ appearance: none; appearance: auto; appearance: menulist-button; appearance: textfield; /* "compat-auto" values, which have the same effect as 'auto' */ appearance: button; appearance: searchfield; appearance: textarea; appearance: push-button; appearance: slider-horizontal; appearance: checkbox; appearance: radio; appearance: square-button; appearance: menulist; appearance: li...
... specifications specification status comment css basic user interface module level 4the definition of 'appearance' in that specification.
attr() - CSS: Cascading Style Sheets
WebCSSattr
="background" data-background="lime">background expected to be red if your browser does not support advanced usage of attr()</div> css .background { height: 100vh; } .background { background-color: red; } .background[data-background] { background-color: attr(data-background color, red); } specifications specification status comment css values and units module level 4the definition of 'attr()' in that specification.
... css values and units module level 3the definition of 'attr()' in that specification.
background-clip - CSS: Cascading Style Sheets
900 1.2em sans-serif; text-decoration: underline; } .border-box { background-clip: border-box; } .padding-box { background-clip: padding-box; } .content-box { background-clip: content-box; } .text { background-clip: text; -webkit-background-clip: text; color: rgba(0,0,0,.2); } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-clip' in that specification.
... css backgrounds and borders module level 4the definition of 'background-clip' in that specification.
clip-path - CSS: Cascading Style Sheets
WebCSSclip-path
ath</option> </select> css #clipped { margin-bottom: 20px; clip-path: url(#cross); } javascript const clippathselect = document.getelementbyid("clippath"); clippathselect.addeventlistener("change", function (evt) { document.getelementbyid("clipped").style.clippath = evt.target.value; }); result specifications specification status comment css masking module level 1the definition of 'clip-path' in that specification.
... css shapes module level 2the definition of 'path' in that specification.
color - CSS: Cascading Style Sheets
WebCSScolor
all ways to make a paragraph's text red: p { color: red; } p { color: #f00; } p { color: #ff0000; } p { color: rgb(255,0,0); } p { color: rgb(100%, 0%, 0%); } p { color: hsl(0, 100%, 50%); } /* 50% translucent */ p { color: #ff000080; } p { color: rgba(255, 0, 0, 0.5); } p { color: hsla(0, 100%, 50%, 0.5); } specifications specification status comment css color module level 4the definition of 'color' in that specification.
... css color module level 3the definition of 'color' in that specification.
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
</p> css .content-box { column-count: 3; column-gap: 40px; } result specifications specification status comment css box alignment module level 3the definition of 'column-gap' in that specification.
... candidate recommendation specifies how this property affects grid layouts css multi-column layout modulethe definition of 'column-gap' in that specification.
<dimension> - CSS: Cascading Style Sheets
WebCSSdimension
specifications specification status comment css values and units module level 4the definition of '<dimension>' in that specification.
... editor's draft adds cap, ic, lh, rlh, vi, vb css values and units module level 3the definition of '<dimension>' in that specification.
font-family - CSS: Cascading Style Sheets
</div> specifications specification status comment css fonts module level 4the definition of 'generic font families' in that specification.
... css fonts module level 3the definition of 'font-family' in that specification.
font-size - CSS: Cascading Style Sheets
WebCSSfont-size
examples setting font sizes css .small { font-size: xx-small; } .larger { font-size: larger; } .point { font-size: 24pt; } .percent { font-size: 200%; } html <h1 class="small">small h1</h1> <h1 class="larger">larger h1</h1> <h1 class="point">24 point h1</h1> <h1 class="percent">200% h1</h1> result specifications specification status comment css fonts module level 4the definition of 'font-size' in that specification.
... css fonts module level 3the definition of 'font-size' in that specification.
font-stretch - CSS: Cascading Style Sheets
able'; 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%; } .expanded { font-stretch: 200%; } result specifications specification status comment css fonts module level 4the definition of 'font-stretch' in that specification.
... css fonts module level 3the definition of 'font-stretch' in that specification.
font-style - CSS: Cascading Style Sheets
examples font styles <p class="normal">this paragraph is normal.</p> <p class="italic">this paragraph is italic.</p> <p class="oblique">this paragraph is oblique.</p> .normal { font-style: normal; } .italic { font-style: italic; } .oblique { font-style: oblique; } specifications specification status comment css fonts module level 4the definition of 'font-style' in that specification.
... working draft adds the ability to specify an angle after oblique css fonts module level 3the definition of 'font-style' in that specification.
font-variant - CSS: Cascading Style Sheets
4 | simplified | traditional ]<east-asian-width-values> = [ full-width | proportional-width ] examples setting the small-caps font variant html <p class="normal">firefox rocks!</p> <p class="small">firefox rocks!</p> css p.normal { font-variant: normal; } p.small { font-variant: small-caps; } result specifications specification status comment css fonts module level 3the definition of 'font-variant' in that specification.
... 1chrome android full support 18firefox android full support 4opera android full support 11safari ios full support 1samsung internet android full support 1.0css fonts module level 3 shorthandchrome full support 52edge full support 79firefox full support 34 full support 34 no support 33 — 34disabled disabled from version 33 until version 34 (exclusive): this featu...
font-weight - CSS: Cascading Style Sheets
*/ span { font-weight: lighter; } result specifications specification status comment css fonts module level 4the definition of 'font-weight' in that specification.
... css fonts module level 3the definition of 'font-weight' in that specification.
<frequency-percentage> - CSS: Cascading Style Sheets
specifications specification status comment css values and units module level 4the definition of '<frequency-percentage>' in that specification.
... editor's draft css values and units module level 3the definition of '<frequency-percentage>' in that specification.
<gradient> - CSS: Cascading Style Sheets
WebCSSgradient
<div class="conic-gradient">conic gradient</div> div { width: 200px; height: 200px; } .conic-gradient { background: conic-gradient(lightpink, white, powderblue); } specifications specification status comment css images module level 4the definition of '<gradient>' in that specification.
... working draft adds conic-gradient css images module level 3the definition of '<gradient>' in that specification.
height - CSS: Cascading Style Sheets
WebCSSheight
</div> </div> css div { width: 250px; margin-bottom: 5px; border: 2px solid blue; } #taller { height: 50px; } #shorter { height: 25px; } #parent { height: 100px; } #child { height: 50%; width: 75%; } result specifications specification status comment css box sizing module level 4the definition of 'height' in that specification.
... editor's draft css box sizing module level 3the definition of 'height' in that specification.
ident - CSS: Cascading Style Sheets
WebCSSident
specifications specification status comment css values and units module level 4the definition of '<ident>' in that specification.
... editor's draft css values and units module level 3the definition of '<ident>' in that specification.
<image> - CSS: Cascading Style Sheets
WebCSSimage
*/ image(z.jpg#xy=0,0) /* the spatial fragment must be written in the format of xywh=#,#,#,# */ image-set('cat.jpg' 1x, 'dog.jpg' 1x) /* every image in an image set must have a different resolutions */ specifications specification status comment css images module level 4the definition of '<image>' in that specification.
... css images module level 3the definition of '<image>' in that specification.
<integer> - CSS: Cascading Style Sheets
WebCSSinteger
specifications specification status comment css values and units module level 4the definition of '<integer>' in that specification.
... css values and units module level 3the definition of '<integer>' in that specification.
justify-content - CSS: Cascading Style Sheets
-evenly</option> <option value="stretch">stretch</option> </select> javascript var justifycontent = document.getelementbyid("justifycontent"); justifycontent.addeventlistener("change", function (evt) { document.getelementbyid("container").style.justifycontent = evt.target.value; }); result specifications specification status comment css box alignment module level 3the definition of 'justify-content' in that specification.
... css flexible box layout modulethe definition of 'justify-content' in that specification.
<length-percentage> - CSS: Cascading Style Sheets
therefore, all of the following values are acceptable for width: width: 200px; width: 20%; width: calc(100% - 200px); specifications specification status comment css values and units module level 4the definition of '<length-percentage>' in that specification.
... editor's draft css values and units module level 3the definition of '<length-percentage>' in that specification.
<length> - CSS: Cascading Style Sheets
WebCSSlength
yle.width = inputelem.value; const result = document.createelement('div'); result.classname = 'result'; result.style.width = inputelem.value; result.innerhtml = `<code>width: ${inputelem.value}</code>`; resultsdiv.appendchild(result); inputelem.value = ''; inputelem.focus(); }) result specifications specification status comment css values and units module level 4the definition of '<length>' in that specification.
... css values and units module level 3the definition of '<length>' in that specification.
linear-gradient() - CSS: Cascading Style Sheets
specifications specification status comment css images module level 4the definition of 'gradient color-stops' in that specification.
... css images module level 3the definition of 'linear-gradient()' in that specification.
max-height - CSS: Cascading Style Sheets
th, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting max-height using percentage and keyword values table { max-height: 75%; } form { max-height: none; } specifications specification status comment css box sizing module level 4the definition of 'max-height' in that specification.
... editor's draft css box sizing module level 3the definition of 'max-height' in that specification.
max-width - CSS: Cascading Style Sheets
WebCSSmax-width
</div> </div> css #parent { background: lightblue; width: 300px; } #child { background: gold; width: 100%; max-width: 150px; } result specifications specification status comment css box sizing module level 4the definition of 'max-width' in that specification.
... editor's draft css box sizing module level 3the definition of 'max-width' in that specification.
min-height - CSS: Cascading Style Sheets
the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting min-height table { min-height: 75%; } form { min-height: 0; } specifications specification status comment css box sizing module level 4the definition of 'min-height' in that specification.
... editor's draft css box sizing module level 3the definition of 'min-height' in that specification.
<number> - CSS: Cascading Style Sheets
WebCSSnumber
specifications specification status comment css values and units module level 4the definition of '<number>' in that specification.
... css values and units module level 3the definition of '<number>' in that specification.
object-fit - CSS: Cascading Style Sheets
{ width: 150px; height: 100px; border: 1px solid #000; } .narrow { width: 100px; height: 150px; margin-top: 10px; } .fill { object-fit: fill; } .contain { object-fit: contain; } .cover { object-fit: cover; } .none { object-fit: none; } .scale-down { object-fit: scale-down; } result specifications specification status comment css images module level 4the definition of 'object-fit' in that specification.
... working draft css images module level 3the definition of 'object-fit' in that specification.
opacity - CSS: Cascading Style Sheets
WebCSSopacity
g/opengraph-logo.png" alt="mdn logo" width="128" height="146" class="opacity"> css img.opacity { opacity: 1; filter: alpha(opacity=100); /* ie8 and lower */ zoom: 1; /* triggers "haslayout" in ie 7 and lower */ } img.opacity:hover { opacity: 0.5; filter: alpha(opacity=50); zoom: 1; } result specifications specification status comment css color module level 4the definition of 'opacity' in that specification.
... css color module level 3the definition of 'opacity' in that specification.
order - CSS: Cascading Style Sheets
WebCSSorder
the flexible box layout module automatically creates blocks of equal vertical size and uses as much horizontal space as available.
...der> <main> <article>article</article> <nav>nav</nav> <aside>aside</aside> </main> <footer>...</footer> css main { display: flex; text-align:center; } main > article { flex:1; order: 2; } main > nav { width: 200px; order: 1; } main > aside { width: 200px; order: 3; } result specifications specification status comment css flexible box layout modulethe definition of 'order' in that specification.
<percentage> - CSS: Cascading Style Sheets
width: 30%, left margin: 60% </div> </div> the above html will output: font-size <div style="font-size:18px;"> <p>full-size text (18px)</p> <p><span style="font-size:50%;">50% (9px)</span></p> <p><span style="font-size:200%;">200% (36px)</span></p> </div> the above html will output: specifications specification status comment css values and units module level 4the definition of '<percentage>' in that specification.
... css values and units module level 3the definition of '<percentage>' in that specification.
<resolution> - CSS: Cascading Style Sheets
specifications specification status comment css values and units module level 4the definition of '<resolution>' in that specification.
... css values and units module level 3the definition of '<resolution>' in that specification.
shape-outside - CSS: Cascading Style Sheets
(0 0, 100% 100%, 0 100%); } .right { -webkit-shape-outside: polygon(100% 0, 100% 100%, 0 100%); shape-outside: polygon(100% 0, 100% 100%, 0 100%); float: right; -webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%); clip-path: polygon(100% 0, 100% 100%, 0 100%); } p { text-align: center; } result specifications specification status comment css shapes module level 1the definition of 'shape-outside' in that specification.
... css shapes module level 2the definition of 'shape-outside' in that specification.
text-align - CSS: Cascading Style Sheets
editor's draft no changes css text module level 4the definition of 'text-align' in that specification.
... css text module level 3the definition of 'text-align' in that specification.
text-decoration - CSS: Cascading Style Sheets
on the underline to denote hyperlinks.</p> <p class="underover">this text has lines above <em>and</em> below it.</p> <p class="thick">this text has a really thick purple underline in supporting browsers.</p> <p class="blink">this text might blink for you, depending on the browser you use.</p> specifications specification status comment css text decoration module level 4 working draft adds text-decoration-thickness; note that this isn't yet officially part of the shorthand — this is as yet unspecified.
... css text decoration module level 3the definition of 'text-decoration' in that specification.
<time-percentage> - CSS: Cascading Style Sheets
specifications specification status comment css values and units module level 4the definition of '<time-percentage>' in that specification.
... editor's draft css values and units module level 3the definition of '<time-percentage>' in that specification.
<time> - CSS: Cascading Style Sheets
WebCSStime
specifications specification status comment css values and units module level 4the definition of '<time>' in that specification.
... editor's draft css values and units module level 3the definition of '<time>' in that specification.
url() - CSS: Cascading Style Sheets
WebCSSurl()
: yellow; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='90' height='45'%3e%3cpath d='m10 10h60' stroke='%2300f' stroke-width='5'/%3e%3cpath d='m10 20h60' stroke='%230f0' stroke-width='5'/%3e%3cpath d='m10 30h60' stroke='red' stroke-width='5'/%3e%3c/svg%3e"); } specifications specification status comment css values and units module level 4the definition of 'url()' in that specification.
... editor's draft css values and units module level 3the definition of 'url()' in that specification.
<url> - CSS: Cascading Style Sheets
WebCSSurl
ple.com/mycursor.png") <a_css_property>: url('http://mysite.example.com/mycursor.png') <a_css_property>: url(http://mysite.example.com/mycursor.png) examples .topbanner { background: url("topbanner.png") #00d no-repeat fixed; } ul { list-style: square url(http://www.example.com/redball.png); } specifications specification status comment css values and units module level 4the definition of '<url>' in that specification.
... editor's draft css values and units module level 3the definition of '<url>' in that specification.
widows - CSS: Cascading Style Sheets
WebCSSwidows
it has a little bit more text than the first one.</p> </div> css div { background-color: #8cffa0; columns: 3; widows: 2; } p { background-color: #8ca0ff; } p:first-child { margin-top: 0; } result specifications specification status comment css fragmentation module level 3the definition of 'widows' in that specification.
... css multi-column layout modulethe definition of 'widows' in that specification.
width - CSS: Cascading Style Sheets
WebCSSwidth
een">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 class="minblue">the mozilla community produces a lot of great software.</p> specifications specification status comment css box sizing module level 4the definition of 'width' in that specification.
... editor's draft css box sizing module level 3the definition of 'width' in that specification.
EXSLT
there are a number of modules; those that are supported by firefox are listed below: common (exsl)the exslt common package provides basic functions that expand upon the capabilities of xslt.math (math)the exslt math package provides functions for working with numeric values and comparing nodes.regular expressions (regexp)the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript style regular expressions.sets (set)the exslt sets package offers functions that let you perform set manipulation.strings (str)the exslt strings package provides functions that allow the manipulation of strings.
... exslt modules to use an exslt function, you need to declare the namespace the function is in, and then use the appropriate prefix when calling the function.
Redirections in HTTP - HTTP
the mod_alias module has redirect and redirectmatch directives that set up 302 redirects by default: <virtualhost *:443> servername example.com redirect / https://www.example.com </virtualhost> the url https://example.com/ will be redirected to https://www.example.com/, as will any files or directories under it (https://example.com/some-page will be redirected to https://www.example.com/some-page) redirectmatch...
... if you don't want a temporary redirect, an extra parameter (either the http status code to use or the permanent keyword) can be used to set up a different redirect: redirect permanent / https://www.example.com # …acts the same as: redirect 301 / https://www.example.com the mod_rewrite module can also create redirects.
Keyed collections - JavaScript
everything exposed on the instance and prototype is public; everything else is inaccessible from the outside world because privates is not exported from the module.
...}; module.exports = public; sets set object set objects are collections of values.
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.
WebAssembly.Table() constructor - JavaScript
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 contains two functions (one that returns 42 and another that returns 83) and stores both into elements 0 and 1 of the imported table (see text representation).
WebAssembly.Table - JavaScript
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 contains two functions (one that returns 42 and another that returns 83) and stores both into elements 0 and 1 of the imported table (see text representation).
Web Performance
this article starts the module off with a good look at what performance actually is — this includes the tools, metrics, apis, networks, and groups of people we need to consider when thinking about performance, and how we can make performance part of our web development workflow.
...in this guide we'll talk about the dynamic import() statement, which is a feature in modern browsers that loads a javascript module on demand.
dx - SVG: Scalable Vector Graphics
WebSVGAttributedx
value list of <length> default value none animatable yes specifications specification status comment filter effects module level 1the definition of 'dx' in that specification.
... working draft initial definition for <fedropshadow> filter effects module level 1the definition of 'dx' in that specification.
dy - SVG: Scalable Vector Graphics
WebSVGAttributedy
value list of <length> default value none animatable yes specifications specification status comment filter effects module level 1the definition of 'dy' in that specification.
... working draft initial definition for <fedropshadow> filter effects module level 1the definition of 'dy' in that specification.
edgeMode - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'edgemode for <fegaussianblur>' in that specification.
... working draft initial definition for <fegaussianblur> filter effects module level 1the definition of 'edgemode for <feconvolvematrix>' in that specification.
font-family - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 4the definition of 'generic font families' in that specification.
... css fonts module level 3the definition of 'font-family' in that specification.
font-stretch - SVG: Scalable Vector Graphics
>, and <tspan> usage notes value <font-stretch-absolute>where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> default value normal animatable yes specifications specification status comment css fonts module level 4the definition of 'font-stretch' in that specification.
... css fonts module level 3the definition of 'font-stretch' in that specification.
font-style - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 4the definition of 'font-style' in that specification.
... working draft no change css fonts module level 3the definition of 'font-style' in that specification.
font-variant - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 4the definition of 'font-variant' in that specification.
... working draft no change css fonts module level 3the definition of 'font-variant' in that specification.
font-weight - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 4the definition of 'font-weight' in that specification.
... css fonts module level 3the definition of 'font-weight' in that specification.
opacity - SVG: Scalable Vector Graphics
WebSVGAttributeopacity
specifications specification status comment css color module level 4the definition of 'opacity' in that specification.
... css color module level 3the definition of 'opacity' in that specification.
operator - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'operator for <femorphology>' in that specification.
... working draft no change filter effects module level 1the definition of 'operator for <fecomposite>' in that specification.
specularExponent - SVG: Scalable Vector Graphics
value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'specularexponent for <fespecularlighting>' in that specification.
... working draft no change filter effects module level 1the definition of 'specularexponent for <fespotlight>' in that specification.
surfaceScale - SVG: Scalable Vector Graphics
value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'surfacescale for <fediffuselighting>' in that specification.
... working draft no change filter effects module level 1the definition of 'surfacescale for <fespecularlighting>' in that specification.
z - SVG: Scalable Vector Graphics
WebSVGAttributez
value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'z for <fepointlight>' in that specification.
... working draft no change filter effects module level 1the definition of 'z for <fespotlight>' in that specification.
Content type - SVG: Scalable Vector Graphics
svg supports all of the syntax alternatives for <color> defined in css2 syntax and basic data types, and (depend on the implementation) in the future css color module level 3.
... | "rgb("integer, integer, integer")" | "rgb("integer "%", integer "%", integer "%)" | color-keyword hexdigit ::= [0-9a-fa-f] where color-keyword matches (case insensitively) one of the color keywords listed in css color module level 3, or one of the system color keywords listed in user preferences for colors (css2, section 18.2).
Converting WebAssembly text format to wasm - WebAssembly
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 "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).
2015 MDN Fellowship Program - Archive of obsolete content
command of javascript and module systems preferred.
Communicating With Other Scripts - Archive of obsolete content
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.
Reddit Example - Archive of obsolete content
finally, it registers a listener to the user-defined click event which in turn passes the url into the open function of the tabs module.
port - Archive of obsolete content
each end of the conversation has access to a port: the content script via the global self property, and the main add-on code via a worker object associated with the sdk module you've used to attach the content script, such as page-mod or page-worker.
Classes and Inheritance - Archive of obsolete content
it is defined in the module “core/heritage”: const { class } = require('sdk/core/heritage'); the function class is a meta-constructor: it creates constructors that behave properly with respect to inheritance.
Private Properties - Archive of obsolete content
it's defined in the module "core/namespace", and it's use is straightforward.
Firefox Compatibility - Archive of obsolete content
this page is out of date: now the sdk ships inside firefox, compatibility between the sdk modules and firefox versions is no longer an issue.
Program ID - Archive of obsolete content
for example: addons.mozilla.org uses it to distinguish between new add-ons and updates to existing add-ons, and the simple-storage module uses it to figure out which stored data belongs to which add-on.
clipboard - Archive of obsolete content
the following types are supported: text (plain text) html (a string of html) image (a base-64 encoded png) if no data type is provided, then the module will detect it for you.
l10n - Archive of obsolete content
usage to learn how to use this module to write localizable code, read the localization tutorial.
request - Archive of obsolete content
for more advanced usage, check out the net/xhr module, based on the browser's xmlhttprequest object.
simple-prefs - Archive of obsolete content
this means that they're visible in about:config, and they can be accessed using the global simple-preferences module.
system - Archive of obsolete content
usage querying your environment using the system module you can access environment variables (such as path), find out which operating system your add-on is running on and get information about the host application (for example, firefox or fennec), such as its version.
ui - Archive of obsolete content
this module exports constructors for the following: actionbutton togglebutton frame toolbar sidebar each object has its own reference page, linked above: for all the details please refer to the reference page.
console/plain-text - Archive of obsolete content
all of its methods are inherited from console.jsm (resource://gre/modules/devtools/console.jsm).
content/worker - Archive of obsolete content
used in the internal implementation of sdk modules which use content scripts to interact with web content.
frame/utils - Archive of obsolete content
usage module exports create function that takes the nsidomdocument of a privileged document and creates a browser element in its documentelement: let { open } = require('sdk/window/utils'); let { create } = require('sdk/frame/utils'); let window = open('data:text/html,foo'); let frame = create(window.document); optionally create can be passed set of options to configure created frame even further.
io/file - Archive of obsolete content
use the fs/path module for relative path support.
lang/functional - Archive of obsolete content
usage the lang/functional module provides functional helper methods.
lang/type - Archive of obsolete content
the difference is that the type constructor can be from a scope that has a different top level object: for example, it could be from a different iframe, module or sandbox.
preferences/event-target - Archive of obsolete content
you can also use the simple-prefs module to access just the preferences for your own add-on and expose them to the user in the add-on manager.
preferences/service - Archive of obsolete content
you can also use the simple-prefs module to access just the preferences for your own add-on and expose them to the user in the add-on manager.
stylesheet/style - Archive of obsolete content
those functions are part of content/mod module.
system/events - Archive of obsolete content
usage the system/events module provides core (low level) api for working with the application observer service, also known as nsiobserverservice.
tabs/utils - Archive of obsolete content
to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module.
test/assert - Archive of obsolete content
usage to use the assert module, write a set of unit tests following the instructions in the unit testing tutorial.
test/httpd - Archive of obsolete content
this module was removed in firefox 36, please use the addon-httpd npm module instead.
test/runner - Archive of obsolete content
this module contains the package's main program, which does a bit of high-level setup and then delegates test finding and running to the harness module.
ui/button/action - Archive of obsolete content
with this module you can create buttons that display icons and can respond to click events.
ui/button/toggle - Archive of obsolete content
with this module you can create buttons that function like a check box, representing an on/off choice.
ui/frame - Archive of obsolete content
usage this module exports the frame constructor, which can be used to create frame components.
ui/sidebar - Archive of obsolete content
unlike modules such as panel, the content must be local, typically loaded from the add-on's data directory via a url constructed using self.data.url(): var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', 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").
jpm-mobile - Archive of obsolete content
jpm-mobile test jpm-mobile test see the tutorial on unit testing and the reference documentation for the assert module for more details on this.
Adding a Button to the Toolbar - Archive of obsolete content
to add a button to the toolbar, use the action button or toggle button modules.
Implementing the widget - Archive of obsolete content
please see the ui module for replacements.
Annotator - Archive of obsolete content
please see the ui module for replacements.
Listen for Page Load - Archive of obsolete content
you can get notifications about new pages loading using the tabs module.
Listening for Load and Unload - Archive of obsolete content
if your add-on exports a function called main(), that function will be called immediately after the overall main.js is evaluated, and after all top-level require() statements have run (so generally after all dependent modules have been loaded).
Modifying Web Pages Based on URL - Archive of obsolete content
to modify any pages that match a particular pattern (for example, "http://example.org/") as they are loaded, use page-mod module.
Open a Web Page - Archive of obsolete content
to open a new web page, you can use the tabs module: var tabs = require("sdk/tabs"); tabs.open("http://www.example.com"); this function is asynchronous, so you don't immediately get back a tab object which you can examine.
JavaScript Debugger Service - Archive of obsolete content
jsd.clearfilters(); // clear the list of filters // we exclude the scripts with the following filenames from being tracked jsd.appendfilter(createfilter("*/firefox/components/*")); jsd.appendfilter(createfilter("*/firefox/modules/*")); jsd.appendfilter(createfilter("xstringbundle")); jsd.appendfilter(createfilter("chrome://*")); jsd.appendfilter(createfilter("x-jsd:ppbuffer*")); jsd.appendfilter(createfilter("xpcsafejsobjectwrapper.cpp")); jsd.appendfilter(createfilter("file://*")); note that appendfilter adds the filter to the end of the list.
JavaScript timers - Archive of obsolete content
timer.jsm the timer.jsm javascript code module contains pure-javascript implementations of settimeout and cleartimeout that are compatible with the dom window functions, but that can be used by code that does not have access to a dom window (for example, javascript code modules or content frame scripts).
Downloading JSON and JavaScript in extensions - Archive of obsolete content
downloading javascript of course there are times when javascript code modules are downloaded and injected into the extension.
Extension Etiquette - Archive of obsolete content
scripts can be loaded into their own globals, such as commonjs modules, javascript modules, or sandboxes, to avoid most global variable and prototype conflicts.
Inline options - Archive of obsolete content
this code should be in bootstrap.js (within the startup() function) for restartless extensions or in an xpcom component or a javascript code module (not an overlay!) for traditional extensions.
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
listing 2: content for test_calc.js (first-round test case) var testcase = mozlab.mozunit.testcase; var assert = mozlab.mozunit.assertions; var tc = new testcase('rpn calc testcase'); var module = new modulemanager(); var rpncalc = module.require('package', 'calc'); tc.tests = { '2 1 +': function() { var calc = new rpncalc.rpncalc(); calc.init(); calc.push(2); calc.push(1); calc.plus(); assert.equals(calc.pop(), 3); } } listing 3: additional content for calc.js function rpncalc() { this.stack = new array(); } rpncalc.prototype = { init: function() { ...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
each component is identified with a contract id in the form @domain_name/module_name/component_name;version_number, and implements one or more interfaces that determine what functions can be called on these components.
Intercepting Page Loads - Archive of obsolete content
they are window-independent, so it is better to keep your observer code in non-chrome objects (your xpcom service or jsm module).
Mozilla Documentation Roadmap - Archive of obsolete content
first of all, the in-site search is not reliable, so we recommend using a search engine like google, with queries such as "mdc javascript code modules" or "javascript code modules site:developer.mozilla.org".
List of Mozilla-Based Applications - Archive of obsolete content
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 service basilisk pre-servo xul-based web browser uses most of the firefox 55...
How Mozilla finds its configuration files - Archive of obsolete content
different versions of perl, or of these modules may lead to bugs.
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
nprt.def) to project properties|(all configurations)|linker|input|module definition file.
Creating a hybrid CD - Archive of obsolete content
'text' "text file" install ascii 'moss' 'text' "text file" license ascii 'moss' 'text' "text file" .gif raw 'ogle' 'giff' "gif file" .png raw 'ogle' 'png ' "png file" .jpg raw 'ogle' 'jpeg' "jpeg file" .jpeg raw 'ogle' 'jpeg' "jpeg file" .pl ascii 'mcpl' 'text' "perl file" .pm ascii 'mcpl' 'text' "perl module file" .xml ascii 'r*ch' 'text' "xml file" .xul ascii 'r*ch' 'text' "xul file" .xbl ascii 'r*ch' 'text' "xbl file" .css ascii 'r*ch' 'text' "css file" .dtd ascii 'r*ch' 'text' "dtd file" .js ascii 'r*ch' 'text' "javascript file" .mp3 raw 'tvod' 'mpg3' "mpeg file" .mpg raw 'tvod' 'mpeg' "mpeg file" .mpeg ...
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.
External CVS snapshots in mozilla-central - Archive of obsolete content
mozilla-central contains copies of external software modules that it depends on.
Layout System Overview - Archive of obsolete content
the layout module looks at the 'display' field of the style context to determine what kind of frame to create (block, inline, table, etc.).
Firefox Sync - Archive of obsolete content
it exists as a core javascript module providing generic functionality and ui components for each product.
Enabling Experimental Jetpack Features - Archive of obsolete content
the proposed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module.
Enabling - Archive of obsolete content
the proposed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module.
Enabling Experimental Jetpack Features - Archive of obsolete content
ArchiveMozillaJetpackdocsMetaFuture
the proposed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module.
Plugin Architecture - Archive of obsolete content
nsobjectframe the frame responsible for displaying plugins nsplugininstanceowner glue between plugin code (modules/plugin) and layout code (layout/generic).
Safely loading URIs - Archive of obsolete content
some other schemes are used internally by mozilla modules to communicate with each other.
Install Wizards (aka: Stub Installers) - Archive of obsolete content
it then proceeds to extract the xpinstall engine and feed it the downloaded software packages to install.) the stub installer code includes: the logic to display the install wizard widgets and dialogs the code that reads in the configuration file (config.ini) and dynamically installs from the net or from local xpi modules found next to the installer binary the code that processes user selections the code that calls the xpinstall engine through xpistub the libxpnet code that is statically linked in the stub installers are written in code native to the platform using native widget toolkits including the windows api for windows, the mac toolbox for the mac, and gtk for the unix version.
Namespaces - Archive of obsolete content
it holds and allows disambiguation of items having the same name." if you are familiar with c++ namespaces, java packages, perl packages, or python module importing, you are already familiar with the namespace concept.
Providing Command-Line Options - Archive of obsolete content
991c315-b871-42cd-b33f-bfee4fcbf682} components/commandline.js contract @mozilla.org/commandlinehandler/general-startup;1?type=myapp {2991c315-b871-42cd-b33f-bfee4fcbf682} category command-line-handler m-myapp @mozilla.org/commandlinehandler/general-startup;1?type=myapp the javascript code const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); components.utils.import("resource://gre/modules/services.jsm"); // changeme: to the chrome uri of your extension or application const chrome_uri = "chrome://myapp/content/"; /** * utility functions */ /** * opens a chrome window.
XPCOM Interfaces - Archive of obsolete content
the syntax of a contract id is: @<internetdomain>/module[/submodule[...]];<version>[?<name>=<value>[&<name>=<value>[...]]] other components can be referred to in a similar way.
Using Remote XUL - Archive of obsolete content
//www.mozilla.org/newsbot/" /> </menupopup> </menu> <menu label="developer docs"> <menupopup> <menuitem label="roadmap" value="https://www.mozilla.org/roadmap.html" /> <menuitem label="projects" value="https://www.mozilla.org/projects/" /> <menuitem label="ports" value="https://www.mozilla.org/ports/" /> <menuitem label="module owners" value="https://www.mozilla.org/owners.html" /> <menuitem label="hacking" value="https://www.mozilla.org/hacking/" /> <menuitem label="get the source" value="https://www.mozilla.org/source.html" /> <menuitem label="build it" value="https://www.mozilla.org/build/" /> </menupopup> </menu> <menu label="testing"> <menupopup> ...
Using nsIXULAppInfo - Archive of obsolete content
obtaining platform version information is done like this: var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); var platformver = appinfo.platformversion; var platformbuildid = appinfo.platformbuildid; getting nsixulappinfo in xpcshell tests in firefox 21, a testing module was added that provides access to app info during the execution of xpcshell tests.
Application Update - Archive of obsolete content
you will need to compile a unix/linux executable mar from mozilla/modules/libmar.
2006-10-06 - Archive of obsolete content
other links of interest: roadmap for accessible rich internet applications (wai-aria roadmap) roles for accessible rich internet applications (wai-aria roles) states and properties module for accessible rich internet applications (wai-aria states and properties) making ajax work with screen readers meetings accessibility hackfest 2006 - october 10-12 in cambridge, ma (more details) participants include the mozilla foundation, ibm, sun and novell to name a few.
2006-11-22 - Archive of obsolete content
if anyone has experience with these issues, and is comfortable helping out in the mozilla/accessible module, would you please take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=166994 he stated that he almost had it working a couple of years ago.
2006-11-24 - Archive of obsolete content
module owner for mozilla/testing - tim needs suggestions on who to promote as a moderator (to replace davel).
2006-10-06 - Archive of obsolete content
problem looping c_opensession problem in thunderbird christian bongiorno has run into a problem developing a pkcs11 module for a new card.
2006-12-01 - Archive of obsolete content
it supports a apache2 module and stand alone version.
NP_GetMIMEDescription - Archive of obsolete content
one mime type // example inside http://mxr.mozilla.org/mozilla-central/source/modules/plugin/sdk/samples/basic/unix/plugin.cpp #define mime_type_description "application/basic-plugin:bsp:basic example plug-in for mozilla" const char* np_getmimedescription(void) { return(mime_types_description); } two mime types const char* np_getmimedescription(void) { return "application/basic-example-plugin:xmp1:example 1;application/basic-example2-plugin:xmp2, xm2p:example 2"; } gnome i...
Samples and Test Cases - Archive of obsolete content
npapi plugin samples collections of npapi plugin samples can be found in the seamonkey source code at /modules/plugin/sdk/samples.
What is RSS - Archive of obsolete content
when you create your own rss feeds, you will likely want to make them more complex than these and include additional rss elements and make use of the various rss modules.
Building a Theme - Archive of obsolete content
it contains several folders, modules, jssubloader and others.
-ms-block-progression - Archive of obsolete content
this property is based on the block-progression property of the css3 text layout module.
-ms-wrap-flow - Archive of obsolete content
for more information about the impact of an exclusion element on content flow, see the terminology section of the css exclusions module level 1 specification.
-ms-wrap-through - Archive of obsolete content
for more information about exclusion elements' impact on content flow, see the terminology section of the css exclusions module level 1 specification.
display-inside - Archive of obsolete content
specifications specification status comment css display module level 3the definition of 'display-inside' in that specification.
display-outside - Archive of obsolete content
specifications specification status comment css display module level 3the definition of 'display-outside' in that specification.
Developing Mozilla XForms - Archive of obsolete content
to activate this logging output, set the nspr_log_modules environment variable: export nspr_log_modules=schemavalidation:5 this only works on a debug build as described above.
XForms Repeat Element - Archive of obsolete content
actions you can use xforms action module elements to modify the nodeset that the repeat element is bound to.
XForms Trigger Element - Archive of obsolete content
actions are described by the xforms action module (see the spec).
Mozilla XForms User Interface - Archive of obsolete content
form controls module this section contains a short description for each form control element.
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
related sources the full sample plugin code can be found in the mozilla source tree under modules/plugin/samples/4x-scriptable/ ibm developer works has published a good article on xpcom.
Visual-js game engine - Game development
1) click create application 2) enter new application name in input prompt 3) select folder for server part of application (important : www is not secure place) 4) select folder for client part of application ( any path in www) 5) new app name will appear in project list , select and click open application 6) open your server folder : install node.js modules one way - use windows bat-s file (in server root folder with prefix install_ ) second way - open cmd terminal and enter next command : npm install mysql npm install delivery npm install express npm install mkdirp npm install socket.io npm install nodemailer@0.7.0 very easy installation and project files generator .
Gecko FAQ - Gecko Redirect 1
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.
Plug-in Development Overview - Gecko Plugin API Reference
when it starts up, the browser checks for plug-in modules for the platform and registers them.
CSS pixel - MDN Web Docs Glossary: Definitions of Web-related terms
learn more technical reference css values and units module, section 5.2: absolute lengths learn about it css length explained on the mdn hacks blog ...
Parser - MDN Web Docs Glossary: Definitions of Web-related terms
a parser is the module of a compiler or interpreter that parses a source code file.
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.
CSS and JavaScript accessibility best practices - Learn web development
previous overview: accessibility next in this module what is accessibility?
HTML: A good basis for accessibility - Learn web development
previous overview: accessibility next in this module what is accessibility?
HTML: A good basis for accessibility - Learn web development
previous overview: accessibility next in this module what is accessibility?
WAI-ARIA basics - Learn web development
enhancing keyboard accessibility as discussed in a few other places in the module, one of the key strengths of html with respect to accessibility is the built-in keyboard accessibility of features such as buttons, form controls, and links.
A cool-looking box - Learn web development
prerequisites: before attempting this assessment, you should have already worked through all the articles in this module.
Advanced styling effects - Learn web development
we will cover these in detail in our css layout module.
Backgrounds and borders - Learn web development
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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Creating fancy letterheaded paper - Learn web development
prerequisites: before attempting this assessment you should have already worked through all the articles in this module.
Debugging CSS - Learn web development
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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Organizing your CSS - Learn web development
previous overview: building blocks in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Overflowing content - Learn web development
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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Attribute selectors - Learn web development
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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Combinators - Learn web development
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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Pseudo-classes and pseudo-elements - Learn web development
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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Type, class, and ID selectors - Learn web development
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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
CSS selectors - Learn web development
selectors p:first-child { } pseudo-classes pseudo-element selectors p::first-line { } pseudo-elements descendant combinator article p descendant combinator child combinator article > p child combinator adjacent sibling combinator h1 + p adjacent sibling general sibling combinator h1 ~ p general sibling in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Sizing items in CSS - Learn web development
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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Styling tables - Learn web development
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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
The box model - Learn web development
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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
CSS values and units - Learn web development
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 the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Floats - Learn web development
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 methods supporting older browsers fundamental layout comprehension assessment ...
Grids - Learn web development
see also css grid guides css grid inspector: examine grid layouts 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 methods supporting older browsers fundamental layout comprehension assessment ...
Legacy layout methods - Learn web development
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 methods supporting older browsers fundamental layout comprehension assessment ...
Beginner's guide to media queries - Learn web development
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 methods supporting older browsers fundamental layout comprehension assessment ...
Practical positioning examples - Learn web development
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 methods supporting older browsers fundamental layout comprehension assessment ...
Responsive design - Learn web development
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 methods supporting older browsers fundamental layout comprehension assessment ...
Getting started with CSS - Learn web development
previous overview: first steps next in this module what is css?
CSS FAQ - Learn web development
LearnCSSHowtoCSS FAQ
for example: -ms-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg); note: for more information on dealing with prefixed properties, see handling common html and css problems — handling css prefixes from our cross-browser testing module.
Use CSS to solve common problems - Learn web development
LearnCSSHowto
how to create fancy boxes (also see the styling boxes module, generally).
What are hyperlinks? - Learn web development
the creating hyperlinks article of our introduction to html module explains how to implement links in detail.
How do you set up a local testing server? - Learn web development
running server-side languages locally python's simplehttpserver (python 2.0) http.server (python 3.0) module is useful, but it doesn't know how to run code written in languages such as python, php or javascript.
Basic native form controls - Learn web development
previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for form widgets ...
How to structure a web form - Learn web development
see also a list apart: sensible forms: a form usability checklist previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for form widgets ...
Other form controls - Learn web development
previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for form widgets ...
Sending form data - Learn web development
note: to get a better idea of how client-server architectures work, read our server-side website programming first steps module.
CSS basics - Learn web development
previous overview: getting started with the web next in this module installing basic software what will your website look like?
Dealing with files - Learn web development
your folder structure should look something like this: previous overview: getting started with the web next in this module installing basic software what will your website look like?
Installing basic software - Learn web development
overview: getting started with the web next in this module installing basic software what will your website look like?
Publishing your website - Learn web development
previous overview: getting started with the web next in this module installing basic software what will your website look like?
What will your website look like? - Learn web development
previous overview: getting started with the web next in this module installing basic software what will your website look like?
Advanced text formatting - Learn web development
previous overview: introduction to html next in this module getting started with html what’s in the head?
Creating hyperlinks - Learn web development
previous overview: introduction to html next in this module getting started with html what’s in the head?
Getting started with HTML - Learn web development
the subsequent articles of this module go further on some of the topics introduced here, as well as presenting other concepts of the language.
HTML text fundamentals - Learn web development
previous overview: introduction to html next in this module getting started with html what’s in the head?
Marking up a letter - Learn web development
previous overview: introduction to html next in this module getting started with html what’s in the head?
Structuring a page of content - Learn web development
previous overview: introduction to html in this module getting started with html what’s in the head?
What’s in the head? Metadata in HTML - Learn web development
previous overview: introduction to html next in this module getting started with html what’s in the head?
Adding vector graphics to the Web - Learn web development
in the last article of this module we will explore responsive images in detail, looking at the tools html has to allow you to make your images work better across different devices.
Images in HTML - Learn web development
overview: multimedia and embedding next 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 ...
Making asynchronous programming easier with async and await - Learn web development
previous overview: asynchronous next in this module general asynchronous programming concepts introducing asynchronous javascript cooperative asynchronous javascript: timeouts and intervals graceful asynchronous programming with promises making asynchronous programming easier with async and await choosing the right approach ...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
previous overview: asynchronous next in this module general asynchronous programming concepts introducing asynchronous javascript cooperative asynchronous javascript: timeouts and intervals graceful asynchronous programming with promises making asynchronous programming easier with async and await choosing the right approach ...
Build your own function - Learn web development
previous overview: building blocks next in this module making decisions in your code — conditionals looping code functions — reusable blocks of code build your own function function return values introduction to events image gallery ...
Making decisions in your code — conditionals - Learn web development
the condition makes use of the comparison operators we discussed in the last module and returns true or false.
Third-party APIs - Learn web development
previous overview: client-side web apis next in this module introduction to web apis manipulating documents fetching data from the server third party apis drawing graphics video and audio apis client-side storage ...
A first splash into JavaScript - Learn web development
previous overview: first steps next in this module what is javascript?
Handling text — strings in JavaScript - Learn web development
previous overview: first steps next in this module what is javascript?
Useful string methods - Learn web development
previous overview: first steps next in this module what is javascript?
JavaScript object basics - Learn web development
overview: objects next in this module object basics object-oriented javascript for beginners object prototypes inheritance in javascript working with json data object building practice adding features to our bouncing balls demo ...
Inheritance in JavaScript - Learn web development
inside here you'll find the same person() constructor example that we've been using all the way through the module, with a slight difference — we've defined only the properties inside the constructor: function person(first, last, age, gender, interests) { this.name = { first, last }; this.age = age; this.gender = gender; this.interests = interests; }; the methods are all defined on the constructor's prototype.
Object-oriented JavaScript for beginners - Learn web development
previous overview: objects next in this module object basics object-oriented javascript for beginners object prototypes inheritance in javascript working with json data object building practice adding features to our bouncing balls demo ...
Object building practice - Learn web development
summary we hope you had fun writing your own real world random bouncing balls example, using various object and object-oriented techniques from throughout the module!
Object prototypes - Learn web development
previous overview: objects next in this module object basics object-oriented javascript for beginners object prototypes inheritance in javascript working with json data object building practice adding features to our bouncing balls demo ...
CSS performance optimization - Learn web development
conclusion previous overview: performance next in this module the "why" of web performance what is web performance?
Measuring performance - Learn web development
previous overview: performance next in this module the "why" of web performance what is web performance?
Multimedia: Images - Learn web development
previous overview: performance next in this module the "why" of web performance what is web performance?
Perceived performance - Learn web development
previous overview: performance next in this module the "why" of web performance what is web performance?
The business case for web performance - Learn web development
previous overview: performance in this module the "why" of web performance what is web performance?
Multimedia: video - Learn web development
previous overview: performance next in this module the "why" of web performance what is web performance?
The "why" of web performance - Learn web development
overview: performance next in this module the "why" of web performance what is web performance?
Properly configuring server MIME types - Learn web development
if you're using the cgi module, you can use the line print $cgi->header('text/html'); instead, where $cgi is your reference to the cgi instance.
Introduction to the server side - Learn web development
overview: first steps next in this module introduction to the server side client-server overview server-side web frameworks website security ...
Accessibility in React - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Componentizing our React app - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
React interactivity: Editing, filtering, conditional rendering - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Beginning our React todo list - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Starting our Svelte Todo list app - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
TypeScript support in Svelte - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Componentizing our Svelte app - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Using Vue computed properties - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Vue conditional rendering: editing existing todos - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Creating our first Vue component - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Getting started with Vue - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Adding a new todo form: Vue events, methods, and models - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Focus management with Vue refs - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Rendering a list of Vue components - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Vue resources - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Styling Vue components with CSS - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and com...
Implementing feature detection - Learn web development
previous overview: cross browser testing next in this module introduction to cross browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
omni.ja (formerly omni.jar)
/modules javascript code modules.
Index
these processes include minifying your code, as well as the use of module bundlers or similar tools, such as webpack.
Testopia
bugzilla 4.x mysql 5.0 or postgresql 8.3 mozilla compatible browser ;-) additional 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.
Debugging on Windows
you need to make sure this configure parameter is set: --enable-debugger-info-modules=yes you can also choose to include or exclude specific modules.
Configuring Build Options
ac_add_options --enable-debug-js-modules enable only javascript assertions.
pymake
make.py (and the pymake modules that support it) are an implementation of the make tool which are mostly compatible with makefiles written for gnu make.
The Firefox codebase: CSS Guidelines
ng your stylesheets, it's best to import the content css before the theme css, that way the theme values get to override the content values (which is probably what you want), and you're going to want them both after the global values, so your imports will look like this: <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/content/path/module.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/skin/path/module.css" type="text/css"?> [1] -moz-appearance is tricky.
Interface Compatibility
this may involve using javascript modules, passing named parameters using objects, or other similar techniques.
Reviewer Checklist
[fennec: checking for log levels is expensive unless you're using logger.] style follow the style guide for the language and module in question.
Developer guide
mozilla modules and module ownership this article provides information about mozilla's modules, what the role of a module owner is, and how module owners are selected.
Process scripts
if you're using the addon sdk you can use the remote/parent module's remoterequire instead.
Firefox and the "about" protocol
the about location information is duplicated in docshell/build/nsdocshellmodule.cpp.
overflow-clip-box-block
s() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been proposed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow module level 3.
overflow-clip-box-inline
s() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been proposed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow module level 3.
overflow-clip-box
s() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been proposed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow module level 3.
Roll your own browser: An embedding how-to
uses gtkmozembed widget, part of the kdebindings module and available from http://websvn.kde.org/trunk/kde/kdebindings/xparts/.
HTTP Cache
rapping following four arguments into a single one: private-browsing boolean flag anonymous load boolean flag app id number (0 for no app) is-in-browser boolean flag helper functions to create nsiloadcontextinfo objects: c++ consumers: functions at loadcontextinfo.h exported header js consumers: resource://gre/modules/loadcontextinfo.jsm module methods two storage objects created with the same set of nsiloadcontextinfo arguments are identical, containing the same cache entries.
How to Report a Hung Firefox
indow("navigator:browser"); let browser = win.gbrowser.selectedbrowser; if (browser.isremotebrowser) { browser.messagemanager.loadframescript('data:,let appinfo = components.classes["@mozilla.org/xre/app-info;1"];if (appinfo && appinfo.getservice(components.interfaces.nsixulruntime).processtype != components.interfaces.nsixulruntime.process_type_default) {components.utils.import("resource://gre/modules/ctypes.jsm");var zero = new ctypes.intptr_t(8);var badptr = ctypes.cast(zero, ctypes.pointertype(ctypes.int32_t));var crash = badptr.contents;}', true); } other techniques on os x if you use a nightly build (>= firefox 16), you can use activity monitor's "sample process" feature to generate a sample.
Creating a New Protocol
the toplevel protocol for plugins is ppluginmodule.
IPDL Tutorial
in mozilla there are two main top-level protocols: ppluginmodule for remote plugins, and pcontent for remote tabs.
IPDL Type Serialization
serializers and deserializers are security-sensitive and must always receive two reviews from module owners who understand ipc serialization well.
AddonManager
to import the addonmanager object in the add-on sdk, use: const { addonmanager } = require("resource://gre/modules/addonmanager.jsm"); to import it in a normal bootstrapped extension or similar, use: cu.import("resource://gre/modules/addonmanager.jsm"); method overview promise?
AddonUpdateChecker
to import the addonupdatechecker, use: components.utils.import("resource://gre/modules/addonupdatechecker.jsm"); method overview updateinfo getcompatibilityupdate(in updateinfo updates[], in string version, in boolean ignorecompatibility, in string appversion, in string platformversion) updateinfo getnewestcompatibleupdate(in updateinfo updates[], in string appversion, in string platformversion) void checkforupdates(in string id, in string type, in string updatekey, string url, in updatechecklistener listener) constants constan...
Add-on Repository
to import the add-on repository code module, use: components.utils.import("resource://gre/modules/addonrepository.jsm"); method overview string getrecommendedurl() string getsearchurl(in string searchterms) void cancelsearch() void retrieverecommendedaddons(in integer maxresults, in searchcallback callback) void searchaddons(in string searchterms, in integer maxresults, in searchcallback cal...
Following the Android Toasts Tutorial from a JNI Perspective
it will use the jni.jsm module that is available in firefox for android since version 17.
OS.File for the main thread
using os.file from a jsm to import os.file into your chrome code, add the following line at the start of your script: components.utils.import("resource://gre/modules/osfile.jsm") promises before using os.file from the main thread, you need some understanding of the promise library.
OSFile.jsm
javascript module os.file contains primitives for manipulating files out of the main thread.
Deferred
function deferred() { // update 062115 for typeof if (typeof(promise) != 'undefined' && promise.defer) { //need import of promise.jsm for example: cu.import('resource:/gree/modules/promise.jsm'); return promise.defer(); } else if (typeof(promiseutils) != 'undefined' && promiseutils.defer) { //need import of promiseutils.jsm for example: cu.import('resource:/gree/modules/promiseutils.jsm'); return promiseutils.defer(); } else { /* a method to resolve the associated promise with the value passed.
Promise
you don't need to import the promise.jsm module to use a promise object to which you already have a reference.
SourceMap.jsm
get a reference to the module: let sourcemap = {}; components.utils.import('resource:///modules/devtools/sourcemap.jsm', sourcemap); sourcemapconsumer a sourcemapconsumer instance represents a parsed source map which we can query for information about the original file positions by giving it a file position in the generated source.
MathML Accessibility in Mozilla
accessfu: mathml support in android and firefox os is currently being implemented in our accessfu module and a patch is available on bug 1163374.
Mozilla DOM Hacking Guide
the part about componentregistrar is designed to allow external modules (in this case xpath) to be included in domclassinfo and as such benefit from the javascript benefits it provides.
Mozilla Style System
the style system is the module of mozilla's code responsible for the loading and parsing of css style sheets, and the computation of computed values for all css properties.
Investigating leaks using DMD heap scan mode
fortunately, this method mostly just contains two calls to new, one for scriptloadrequest and one for moduleloadrequest.
Leak Gauge
nspr_log_modules=domleak:5,documentleak:5,nsdocshellleak:5,nodeinfomanagerleak:5 nspr_log_file=nspr.log # or any other filename of your choice this will overwrite any existing file called nspr.log.
TimerFirings logging
nspr_log_modules=timerfirings:4 output once enabled, timerfirings will print one line of logging output per timer fired.
about:memory
├───40,214,384 b (04.17%) -- add-ons │ ├──21,184,320 b (02.20%) ++ {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/js-non-window/zones/zone(0x100496800)/compartment([system principal], jar:file:///users/njn/library/application%20support/firefox/profiles/puna0zr8.new/extensions/%7bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7d.xpi!/bootstrap.js (from: resource://gre/modules/addons/xpiprovider.jsm:4307)) │ ├──11,583,312 b (01.20%) ++ jid1-xufzosoflzsoxg@jetpack/js-non-window/zones/zone(0x100496800) │ ├───5,574,608 b (00.58%) -- {59c81df5-4b7a-477b-912d-4e0fdf64e5f2} │ │ ├──5,529,280 b (00.57%) -- window-objects │ │ │ ├──4,175,584 b (00.43%) ++ top(chrome://chatzilla/content/chatzilla.xul, id=4293) │ │ │ ...
dtrace
mach_kernel is the module name and wakeup is the probe name.
Performance
profiling with zoom zoom is a profiler for linux done by the people who made shark measuring performance using the perfmeasurement.jsm code module using perfmeasurement.jsm to measure performance data in your javascript code.
A brief guide to Mozilla preferences
programmatic changes to preferences can be made using the preferences.jsm module from js code, or the mozilla::preferences static class methods from c++ code.
MailNews automated testing
this makes them especially useful for testing at the component / module level.
Cryptography functions
pk11_getkeygen mxr 3.4 and later pk11_getkeylength mxr 3.2 and later pk11_getkeystrength mxr 3.2 and later pk11_getmechanism mxr 3.2 and later pk11_getminimumpwdlength mxr 3.4 and later pk11_getmodinfo mxr 3.6 and later pk11_getmodule mxr 3.3 and later pk11_getmoduleid mxr 3.2 and later pk11_getnextgenericobject mxr 3.9.2 and later pk11_getnextsafe mxr 3.4 and later pk11_getnextsymkey mxr 3.4 and later pk11_getpadmechanism mxr 3.4 and later pk11_getpbecryptomech...
NSS FAQ
MozillaProjectsNSSFAQ
the psm binary provides a client module that performs cryptographic operations on behalf of applications.
JSS Provider Notes
upported classes cipher dsaprivatekey dsapublickey keyfactory keygenerator keypairgenerator mac messagedigest rsaprivatekey rsapublickey secretkeyfactory secretkey securerandom signature what's not supported the following classes don't work very well: keystore: there are many serious problems mapping the jca keystore interface onto nss's model of pkcs #11 modules.
Mozilla-JSS JCA Provider notes
what's not supported the following classes don't work very well: keystore: there are many serious problems mapping the jca keystore interface onto nss's model of pkcs #11 modules.
NSS_3.11.10_release_notes.html
bug 291384: certutil -k behavior doesn't match usage bug 374247: modutil -disable command not disabling modules' slots bug 384459: certification path validation fails when authority key identifier extension contains key identifier bug 385946: can't import certificate into cert database in fips mode (certutil).
NSS_3.12.2_release_notes.html
bug 456854: cert_decodecertpackage does not set nspr error code upon error bug 457980: hundreds of kilobytes of useless strings in libpkix bug 457984: enable pkcs11 module logging in optimized builds bug 458905: memory leaks in pkix bridge certificates.
NSS 3.14.1 release notes
applications which use multiple pkcs#11 modules, which do not indicate which tokens should be used by default for particular algorithms, and which do make use of cipherorder may now find that cryptographic operations occur on a different pkcs#11 token.
NSS 3.14 release notes
the following functions have been added to the libssl library included in nss 3.14: dtls_importfd (in ssl.h) dtls_gethandshaketimeout (in ssl.h) ssl_getsrtpcipher (in ssl.h) ssl_setrtpciphers (in ssl.h) support for aes-gcm support for aes-gcm has been added to the nss pkcs #11 module (softoken), based upon the draft 7 of pkcs #11 v2.30.
NSS 3.15 release notes
the list of root ca certificates in the nssckbi module has been updated.
NSS 3.16.1 release notes
nss 3.16.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_16_1_rtm/src/ new in nss 3.16.1 new functionality added the "ecc" flag for modutil to select the module used for elliptic curve cryptography (ecc) operations.
NSS 3.16 release notes
the built-in roots module has been updated to version 1.97, which adds, removes, and distrusts several certificates.
NSS 3.17.4 release notes
bug 1113632: fixed a failure to reload a pkcs#11 module in fips mode.
NSS 3.30 release notes
nss 3.30 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_30_rtm/src/ new in nss 3.30 new functionality in the pkcs#11 root ca module (nssckbi), cas with positive trust are marked with a new boolean attribute, cka_nss_mozilla_ca_policy, set to true.
NSS 3.31 release notes
pk11_getmoduleuri - retrieve the uri of the given module.
NSS 3.39 release notes
utilpars.h nssutil_addnssflagtomodulespec - a helper function for modifying the pkcs#11 module configuration.
NSS 3.45 release notes
only relevant for clients that might have copied the unit test code verbatim bug 1550022 - ensure nssutil3 gets built on android bug 1528174 - chacha20poly1305 should no longer modify output length on failure bug 1549382 - don't leak in pkcs#11 modules if c_getslotinfo() returns error bug 1551041 - fix builds using gcc < 4.3 on big-endian architectures bug 1554659 - add versioning to openbsd builds to fix link time errors using nss bug 1553443 - send session ticket only after handshake is marked as finished bug 1550708 - fix gyp scripts on solaris sparc so that libfreebl_64fpu_3.so builds bug 1554336 - optimize away unneeded loop in ...
NSS 3.52 release notes
bug 1629105 - add pkcs11 v3.0 functions to module debug logger.
Enc Dec MAC Output Public Key as CSR
*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } switch (cmd) { case gen_csr: /* validate command for generate csr */ if (!certreqfilename || !subj...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
ate(optstate); if (cmd == unknown || !dbdir) usage(progname); /* open db for read/write and authenticate to it */ pr_init(pr_user_thread, pr_priority_normal, 0); initialized = pr_true; rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } switch (cmd) { case generate_csr: val...
NSS Sample Code Sample_2_Initialization of NSS
ewpass; } else if (newpwfile) { newpwdata.source = pw_fromfile; newpwdata.data = null; } else { newpwdata.source = pw_none; newpwdata.data = null; } if (pk11_needuserinit(slot)) { newpw = initslotpassword(slot, pr_false, &pwdata); rv = pk11_initpin(slot, (char*)null, newpw); } else { for (;;) { oldpw = getmodulepassword(slot, pr_false, &pwdata); if (pk11_checkuserpassword(slot, oldpw) != secsuccess) { if (pwdata.source == pw_none) { pr_fprintf(pr_stderr, "invalid password.
Initialize NSS database - sample 2
ata.source = pw_none; newpwdata.data = null; } if (pk11_needuserinit(slot)) { newpw = initslotpassword(slot, pr_false, &pwdata); rv = pk11_initpin(slot, (char*)null, newpw); if (rv == secsuccess) { pr_fprintf(pr_stderr, "pk11_initpin failed.\n"); return secfailure; } } else { for (;;) { oldpw = getmodulepassword(slot, pr_false, &pwdata); if (pk11_checkuserpassword(slot, oldpw) != secsuccess) { if (pwdata.source == pw_none) { pr_fprintf(pr_stderr, "invalid password.
sample2
r_true; break; default: usage(progname); break; } } pl_destroyoptstate(optstate); if (cmd == unknown || !dbdir) usage(progname); /* open db for read/write and authenticate to it */ pr_init(pr_user_thread, pr_priority_normal, 0); initialized = pr_true; rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } switch (cmd) { case generate_csr: validategeneratecsrcommand(progname, dbdir, subject, subjectstr, certreqfilename); /* generate a csr */ rv = creat...
nss tech note6
the softoken and freebl binaries won't match any nss binaries that may have been submitted to nist for validation, and thus may not be verified as being the actual fips 140 validated cryptographic module .
NSS Tech Notes
tn2: using the pkcs #11 module logger.
PKCS11
pkcs #11 information for implementors of cryptographic modules: implementing pkcs11 for nss pkcs11 faq using the jar installation manager to install a pkcs #11 cryptographic module pkcs #11 conformance testing ...
FC_CloseAllSessions
the nss cryptographic module currently doesn't call the surrender callback function notify.
FC_Finalize
syntax ck_rv fc_finalize (ck_void_ptr preserved); parameters fc_finalize has one parameter: preserved must be null description fc_finalize shuts down the nss cryptographic module in the fips mode of operation.
FC_GetFunctionList
description fc_getfunctionlist stores in *ppfunctionlist a pointer to the nss cryptographic module's list of function pointers in the fips mode of operation.
FC_GetSessionInfo
if the nss cryptographic module is in the error state, fc_getsessioninfo returns ckr_device_error.
FC_GetTokenInfo
ckr_cryptoki_not_initialized the pkcs #11 module library is not initialized.
FC_Login
the nss cryptographic module doesn't allow the so to log in if the normal user's pin is already initialized.
FC_OpenSession
the nss cryptographic module currently doesn't call the surrender callback function notify.
FC_SeedRandom
the initial seed material is provided by the nss cryptographic module itself.
FC_WaitForSlotEvent
description this function is not supported by the nss cryptographic module.
NSC_Login
the nss cryptographic module doesn't allow the so to log in if the normal user's pin is already initialized.
NSS Key Functions
description nss_init opens the certificate, key, and security module databases that you specify for use with nss.
NSS tools : crlutil
for information on security module database management, see using the security module database tool.
OLD SSL Reference
seckey_getdefaultkeydb seckey_destroyprivatekey chapter 7 pkcs #11 functions this chapter describes the core pkcs #11 functions that an application needs for communicating with cryptographic modules.
pkfnc.html
upgraded documentation may be found in the current nss reference pkcs #11 functions chapter 7 pkcs #11 functions this chapter describes the core pkcs #11 functions that an application needs for communicating with cryptographic modules.
sslintro.html
sets the global callback function to obtain passwords for pkcs #11 modules.
sslkey.html
description nss_init opens the certificate, key, and security module databases that you specify for use with nss.
NSS troubleshooting
debugging tips, how to enable tracing of the various modules, etc.
NSS_3.12.3_release_notes.html
nss_strict_nofork string ("1", "disabled", or any other non-empty value) it is an error to try to use a pkcs#11 crypto module in a process before it has been initialized in that process, even if the module was initialized in the parent process.
NSS Tools crlutil
for information on security module database management, see using the security module database tool.
NSS tools : crlutil
MozillaProjectsNSStoolscrlutil
for information on security module database management, see using the security module database tool.
Network Security Services
pkcs #11 information documentation on pkcs #11 modules implementing pkcs #11 for nss the strings nss uses to load pkcs #11 modules pkcs #11 faq using the jar installation manager to install a pkcs #11 cryptographic module pkcs #11 conformance testing - archived version ca certificates pre-loaded into nss mozilla ca certificate policy list of pre-loaded ca certificates consum...
Necko
browse our code in its latest state at netwerk/ documents a necko code walkthrough necko architecture necko multithreading necko faq necko interfaces overview the necko http module proxies in necko pac files community view mozilla forums...
New in Rhino 1.7R4
update license to mpl 2.0 make string concatenation with + fast java class generation updates and fixes faster number to string conversion several regexp fixes regexp performance improvements es5 compliance fixes improved interpreter performance improved commonjs module implementation javascript 1.8 generator expressions many parser and ast fixes use javascript 1.7 as default version in rhino shell javaadapter improvements fixes in js to java access include mozilla test suite a list of bugs that were fixed since the previous release.
Statistics API
var prefs = require("api-utils/preferences-service"); components.utils.import('resource://gre/modules/services.jsm'); function observer(subject, topic, json) { var data = json.parse(json); // process the data } prefs.set("javascript.options.mem.notify", true); services.obs.addobserver(observer, "garbage-collection-statistics", false); the toplevel json object contains these fields: timestamp: integer (microseconds) - time at which the gc ended, measured from epoch.
SpiderMonkey Internals
jsemit.*, jsopcode.tbl, jsopcode.*, jsparse.*, jsscan.*, jsscript.* compiler and decompiler modules.
JS_AddExternalStringFinalizer
in a js_threadsafe build, this function must be invoked on the primordial thread only, at startup—or else the entire program must single-thread itself while loading a module that calls this function.
Profiling SpiderMonkey
here's a sample mozconfig: mk_add_options moz_objdir=@topsrcdir@/ff-opt-libxul mk_add_options moz_make_flags=-j3 ac_add_options --enable-optimize ac_add_options --enable-libxul ac_add_options --enable-shark ac_add_options --enable-debugger-info-modules ac_add_options --enable-application=browser 2.) you'll want to run shark on both the browser and [xpcshell], since the host environments differ.
TPS Tests
comment out the goquitapplication() calls in services/sync/tps/extensions/tps/modules/tps.jsm (remember to undo this later!).
Mozinfo
the top level attributes (os, version, bits, processor) are available as module globals: if mozinfo.os == 'win': ...
Redis Tips
you might use psubscribe in a case where you have message channels named according to application namespaces, as different modules or logging systems might do.
Setting up an update server
you can use this command with firefox's browser console to determine the update directory: const {fileutils} = chromeutils.import("resource://gre/modules/fileutils.jsm"); fileutils.getdir("updrootd", [], false).path once you have determined the update directory, close firefox, browse to the directory and remove the subdirectory called updates.
Querying Places
the defaults for these objects will result in a query that returns all of your browser history in a flat list: chromeutils.definemodulegetter(this, "placesutils", "resource://gre/modules/placesutils.jsm"); // no query options set will get all history, sorted in database order, // which is nsinavhistoryqueryoptions.sort_by_none.
Using the Places keywords API
using the keywords api the keywords api is a promise-based api available through the placesutils module: components.utils.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.definelazymodulegetter(this, "placesutils", "resource://gre/modules/placesutils.jsm"); setting a keyword for an url the insert() method accepts a keyword entry object describing the keyword to insert.
Resources
ux: http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-i686-pc-linux-gnu-1.4a.tar.gz windows: http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-win32-1.4a.zip other mozilla downloads gecko resources internal string guide external string guide the gecko networking library ("necko") the netscape portable runtime environment embedding mozilla current module owners xpinstall xul xpcom resources the xpcom project page xulplanet's online xpcom reference information on xpconnect and scriptable components the smart pointer guide xpidl xpidl compiler reference general development resources the world wide web consortium url specification at the w3 gnu make « previous copyright (c) 2003 by doug turner and ian oeschger.
Making cross-thread calls using runnables
} see also chromeworker using workers in javascript code modules the thread manager ...
Mozilla internal string guide
str.assign(reversedstr); } as function parameters for methods which are exposed across modules, use nsastring references to pass strings.
XPCOM guide
MozillaTechXPCOMGuide
do so, first by explaining the underlying concepts, and second by describing a number of common javascript patterns that cause leaks.creating xpcom componentsthis guide is about gecko, and about creating xpcom components for gecko-based applications.how to build an xpcom component in javascriptif you are looking for add-on sdk solution for xpcom javascript components then check out platform/xpcom module first.inheriting from implementation classesgiven that idl interfaces map to abstract classes in c++, a common problem when dealing with idl is when you have an idl inheritance hierarchy, and a corresponding c++ implementation hierarchy, you run into multiple inheritance.
Components object
utils.import loads a javascript module into the current script, without sharing a scope.
Profiling XPCShell
introduction sometimes, you might want to get a performance profile of a certain piece of javascript (like an xpcom module), to see which part takes the most time.
xpcshell
js> see also howto for common problems in writing xpcshell scripts, e.g., doing async network calls or using js modules.
Observer Notifications
it's used by the context-menu module in the add-on sdk, to help send information to the context-menu code running in the chrome process when a context menu is displayed.
Core XPCOM functions
erthe ns_getmemorymanager function returns a reference to the xpcom memory manager.ns_getservicemanagerthe ns_getservicemanager function returns a reference to the xpcom service manager.ns_initxpcom2the ns_initxpcom2 function initiates use of xpcom in the calling process.ns_initxpcom3the ns_initxpcom3 function initiates use of xpcom in the calling process with support for statically defined xpcom modules.
imgIDecoder
modules/libpr0n/public/imgidecoder.idlscriptable base class for a decoder that reads an image from an input stream and sends it to an imgiloader object.
imgIEncoder
modules/libpr0n/public/imgiencoder.idlscriptable please add a summary to this article.
imgILoader
modules/libpr0n/public/imgiloader.idlscriptable please add a summary to this article.
imgIRequest
modules/libpr0n/public/imgirequest.idlscriptable please add a summary to this article.
nsIAccessibleSelectable
accessible/public/nsiaccessibleselectable.idlscriptable an interface for the accessibility module and in-process accessibility clients for dealing with getting and changing the selection of accessible nodes.
nsIClassInfo
eager_classinfo 1 << 5 this flag is designed for use with nsgenericfactory and can be set in nsmodulecomponentinfo::mflags.
nsICookieStorage
modules/plugin/base/public/nsicookiestorage.idlnot scriptable please add a summary to this article.
nsIDOMClientRect
see also cssom view module : the clientrect interfacewd this object was renamed a few times: initial name was textrectangle, then clientrect, then domrect.
nsIFile
to create an nsifile from a path you can use fileutils.jsm: var fileutils = cu.import("resource://gre/modules/fileutils.jsm").fileutils var nsifile = new fileutils.file( filename ) note: nsilocalfile was merged with this interface in gecko 14.
nsIFormHistory2
astring value); boolean nameexists(in astring name); void removeallentries(); void removeentriesbytimeframe(in long long abegintime, in long long aendtime); void removeentriesforname(in astring name); void removeentry(in astring name, in astring value); attributes attribute type description dbconnection mozistorageconnection returns the underlying db connection the form history module is using.
nsIHTTPHeaderListener
modules/plugin/base/public/nsihttpheaderlistener.idlscriptable this interface allows plugin authors to access http response headers after issuing an nsipluginhost.geturl or nsipluginhost.posturl call.
nsIHttpChannel
this method allows, for example, the cookies module to add "cookie" headers to the outgoing http request.
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.
nsILoginMetaInfo
see also nsiloginmanager nsilogininfo creating a login manager storage module ...
canUnload
this content is now available at nsimodule.canunload().
getClassObject
this content is now available at nsimodule.getclassobject().
registerSelf
this content is now available at nsimodule.registerself().
unregisterSelf
this content is now available at nsimodule.unregisterself().
Component; nsIPrefBranch
component: nsiprefbranch modules/libpref/public/nsiprefbranch.idlscriptable this interface is used to manipulate the preferences data.
nsIPrefLocalizedString
modules/libpref/public/nsipreflocalizedstring.idlscriptable this interface is simply a wrapper interface for nsisupportsstring so the preferences service can have a unique identifier to distinguish between requests for normal wide strings nsisupportsstring) and 'localized' wide strings, which get their default values from properites files.
nsIPrefService
modules/libpref/public/nsiprefservice.idlscriptable this interface is the main entry point into the back end preferences management library.
nsIPushSubscription
key: string.fromcharcode.apply(null, btoa(subscription.getkey("p256dh"))), secret: string.fromcharcode.apply(null, btoa(subscription.getkey("auth"))), })); } pushservice.subscribe( "chrome://my-module/push", scriptsecuritymanager.getsystemprincipal(), (code, subscription) => { if (!components.issuccesscode(code)) { cu.reporterror("error creating subscription: " + code); } else { sendsubscriptiontoserver(subscription); } } ); see also nsipushservice nsipushmessage pushsubscription ...
nsIScriptableInputStream
note: starting in gecko 2.0, you can use the netutils.jsm javascript code module and its readinputstreamtostring() method to read arbitrary binary data into a javascript string.
nsITelemetry
nents.interfaces.nsitelemetry); method overview jsval gethistogrambyid(in acstring id); jsval snapshothistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in acstring id); void capturestack(in acstring name); jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); void sethistogramrecordingenabled(in acstring id, in boolean enabled); void asyncfetchtelemetrydata(in nsifetchtelemetrydatacallback acallback); double mssinceprocessstart(); void scalaradd(in acstring aname, in jsval avalue); void scalarset(i...
nsITraceableChannel
/////// start - do not edit var {classes: cc, interfaces: ci, results: cr, constructor: cc, utils: cu} = components; cu.import('resource://gre/modules/services.jsm'); var binaryinputstream = cc('@mozilla.org/binaryinputstream;1', 'nsibinaryinputstream', 'setinputstream'); var binaryoutputstream = cc('@mozilla.org/binaryoutputstream;1', 'nsibinaryoutputstream', 'setoutputstream'); var storagestream = cc('@mozilla.org/storagestream;1', 'nsistoragestream', 'init'); function tracinglistener() { this.receivedchunks = []; // array for incoming da...
nsIVersionComparator
see here: nsixulappinfo components.utils.import("resource://gre/modules/services.jsm"); var curentbrowserversion = services.appinfo.platformversion; //example: '31.*' var comparetothisversion = '25.*'; var compareresult = services.vc.compare(curentbrowserversion, comparetothisversion); if (compareresult == -1) { //currentbrowserversion is less than '25.*' (comparetothisversion) } else if (compareresult == 0) { //currentbrowserversion is '25.*' (comparetot...
nsIWebProgressListener
cu.reporterror("saw: " + data.name + " -- passing: " + json.stringify(data)); }); /** * below is the contents of example-framescript.js */ const {classes: cc, interfaces: ci, utils: cu} = components; cu.import("resource://gre/modules/xpcomutils.jsm"); var mylistener = { queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), onstatechange: function(awebprogress, arequest, aflag, astatus) { let win = awebprogress.domwindow; let outerwindowid = win.queryinterface(ci.nsiinterfacerequestor) .
nsIXMLHttpRequest
ning a simple http request from a xul application (like a mozilla extension) without using observers: var req = components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(); req.open('post', "http://www.foo.bar:8080/nietzsche.do", true); req.send('your=data&and=more&stuff=here'); example 2 var {cu: utils, cc: classes, ci: instances} = components; cu.import('resource://gre/modules/services.jsm'); function xhr(url, cb) { let xhr = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(ci.nsixmlhttprequest); let handler = ev => { evf(m => xhr.removeeventlistener(m, handler, !1)); switch (ev.type) { case 'load': if (xhr.status == 200) { cb(xhr.response); break; ...
nsIZipReaderCache
modules/libjar/nsizipreader.idlscriptable please add a summary to this article.
Storage
opening a connection javascript example of opening my_db_file_name.sqlite in the profile directory: components.utils.import("resource://gre/modules/services.jsm"); components.utils.import("resource://gre/modules/fileutils.jsm"); let file = fileutils.getfile("profd", ["my_db_file_name.sqlite"]); let dbconn = services.storage.opendatabase(file); // will also create the file if it does not exist likewise, the c++ would look like this: nscomptr<nsifile> dbfile; rv = ns_getspecialdirectory(ns_app_user_profile_50_dir, ...
Using the Gecko SDK
linking (link line, version script to only expose nsgetmodule, etc.) ...
Working with Multiple Versions of Interfaces
the problem in this short note we illustrate how one can update an xpcom module in order for it to work in both firefox 2 and firefox 3, even if the interfaces have changed in the interim.
XPIDL Syntax
MozillaTechXPIDLSyntax
the following is a list of potential features which are parseable but may not result in expected code: struct, union, and enumerated types array declarators (appears to be supported in xpidl_header.c but not xpidl_typelib.c) exception declarations module declarations variable arguments (that makes the abnf get more wonky) sequence types max-length strings fixed-point numbers "any" and "long double" types.
XSLT 2.0
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.
Creating a gloda message query
you can find the file, which includes doxygen markup of sorts, here: https://hg.mozilla.org/comm-central/file/tip/mailnews/db/gloda/modules/gloda.js components.utils.import("resource:///modules/gloda/public.js"); create the query let query = gloda.newquery(gloda.noun_message); add constraints to the query each constraint function takes one or more arguments which are "or"ed together.
Thunderbird API documentation
hidden prefs libmime libmime module libmime content type handlers mail and rdf using the multiple accounts api spam filtering ...
Demo Addon
it lets you iterate over any collection and transforms your collection elements in the given objects, to use fixiterator, you have to import it with cu.import("resource:///modules/iteratorutils.jsm");.
Folders and message lists
components.utils.import("resource:///modules/iteratorutils.jsm"); for (let msghdr in fixiterator(myfolder.messages, components.interfaces.nsimsgdbhdr)) { // do something with msghdr...
Using Mozilla code in other projects
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.
WebIDL bindings
components.utils.import("resource://gre/modules/xpcomutils.jsm"); function mynumberinner() { this.value = 111; this.invisiblevalue = 12345; } mynumberinner.prototype = { classdescription: "get my number xpcom component", classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), // dummy uuid contractid: "@mozilla.org/my-number;1", queryinterface: xpcomutils.generateqi([components.interfaces.nsisupports]), donothing: fu...
Zombie compartments
js-compartment([system principal], 0x7f10f1250000) compartment(atoms) js-compartment(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.
Using COM from js-ctypes
let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); // some groundwork let is64bit; if (ctypes.voidptr_t.size == 4 /* 32-bit */) { is64bit = false; } else if (ctypes.voidptr_t.size == 8 /* 64-bit */) { is64bit = true; } let winabi = is64bit ?
ctypes.open
if the native file is located at chrome://youraddon/content/mysubfolder/mycfunctionsforunix.so then it is converted to a file uri like this: components.utils.import("resource://gre/modules/services.jsm"); var cr = components.classes['@mozilla.org/chrome/chrome-registry;1'].getservice(components.interfaces.nsichromeregistry); var chromeuri_mylib = services.io.newuri('chrome://youraddon/content/mysubfolder/mycfunctionsforunix.so', 'utf-8', null); var localfile_mylib = cr.convertchromeurl(chromeuri_mylib); var jarpath_mylib = localfile_mylib.spec; // "jar:file:///c:/users/vayeate/ap...
ctypes
credit for this example is to nmaier (stackoverflow :: getting tb_button is crashing and not working) example of cast and functiontype on windows components.utils.import("resource://gre/modules/ctypes.jsm"); var kernel = ctypes.open("kernel32.dll"); var hmodule = ctypes.uint32_t; var hwnd = ctypes.uint32_t; var lpctstr = ctypes.jschar.ptr; var lpcstr = ctypes.char.ptr; var loadlibrary = kernel.declare("loadlibraryw", ctypes.winapi_abi, hmodule, lpctstr); var getprocaddress = kernel.declare("getprocaddress", ctypes.winapi_abi, ctypes.void_t.ptr, hmodule, lpcstr); var huser = loadlibra...
Constants - Plugins
nperr_module_load_failed_error 4 loading of plug-in failed.
Plug-in Development Overview - Plugins
when it starts up, the browser checks for plug-in modules for the platform and registers them.
DOM Inspector - Firefox Developer Tools
to find out who knows dom inspector code and where it lives, see the dom inspector module listing.
Using the Debugger map scopes feature - Firefox Developer Tools
it’s also possible to inspect variables from the generated scopes (e.g., a bundle file with all concatenated module files).
Debugger.Frame - Firefox Developer Tools
"module": a frame running code at the top level of a module.
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
components.utils.import('resource://gre/modules/jsdebugger.jsm'); adddebuggertoglobal(window); (function () { // the debugger we'll use to observe a tab's allocation.
Tutorial: Set a breakpoint - Firefox Developer Tools
click on the scratchpad panel and enter the following code: components.utils.import("resource://gre/modules/jsdebugger.jsm"); components.utils.import("resource://gre/modules/console.jsm"); // this simply defines 'debugger' in this scratchpad; // it doesn't actually start debugging anything.
Debugger.Object - Firefox Developer Tools
for example, in firefox, a metadata object for a javascript module's global object might look like this: { "type":"jsm", "uri":"resource:://gre/modules/xpcomutils.jsm" } firefox provides [debuggerhostannotationsforfirefox annotations] for its host objects.
Index - Firefox Developer Tools
it’s also possible to inspect variables from the generated scopes (e.g., a bundle file with all concatenated module files).
AudioContext() - Web APIs
the audiocontext() constructor creates a new audiocontext object which represents an audio-processing graph, built from audio modules linked together, each represented by an audionode.
AudioContext - Web APIs
the audiocontext interface represents an audio-processing graph built from audio modules linked together, each represented by an audionode.
AudioParamDescriptor - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('white-noise-processor.js') const whitenoisenode = new audioworkletnode(audiocontext, 'white-noise-processor') whitenoisenode.connect(audiocontext.destination) now we can change the gain on the node like this: const gainparam = whitenoisenode.parameters.get('customgain') gainparam.setvalueattime(0, audiocontext.currenttime) gainparam.linearramptovalueattime(0.5, audiocontext.currenttime + 0.5)...
AudioWorkletGlobalScope.registerProcessor - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('test-processor.js') const node = new audioworkletnode(audiocontext, 'test-processor') node.connect(audiocontext.destination) specifications specification status comment web audio apithe definition of 'registerprocessor()' in that specification.
AudioWorkletGlobalScope - Web APIs
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.
AudioWorkletNode.parameters - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('white-noise-processor.js') const whitenoisenode = new audioworkletnode(audiocontext, 'white-noise-processor') whitenoisenode.connect(audiocontext.destination) now we can change the gain on the node like this: const gainparam = whitenoisenode.parameters.get('customgain') gainparam.setvalueattime(0, audiocontext.currenttime) gainparam.linearramptovalueattime(0.5, audiocontext.currenttime + 0.5)...
AudioWorkletNode.port - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will...
AudioWorkletNode - Web APIs
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.
AudioWorkletProcessor() - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('test-processor.js') const testnode = new audioworkletnode(audiocontext, 'test-processor', { processoroptions: { someusefulvariable: new map([[1, 'one'], [2, 'two']]) } }) the console output will be as follows: > 1 // audioworkletnode options.numberofinputs set to default > map(2) {1 => "one", 2 => "two"} // a cloned map under someusefulvariable specifications specification...
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('white-noise-processor.js') const whitenoisenode = new audioworkletnode(audiocontext, 'white-noise-processor') whitenoisenode.connect(audiocontext.destination) now we can change the gain on the node like this: const gainparam = whitenoisenode.parameters.get('customgain') gainparam.setvalueattime(0, audiocontext.currenttime) gainparam.linearramptovalueattime(0.5, audiocontext.currenttime + 0.5)...
AudioWorkletProcessor.port - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will...
CSS.paintWorklet (Static property) - Web APIs
WebAPICSSpaintWorklet
<script> if ('paintworklet' in css) { css.paintworklet.addmodule('checkerboard.js'); } </script> specifications specification status comment css painting api level 1the definition of 'paintworklet' in that specification.
CSS.supports() - Web APIs
WebAPICSSsupports
"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.
CSS - Web APIs
WebAPICSS
css conditional rules module level 3the definition of 'css' in that specification.
CSSConditionRule - Web APIs
specifications specification status comment css conditional rules module level 3the definition of 'cssconditionrule' in that specification.
CSSMediaRule - Web APIs
specifications specification status comment css conditional rules module level 3the definition of 'cssmediarule' in that specification.
CSSSupportsRule - Web APIs
specification specification status comment css conditional rules module level 3the definition of 'csssupportsrule' in that specification.
CSS Counter Styles - Web APIs
the css counter styles module allows to define custom counter styles, which can be used for css list-marker and generated-content counters.
CSS Font Loading API - Web APIs
specifications specification status comment css font loading module level 3 working draft initial definition.
CaretPosition - Web APIs
methods caretposition.getclientrect specification specification status comment css object model (cssom) view modulethe definition of 'caretposition' in that specification.
DOMMatrix() - Web APIs
var scaley = 3; var translatex = 12; var translatey = 8; var angle = math.pi / 2; var matrix = new dommatrix([ math.sin(angle) * scalex, math.cos(angle) * scalex, -math.sin(angle) * scaley, math.cos(angle) * scaley, translatex, translatey ]); var transformedpoint = point.matrixtransform(matrix); specifications specification status comment geometry interfaces module level 1the definition of 'dommatrix' in that specification.
DOMMatrix - Web APIs
WebAPIDOMMatrix
specifications specification status comment geometry interfaces module level 1the definition of 'dommatrix' in that specification.
DOMMatrixReadOnly() - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly' in that specification.
DOMMatrixReadOnly.flipX() - Web APIs
const flipped = document.getelementbyid('flipped'); const matrix = new dommatrixreadonly(); const flippedmatrix = matrix.flipx(); flipped.setattribute('transform', flippedmatrix.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.flipx()' in that specification.
DOMMatrixReadOnly.scale() - Web APIs
ectssixparamscale) { scaledmatrixwithorigin = matrix.scale(0.5, 0.5, 1, 25, 25, 0); } document.queryselector('#transformed').setattribute('transform', scaledmatrix.tostring()); document.queryselector('#transformedorigin').setattribute('transform', scaledmatrixwithorigin.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.scale()' in that specification.
DOMMatrixReadOnly.translate() - Web APIs
const matrix = new dommatrixreadonly().translate(25, 25); document.queryselector('#transformed').setattribute('transform', matrix.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.translate()' in that specification.
DOMMatrixReadOnly - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly' in that specification.
DOMPoint.fromPoint() - Web APIs
var center = dompoint.frompoint({x: 75, y: -50, z: -55, w: 0.25}); specifications specification status comment geometry interfaces module level 1the definition of 'frompoint()' in that specification.
DOMPoint.DOMPoint() - Web APIs
WebAPIDOMPointDOMPoint
var windtopleft = new dompoint(window.screenx, window.screeny); var newtopleft = dompoint.frompoint(windtopleft); newtopleft.x += 100; newtopleft.y += 100; specifications specification status comment geometry interfaces module level 1the definition of 'dompoint()' in that specification.
DOMPoint.w - Web APIs
WebAPIDOMPointw
specifications specification status comment geometry interfaces module level 1the definition of 'w' in that specification.
DOMPoint.x - Web APIs
WebAPIDOMPointx
specifications specification status comment geometry interfaces module level 1the definition of 'x' in that specification.
DOMPoint.y - Web APIs
WebAPIDOMPointy
specifications specification status comment geometry interfaces module level 1the definition of 'y' in that specification.
DOMPoint.z - Web APIs
WebAPIDOMPointz
specifications specification status comment geometry interfaces module level 1the definition of 'z' in that specification.
DOMPoint - Web APIs
WebAPIDOMPoint
console.log('xr viewer orientation: {x: ' + roundtotwo(orientation.x) + ', y: ' + roundtotwo(orientation.y) + ', z: ' + roundtotwo(orientation.z) + ', w: ' + roundtotwo(orientation.w)); } } specifications specification status comment geometry interfaces module level 1the definition of 'dompoint' in that specification.
DOMPointInit.w - Web APIs
WebAPIDOMPointInitw
specifications specification status comment geometry interfaces module level 1the definition of 'w' in that specification.
DOMPointInit.x - Web APIs
WebAPIDOMPointInitx
specifications specification status comment geometry interfaces module level 1the definition of 'x' in that specification.
DOMPointInit.y - Web APIs
WebAPIDOMPointInity
specifications specification status comment geometry interfaces module level 1the definition of 'y' in that specification.
DOMPointInit.z - Web APIs
WebAPIDOMPointInitz
specifications specification status comment geometry interfaces module level 1the definition of 'z' in that specification.
DOMPointInit - Web APIs
const pointdesc = { x: window.screenx, y: window.screeny, z: 5.0 }; const windtopleft = dompoint.frompoint(pointdesc) specifications specification status comment geometry interfaces module level 1the definition of 'dompointreadonly.frompoint()' in that specification.
DOMPointReadOnly() - Web APIs
var point2d = new dompointreadonly(50, 25); var point3d = new dompointreadonly(50, 0, 10); var perspectivepoint3d = new dompointreadonly(50, 50, 25, 0.5); specifications specification status comment geometry interfaces module level 1the definition of 'dompointreadonly' in that specification.
DOMPointReadOnly.fromPoint() - Web APIs
const origpoint = new dompoint(25, 25, 100, 0.5) const newpoint = dompointreadonly.frompoint(origpoint) specifications specification status comment geometry interfaces module level 1the definition of 'frompoint()' in that specification.
DOMPointReadOnly.toJSON() - Web APIs
var topleft = new dompoint(window.screenx, window.screeny); var pointjson = topleft.tojson(); specifications specification status comment geometry interfaces module level 1the definition of 'dompointreadonly.tojson()' in that specification.
DOMPointReadOnly.w - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'w' in that specification.
DOMPointReadOnly.x - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'x' in that specification.
DOMPointReadOnly.y - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'y' in that specification.
DOMPointReadOnly.z - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'z' in that specification.
DOMPointReadOnly - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'dompoint' in that specification.
DOMQuad - Web APIs
WebAPIDOMQuad
specifications specification status comment geometry interfaces module level 1the definition of 'domquad' in that specification.
DOMRect.DOMRect() - Web APIs
WebAPIDOMRectDOMRect
examples to create a new domrect, you could run a line of code like so: mydomrect = new domrect(0,0,100,100); // running 'mydomrect' in the console would then return // domrect { x: 0, y: 0, width: 100, height: 100, top: 0, right: 100, bottom: 100, left: 0 } specifications specification status comment geometry interfaces module level 1the definition of 'domrect()' in that specification.
DOMRect - Web APIs
WebAPIDOMRect
specifications specification status comment geometry interfaces module level 1the definition of 'domrect' in that specification.
DOMRectReadOnly() - Web APIs
examples to create a new dompoint, you could run a line of code like so: const mydomrect = new domrectreadonly(0, 0, 100, 100) // running 'mydomrect' in the console would then return // domrect { x: 0, y: 0, width: 100, height: 100, top: 0, right: 100, bottom: 100, left: 0 } specifications specification status comment geometry interfaces module level 1the definition of 'domrectreadonly()' in that specification.
DOMRectReadOnly.bottom - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'bottom' in that specification.
DOMRectReadOnly.fromRect() - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'fromrect()' in that specification.
DOMRectReadOnly.height - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'height' in that specification.
DOMRectReadOnly.left - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'left' in that specification.
DOMRectReadOnly.right - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'right' in that specification.
DOMRectReadOnly.top - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'top' in that specification.
DOMRectReadOnly.width - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'width' in that specification.
DOMRectReadOnly.x - Web APIs
WebAPIDOMRectReadOnlyx
specifications specification status comment geometry interfaces module level 1the definition of 'x' in that specification.
DOMRectReadOnly.y - Web APIs
WebAPIDOMRectReadOnlyy
specifications specification status comment geometry interfaces module level 1the definition of 'y' in that specification.
DOMRectReadOnly - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'domrectreadonly' in that specification.
DelayNode() - Web APIs
the delaynode() constructor of the web audio api creates a new delaynode object with a delay-line; an audionode audio-processing module that causes a delay between the arrival of an input data, and its propagation to the output.
DelayNode - Web APIs
WebAPIDelayNode
the delaynode interface represents a delay-line; an audionode audio-processing module that causes a delay between the arrival of an input data and its propagation to the output.
Document.createEvent() - Web APIs
event module standard event object gecko also supports text event module textevent textevents keyboard event module keyboardevent keyevents basic events module event events specifications specification status comment domthe definition of 'document.createevent' in that specification.
Document.fonts - Web APIs
WebAPIDocumentfonts
}); specifications specification status comment css font loading module level 3the definition of 'fontfaceset' in that specification.
Document: scroll event - Web APIs
specifications specification status css object model (cssom) view module working draft ...
Document.scrollingElement - Web APIs
syntax var element = document.scrollingelement; example var scrollelm = document.scrollingelement; scrollelm.scrolltop = 0; specifications specification status comment css object model (cssom) view modulethe definition of 'scrollingelement' in that specification.
Document - Web APIs
WebAPIDocument
css object model (cssom) view modulethe definition of 'document' in that specification.
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
= document.createelement('br'); textnode.parentnode.insertbefore(br, replacement); } } window.onload = function (){ var paragraphs = document.getelementsbytagname("p"); for (i=0 ; i < paragraphs.length; i++) { paragraphs[i].addeventlistener("click", insertbreakatpoint, false); } }; specifications specification status comment css object model (cssom) view modulethe definition of 'caretpositionfrompoint()' in that specification.
DocumentOrShadowRoot.elementFromPoint() - Web APIs
obsolete css object model (cssom) view modulethe definition of 'elementsfrompoint()' in that specification.
DocumentOrShadowRoot.elementsFromPoint() - Web APIs
obsolete css object model (cssom) view modulethe definition of 'elementsfrompoint()' in that specification.
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
there are rules in the browser engine that decide which whitespace characters are useful and which aren’t — these are specified at least in part in css text module level 3, and especially the parts about the css white-space property and whitespace processing details, but we also offer an easier explanation below.
Element.clientHeight - Web APIs
example specification specification status comment css object model (cssom) view modulethe definition of 'clientheight' in that specification.
Element.clientLeft - Web APIs
padding-bottom left top right bottom margin-top margin-bottom border-top border-bottom specifications specification status comment css object model (cssom) view modulethe definition of 'clientleft' in that specification.
Element.clientTop - Web APIs
WebAPIElementclientTop
specifications specification status comment css object model (cssom) view modulethe definition of 'clienttop' in that specification.
Element.clientWidth - Web APIs
example specification specification status comment css object model (cssom) view modulethe definition of 'clientwidth' in that specification.
Element.getBoundingClientRect() - Web APIs
specifications specification status comment css object model (cssom) view modulethe definition of 'element.getboundingclientrect()' in that specification.
Element.getClientRects() - Web APIs
function() { /* call function addclientrectsoverlay(elt) for all elements with assigned class "withclientrectsoverlay" */ var elt = document.getelementsbyclassname('withclientrectsoverlay'); for (var i = 0; i < elt.length; i++) { addclientrectsoverlay(elt[i]); } })(); result specifications specification status comment css object model (cssom) view modulethe definition of 'element.getclientrects()' in that specification.
Element.scroll() - Web APIs
WebAPIElementscroll
examples // put the 1000th vertical pixel at the top of the element element.scroll(0, 1000); using options: element.scroll({ top: 100, left: 100, behavior: 'smooth' }); specification specification status comment css object model (cssom) view modulethe definition of 'element.scroll()' in that specification.
Element.scrollBy() - Web APIs
WebAPIElementscrollBy
examples // scroll an element element.scrollby(300, 300); using options: element.scrollby({ top: 100, left: 100, behavior: 'smooth' }); specification specification status comment css object model (cssom) view modulethe definition of 'element.scrollby()' in that specification.
Element.scrollHeight - Web APIs
registration.accept.checked = false; checkreading.noticebox.id = "notice"; otoberead.parentnode.insertbefore(checkreading.noticebox, otoberead); otoberead.parentnode.insertbefore(document.createelement("br"), otoberead); otoberead.onscroll = checkreading; checkreading.call(otoberead); } specifications specification status comment css object model (cssom) view modulethe definition of 'element.scrollheight' in that specification.
Element.scrollIntoView() - Web APIs
specifications specification status comment css object model (cssom) view modulethe definition of 'element.scrollintoview()' in that specification.
Element.scrollLeft - Web APIs
: 100px; height: 100px; border: 1px solid #ccc; overflow-x: scroll; } #content { width: 250px; background-color: #ccc; } javascript const button = document.getelementbyid('slide'); button.onclick = function () { document.getelementbyid('container').scrollleft += 20; }; result specifications specification status comment css object model (cssom) view modulethe definition of 'scrollleft' in that specification.
Element.scrollTo() - Web APIs
WebAPIElementscrollTo
examples element.scrollto(0, 1000); using options: element.scrollto({ top: 100, left: 100, behavior: 'smooth' }); specifications specification status comment css object model (cssom) view modulethe definition of 'element.scrollto()' in that specification.
Element.scrollTop - Web APIs
WebAPIElementscrollTop
if you can see this, scrolltop is maxed-out padding-bottom left top right bottom margin-top margin-bottom border-top border-bottom specifications specification status comment css object model (cssom) view modulethe definition of 'scrolltop' in that specification.
Element.scrollWidth - Web APIs
er.'); } else { alert('no overflows!'); } } buttonone.addeventlistener('click', function() { alertoverflow(divone); }); buttontwo.addeventlistener('click', function() { alertoverflow(divtwo); }); </script> </html> result specification specification status comment css object model (cssom) view modulethe definition of 'element.scrollwidth' in that specification.
Element: scroll event - Web APIs
specifications specification status css object model (cssom) view module working draft ...
Element - Web APIs
WebAPIElement
css object model (cssom) view modulethe definition of 'element' in that specification.
EventTarget.addEventListener() - Web APIs
this is particularly useful for ajax libraries, javascript modules, or any other kind of code that needs to work well with other libraries/extensions.
FontFace.FontFace() - Web APIs
WebAPIFontFaceFontFace
ttings example async function loadfonts() { const font = new fontface('myfont', 'url(myfont.woff)'); // wait for font to be loaded await font.load(); // add font to document document.fonts.add(font); // enable font with css class document.body.classlist.add('fonts-loaded'); } specifications specification status comment css font loading module level 3the definition of 'fontface constructor' in that specification.
FontFace.family - Web APIs
WebAPIFontFacefamily
example var fontface = new fontface('roboto', 'url(https://fonts.example.com/roboto.woff2)'); console.log(fontface.family); // 'roboto' fontface.family = 'newroboto'; console.log(fontface.family); // 'newroboto' specifications specification status comment css font loading module level 3the definition of 'family' in that specification.
FontFace.featureSettings - Web APIs
specifications specification status comment css font loading module level 3the definition of 'featuresettings' in that specification.
FontFace.load - Web APIs
WebAPIFontFaceload
specifications specification status comment css font loading module level 3the definition of 'load' in that specification.
FontFace.loaded - Web APIs
WebAPIFontFaceloaded
specifications specification status comment css font loading module level 3the definition of 'loaded' in that specification.
FontFace.status - Web APIs
WebAPIFontFacestatus
specifications specification status comment css font loading module level 3the definition of 'status' in that specification.
FontFace.stretch - Web APIs
WebAPIFontFacestretch
specifications specification status comment css font loading module level 3the definition of 'stretch' in that specification.
FontFace.style - Web APIs
WebAPIFontFacestyle
specifications specification status comment css font loading module level 3the definition of 'style' in that specification.
FontFace.unicodeRange - Web APIs
specifications specification status comment css font loading module level 3the definition of 'unicoderange' in that specification.
FontFace.variant - Web APIs
WebAPIFontFacevariant
specifications specification status comment css font loading module level 3the definition of 'variant' in that specification.
FontFace.weight - Web APIs
WebAPIFontFaceweight
specifications specification status comment css font loading module level 3the definition of 'weight' in that specification.
FontFace - Web APIs
WebAPIFontFace
specifications specification status comment css font loading module level 3the definition of 'fontface' in that specification.
FontFaceSet.check() - Web APIs
WebAPIFontFaceSetcheck
specifications specification status comment css font loading module level 3the definition of 'check' in that specification.
FontFaceSet.load() - Web APIs
WebAPIFontFaceSetload
document.fonts.load("12px myfont", "ß").then(…); specifications specification status comment css font loading module level 3the definition of 'load' in that specification.
FontFaceSet.ready - Web APIs
WebAPIFontFaceSetready
specifications specification status comment css font loading module level 3the definition of 'fontfaceset' in that specification.
FontFaceSet - Web APIs
specifications specification status comment css font loading module level 3the definition of 'fontfaceset' in that specification.
FontFaceSetLoadEvent.FontFaceSetLoadEvent() - Web APIs
specifications specification status comment css font loading module level 3the definition of 'fontfacesetloadevent()' in that specification.
FontFaceSetLoadEvent.fontfaces - Web APIs
specifications specification status comment css font loading module level 3the definition of 'fontfaces' in that specification.
FontFaceSetLoadEvent - Web APIs
specifications specification status comment css font loading module level 3the definition of 'fontfacesetloadevent' in that specification.
GainNode - Web APIs
WebAPIGainNode
it is an audionode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output.
GeometryUtils - Web APIs
geometryutils.convertquadfromnode() fixme: needs a description geometryutils.convertrectfromnode() fixme: needs a description geometryutils.convertpointfromnode() fixme: needs a description specifications specification status comment css object model (cssom) view modulethe definition of 'geometryutils' in that specification.
HTMLCanvasElement.mozFetchAsStream() - Web APIs
t) { if (!components.issuccesscode(result)) { alert('failed to create icon'); } else { alert('succesfully made'); } }; } var mfascallback = function(iconname) { return function(instream) { var file = fileutils.getfile('desk', [iconname + '.ico']); var outstream = fileutils.openfileoutputstream(file); cu.import('resource://gre/modules/netutil.jsm'); netutil.asynccopy(instream, outstream, netutilcallback()); } } canvas.mozfetchasstream(mfascallback('myicon'), 'image/vnd.microsoft.icon'); specifications not part of any specification.
HTMLCanvasElement.toBlob() - Web APIs
cu.import('resource://gre/modules/osfile.jsm'); var writepath = os.path.join(os.constants.path.desktopdir, iconname + '.ico'); var promise = os.file.writeatomic(writepath, new uint8array(r.result), {tmppath:writepath + '.tmp'}); promise.then( function() { console.log('successfully wrote file'); }, function() { con...
HTMLElement.offsetHeight - Web APIs
specification specification status comment css object model (cssom) view modulethe definition of 'offsetheight' in that specification.
HTMLElement.offsetLeft - Web APIs
n = document.getelementbyid("longspan"); box.style.left = longspan.offsetleft + document.body.scrollleft + "px"; box.style.top = longspan.offsettop + document.body.scrolltop + "px"; box.style.width = longspan.offsetwidth + "px"; box.style.height = longspan.offsetheight + "px"; </script> specification specification status comment css object model (cssom) view modulethe definition of 'offsetleft' in that specification.
HTMLElement.offsetParent - Web APIs
specification specification status comment css object model (cssom) view modulethe definition of 'offsetparent' in that specification.
HTMLElement.offsetTop - Web APIs
example var d = document.getelementbyid("div1"); var toppos = d.offsettop; if (toppos > 10) { // object is offset more // than 10 pixels from its parent } specification specification status comment css object model (cssom) view modulethe definition of 'offsettop' in that specification.
HTMLElement.offsetWidth - Web APIs
example specification specification status comment css object model (cssom) view modulethe definition of 'offsetwidth' in that specification.
HTMLImageElement.x - Web APIs
1 { background-color: #d7d9f2; } table { border-collapse: collapse; border: 2px solid rgb(100, 100, 100); font-family: sans-serif; } td, th { border: 1px solid rgb(100, 100, 100); padding: 10px 14px; } td > img { max-width: 4em; } result the resulting table looks like this: specifications specification status comment css object model (cssom) view modulethe definition of 'htmlimageelement.x' in that specification.
HTMLImageElement.y - Web APIs
1 { background-color: #d7d9f2; } table { border-collapse: collapse; border: 2px solid rgb(100, 100, 100); font-family: sans-serif; } td, th { border: 1px solid rgb(100, 100, 100); padding: 10px 14px; } td > img { max-width: 4em; } result the resulting table looks like this: specifications specification status comment css object model (cssom) view modulethe definition of 'htmlimageelement.y' in that specification.
HTMLImageElement - Web APIs
r img1.src = 'image1.png'; img1.alt = 'alt'; document.body.appendchild(img1); var img2 = document.createelement('img'); // use dom htmlimageelement img2.src = 'image2.jpg'; img2.alt = 'alt text'; document.body.appendchild(img2); // using first image in the document alert(document.images[0].src); specifications specification status comment css object model (cssom) view modulethe definition of 'extensions to htmlimageelement' in that specification.
HTMLScriptElement - Web APIs
htmlscriptelement.nomodule is a boolean that if true, stops the script's execution in browsers that support es2015 modules — used to run fallback scripts in older browsers that do not support javascript modules.
MediaKeyMessageEvent() - Web APIs
message: an array containing the message generated by the content decryption module.
message - Web APIs
the mediakeymessageevent.message read-only property returns an arraybuffer with a message from the content decryption module.
close() - Web APIs
the mediakeysession.close() method notifies that the current media session is no longer needed, and that the content decryption module should release any resources associated with this object and close it.
load() - Web APIs
}); parameter sessionid a unique string generated by the content decription module for the current media object and its associated keys or licenses.
MediaKeySession.onmessage - Web APIs
the onmessage property of the mediakeysession is an event handler, fired whenever a mediakeymessageevent occurs, denoting a message is generated by the content decryption module.
createSession() - Web APIs
the mediakeys.createsession() method returns a new mediakeysession object, which represents a context for message exchange with a content decryption module (cdm).
MediaKeys - Web APIs
WebAPIMediaKeys
methods mediakeys.createsession() returns a new mediakeysession object, which represents a context for message exchange with a content decryption module (cdm).
MediaQueryList.addListener() - Web APIs
ess than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specifications specification status comment css object model (cssom) view modulethe definition of 'addlistener' in that specification.
MediaQueryList.matches - Web APIs
mq.addeventlistener("change", callback); } else { mq.addlistener(callback); } } addmqlistener(window.matchmedia("(orientation:landscape)"), event => { if (event.matches) { /* now in landscape orientation */ } else { /* now in portrait orientation */ } } ); specifications specification status comment css object model (cssom) view modulethe definition of 'matches' in that specification.
MediaQueryList.media - Web APIs
css .mq-value { font: 18px arial, sans-serif; font-weight: bold; color: #88f; padding: 0.4em; border: 1px solid #dde; } result specifications specification status comment css object model (cssom) view modulethe definition of 'media' in that specification.
MediaQueryList.onchange - Web APIs
", (e) => { if (e.matches) { /* the viewport is 600 pixels wide or less */ console.log('this is a narrow screen — less than 600px wide.') } else { /* the viewport is more than than 600 pixels wide */ console.log('this is a wide screen — more than 600px wide.') } }) specifications specification status comment css object model (cssom) view modulethe definition of 'onchange' in that specification.
MediaQueryList.removeListener() - Web APIs
else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); // later on, when it is no longer needed mql.removelistener(screentest); specifications specification status comment css object model (cssom) view modulethe definition of 'removelistener' in that specification.
MediaQueryList - Web APIs
specifications specification status comment css object model (cssom) view modulethe definition of 'mediaquerylist' in that specification.
MediaQueryListEvent.MediaQueryListEvent() - Web APIs
examples var media = '(max-width: 600px)'; var matches = true; var mymediaquerylistevent = new mediaquerylistevent({media, matches}); specifications specification status comment css object model (cssom) view modulethe definition of 'mediaquerylistevent()' in that specification.
MediaQueryListEvent.matches - Web APIs
ss than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specifications specification status comment css object model (cssom) view modulethe definition of 'matches' in that specification.
MediaQueryListEvent.media - Web APIs
document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } console.log(e.media); } mql.addlistener(screentest); specifications specification status comment css object model (cssom) view modulethe definition of 'media' in that specification.
MediaQueryListEvent - Web APIs
ess than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specifications specification status comment css object model (cssom) view modulethe definition of 'mediaquerylistevent' in that specification.
MediaQueryListListener - Web APIs
specifications specification status comment css object model (cssom) view modulethe definition of 'mediaquerylistlistener' in that specification.
MouseEvent() - Web APIs
specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent' in that specification.
MouseEvent.offsetX - Web APIs
specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent' in that specification.
MouseEvent.offsetY - Web APIs
specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent' in that specification.
MouseEvent.screenX - Web APIs
y elements, you can get the coordinates of that event (e.g., a click) and route it properly, as the following example demonstrates: function checkclickmap(e) { if (e.screenx < 50) doredbutton(); if (50 <= e.screenx && e.screenx < 100) doyellowbutton(); if (e.screenx >= 100) doredbutton(); } specifications specification status comment css object model (cssom) view modulethe definition of 'screenx' in that specification.
MouseEvent.screenY - Web APIs
sition.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (cssom) view modulethe definition of 'screeny' in that specification.
MouseEvent.x - Web APIs
WebAPIMouseEventx
specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent.x' in that specification.
MouseEvent.y - Web APIs
WebAPIMouseEventy
specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent.y' in that specification.
Node.isSupported() - Web APIs
WebAPINodeisSupported
example <div id="doc"> </div> <script> // get an element and check to see if its supports the dom2 html module.
OscillatorNode - Web APIs
it is an audioscheduledsourcenode audio-processing module that causes a specified frequency of a given wave to be created—in effect, a constant tone.
PannerNode - Web APIs
it is an audionode audio-processing module describing its position with right-hand cartesian coordinates, its movement using a velocity vector and its directionality using a directionality cone.
PointerEvent.pointerType - Web APIs
css object model (cssom) view modulethe definition of 'mouseevent' in that specification.
Range.getBoundingClientRect() - Web APIs
nst clientrect = range.getboundingclientrect(); const highlight = document.getelementbyid('highlight'); highlight.style.left = `${clientrect.x}px`; highlight.style.top = `${clientrect.y}px`; highlight.style.width = `${clientrect.width}px`; highlight.style.height = `${clientrect.height}px`; result specification specification status comment css object model (cssom) view modulethe definition of 'range.getboundingclientrect()' in that specification.
Range.getClientRects() - Web APIs
syntax rectlist = range.getclientrects() example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); rectlist = range.getclientrects(); specification specification status comment css object model (cssom) view modulethe definition of 'range.getclientrects()' in that specification.
Range - Web APIs
WebAPIRange
css object model (cssom) view modulethe definition of 'extensions to range' in that specification.
Request.mode - Web APIs
WebAPIRequestmode
however, for requests created other than by the request.request constructor, no-cors is typically used as the mode; for example, for embedded resources where the request is initiated from markup, unless the crossorigin attribute is present, the request is in most cases made using the no-cors mode — that is, for the <link> or <script> elements (except when used with modules), or <img>, <audio>, <video>, <object>, <embed>, or <iframe> elements.
SVGClipPathElement - Web APIs
specifications specification status comment css masking module level 1the definition of 'svgclippathelement' in that specification.
SVGComponentTransferFunctionElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgcomponenttransferfunctionelement' in that specification.
SVGFEBlendElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfeblendelement' in that specification.
SVGFEColorMatrixElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfecolormatrixelement' in that specification.
SVGFEComponentTransferElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfecomponenttransferelement' in that specification.
SVGFECompositeElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfecompositeelement' in that specification.
SVGFEConvolveMatrixElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfeconvolvematrixelement' in that specification.
SVGFEDiffuseLightingElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfediffuselightingelement' in that specification.
SVGFEDisplacementMapElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfedisplacementmapelement' in that specification.
SVGFEDistantLightElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfedistantlightelement' in that specification.
SVGFEDropShadowElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfedropshadowelement' in that specification.
SVGFEFloodElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfefloodelement' in that specification.
SVGFEFuncAElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfefuncaelement' in that specification.
SVGFEFuncBElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfefuncbelement' in that specification.
SVGFEFuncGElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfefuncgelement' in that specification.
SVGFEFuncRElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfefuncrelement' in that specification.
SVGFEGaussianBlurElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfegaussianblurelement' in that specification.
SVGFEImageElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfeimageelement' in that specification.
SVGFEMergeElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfemergeelement' in that specification.
SVGFEMergeNodeElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfemergenodeelement' in that specification.
SVGFEMorphologyElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfemorphologyelement' in that specification.
SVGFEOffsetElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfeoffsetelement' in that specification.
SVGFEPointLightElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfepointlightelement' in that specification.
SVGFESpecularLightingElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfespecularlightingelement' in that specification.
SVGFESpotLightElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfespotlightelement' in that specification.
SVGFETileElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfetileelement' in that specification.
SVGFETurbulenceElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfeturbulenceelement' in that specification.
SVGFilterElement - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfilterelement' in that specification.
SVGFilterPrimitiveStandardAttributes - Web APIs
specifications specification status comment filter effects module level 1the definition of 'svgfilterprimitivestandardattributes' in that specification.
SVGMaskElement - Web APIs
specifications specification status comment css masking module level 1the definition of 'svgmaskelement' in that specification.
SVGRect - Web APIs
WebAPISVGRect
specifications specification status comment geometry interfaces module level 1the definition of 'domrect' in that specification.
Screen.availHeight - Web APIs
specifications specification status comment css object model (cssom) view modulethe definition of 'screen.availheight' in that specification.
Screen.availWidth - Web APIs
WebAPIScreenavailWidth
syntax var width = window.screen.availwidth example var screenavailwidth = window.screen.availwidth; console.log(screenavailwidth); specifications specification status comment css object model (cssom) view modulethe definition of 'screen.availwidth' in that specification.
Screen.colorDepth - Web APIs
WebAPIScreencolorDepth
syntax bitdepth = window.screen.colordepth; example // check the color depth of the screen if ( window.screen.colordepth < 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.colordepth' in that specification.
Screen.height - Web APIs
WebAPIScreenheight
specification specification status comment css object model (cssom) view modulethe definition of 'screen.height' in that specification.
Screen.pixelDepth - Web APIs
WebAPIScreenpixelDepth
syntax let depth = window.screen.pixeldepth example // if there is not adequate bit depth // choose a simpler color if ( window.screen.pixeldepth > 8 ) { document.style.color = "#faebd7"; } else { document.style.color = "#ffffff"; } specifications specification status comment css object model (cssom) view modulethe definition of 'screen.pixeldepth' in that specification.
Screen.width - Web APIs
WebAPIScreenwidth
specification specification status comment css object model (cssom) view modulethe definition of 'screen.width' in that specification.
Screen - Web APIs
WebAPIScreen
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 specification.
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.
ScrollToOptions.behavior - Web APIs
'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (cssom) view modulethe definition of 'behavior' in that specification.
ScrollToOptions.left - Web APIs
'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (cssom) view modulethe definition of 'left' in that specification.
ScrollToOptions.top - Web APIs
'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (cssom) view modulethe definition of 'top' in that specification.
ScrollToOptions - Web APIs
'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (cssom) view modulethe definition of 'scrolltooptions' in that specification.
Service Worker API - Web APIs
client-side compiling and dependency management of coffeescript, less, cjs/amd modules, etc.
SharedWorker() - Web APIs
the value can be classic or module.
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.
WebKitCSSMatrix - Web APIs
specifications specification status comment geometry interfaces module level 1the definition of 'webkitcssmatrix' in that specification.
Starting up and shutting down a WebXR session - Web APIs
it introduced support for augmented reality (ar) through the webxr ar module, which has is approaching a stable state.
Targeting and hit detection - Web APIs
however, there's hope: a proposal has been floated for a webxr hit test module that would layer atop webxr to provide an api for performing hit testing and collision detection.
WebXR Device API - Web APIs
support for ar functionality is added by the webxr augmented reality module.
Attestation and Assertion - Web APIs
tpm - the trusted platform module (tpm) is a set of specifications from the trusted platform group (tpg).
Window.devicePixelRatio - Web APIs
rgin: 0 auto; padding: 0; background-color: #a9f; } .inner-container { padding: 1em 2em; text-align: justify; text-justify: auto; } .pixel-ratio { position: relative; margin: auto; height: 1.2em; text-align: right; bottom: 0; right: 1em; font-weight: bold; } result specifications specification status comment css object model (cssom) view modulethe definition of 'window.devicepixelratio' in that specification.
Window.innerHeight - Web APIs
specification specification status comment css object model (cssom) view modulethe definition of 'window.innerheight' in that specification.
Window.innerWidth - Web APIs
WebAPIWindowinnerWidth
me viewport within a frameset var intframewidth = self.innerwidth; // this will return the width of the viewport of the closest frameset var intframesetwidth = parent.innerwidth; // this will return the width of the viewport of the outermost frameset var intouterframesetwidth = top.innerwidth; specification specification status comment css object model (cssom) view modulethe definition of 'window.innerwidth' in that specification.
Window.matchMedia() - Web APIs
WebAPIWindowmatchMedia
specifications specification status comment css object model (cssom) view modulethe definition of 'window.matchmedia()' in that specification.
Window.moveBy() - Web APIs
WebAPIWindowmoveBy
function budge() { moveby(10, -10); } specification specification status comment css object model (cssom) view modulethe definition of 'window.moveby()' in that specification.
Window.moveTo() - Web APIs
WebAPIWindowmoveTo
function origin() { window.moveto(0, 0); } specification specification status comment css object model (cssom) view modulethe definition of 'window.moveto()' in that specification.
Window.outerHeight - Web APIs
specification specification status comment css object model (cssom) view modulethe definition of 'window.outerheight' in that specification.
Window.outerWidth - Web APIs
WebAPIWindowouterWidth
specification specification status comment css object model (cssom) view modulethe definition of 'window.outerwidth' in that specification.
Window.pageXOffset - Web APIs
specification specification status comment css object model (cssom) view modulethe definition of 'window.pagexoffset' in that specification.
Window.pageYOffset - Web APIs
specification specification status comment css object model (cssom) view modulethe definition of 'window.pageyoffset' in that specification.
Window.resizeBy() - Web APIs
WebAPIWindowresizeBy
specifications specification status comment css object model (cssom) view modulethe definition of 'window.resizeby()' in that specification.
Window.resizeTo() - Web APIs
WebAPIWindowresizeTo
function quarter() { window.resizeto( window.screen.availwidth / 2, window.screen.availheight / 2 ); } specification specification status comment css object model (cssom) view modulethe definition of 'window.resizeto()' in that specification.
Window: resize event - Web APIs
obsolete css object model (cssom) view modulethe definition of 'resize' in that specification.
Window.screen - Web APIs
WebAPIWindowscreen
syntax let screenobj = window.screen; example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specifications specification status comment css object model (cssom) view modulethe definition of 'window.screen' in that specification.
Window.screenLeft - Web APIs
WebAPIWindowscreenLeft
if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom) view modulethe definition of 'window.screenleft' in that specification.
Window.screenTop - Web APIs
WebAPIWindowscreenTop
if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom) view modulethe definition of 'window.screentop' in that specification.
Window.screenX - Web APIs
WebAPIWindowscreenX
if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom) view modulethe definition of 'window.screenx' in that specification.
Window.screenY - Web APIs
WebAPIWindowscreenY
if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom) view modulethe definition of 'window.screeny' in that specification.
Window.scroll() - Web APIs
WebAPIWindowscroll
specification specification status comment css object model (cssom) view modulethe definition of 'window.scroll()' in that specification.
Window.scrollBy() - Web APIs
WebAPIWindowscrollBy
specification specification status comment css object model (cssom) view modulethe definition of 'window.scrollby()' in that specification.
Window.scrollTo() - Web APIs
WebAPIWindowscrollTo
specifications specification status comment css object model (cssom) view modulethe definition of 'window.scroll()' in that specification.
Window.scrollX - Web APIs
WebAPIWindowscrollX
window.pageyoffset : (document.documentelement || document.body.parentnode || document.body).scrolltop; specification specification status comment css object model (cssom) view modulethe definition of 'window.scrollx' in that specification.
Window.scrollY - Web APIs
WebAPIWindowscrollY
document.documentelement.scrolltop : document.body.scrolltop; specification specification status comment css object model (cssom) view modulethe definition of 'window.scrolly' in that specification.
Window - Web APIs
WebAPIWindow
window.pkcs11 formerly provided access to install and remove pkcs11 modules.
Worker() - Web APIs
WebAPIWorkerWorker
the value can be classic or module.
Worklet - Web APIs
WebAPIWorklet
methods worklet.addmodule() adds the script module at the given url to the current worklet.
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
const {cc,ci} = require("chrome"); function createtcperrorfromfailedxhr(xhr) { let status = xhr.channel.queryinterface(ci.nsirequest).status; let errtype; if ((status & 0xff0000) === 0x5a0000) { // security module const nsinsserrorsservice = ci.nsinsserrorsservice; let nsserrorsservice = cc['@mozilla.org/nss_errors_service;1'].getservice(nsinsserrorsservice); let errorclass; // geterrorclass will throw a generic ns_error_failure if the error code is // somehow not in the set of covered errors.
XREnvironmentBlendMode - Web APIs
specifications specification status comment webxr augmented reality modulethe definition of 'xrenvironmentblendmode' in that specification.
XRPermissionDescriptor.mode - Web APIs
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.
XRSession - Web APIs
WebAPIXRSession
note: environmentblendmode() is part of the webxr augmented reality module, which has not been completed.
XRSystem: requestSession() - Web APIs
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.
Alerts - Accessibility
this is because that role is based on the xhtml role attribute module that was simply ported to html for simplicity.
Web accessibility for seizures and physical reactions - Accessibility
media systems and equipment — colour measurement and management — part 2-2: colour management — extended rgb colour space — scrgb photosensitive epilepsy analysis tool along with the harding tool, is generaly recognized to be one of the two "gold standards" for analyzing flashes trace research and development center using peat to create seizureless web animations w3c css color module level 3 personalization semantics explainer 1.0.
Accessibility
this article starts off the module with a good look at what accessibility actually is — this 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.
Custom properties (--*): CSS variables - CSS: Cascading Style Sheets
WebCSS--*
st-color); color: var(--second-color); } #secondparagraph { background-color: var(--second-color); color: var(--first-color); } #container { --first-color: #48ff32; } #thirdparagraph { background-color: var(--first-color); color: var(--second-color); } result specifications specification status comment css custom properties for cascading variables module level 1the definition of '--*' in that specification.
::first-letter (:first-letter) - CSS: Cascading Style Sheets
css text decoration module level 3the definition of 'text-shadow with ::first-letter' in that specification.
::first-line (:first-line) - CSS: Cascading Style Sheets
css text decoration module level 3the definition of 'text-shadow with ::first-line' in that specification.
::marker - CSS: Cascading Style Sheets
WebCSS::marker
css lists module level 3the definition of '::marker' in that specification.
::slotted() - CSS: Cascading Style Sheets
WebCSS::slotted
shazaam</p> <span slot="person-age">immortal</span> <span slot="person-occupation">superhero</span> </person-details> specifications specification status comment css scoping module level 1the definition of '::slotted' in that specification.
:first - CSS: Cascading Style Sheets
WebCSS:first
specifications specification status comment css paged media module level 3the definition of ':first' in that specification.
:host() - CSS: Cascading Style Sheets
WebCSS:host()
specifications specification status comment css scoping module level 1the definition of ':host()' in that specification.
:host-context() - CSS: Cascading Style Sheets
specifications specification status comment css scoping module level 1the definition of ':host-context()' in that specification.
:host - CSS: Cascading Style Sheets
WebCSS:host
specifications specification status comment css scoping module level 1the definition of ':host' in that specification.
:left - CSS: Cascading Style Sheets
WebCSS:left
syntax :left examples setting a margin for left-hand pages @page :left { margin: 2in 3in; } specifications specification status comment css paged media module level 3the definition of ':left' in that specification.
:right - CSS: Cascading Style Sheets
WebCSS:right
syntax :right examples setting margins for right-hand pages @page :right { margin: 2in 3in; } specifications specification status comment css paged media module level 3the definition of ':right' in that specification.
@document - CSS: Cascading Style Sheets
WebCSS@document
w3.org/" - any page whose url begins with "http://www.w3.org/style/" - any page whose url's host is "mozilla.org" or ends with ".mozilla.org" - any standalone video - any page whose url starts with "https:" */ /* make the above-mentioned pages really ugly */ body { color: purple; background: yellow; } } specifications initially in css conditional rules module level 3, @document has been postponed to level 4.
font-display - CSS: Cascading Style Sheets
uto | block | swap | fallback | optional ] examples specifying fallback font-display @font-face { font-family: examplefont; src: url(/path/to/fonts/examplefont.woff) format('woff'), url(/path/to/fonts/examplefont.eot) format('eot'); font-weight: 400; font-style: normal; font-display: fallback; } specifications specification status comment css fonts module level 4the definition of 'font-display' in that specification.
font-family - CSS: Cascading Style Sheets
formal definition related at-rule@font-faceinitial valuen/a (required)computed valueas specified formal syntax <family-name>where <family-name> = <string> | <custom-ident>+ examples setting the font family name @font-face { font-family: examplefont; src: url('examplefont.ttf'); } specifications specification status comment css fonts module level 3the definition of 'font-family' in that specification.
font-variation-settings - CSS: Cascading Style Sheets
pecified formal syntax normal | [ <string> <number> ]# examples setting font weight and stretch in a @font-face rule @font-face { font-family: 'opentypefont'; src: url('open_type_font.woff2') format('woff2'); font-weight: normal; font-style: normal; font-variation-settings: 'wght' 400, 'wdth' 300; } specifications specification status comment css fonts module level 4the definition of 'font-variation-settings' in that specification.
src - CSS: Cascading Style Sheets
WebCSS@font-facesrc
| local( <family-name> ) ]#where <family-name> = <string> | <custom-ident>+ examples specifying font resources using url() and local() @font-face { font-family: examplefont; src: local(example font), url('examplefont.woff') format("woff"), url('examplefont.otf') format("opentype"); } specifications specification status comment css fonts module level 3the definition of 'src' in that specification.
unicode-range - CSS: Cascading Style Sheets
html <div>me & you = us</div> css @font-face { font-family: 'ampersand'; src: local('times new roman'); unicode-range: u+26; } div { font-size: 4em; font-family: ampersand, helvetica, sans-serif; } result specifications specification status comment css fonts module level 3the definition of 'unicode-range' in that specification.
@font-face - CSS: Cascading Style Sheets
recommendation font format specification css fonts module level 3the definition of '@font-face' in that specification.
@font-feature-values - CSS: Cascading Style Sheets
one */ @font-feature-values font one { @styleset { nice-style: 12; } } /* at-rule for "nice-style" in font two */ @font-feature-values font two { @styleset { nice-style: 4; } } … /* apply the at-rules with a single declaration */ .nice-look { font-variant-alternates: styleset(nice-style); } specifications specification status comment css fonts module level 4the definition of '@font-feature-values' in that specification.
@media - CSS: Cascading Style Sheets
WebCSS@media
css working group drafts github issues css conditional rules module level 3the definition of '@media' in that specification.
@namespace - CSS: Cascading Style Sheets
d namespaces @namespace url(http://www.w3.org/1999/xhtml); @namespace svg url(http://www.w3.org/2000/svg); /* this matches all xhtml <a> elements, as xhtml is the default unprefixed namespace */ a {} /* this matches all svg <a> elements */ svg|a {} /* this matches both xhtml and svg <a> elements */ *|a {} specifications specification status comment css namespaces modulethe definition of '@namespace' in that specification.
bleed - CSS: Cascading Style Sheets
WebCSS@pagebleed
formal definition related at-rule@pageinitial valueautocomputed valueas specified formal syntax auto | <length> examples setting a page bleed of 1cm @page { bleed: 1cm; } specifications specification status comment css paged media module level 3the definition of 'bleed' in that specification.
marks - CSS: Cascading Style Sheets
WebCSS@pagemarks
formal definition related at-rule@pageinitial valuenonecomputed valueas specified formal syntax none | [ crop | cross ] examples adding crop and cross marks @page { marks: crop cross; } specifications specification status comment css paged media module level 3the definition of 'marks' in that specification.
size - CSS: Cascading Style Sheets
WebCSS@pagesize
d, but with relative lengths converted into absolute lengths formal syntax <length>{1,2} | auto | [ <page-size> | [ portrait | landscape ] ] examples specifying size and orientation @page { size: 4in 6in landscape; } nesting inside a @media rule @media print { @page { size: 50mm 150mm; } } specifications specification status comment css paged media module level 3the definition of 'size' in that specification.
@page - CSS: Cascading Style Sheets
WebCSS@page
editor's draft adds the :recto and :verso page selectors css paged media module level 3the definition of '@page' in that specification.
At-rules - CSS: Cascading Style Sheets
WebCSSAt-rule
specifications specification status comment css conditional rules module level 3 candidate recommendation initial definition compatibility standardthe definition of 'css at-rules' in that specification.
CSS Animations - CSS: Cascading Style Sheets
css animations is a module of css that lets you animate the values of css properties over time, using keyframes.
CSS Basic Box Model - CSS: Cascading Style Sheets
css basic box model is a module of css that defines the rectangular boxes—including their padding and margin—that are generated for elements and laid out according to the visual formatting model.
CSS Charsets - CSS: Cascading Style Sheets
css charsets is a module of css that lets you specify the character set used in the style sheet.
Using multi-column layouts - CSS: Cascading Style Sheets
the css multi-column layout module extends the block layout mode to allow the easy definition of multiple columns of text.
Using feature queries - CSS: Cascading Style Sheets
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.
CSS Counter Styles - CSS: Cascading Style Sheets
css counter styles is a module of css that lets you define your own counter styles.
CSS Device Adaptation - CSS: Cascading Style Sheets
css device adaptation is a module of css that lets you define the size, zoom factor, and orientation of the viewport.
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
the box alignment module also includes other methods of creating space between items, such as the column-gap and row-gap feature as seen in css grid layout.
Basic concepts of flexbox - CSS: Cascading Style Sheets
the flexible box module, usually referred to as flexbox, was designed as a one-dimensional layout model, and as a method that could offer space distribution between items in an interface and powerful alignment capabilities.
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
at the current time we do not have any implementations of the gap properties from the box alignment module for flexbox.
Flow Layout and Overflow - CSS: Cascading Style Sheets
the level 3 overflow module also includes flow relative properties for overflow - overflow-block and overflow-inline.
Variable fonts guide - CSS: Cascading Style Sheets
resources w3c css fonts module 4 specification (editor’s draft) w3c github issue queue microsoft open type variations introduction microsoft opentype design-variation axis tag registry wakamai fondue (a site that will tell you what your font can do via a simple drag-and-drop inspection interface) axis praxis (the original variable fonts playground site) v-fonts.com (a catalog of variable fonts and where to get them) f...
Subgrid - CSS: Cascading Style Sheets
specification specification status comment css grid layout module level 2 working draft initial definition of subgrids.
CSS Grid Layout - CSS: Cascading Style Sheets
layouts using css grid subgrid external resources css grid and ie11 (polyfill) examples from jen simmons grid by example - a collection of usage examples and video tutorials codrops grid reference firefox devtools css grid inspector css grid playground grid garden - a game for learning css grid specifications specification status comment css grid layout module level 2 working draft added subgrids.
Using CSS counters - CSS: Cascading Style Sheets
--> <li>item</li> <!-- 2.3.3 --> </ol> </li> <li>item</li> <!-- 2.4 --> </ol> </li> <li>item</li> <!-- 3 --> <li>item</li> <!-- 4 --> </ol> <ol> <li>item</li> <!-- 1 --> <li>item</li> <!-- 2 --> </ol> result specifications specification status comment css lists module level 3the definition of 'css counters' in that specification.
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 Table - CSS: Cascading Style Sheets
WebCSSCSS Table
css table is a css module that defines how to lay out table data.
CSS Transforms - CSS: Cascading Style Sheets
css transforms is a module of css that defines how elements styled with css can be transformed in two-dimensional or three-dimensional space.
CSS Transitions - CSS: Cascading Style Sheets
css transitions is a module of css that lets you create gradual transitions between the values of specific css properties.
CSS data types - CSS: Cascading Style Sheets
WebCSSCSS Types
> <integer> <length> <length-percentage> <number> <number-percentage> <percentage> <position> <quote> <ratio> <resolution> <shape-box> <shape-radius> <string> <time> <time-percentage> <timing-function> <toggle-value> <transform-function> <type-or-unit> <url> <url-modifier> <zero> specifications specification status comment css values and units module level 4 editor's draft css values and units module level 3 candidate recommendation initial definition.
Compositing and Blending - CSS: Cascading Style Sheets
compositing and blending is a css module that defines how shapes of different elements are combined into a single image.
CSS Layout cookbook - CSS: Cascading Style Sheets
note: if you are new to css layout then you might first like to take a look at our css layout learning module, as this will give you the basic grounding you need to make use of the recipes here.
Media queries - CSS: Cascading Style Sheets
specifications specification status comment media queries level 5 editor's draft css conditional rules module level 3 candidate recommendation media queries level 4 candidate recommendation media queries recommendation css level 2 (revision 1) recommendation initial definition ...
Pseudo-classes - CSS: Cascading Style Sheets
css basic user interface module level 3 recommendation defined :default, :valid, :invalid, :in-range, :out-of-range, :required, :optional, :read-only and :read-write, but without the associated semantic meaning.
Replaced elements - CSS: Cascading Style Sheets
these are defined by the css images module level 3 and css images module level 4 specifications: object-fit specifies how the replaced element's content object should be fitted to the containing element's box.
Value definition syntax - CSS: Cascading Style Sheets
specifications specification status comment css values and units module level 3the definition of 'value definition syntax' in that specification.
Visual formatting model - CSS: Cascading Style Sheets
initially defined in css2, the display property is extended in the css display module level 3.
aspect-ratio - CSS: Cascading Style Sheets
in firefox, the internal stylesheet rule looks like this: img, input[type="image"], video, embed, iframe, marquee, object, table { aspect-ratio: attr(width) / attr(height); } specifications specification status comment css box sizing module level 4the definition of 'aspect-ratio' in that specification.
backdrop-filter - CSS: Cascading Style Sheets
ion: center center; background-repeat: no-repeat; background-size: cover; } .container { align-items: center; display: flex; justify-content: center; height: 100%; width: 100%; } html <div class="container"> <div class="box"> <p>backdrop-filter: blur(10px)</p> </div> </div> result specifications specification status comment filter effects module level 2the definition of 'backdrop-filter' in that specification.
background-attachment - CSS: Cascading Style Sheets
</p> css p { background-image: url("https://mdn.mozillademos.org/files/12057/starsolid.gif"), url("https://mdn.mozillademos.org/files/12059/startransparent.gif"); background-attachment: fixed, scroll; background-repeat: no-repeat, repeat-y; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-attachment' in that specification.
background-color - CSS: Cascading Style Sheets
ass="examplethree"> lorem ipsum dolor sit amet, consectetuer </div> css .exampleone { background-color: teal; color: white; } .exampletwo { background-color: rgb(153,102,153); color: rgb(255,255,204); } .examplethree { background-color: #777799; color: #ffffff; } result specifications specification comment feedback css backgrounds and borders module level 3the definition of 'background-color' in that specification.
background-image - CSS: Cascading Style Sheets
rl("https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png"); } .catsandstars { background-image: url("https://mdn.mozillademos.org/files/11991/startransparent.gif"), url("https://mdn.mozillademos.org/files/7693/catfront.png"); background-color: transparent; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-image' in that specification.
background-origin - CSS: Cascading Style Sheets
background: url('image.gif'); background-repeat: no-repeat; background-origin: border-box; } div { background-image: url('logo.jpg'), url('mainback.png'); /* applies two images to the background */ background-position: top right, 0px 0px; background-origin: content-box, padding-box; } specifications specification status comment css backgrounds and borders module level 3the definition of 'background-origin' in that specification.
background-position-x - CSS: Cascading Style Sheets
; height: 300px; background-color: skyblue; background-image: url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png); background-repeat: no-repeat; background-position-x: center; background-position-y: bottom 10px; } result specifications specification status comment css backgrounds and borders module level 4the definition of 'background-position-x' in that specification.
background-position-y - CSS: Cascading Style Sheets
; height: 300px; background-color: skyblue; background-image: url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png); background-repeat: no-repeat; background-position-x: center; background-position-y: bottom 10px; } result specifications specification status comment css backgrounds and borders module level 4the definition of 'background-position-y' in that specification.
background-position - CSS: Cascading Style Sheets
*/ .examplethree { background-image: url("https://mdn.mozillademos.org/files/11987/startransparent.gif"), url("https://mdn.mozillademos.org/files/7693/catfront.png"); background-position: 0px 0px, right 3em bottom 2em; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-position' in that specification.
background-repeat - CSS: Cascading Style Sheets
specifications specification status comment css backgrounds and borders module level 3the definition of 'background-repeat' in that specification.
background-size - CSS: Cascading Style Sheets
specifications specification status comment css backgrounds and borders module level 3the definition of 'background-size' in that specification.
background - CSS: Cascading Style Sheets
ages html <p class="topbanner"> starry sky<br/> twinkle twinkle<br/> starry sky </p> <p class="warning">here is a paragraph<p> css .warning { background: pink; } .topbanner { background: url("https://mdn.mozillademos.org/files/11983/starsolid.gif") #99f repeat-y fixed; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background' in that specification.
<basic-shape> - CSS: Cascading Style Sheets
on: 4s poly infinite alternate ease-in-out; margin: 10px auto; } @keyframes poly { from { clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%); } to { clip-path: polygon(50% 30%, 100% 0%, 70% 50%, 100% 100%, 50% 70%, 0% 100%, 30% 50%, 0% 0%); } } result specifications specification status comment css shapes module level 1the definition of '<basic-shape>' in that specification.
border-bottom-color - CSS: Cascading Style Sheets
note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-bottom-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-bottom-color' in that specification.
border-bottom-left-radius - CSS: Cascading Style Sheets
the background color is clipped at the border div { border-bottom-left-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status comment css backgrounds and borders module level 3the definition of 'border-bottom-left-radius' in that specification.
border-bottom-right-radius - CSS: Cascading Style Sheets
the background color is clipped at the border div { border-bottom-right-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status comment css backgrounds and borders module level 3the definition of 'border-bottom-right-radius' in that specification.
border-bottom-style - CSS: Cascading Style Sheets
hidden;} .b3 {border-bottom-style: dotted;} .b4 {border-bottom-style: dashed;} .b5 {border-bottom-style: solid;} .b6 {border-bottom-style: double;} .b7 {border-bottom-style: groove;} .b8 {border-bottom-style: ridge;} .b9 {border-bottom-style: inset;} .b10 {border-bottom-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-bottom-style' in that specification.
border-bottom-width - CSS: Cascading Style Sheets
dth> = <length> | thin | medium | thick examples comparing bottom border widths html <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-bottom-width: thick; } div:nth-child(2) { border-bottom-width: 2em; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-bottom-width' in that specification.
border-bottom - CSS: Cascading Style Sheets
</div> css div { border-bottom: 4px dashed blue; background-color: gold; height: 100px; width: 100px; font-weight: bold; text-align: center; } results specifications specification status comment css backgrounds and borders module level 3the definition of 'border-bottom' in that specification.
border-color - CSS: Cascading Style Sheets
css backgrounds and borders module level 3the definition of 'border-color' in that specification.
border-image-outset - CSS: Cascading Style Sheets
border image html <div id="outset">this element has an outset border image!</div> css #outset { width: 10rem; background: #cef; border: 1.4rem solid; border-image: radial-gradient(#ff2, #55f) 40; border-image-outset: 1.5; /* 1.5 × 1.4rem = 2.1rem */ margin: 2.1rem; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-image-outset' in that specification.
border-image-repeat - CSS: Cascading Style Sheets
eat</option> <option value="space round">space round</option> </select> javascript var repetition = document.getelementbyid("repetition"); repetition.addeventlistener("change", function (evt) { document.getelementbyid("bordered").style.borderimagerepeat = evt.target.value; }); results specifications specification status comment css backgrounds and borders module level 3the definition of 'border-image-repeat' in that specification.
border-image-slice - CSS: Cascading Style Sheets
ewvalue = widthslider.value + 'px'; divelem.style.borderwidth = newvalue; widthoutput.textcontent = newvalue; }) sliceslider.addeventlistener('input', () => { const newvalue = sliceslider.value; divelem.style.borderimageslice = newvalue; sliceoutput.textcontent = newvalue; }) result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-image-slice' in that specification.
border-image-source - CSS: Cascading Style Sheets
specifications specification status comment css backgrounds and borders module level 3the definition of 'border-image-source' in that specification.
border-image-width - CSS: Cascading Style Sheets
clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet.</p> css p { border: 20px solid; border-image: url("/static/external/21/214842819586a8dd293c17b38d0fd0e26430146a86dd04294a53ecaeeea7d0e2.png") 30 round; border-image-width: 16px; padding: 40px; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-image-width' in that specification.
border-image - CSS: Cascading Style Sheets
/* repeat */ } result gradient html <div id="gradient">this element is surrounded by a gradient-based border image!</div> css #gradient { width: 200px; border: 30px solid; border-image: repeating-linear-gradient(45deg, #f33, #3bf, #f33 30px) 60; padding: 20px; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-image' in that specification.
border-left-color - CSS: Cascading Style Sheets
note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-left-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-left-color' in that specification.
border-left-style - CSS: Cascading Style Sheets
rder-left-style: hidden;} .b3 {border-left-style: dotted;} .b4 {border-left-style: dashed;} .b5 {border-left-style: solid;} .b6 {border-left-style: double;} .b7 {border-left-style: groove;} .b8 {border-left-style: ridge;} .b9 {border-left-style: inset;} .b10 {border-left-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-left-style' in that specification.
border-left-width - CSS: Cascading Style Sheets
re <line-width> = <length> | thin | medium | thick examples comparing border widths html <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-left-width: thick; } div:nth-child(2) { border-left-width: 2em; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-left-width' in that specification.
border-left - CSS: Cascading Style Sheets
</div> css div { border-left: 4px dashed blue; background-color: gold; height: 100px; width: 100px; font-weight: bold; text-align: center; } results specifications specification status comment css backgrounds and borders module level 3the definition of 'border-left' in that specification.
border-radius - CSS: Cascading Style Sheets
-width: 2px 4px; border-radius: 40px; live samples sample 1 : http://jsfiddle.net/tripad/qngkj/2/ sample 2 : http://jsfiddle.net/tripad/qngkj/3/ sample 3 : http://jsfiddle.net/tripad/qngkj/4/ sample 4 : http://jsfiddle.net/tripad/qngkj/5/ sample 5 : http://jsfiddle.net/tripad/qngkj/6/ specifications specification status comment css backgrounds and borders module level 3the definition of 'border-radius' in that specification.
border-right-color - CSS: Cascading Style Sheets
note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-right-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-right-color' in that specification.
border-right-style - CSS: Cascading Style Sheets
t-style: hidden;} .b3 {border-right-style: dotted;} .b4 {border-right-style: dashed;} .b5 {border-right-style: solid;} .b6 {border-right-style: double;} .b7 {border-right-style: groove;} .b8 {border-right-style: ridge;} .b9 {border-right-style: inset;} .b10 {border-right-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-right-style' in that specification.
border-right-width - CSS: Cascading Style Sheets
<line-width> = <length> | thin | medium | thick examples comparing border widths html <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-right-width: thick; } div:nth-child(2) { border-right-width: 2em; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-right-width' in that specification.
border-right - CSS: Cascading Style Sheets
</div> css div { border-right: 4px dashed blue; background-color: gold; height: 100px; width: 100px; font-weight: bold; text-align: center; } results specifications specification status comment css backgrounds and borders module level 3the definition of 'border-right' in that specification.
border-style - CSS: Cascading Style Sheets
le example classes */ .b1 {border-style:none;} .b2 {border-style:hidden;} .b3 {border-style:dotted;} .b4 {border-style:dashed;} .b5 {border-style:solid;} .b6 {border-style:double;} .b7 {border-style:groove;} .b8 {border-style:ridge;} .b9 {border-style:inset;} .b10 {border-style:outset;} result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-style' in that specification.
border-top-color - CSS: Cascading Style Sheets
note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-top-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-top-color' in that specification.
border-top-left-radius - CSS: Cascading Style Sheets
se is used as the border div { border-top-left-radius: 40%; } the background color is clipped at the border div { border-top-left-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status comment css backgrounds and borders module level 3the definition of 'border-top-left-radius' in that specification.
border-top-right-radius - CSS: Cascading Style Sheets
is used as the border div { border-top-right-radius: 40%; } the background color is clipped at the border div { border-top-right-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status comment css backgrounds and borders module level 3the definition of 'border-top-right-radius' in that specification.
border-top-style - CSS: Cascading Style Sheets
} .b2 {border-top-style: hidden;} .b3 {border-top-style: dotted;} .b4 {border-top-style: dashed;} .b5 {border-top-style: solid;} .b6 {border-top-style: double;} .b7 {border-top-style: groove;} .b8 {border-top-style: ridge;} .b9 {border-top-style: inset;} .b10 {border-top-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-top-style' in that specification.
border-top-width - CSS: Cascading Style Sheets
mal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples html <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-top-width: thick; } div:nth-child(2) { border-top-width: 2em; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-top-width' in that specification.
border-top - CSS: Cascading Style Sheets
</div> css div { border-top: 4px dashed blue; background-color: gold; height: 100px; width: 100px; font-weight: bold; text-align: center; } results specifications specification status comment css backgrounds and borders module level 3the definition of 'border-top' in that specification.
border-width - CSS: Cascading Style Sheets
c; border-width: 6px; } #bival { border: solid red; border-width: 2px 10px; } #treval { border: dotted orange; border-width: 0.3em 0 9px; } #fourval { border: solid lightgreen; border-width: thin medium thick 1em; } p { width: auto; margin: 0.25em; padding: 0.25em; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-width' in that specification.
border - CSS: Cascading Style Sheets
WebCSSborder
amazing, isn't it?</div> css div { border: 0.5rem outset pink; outline: 0.5rem solid khaki; box-shadow: 0 0 0 2rem skyblue; border-radius: 12px; font: bold 1rem sans-serif; margin: 2rem; padding: 1rem; outline-offset: 0.5rem; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border' in that specification.
bottom - CSS: Cascading Style Sheets
WebCSSbottom
<p>absolute</p></div> css p { font-size: 30px; line-height: 2em; } div { width: 48%; text-align: center; background: rgba(55,55,55,.2); border: 1px solid blue; } .absolute { position: absolute; bottom: 0; left: 0; } .fixed { position: fixed; bottom: 0; right: 0; } result specifications specification status comment css positioned layout module level 3the definition of 'bottom' in that specification.
box-align - CSS: Cascading Style Sheets
WebCSSbox-align
warning: this is a property of the original css flexible box layout module draft, and has been replaced by a newer standard.
box-decoration-break - CSS: Cascading Style Sheets
specifications specification status comment css fragmentation module level 3the definition of 'box-decoration-break' in that specification.
box-direction - CSS: Cascading Style Sheets
this is a property of the original css flexible box layout module draft, and has been replaced by a newer standard.
box-flex-group - CSS: Cascading Style Sheets
this is a property of the original css flexible box layout module draft, and has been replaced by a newer standard.
box-flex - CSS: Cascading Style Sheets
WebCSSbox-flex
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).
box-lines - CSS: Cascading Style Sheets
WebCSSbox-lines
this is a property of the original css flexible box layout module draft, and has been replaced by a newer standard.
box-ordinal-group - CSS: Cascading Style Sheets
this is a property of the original css flexible box layout module draft, and has been replaced by a newer standard.
box-orient - CSS: Cascading Style Sheets
this is a property of the original css flexible box layout module draft, and has been replaced by a newer standard.
box-pack - CSS: Cascading Style Sheets
WebCSSbox-pack
this is a property of the original css flexible box layout module draft, and has been replaced by a newer standard.
box-shadow - CSS: Cascading Style Sheets
html <div><p>hello world</p></div> css p { box-shadow: 0 0 0 2em #f4aab9, 0 0 0 4em #66ccff; margin: 4em; padding:1em; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'box-shadow' in that specification.
box-sizing - CSS: Cascading Style Sheets
136px content box width: 160px content box height: 80px */ } .border-box { box-sizing: border-box; /* total width: 160px total height: 80px content box width: 160px - (2 * 20px) - (2 * 8px) = 104px content box height: 80px - (2 * 20px) - (2 * 8px) = 24px */ } result specifications specification status comment css basic user interface module level 3the definition of 'box-sizing' in that specification.
calc() - CSS: Cascading Style Sheets
WebCSScalc
specifications specification status comment css values and units module level 3the definition of 'calc()' in that specification.
caret-color - CSS: Cascading Style Sheets
aret color!" size="64"/> <p contenteditable class="custom">this paragraph can be edited, and its caret has a custom color as well!</p> css input { caret-color: auto; display: block; margin-bottom: .5em; } input.custom { caret-color: red; } p.custom { caret-color: green; } result specifications specification status comment css basic user interface module level 3the definition of 'caret-color' in that specification.
clamp() - CSS: Cascading Style Sheets
WebCSSclamp
</p> css html { font-family: sans-serif; } body { margin: 0 auto; width: min(1000px, calc(70% + 100px)); } h1 { letter-spacing: 2px; font-size: clamp(1.8rem, 2.5vw, 2.8rem); } p { line-height: 1.5; font-size: max(1.2rem, 1.2vw); } specifications specification status comment css values and units module level 4the definition of 'clamp()' in that specification.
clip - CSS: Cascading Style Sheets
WebCSSclip
f3500.jpg" title="graphic clipped to upper left"> <img id="middle" src="https://udn.realityripple.com/samples/8f/15174f3500.jpg" title="graphic clipped towards middle"> <img id="bottom-right" src="https://udn.realityripple.com/samples/8f/15174f3500.jpg" title="graphic clipped to bottom right"> </p> result specifications specification status comment css masking module level 1the definition of 'clip' in that specification.
color-adjust - CSS: Cascading Style Sheets
.5), rgba(70, 140, 220, 0.5)); color: #900; width: 15rem; height: 6rem; text-align: center; font: 24px "helvetica", sans-serif; display: flex; align-items: center; justify-content: center; color-adjust: exact; } html <div class="my-box"> <p>need more contrast!</p> </div> result specifications specification status comment css color adjustment module level 1the definition of 'color-adjust' in that specification.
column-count - CSS: Cascading Style Sheets
</p> css .content-box { column-count: 3; } result specifications specification status comment css multi-column layout modulethe definition of 'column-count' in that specification.
column-fill - CSS: Cascading Style Sheets
</p> css .content-box { column-count: 4; column-rule: 1px solid black; column-fill: balance; } result specifications specification status comment css multi-column layout modulethe definition of 'column-fill' in that specification.
column-rule-color - CSS: Cascading Style Sheets
don't you think that's wonderful?</p> css p { column-count: 3; column-rule-style: solid; column-rule-color: blue; } result specifications specification status comment css multi-column layout modulethe definition of 'column-rule-color' in that specification.
column-rule-style - CSS: Cascading Style Sheets
don't you think that's wonderful?</p> css p { column-count: 3; column-rule-style: dashed; } result specifications specification status comment css multi-column layout modulethe definition of 'column-rule-style' in that specification.
column-rule-width - CSS: Cascading Style Sheets
don't you think that's wonderful?</p> css p { column-count: 3; column-rule-style: solid; column-rule-width: thick; } result specifications specification status comment css multi-column layout modulethe definition of 'column-rule-width' in that specification.
column-rule - CSS: Cascading Style Sheets
</p> css .content-box { padding: 0.3em; background: #ff7; column-count: 3; column-rule: inset 2px #33f; } result specifications specification status comment css multi-column layout modulethe definition of 'column-rule' in that specification.
column-span - CSS: Cascading Style Sheets
the text is equally distributed over the columns.</p> </article> css article { columns: 3; } h2 { column-span: all; } result specifications specification status comment css multi-column layout modulethe definition of 'column-span' in that specification.
column-width - CSS: Cascading Style Sheets
css multi-column layout modulethe definition of 'column-width' in that specification.
columns - CSS: Cascading Style Sheets
WebCSScolumns
</p> css .content-box { columns: 3 auto; } result specifications specification status comment css multi-column layout modulethe definition of 'columns' in that specification.
conic-gradient() - CSS: Cascading Style Sheets
specifications specification status comment css images module level 4the definition of 'conic-gradient()' in that specification.
contain - CSS: Cascading Style Sheets
WebCSScontain
" alt="photo"> <p>more content here.</p> </article> img { float: left; border: 3px solid black; } article { border: 1px solid black; contain: content; } this also means that the first image no longer floats down to the second article, and instead stays inside it's containing element's bounds: specifications specification status comment css containment module level 1the definition of 'contain' in that specification.
content - CSS: Cascading Style Sheets
WebCSScontent
html <div id="replaced">mozilla</div> css #replaced { content: url("https://mdn.mozillademos.org/files/12668/mdn.svg"); } #replaced::after { /* will not show if element replacement is supported */ content: " (" attr(id) ")"; } result specifications specification status comment css generated content module level 3the definition of 'content' in that specification.
counter-increment - CSS: Cascading Style Sheets
]+ | none examples incrementing named counters h1 { counter-increment: chapter section 2 page; /* increases the value of the chapter and page counters by 1, and the section counter by 2 */ } specifications specification status comment css lists module level 3the definition of 'counter-increment' in that specification.
counter-reset - CSS: Cascading Style Sheets
]+ | none examples resetting named counters h1 { counter-reset: chapter section 1 page; /* sets the chapter and page counters to 0, and the section counter to 1 */ } specifications specification status comment css lists module level 3the definition of 'counter-reset' in that specification.
counter-set - CSS: Cascading Style Sheets
]+ | none examples setting named counters h1 { counter-set: chapter section 1 page; /* sets the chapter and page counters to 0, and the section counter to 1 */ } specifications specification status comment css lists module level 3the definition of 'counter-set' in that specification.
counter() - CSS: Cascading Style Sheets
WebCSScounter
result decimal-leading-zero compared to lower-alpha html <ol> <li></li> <li></li> <li></li> </ol> css ol { counter-reset: count; } li { counter-increment: count; } li::after { content: "[" counter(count, decimal-leading-zero) "] == [" counter(count, lower-alpha) "]"; } result specifications specification status comment css lists module level 3the definition of 'css counters' in that specification.
counters() - CSS: Cascading Style Sheets
WebCSScounters
</ol> </li> </ol> </li> </ol> css ol { counter-reset: count; } li { counter-increment: count; } li::marker { content: counters(count, '.', upper-alpha) ') '; } li::before { content: counters(count, ".", decimal-leading-zero) " == " counters(count, ".", lower-alpha); } result specifications specification status comment css lists module level 3the definition of 'css counters' in that specification.
cross-fade() - CSS: Cascading Style Sheets
('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 comment css images module level 4the definition of 'cross-fade()' in that specification.
cursor - CSS: Cascading Style Sheets
WebCSScursor
-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing ] ] examples setting cursor types .foo { cursor: crosshair; } .bar { cursor: zoom-in; } /* a fallback keyword value is required when using a url */ .baz { cursor: url("hyper.cur"), auto; } specifications specification status comment css basic user interface module level 3the definition of 'cursor' in that specification.
direction - CSS: Cascading Style Sheets
WebCSSdirection
formal definition initial valueltrapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax ltr | rtl examples setting right-to-left direction blockquote { direction: rtl; } specifications specification status comment css writing modes module level 3the definition of 'direction' in that specification.
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
firefox 70 implemented the two-value syntax for the display property, which is part of the css display module level 3.
<display-box> - CSS: Cascading Style Sheets
html <div class="outer"> <div>inner div.</div> </div> css .outer { border: 2px solid red; width: 300px; display: contents; } .outer > div { border: 1px solid green; } result specifications specification status css display module level 3the definition of 'display-box' in that specification.
<display-inside> - CSS: Cascading Style Sheets
v> <p>i am content inside the container.</p> </div> css .box { background-color: rgb(224, 206, 247); border: 5px solid rebeccapurple; display: flow-root; } .float { float: left; width: 200px; height: 150px; background-color: white; border:1px solid black; padding: 10px; } result specifications specification status css display module level 3the definition of 'display-inside' in that specification.
<display-internal> - CSS: Cascading Style Sheets
v> <label for="name">name</label> <input type="text" id="name" name="name"> </div> <div> <label for="age">age</label> <input type="text" id="age" name="age"> </div> </main> css main { display: table; } div { display: table-row; } label, input { display: table-cell; margin: 5px; } result specifications specification status css display module level 3the definition of 'display-internal' in that specification.
<display-legacy> - CSS: Cascading Style Sheets
.container { display: inline flex; } specifications specification status css display module level 3the definition of 'display-legacy' in that specification.
<display-listitem> - CSS: Cascading Style Sheets
examples html <div class="fake-list">i will display as a list item</div> css .fake-list { display: list-item; list-style-position: inside; } result specifications specification status css display module level 3the definition of 'display-listitem' in that specification.
<display-outside> - CSS: Cascading Style Sheets
html <span>span 1</span> <span>span 2</span> css span { display: block; border: 1px solid rebeccapurple; } result specifications specification status css display module level 3the definition of 'display-outside' in that specification.
<easing-function> - CSS: Cascading Style Sheets
working draft defines <single-timing-function> as a synonym for <single-transition-timing-function> of the css transitions module.
element() - CSS: Cascading Style Sheets
WebCSSelement
<div style="width:400px; height:100px; background:-moz-element(#mybackground2);"> </div> <div style="overflow:hidden; height:0;"> <button id="mybackground2" type="button">evil button!</button> </div> specifications specification status comment css images module level 4the definition of 'using elements as images: the element() notation' in that specification.
env() - CSS: Cascading Style Sheets
WebCSSenv
specifications specification status comment css environment variables module level 1the definition of 'env()' in that specification.
blur() - CSS: Cascading Style Sheets
examples setting a blur with pixels and with rem blur(0) /* no effect */ blur(8px) /* blur with 8px radius */ blur(1.17rem) /* blur with 1.17rem radius */ specifications specification status filter effects module level 1the definition of 'blur()' in that specification.
brightness() - CSS: Cascading Style Sheets
examples setting brightness using numbers and percentages brightness(0%) /* completely black */ brightness(0.4) /* 40% brightness */ brightness(1) /* no effect */ brightness(200%) /* double brightness */ specifications specification status filter effects module level 1the definition of 'brightness()' in that specification.
contrast() - CSS: Cascading Style Sheets
examples setting contrast using numbers and percentages contrast(0) /* completely gray */ contrast(65%) /* 65% contrast */ contrast(1) /* no effect */ contrast(200%) /* double contrast */ specifications specification status filter effects module level 1the definition of 'contrast()' in that specification.
drop-shadow() - CSS: Cascading Style Sheets
examples setting a drop shadow using pixel offsets and blur radius /* black shadow with 10px blur */ drop-shadow(16px 16px 10px black) setting a drop shadow using rem offsets and blur radius /* reddish shadow with 1rem blur */ drop-shadow(.5rem .5rem 1rem #e23) specifications specification status filter effects module level 1the definition of 'drop-shadow()' in that specification.
grayscale() - CSS: Cascading Style Sheets
examples grayscale(0) /* no effect */ grayscale(.7) /* 70% grayscale */ grayscale(100%) /* completely grayscale */ specifications specification status filter effects module level 1the definition of 'grayscale()' in that specification.
hue-rotate() - CSS: Cascading Style Sheets
examples hue-rotate(-90deg) /* same as 270deg rotation */ hue-rotate(0deg) /* no effect */ hue-rotate(90deg) /* 90deg rotation */ hue-rotate(.5turn) /* 180deg rotation */ hue-rotate(405deg) /* same as 45deg rotation */ specifications specification status filter effects module level 1the definition of 'hue-rotate()' in that specification.
invert() - CSS: Cascading Style Sheets
examples invert(0) /* no effect */ invert(.6) /* 60% inversion */ invert(100%) /* completely inverted */ specifications specification status filter effects module level 1the definition of 'invert()' in that specification.
opacity() - CSS: Cascading Style Sheets
examples opacity(0%) /* completely transparent */ opacity(50%) /* 50% transparent */ opacity(1) /* no effect */ specifications specification status filter effects module level 1the definition of 'opacity()' in that specification.
saturate() - CSS: Cascading Style Sheets
examples saturate(0) /* completely unsaturated */ saturate(.4) /* 40% saturated */ saturate(100%) /* no effect */ saturate(200%) /* double saturation */ specifications specification status filter effects module level 1the definition of 'saturate()' in that specification.
sepia() - CSS: Cascading Style Sheets
examples sepia(0) /* no effect */ sepia(.65) /* 65% sepia */ sepia(100%) /* completely sepia */ specifications specification status filter effects module level 1the definition of 'sepia()' in that specification.
<filter-function> - CSS: Cascading Style Sheets
(${slider.value}${slider.getattribute('data-unit')}`; } updateoutput(); updatecurvalue(); } function updateoutput() { output.textcontent = slider.value; } function updatecurvalue() { curvalue.textcontent = `filter: ${divelem.style.filter}`; } setslider(selectelem.value); setdiv(selectelem.value); result specifications specification status filter effects module level 1the definition of 'filter-function' in that specification.
filter - CSS: Cascading Style Sheets
WebCSSfilter
iv { filter: grayscale(50%); } /* gray all images by 50% and blur by 10px */ img { filter: grayscale(0.5) blur(10px); } applying svg filters examples of using the url function with an svg resource are as follows: .target { filter: url(#c1); } .mydiv { filter: url(commonfilters.xml#large-blur); } specifications specification status comment filter effects module level 1the definition of 'filter' in that specification.
fit-content() - CSS: Cascading Style Sheets
/div> css #container { display: grid; grid-template-columns: fit-content(300px) fit-content(300px) 1fr; grid-gap: 5px; box-sizing: border-box; height: 200px; width: 100%; background-color: #8cffa0; padding: 10px; } #container > div { background-color: #8ca0ff; padding: 5px; } result specifications specification status comment css box sizing module level 3the definition of 'fit-content()' in that specification.
flex-basis - CSS: Cascading Style Sheets
s: min-content; } .flex3:after { content: 'min-content'; } .flex4 { flex-basis: fit-content; } .flex4:after { content: 'fit-content'; } .flex5 { flex-basis: content; } .flex5:after { content: 'content'; } .flex6 { flex-basis: fill; } .flex6:after { content: 'fill'; } results specifications specification status comment css flexible box layout modulethe definition of 'flex-basis' in that specification.
flex-direction - CSS: Cascading Style Sheets
; border: 1px solid #c3c3c3; display: flex; flex-direction: column-reverse; } .box { width: 50px; height: 50px; } #content1 { width: 200px; height: 200px; border: 1px solid #c3c3c3; display: flex; flex-direction: row-reverse; } .box1 { width: 50px; height: 50px; } result specifications specification status comment css flexible box layout modulethe definition of 'flex-direction' in that specification.
flex-flow - CSS: Cascading Style Sheets
WebCSSflex-flow
flex items are laid out in multiple lines */ flex-flow: column-reverse wrap; } specifications specification status comment css flexible box layout modulethe definition of 'flex-flow' in that specification.
flex-grow - CSS: Cascading Style Sheets
WebCSSflex-grow
style="background-color:brown;">f</div> </div> css #content { display: flex; justify-content: space-around; flex-flow: row wrap; align-items: stretch; } .box { flex-grow: 1; border: 3px solid rgba(0,0,0,.2); } .box1 { flex-grow: 2; border: 3px solid rgba(0,0,0,.2); } result specifications specification status comment css flexible box layout modulethe definition of 'flex-grow' in that specification.
flex-shrink - CSS: Cascading Style Sheets
background-color:brown;">d</div> <div class="box1" style="background-color:lightgreen;">e</div> </div> css #content { display: flex; width: 500px; } #content div { flex-basis: 120px; border: 3px solid rgba(0,0,0,.2); } .box { flex-shrink: 1; } .box1 { flex-shrink: 2; } result specifications specification status comment css flexible box layout modulethe definition of 'flex-shrink' in that specification.
flex-wrap - CSS: Cascading Style Sheets
WebCSSflex-wrap
und: orangered; } .green { background: yellowgreen; } .blue { background: steelblue; } /* flexbox styles */ .content { display: flex; flex-wrap: wrap; } .content1 { display: flex; flex-wrap: nowrap; } .content2 { display: flex; flex-wrap: wrap-reverse; } results specifications specification status comment css flexible box layout modulethe definition of 'flex-wrap' in that specification.
flex - CSS: Cascading Style Sheets
WebCSSflex
"block" : "none"; }); #flex-container { width: 100%; font-family: consolas, arial, sans-serif; } #flex-container > div { border: 1px solid #f00; padding: 1rem; } #flex-container > .raw-item { border: 1px solid #000; } result specifications specification status comment css flexible box layout modulethe definition of 'flex' in that specification.
font-feature-settings - CSS: Cascading Style Sheets
nable automatic fractions */ .fractions { font-feature-settings: "frac"; } /* use the second available swash character */ .swash { font-feature-settings: "swsh" 2; } /* enable stylistic set 7 */ .fancystyle { font-family: gabriola; /* available on windows 7, and on mac os */ font-feature-settings: "ss07"; } specifications specification status comment css fonts module level 3the definition of 'font-feature-settings' in that specification.
font-kerning - CSS: Cascading Style Sheets
ocument.getelementbyid('kern'); let nokern = document.getelementbyid('nokern'); input.addeventlistener('keyup', function() { kern.textcontent = input.value; /* update content */ nokern.textcontent = input.value; }); kern.textcontent = input.value; /* initialize content */ nokern.textcontent = input.value; specifications specification status comment css fonts module level 3the definition of 'font-kerning' in that specification.
font-language-override - CSS: Cascading Style Sheets
ntax normal | <string> examples using danish glyphs html <p class="para1">default language setting.</p> <p class="para2">this is a string with the <code>font-language-override</code> set to danish.</p> css p.para1 { font-language-override: normal; } p.para2 { font-language-override: "dan"; } result specifications specification status comment css fonts module level 4the definition of 'font-language-override' in that specification.
font-optical-sizing - CSS: Cascading Style Sheets
specifications specification status comment css fonts module level 4the definition of 'font-optical-sizing' in that specification.
font-size-adjust - CSS: Cascading Style Sheets
is the 10px times, but now adjusted to the same aspect ratio as the verdana.</p> css .times { font-family: times, serif; font-size: 10px; } .verdana { font-family: verdana, sans-serif; font-size: 10px; } .adjtimes { font-family: times, serif; font-size-adjust: 0.58; font-size: 10px; } results specifications specification status comment css fonts module level 3the definition of 'font-size-adjust' in that specification.
font-synthesis - CSS: Cascading Style Sheets
站直。</em> css em { font-weight: bold; } .syn { font-synthesis: style weight; } .no-syn { font-synthesis: none; } result specifications specification status comment css fonts module level 3the definition of 'font-synthesis' in that specification.
font-variant-caps - CSS: Cascading Style Sheets
g-caps examples setting the small-caps font variant html <p class="small-caps">firefox rocks, small caps!</p> <p class="normal">firefox rocks, normal caps!</p> css .small-caps { font-variant-caps: small-caps; font-style: italic; } .normal { font-variant-caps: normal; font-style: italic; } result specifications specification status comment css fonts module level 3the definition of 'font-variant-caps' in that specification.
font-variant-east-asian - CSS: Cascading Style Sheets
lass="traditional">大学</td> </tr> </tbody> </table> css td{ font-family:"yu gothic"; font-size:20px; } th{ color:grey; padding-right:10px; } .ruby { font-variant-east-asian: ruby; } .jis78 { font-variant-east-asian: jis78; } .traditional{ font-variant-east-asian: traditional; } result specifications specification status comment css fonts module level 3the definition of 'font-variant-east-asian' in that specification.
font-variant-ligatures - CSS: Cascading Style Sheets
s { font-variant-ligatures: historical-ligatures; } .no-historical-ligatures { font-variant-ligatures: no-historical-ligatures; } .contextual { font-variant-ligatures: contextual; } .no-contextual { font-variant-ligatures: no-contextual; } .contextual { font-variant-ligatures: contextual; } result specifications specification status comment css fonts module level 3the definition of 'font-variant-ligatures' in that specification.
font-variant-numeric - CSS: Cascading Style Sheets
ts/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 definition of 'font-variant-numeric' in that specification.
font-variant-position - CSS: Cascading Style Sheets
er examples setting superscript and subscript forms html <p class="normal">normal!</p> <p class="super">super!</p> <p class="sub">sub!</p> css p { display: inline; } .normal { font-variant-position: normal; } .super { font-variant-position: super; } .sub { font-variant-position: sub; } result specifications specification status comment css fonts module level 3the definition of 'font-variant-position' in that specification.
font-variation-settings - CSS: Cascading Style Sheets
specifications specification status comment css fonts module level 4the definition of 'font-variation-settings' in that specification.
font - CSS: Cascading Style Sheets
WebCSSfont
njectcss = function(cssfragment) { old = document.body.getelementsbytagname("style"); if (old.length > 1) { old[1].parentelement.removechild(old[1]); } css = document.createelement("style"); css.innerhtml = ".fontshorthand{font: " + cssfragment + "}"; document.body.appendchild(css); } setcss(); specifications specification status comment css fonts module level 3the definition of 'font' in that specification.
<frequency> - CSS: Cascading Style Sheets
WebCSSfrequency
specifications specification status comment css values and units module level 3the definition of '<frequency>' in that specification.
gap (grid-gap) - CSS: Cascading Style Sheets
WebCSSgap
</p> css .content-box { column-count: 3; gap: 40px; } result specifications specification status comment css box alignment module level 3the definition of 'gap' in that specification.
grid-template-columns - CSS: Cascading Style Sheets
candidate recommendation initial definition css grid layout module level 2the definition of 'subgrid' in that specification.
grid-template-rows - CSS: Cascading Style Sheets
candidate recommendation initial definition css grid layout module level 2the definition of 'subgrid' in that specification.
hanging-punctuation - CSS: Cascading Style Sheets
praesent laoreet tortor massa, sit amet vulputate nulla pharetra ut.”</p> css p { hanging-punctuation: first last; margin: .5rem; } result specifications specification status comment css text module level 3the definition of 'hanging-punctuation' in that specification.
hyphens - CSS: Cascading Style Sheets
WebCSShyphens
rd</dd> </dl> css dd { width: 55px; border: 1px solid black; } dd.none { -webkit-hyphens: none; -ms-hyphens: none; hyphens: none; } dd.manual { -webkit-hyphens: manual; -ms-hyphens: manual; hyphens: manual; } dd.auto { -webkit-hyphens: auto; -ms-hyphens: auto; hyphens: auto; } result specifications specification status comment css text module level 3the definition of 'hyphens' in that specification.
image-orientation - CSS: Cascading Style Sheets
rom-image">from-image</option> <option value="none">none</option> </select> javascript var imageorientation = document.getelementbyid("imageorientation"); imageorientation.addeventlistener("change", function (evt) { document.getelementbyid("image").style.imageorientation = evt.target.value; }); result specifications specification status comment css images module level 3the definition of 'image-orientation' in that specification.
image-rendering - CSS: Cascading Style Sheets
pple.com/samples/de/cedd397be3.jpg" /> </div> img { height: 200px; } css .auto { image-rendering: auto; } .pixelated { -ms-interpolation-mode: nearest-neighbor; image-rendering: pixelated; } .crisp-edges { image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; } result specifications specification status comment css images module level 3the definition of 'image-rendering' in that specification.
image-set() - CSS: Cascading Style Sheets
WebCSSimage-set
mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 specifications specification status comment css images module level 4the definition of 'the image-set() notation' in that specification.
image() - CSS: Cascading Style Sheets
specifications specification status comment css images module level 4the definition of 'image()' in that specification.
ime-mode - CSS: Cascading Style Sheets
WebCSSime-mode
specifications specification status comment css basic user interface module level 3the definition of 'ime-mode' in that specification.
inherit - CSS: Cascading Style Sheets
WebCSSinherit
css values and units module level 3the definition of 'inherit' in that specification.
justify-items - CSS: Cascading Style Sheets
ap: 10px; width: 300px; justify-items: stretch; } article:hover, article:focus { justify-items: center; } article span { background-color: black; color: white; margin: 1px; text-align: center; } article, span { padding: 10px; border-radius: 7px; } article { margin: 20px; } result specifications specification status comment css box alignment module level 3the definition of 'justify-items' in that specification.
justify-self - CSS: Cascading Style Sheets
justify-self: start; } span:nth-child(3) { justify-self: center; } span:nth-child(4) { justify-self: end; } article span { background-color: black; color: white; margin: 1px; text-align: center; } article, span { padding: 10px; border-radius: 7px; } article { margin: 20px; } result specifications specification status comment css box alignment module level 3the definition of 'justify-self' in that specification.
left - CSS: Cascading Style Sheets
WebCSSleft
lative; top: 20px; left: 20px; background-color: #ffd7c2; } #example_4 { width:200px; height:200px; position:absolute; bottom:10px; right:20px; background-color:#ffc7e4; } #example_5 { position: absolute; right: 0; left: 0; top: 100px; background-color: #d7ffc2; } result specifications specification status comment css positioned layout module level 3the definition of 'left' in that specification.
letter-spacing - CSS: Cascading Style Sheets
p class="em-wider">letter spacing</p> <p class="em-tight">letter spacing</p> <p class="px-wide">letter spacing</p> css .normal { letter-spacing: normal; } .em-wide { letter-spacing: 0.4em; } .em-wider { letter-spacing: 1em; } .em-tight { letter-spacing: -0.05em; } .px-wide { letter-spacing: 6px; } result specifications specification status comment css text module level 3the definition of 'letter-spacing' in that specification.
line-break - CSS: Cascading Style Sheets
��ずつぶやいた。</p> </div> css .wrapbox { width: 10em; margin: 0.5em; white-space: normal; vertical-align: top; display: inline-block; } .auto { line-break: auto; } .loose { line-break: loose; } .normal { line-break: normal; } .strict { line-break: strict; } .anywhere { line-break: anywhere; } result specifications specification status comment css text module level 3the definition of 'line-break' in that specification.
list-style-image - CSS: Cascading Style Sheets
eritedyescomputed valuenone or the image with its uri made absoluteanimation typediscrete formal syntax <url> | none examples setting list item images html <ul> <li>item 1</li> <li>item 2</li> </ul> css ul { list-style-image: url("https://mdn.mozillademos.org/files/11981/starsolid.gif"); } result specifications specification status comment css lists module level 3the definition of 'list-style-image' in that specification.
list-style-position - CSS: Cascading Style Sheets
>list item 3-4</li> </ul> css .inside { list-style-position: inside; list-style-type: square; } .outside { list-style-position: outside; list-style-type: circle; } .inside-img { list-style-position: inside; list-style-image: url("https://mdn.mozillademos.org/files/11979/starsolid.gif"); } result specifications specification status comment css lists module level 3the definition of 'list-style-position' in that specification.
list-style-type - CSS: Cascading Style Sheets
css lists module level 3the definition of 'list-style-type' in that specification.
list-style - CSS: Cascading Style Sheets
st style type and position html list 1 <ul class="one"> <li>list item1</li> <li>list item2</li> <li>list item3</li> </ul> list 2 <ul class="two"> <li>list item a</li> <li>list item b</li> <li>list item c</li> </ul> css .one { list-style: circle; } .two { list-style: square inside; } result specifications specification status comment css lists module level 3the definition of 'list-style' in that specification.
margin-left - CSS: Cascading Style Sheets
css flexible box layout modulethe definition of 'margin-left' in that specification.
margin-right - CSS: Cascading Style Sheets
working draft no significant change css flexible box layout modulethe definition of 'margin-right' in that specification.
margin-trim - CSS: Cascading Style Sheets
} specifications specification status css box model module level 4the definition of 'margin-trim' in that specification.
mask-border-mode - CSS: Cascading Style Sheets
when browsers support it, it will specify the type of blending mode used for the mask border — luminance or alpha: mask-border-mode: luminance; mask-border-mode: alpha; specifications specification status comment css masking module level 1the definition of 'mask-border-mode' in that specification.
mask-border-outset - CSS: Cascading Style Sheets
specifications specification status comment css masking module level 1the definition of 'mask-border-outset' in that specification.
mask-border-repeat - CSS: Cascading Style Sheets
specifications specification status comment css masking module level 1the definition of 'mask-border-repeat' in that specification.
mask-border-slice - CSS: Cascading Style Sheets
specifications specification status comment css masking module level 1the definition of 'mask-border-slice' in that specification.
mask-border-source - CSS: Cascading Style Sheets
specifications specification status comment css masking module level 1the definition of 'mask-border-source' in that specification.
mask-border-width - CSS: Cascading Style Sheets
specifications specification status comment css masking module level 1the definition of 'mask-border-width' in that specification.
mask-border - CSS: Cascading Style Sheets
/* updated standard shorthand property, not supported anywhere yet */ mask-border: url("https://udn.realityripple.com/samples/2d/fd08a3134c.png") /* source */ 30 fill / /* slice */ 20px / /* width */ 1px /* outset */ round; /* repeat */ } result specifications specification status comment css masking module level 1the definition of 'mask-border' in that specification.
mask-clip - CSS: Cascading Style Sheets
WebCSSmask-clip
box</option> <option value="view-box">view-box</option> <option value="no-clip">no-clip</option> </select> javascript var clipbox = document.getelementbyid("clipbox"); clipbox.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskclip = evt.target.value; }); result specifications specification status comment css masking module level 1the definition of 'mask-clip' in that specification.
mask-composite - CSS: Cascading Style Sheets
<option value="intersect">intersect</option> <option value="exclude">exclude</option> </select> javascript var clipbox = document.getelementbyid("compositemode"); clipbox.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskcomposite = evt.target.value; }); result specifications specification status comment css masking module level 1the definition of 'mask-composite' in that specification.
mask-image - CSS: Cascading Style Sheets
> examples setting a mask image with a url html <div id="masked"></div> css #masked { width: 100px; height: 100px; background-color: #8cffa0; -webkit-mask-image: url(https://mdn.mozillademos.org/files/12676/star.svg); mask-image: url(https://mdn.mozillademos.org/files/12676/star.svg); } result specifications specification status comment css masking module level 1the definition of 'mask-image' in that specification.
mask-mode - CSS: Cascading Style Sheets
WebCSSmask-mode
<option value="luminance">luminance</option> <option value="match-source">match-source</option> </select> javascript var maskmode = document.getelementbyid("maskmode"); maskmode.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskmode = evt.target.value; }); result specifications specification status comment css masking module level 1the definition of 'mask-mode' in that specification.
mask-origin - CSS: Cascading Style Sheets
option> <option value="stroke-box">stroke-box</option> <option value="view-box">view-box</option> </select> javascript var origin = document.getelementbyid("origin"); origin.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskorigin = evt.target.value; }); result specifications specification status comment css masking module level 1the definition of 'mask-origin' in that specification.
mask-position - CSS: Cascading Style Sheets
n value="10px 20px">10px 20px</option> <option value="60% 20%">60% 20%</option> </select> javascript var maskposition = document.getelementbyid("maskposition"); maskposition.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskposition = evt.target.value; }); result specifications specification status comment css masking module level 1the definition of 'mask-position' in that specification.
mask-repeat - CSS: Cascading Style Sheets
specifications specification status comment css masking module level 1the definition of 'mask-repeat' in that specification.
mask-size - CSS: Cascading Style Sheets
WebCSSmask-size
100px</option> <option value="cover">cover</option> <option value="contain">contain</option> </select> javascript var masksize = document.getelementbyid("masksize"); masksize.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.masksize = evt.target.value; }); result specifications specification status comment css masking module level 1the definition of 'mask-size' in that specification.
mask-type - CSS: Cascading Style Sheets
WebCSSmask-type
ask-type:luminance"> <rect x=".1" y=".1" width=".8" height=".8" fill="red" fill-opacity="0.7"/> </mask> </defs> </svg> css .redsquare { height: 100px; width: 100px; background-color: rgb(128, 128, 128); border: solid 1px black; mask: url("#m"); mask-type:luminance; } result specifications specification status comment css masking module level 1the definition of 'mask-type' in that specification.
mask - CSS: Cascading Style Sheets
WebCSSmask
ngle-percentage>where <color-stop-length> = <length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> examples masking an image .target { mask: url(#c1) luminance; } .anothertarget { mask: url(resources.svg#c1) 50px 30px/10px 10px repeat-x exclude; } specifications specification status comment css masking module level 1the definition of 'mask' in that specification.
max() - CSS: Cascading Style Sheets
WebCSSmax
mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 specifications specification status comment css values and units module level 4the definition of 'max()' in that specification.
min() - CSS: Cascading Style Sheets
WebCSSmin
<form> <label>type something:</label> <input type="text"> </form> specifications specification status comment css values and units module level 4the definition of 'min()' in that specification.
object-position - CSS: Cascading Style Sheets
result specifications specification status comment css images module level 3the definition of 'object-position' in that specification.
offset-anchor - CSS: Cascading Style Sheets
} .offset-anchor1 { offset-anchor: auto; background: cyan; } .offset-anchor2 { offset-anchor: right top; background: purple; } .offset-anchor3 { offset-anchor: left bottom; background: magenta; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } result specifications specification status comment motion path module level 1the definition of 'offset-anchor' in that specification.
offset-distance - CSS: Cascading Style Sheets
="motion-demo"></div> css #motion-demo { offset-path: path('m20,20 c20,100 200,0 200,100'); animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } result specifications specification status comment motion path module level 1the definition of 'offset-distance' in that specification.
offset-path - CSS: Cascading Style Sheets
86,201 v300 l1294,423 h1216 a11,11 0 0,0 1205,434 v789 a11,11 0 0,1 1194,800 h606 a11,11 0 0,1 595,789 v434 a11,11 0 0,0 584,423 h506 l900,190'); animation: followpath 4s linear infinite; } @keyframes followpath { to { motion-offset: 100%; offset-distance: 100%; } } result specifications <body> specification status comment motion path module level 1the definition of 'offset-path' in that specification.
offset-position - CSS: Cascading Style Sheets
></div> #motion-demo { offset-path: path('m20,20 c20,100 200,0 200,100'); offset-position: left top; animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } specifications specification status comment motion path module level 1the definition of 'offset-position' in that specification.
offset-rotate - CSS: Cascading Style Sheets
on: move 5000ms infinite alternate ease-in-out; offset-path: path('m20,20 c20,50 180,-10 180,20'); } div:nth-child(1) { offset-rotate: auto; } div:nth-child(2) { offset-rotate: auto 90deg; } div:nth-child(3) { offset-rotate: 30deg; } @keyframes move { 100% { offset-distance: 100%; } } result specifications specification status comment motion path module level 1the definition of 'offset-rotate' in that specification.
offset - CSS: Cascading Style Sheets
WebCSSoffset
<div id="offsetelement"></div> css @keyframes move { from { offset-distance: 0%; } to { offset-distance: 100%; } } #offsetelement { width: 50px; height: 50px; background-color: blue; offset: path("m 100 100 l 300 100 l 200 300 z") auto; animation: move 3s linear infinite; } result specifications specification status comment motion path module level 1the definition of 'offset' in that specification.
orphans - CSS: Cascading Style Sheets
WebCSSorphans
it has a little bit more text than the first one.</p> </div> css div { background-color: #8cffa0; height: 150px; columns: 3; orphans: 3; } p { background-color: #8ca0ff; } p:first-child { margin-top: 0; } result specifications specification status comment css fragmentation module level 3the definition of 'orphans' in that specification.
outline-color - CSS: Cascading Style Sheets
= <number> | <percentage><hue> = <number> | <angle> examples setting a solid blue outline html <p>my outline is blue, as you can see.</p> css p { outline: 2px solid; /* set the outline width and style */ outline-color: #0000ff; /* make the outline blue */ margin: 5px; } result specifications specification status comment css basic user interface module level 3the definition of 'outline-color' in that specification.
outline-offset - CSS: Cascading Style Sheets
absolute lengthsanimation typea length formal syntax <length> examples setting outline offset in pixels html <p>gallia est omnis divisa in partes tres.</p> css p { outline: 1px dashed red; outline-offset: 10px; background: yellow; border: 1px solid blue; margin: 15px; } result specifications specification status comment css basic user interface module level 3the definition of 'outline-offset' in that specification.
outline-style - CSS: Cascading Style Sheets
ult setting outline style to inset and outset html <div> <div class="inset"> <p class="outset">outline demo</p> </div> </div> css .inset { outline-style: inset; } .outset { outline-style: outset; } /* to make the demo clearer */ * { outline-width: 10px; padding: 15px; } result specifications specification status comment css basic user interface module level 3the definition of 'outline-style' in that specification.
outline-width - CSS: Cascading Style Sheets
span { outline-style: solid; display: inline-block; margin: 20px; } #thin { outline-width: thin; } #medium { outline-width: medium; } #thick { outline-width: thick; } #twopixels { outline-width: 2px; } #oneex { outline-width: 1ex; } #em { outline-width: 1.2em; } result specifications specification status comment css basic user interface module level 3the definition of 'outline-width' in that specification.
outline - CSS: Cascading Style Sheets
WebCSSoutline
ing outline to set a focus style html <a href="#">this link has a special focus style.</a> css a { border: 1px solid; border-radius: 3px; display: inline-block; margin: 10px; padding: 5px; } a:focus { outline: 4px dotted #e73; outline-offset: 4px; background: #ffa; } result specifications specification status comment css basic user interface module level 3the definition of 'outline' in that specification.
overflow-anchor - CSS: Cascading Style Sheets
body { overflow-anchor: none; } specifications specification status comment css scroll anchoring module level 1the definition of 'overflow-anchor' in that specification.
overflow-block - CSS: Cascading Style Sheets
, #div3, #div4 { border: 1px solid black; width: 250px; height: 100px; } #div1 { overflow-block: hidden; margin-bottom: 120px;} #div2 { overflow-block: scroll; margin-bottom: 120px;} #div3 { overflow-block: visible; margin-bottom: 120px;} #div4 { overflow-block: auto; margin-bottom: 120px;} result specifications specification status comment css overflow module level 3the definition of 'overflow-block' in that specification.
overflow-inline - CSS: Cascading Style Sheets
stuvwxyzabcdefghijklmopqrstuvwxyz </div> </li> </ul> css #div1, #div2, #div3, #div4 { border: 1px solid black; width: 250px; margin-bottom: 12px; } #div1 { overflow-inline: hidden;} #div2 { overflow-inline: scroll;} #div3 { overflow-inline: visible;} #div4 { overflow-inline: auto;} result specifications specification status comment css overflow module level 3the definition of 'overflow-inline' in that specification.
overflow-wrap - CSS: Cascading Style Sheets
(<code>hyphens</code>, german rules)</p> css p { width: 13em; margin: 2px; background: gold; } .ow-anywhere { overflow-wrap: anywhere; } .ow-break-word { overflow-wrap: break-word; } .word-break { word-break: break-all; } .hyphens { hyphens: auto; } result specifications specification status comment css text module level 3the definition of 'overflow-wrap' in that specification.
overflow-x - CSS: Cascading Style Sheets
abcdefghijklmopqrstuvwxyzabcdefghijklmopqrstuvwxyz </div> </li> </ul> css #div1, #div2, #div3, #div4 { border: 1px solid black; width: 250px; margin-bottom: 12px; } #div1 { overflow-x: hidden;} #div2 { overflow-x: scroll;} #div3 { overflow-x: visible;} #div4 { overflow-x: auto;} result specifications specification status comment css overflow module level 3the definition of 'overflow-x' in that specification.
overflow-y - CSS: Cascading Style Sheets
css #div1, #div2, #div3, #div4 { border: 1px solid black; width: 250px; height: 100px; } #div1 { overflow-y: hidden; margin-bottom: 12px;} #div2 { overflow-y: scroll; margin-bottom: 12px;} #div3 { overflow-y: visible; margin-bottom: 120px;} #div4 { overflow-y: auto; margin-bottom: 120px;} result specifications specification status comment css overflow module level 3the definition of 'overflow-y' in that specification.
overflow - CSS: Cascading Style Sheets
WebCSSoverflow
specifications specification status comment css overflow module level 3the definition of 'overflow' in that specification.
overscroll-behavior-block - CSS: Cascading Style Sheets
; background-color: yellow; background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } p { padding: 10px; background-color: rgba(255,0,0,0.5); margin: 0; width: 340px; position: relative; top: 10px; left: 10px; } result specifications specification status comment css overscroll behavior module level 1the definition of 'overscroll-behavior-block' in that specification.
overscroll-behavior-inline - CSS: Cascading Style Sheets
x; background-color: yellow; background-image: repeating-linear-gradient(to right, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } p { padding: 10px; background-color: rgba(255,0,0,0.5); margin: 0; width: 360px; position: relative; top: 10px; left: 10px; } result specifications specification status comment css overscroll behavior module level 1the definition of 'overscroll-behavior-inline' in that specification.
overscroll-behavior-x - CSS: Cascading Style Sheets
to avoid this, you can set overscroll-behavior-x: contain on the inner box: main > div { height: 300px; width: 500px; overflow: auto; position: relative; top: 100px; left: 100px; overscroll-behavior-x: contain; } specifications specification status comment css overscroll behavior module level 1the definition of 'overscroll-behavior-x' in that specification.
overscroll-behavior-y - CSS: Cascading Style Sheets
specifications specification status comment css overscroll behavior module level 1the definition of 'overscroll-behavior-y' in that specification.
overscroll-behavior - CSS: Cascading Style Sheets
this can be prevented by setting overscroll-behavior: none on the <body> element: body { margin: 0; overscroll-behavior: none; } specifications specification status comment css overscroll behavior module level 1the definition of 'overscroll-behavior' in that specification.
page-break-after - CSS: Cascading Style Sheets
css paged media module level 3the definition of 'page-break-after' in that specification.
page-break-before - CSS: Cascading Style Sheets
css paged media module level 3the definition of 'page-break-before' in that specification.
page-break-inside - CSS: Cascading Style Sheets
background-color: #8cffa0; height: 90px; width: 200px; columns: 1; column-width: 100px; } .list, ol, ul, p { break-inside: avoid; } p { background-color: #8ca0ff; } ol, ul, .list { margin: 0.5em 0; display: block; background-color: orange; } p:first-child { margin-top: 0; } result specifications specification status comment css paged media module level 3the definition of 'page-break-inside' in that specification.
paint() - CSS: Cascading Style Sheets
WebCSSpaint
<li>item 3</li> <li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7</li> <li>item 8</li> <li>item 9</li> <li>item 10</li> <li>item 11</li> <li>item 12</li> <li>item 13</li> <li>item 14</li> <li>item 15</li> <li>item 16</li> <li>item 17</li> <li>item 18</li> <li>item 19</li> <li>item 20</li> </ul> css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/worklets/hilite.js'); li { --boxcolor: hsla(55, 90%, 60%, 1.0); background-image: paint(hollowhighlights, stroke, 2px); } li:nth-of-type(3n) { --boxcolor: hsla(155, 90%, 60%, 1.0); background-image: paint(hollowhighlights, filled, 3px); } li:nth-of-type(3n+1) { --boxcolor: hsla(255, 90%, 60%, 1.0); background-image: pai...
place-content - CSS: Cascading Style Sheets
* can be changed in the live sample */ place-content: flex-end center; /* can be changed in the live sample */ } div > div { border: 2px solid #8c8c8c; width: 50px; background-color: #a0c8ff; } .small { font-size: 12px; height: 40px; } .large { font-size: 14px; height: 50px; } result specifications specification status comment css box alignment module level 3the definition of 'place content' in that specification.
place-items - CSS: Cascading Style Sheets
#container { height:200px; width: 240px; place-items: center; /* you can change this value by selecting another option in the list */ background-color: #8c8c8c; } .flex { display: flex; flex-wrap: wrap; } .grid { display: grid; grid-template-columns: repeat(auto-fill, 50px); } result specifications specification status comment css box alignment module level 3the definition of 'place-items' in that specification.
place-self - CSS: Cascading Style Sheets
lf: start center; } span:nth-child(3) { place-self: center start; } span:nth-child(4) { place-self: end; } article span { background-color: black; color: white; margin: 1px; text-align: center; } article, span { padding: 10px; border-radius: 7px; } article { margin: 20px; } result specifications specification status comment css box alignment module level 3the definition of 'place-self' in that specification.
pointer-events - CSS: Cascading Style Sheets
recommendation initial definition its extension to html elements, though present in early drafts of css basic user interface module level 3, has been pushed to its level 4.
position - CSS: Cascading Style Sheets
WebCSSposition
recommendation css positioned layout module level 3the definition of 'position' in that specification.
quotes - CSS: Cascading Style Sheets
WebCSSquotes
lang="fr"> <q>ceci est une citation française.</q> <div> <hr> <div lang="ru"> <q>Это русская цитата</q> <div> <hr> <div lang="de"> <q>dies ist ein deutsches zitat</q> <div> <hr> <div lang="en"> <q>this is an english quote.</q> <div> css /*q { quotes: auto; }*/ result specifications specification status comment css generated content module level 3the definition of 'quotes' in that specification.
radial-gradient() - CSS: Cascading Style Sheets
specifications specification status comment css images module level 3the definition of 'radial-gradients()' in that specification.
repeating-conic-gradient() - CSS: Cascading Style Sheets
specifications specification status comment css images module level 4the definition of 'repeating-conic-gradient()' in that specification.
repeating-linear-gradient() - CSS: Cascading Style Sheets
specifications specification status comment css images module level 3the definition of 'repeating-linear-gradient()' in that specification.
repeating-radial-gradient() - CSS: Cascading Style Sheets
specifications specification status comment css images module level 3the definition of 'repeating-radial-gradient()' in that specification.
resize - CSS: Cascading Style Sheets
WebCSSresize
css basic user interface module level 3the definition of 'resize' in that specification.
right - CSS: Cascading Style Sheets
WebCSSright
#parent { width: 200px; height: 200px; background-color: #ffc7e4; position: relative; } /* declare both a left and a right */ #width, #nowidth { background-color: #c2ffd7; position: absolute; left: 0; right: 0; } /* declare a width */ #width { width: 100px; top: 60px; } result specifications specification status comment css positioned layout module level 3the definition of 'right' in that specification.
row-gap (grid-row-gap) - CSS: Cascading Style Sheets
WebCSSrow-gap
id"> <div></div> <div></div> <div></div> </div> css #grid { grid-row-gap: 20px; } #grid { display: grid; height: 200px; grid-template-columns: 200px; grid-template-rows: repeat(3, 1fr); row-gap: 20px; } #grid > div { border: 1px solid green; background-color: lime; } result specifications specification status comment css box alignment module level 3the definition of 'row-gap' in that specification.
ruby-align - CSS: Cascading Style Sheets
>short ruby</rt><rp>)</rp> </ruby> css ruby { ruby-align: space-between; } result extra space distributed between and around ruby elements html <ruby> <rb>this is a long text to check</rb> <rp>(</rp><rt>short ruby</rt><rp>)</rp> </ruby> css ruby { ruby-align: space-around; } result specifications specification status comment css ruby layout module level 1the definition of 'ruby-align' in that specification.
ruby-position - CSS: Cascading Style Sheets
<rb>超電磁砲</rb> <rp>(</rp><rt>レールガン</rt><rp>)</rp> </ruby> css ruby { ruby-position:over; } result ruby positioned under the text html <ruby> <rb>超電磁砲</rb> <rp>(</rp><rt>レールガン</rt><rp>)</rp> </ruby> css ruby { ruby-position:under; } result specifications specification status comment css ruby layout module level 1the definition of 'ruby-position' in that specification.
scroll-behavior - CSS: Cascading Style Sheets
; padding: 5px; border: 1px solid black; } scroll-container { display: block; width: 350px; height: 200px; overflow-y: scroll; scroll-behavior: smooth; } scroll-page { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 5em; } result specifications specification status comment css object model (cssom) view modulethe definition of 'scroll-behavior' in that specification.
scroll-margin-block-end - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block-end' in that specification.
scroll-margin-block-start - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block-start' in that specification.
scroll-margin-block - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length>{1,2} specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block' in that specification.
scroll-margin-bottom - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-bottom' in that specification.
scroll-margin-inline-end - CSS: Cascading Style Sheets
result try it for yourself: specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-inline-end' in that specification.
scroll-margin-inline-start - CSS: Cascading Style Sheets
result try it for yourself: specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-inline-start' in that specification.
scroll-margin-inline - CSS: Cascading Style Sheets
result try it for yourself: specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-inline' in that specification.
scroll-margin-left - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-left' in that specification.
scroll-margin-right - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-right' in that specification.
scroll-margin-top - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-top' in that specification.
scroll-margin - CSS: Cascading Style Sheets
result try it for yourself: specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin' in that specification.
scroll-padding-block-end - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block-end' in that specification.
scroll-padding-block-start - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block-start' in that specification.
scroll-padding-block - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax [ auto | <length-percentage> ]{1,2}where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block' in that specification.
scroll-padding-bottom - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-bottom' in that specification.
scroll-padding-inline-end - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline-end' in that specification.
scroll-padding-inline-start - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline-start' in that specification.
scroll-padding-inline - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax [ auto | <length-percentage> ]{1,2}where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline' in that specification.
scroll-padding-left - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-left' in that specification.
scroll-padding-right - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-right' in that specification.
scroll-padding-top - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-top' in that specification.
scroll-padding - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax [ auto | <length-percentage> ]{1,4}where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding' in that specification.
scroll-snap-align - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ none | start | end | center ]{1,2} specifications specification status comment css scroll snap module level 1the definition of 'scroll-snap-align' in that specification.
scroll-snap-stop - CSS: Cascading Style Sheets
rtl</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> </div> result specifications specification status comment css scroll snap module level 1the definition of 'scroll-snap-stop' in that specification.
scroll-snap-type - CSS: Cascading Style Sheets
font-size: 128px; width: 256px; height: 100%; } /* appearance fixes */ .y.container > div:first-child { line-height: 1.3; font-size: 64px; } /* coloration */ .container > div:nth-child(even) { background-color: #87ea87; } .container > div:nth-child(odd) { background-color: #87ccea; } results specifications specification status comment css scroll snap module level 1the definition of 'scroll-snap-type' in that specification.
shape-image-threshold - CSS: Cascading Style Sheets
result specifications specification status comment css shapes module level 1the definition of 'shape-image-threshold' in that specification.
shape-margin - CSS: Cascading Style Sheets
sts, probably knows its truth as we know it.</section> css section { max-width: 400px; } .shape { float: left; width: 150px; height: 150px; background-color: maroon; clip-path: polygon(0 0, 150px 150px, 0 150px); shape-outside: polygon(0 0, 150px 150px, 0 150px); shape-margin: 20px; } result specifications specification status comment css shapes module level 1the definition of 'shape-margin' in that specification.
<string> - CSS: Cascading Style Sheets
WebCSSstring
has \27 an escaped single quote.' "this is a string with \\ an escaped backslash." /* new line in a string */ "this string has a \aline break in it." /* string spanning two lines of code (these two strings will have identical output) */ "a really long \ awesome string" "a really long awesome string" specifications specification status comment css values and units module level 3the definition of '<string>' in that specification.
tab-size - CSS: Cascading Style Sheets
WebCSStab-size
html <p>no tab</p> <p>&#0009;default tab size of 8 characters wide</p> <p class="custom">&#0009;custom tab size of 3 characters wide</p> <p>&nbsp;&nbsp;&nbsp;3 spaces, equivalent to the custom tab size</p> css p { white-space: pre; } .custom { tab-size: 3; -moz-tab-size: 3; } result specifications specification status comment css text module level 3the definition of 'tab-size' in that specification.
text-align-last - CSS: Cascading Style Sheets
nullam est eros, suscipit sed dictum quis, accumsan a ligula.</p> css p { font-size: 1.4em; text-align: justify; text-align-last: center; } results specifications specification status comment css text module level 3the definition of 'text-align-last' in that specification.
text-combine-upright - CSS: Cascading Style Sheets
candidate recommendation add digits value css writing modes module level 3the definition of 'text-combine-upright' in that specification.
text-decoration-color - CSS: Cascading Style Sheets
r> | <angle> examples <p>this paragraph has <s>some erroneous text</s> inside it that i want to call attention to.</p> p { text-decoration-line: underline; text-decoration-color: cyan; } s { text-decoration-line: line-through; text-decoration-color: red; text-decoration-style: wavy; } specifications specification status comment css text decoration module level 3the definition of 'text-decoration-color' in that specification.
text-decoration-line - CSS: Cascading Style Sheets
ror examples <p class="wavy">here's some text with wavy red underline!</p> <p class="both">this text has lines both above and below it.</p> .wavy { text-decoration-line: underline; text-decoration-style: wavy; text-decoration-color: red; } .both { text-decoration-line: underline overline; } specifications specification status comment css text decoration module level 3the definition of 'text-decoration-line' in that specification.
text-decoration-skip-ink - CSS: Cascading Style Sheets
n-skip-ink: all の使用例を示しています。</p> css p { font-size: 1.5em; text-decoration: underline blue; text-decoration-skip-ink: auto; /* this is the default anyway */ } .no-skip-ink { text-decoration-skip-ink: none; } .skip-ink-all{ text-decoration-skip-ink: all; } result specifications specification status comment css text decoration module level 4the definition of 'text-decoration-skip-ink' in that specification.
text-decoration-skip - CSS: Cascading Style Sheets
ete formal syntax none | [ objects | [ spaces | [ leading-spaces | trailing-spaces ] ] | edges | box-decoration ] examples skipping edges html <p>hey, grab a cup of <em>coffee!</em></p> css p { margin: 0; font-size: 3em; text-decoration: underline; text-decoration-skip: edges; } result specifications specification status comment css text decoration module level 4the definition of 'text-decoration-skip' in that specification.
text-decoration-style - CSS: Cascading Style Sheets
-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-decoration-thickness - CSS: Cascading Style Sheets
-decoration-style: solid; text-decoration-color: red; text-decoration-thickness: 1px; } .thick { text-decoration-line: underline; text-decoration-style: solid; text-decoration-color: red; text-decoration-thickness: 5px; } .shorthand { text-decoration: underline solid red 5px; } results specifications specification status comment css text decoration module level 4the definition of 'text-decoration-width' in that specification.
text-emphasis-color - CSS: Cascading Style Sheets
)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples emphasis with a color and custom character css em { text-emphasis-color: green; text-emphasis-style: "*"; } html <p>here's an example:</p> <em>this has emphasis marks!</em> result specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification.
text-emphasis-position - CSS: Cascading Style Sheets
in html, this can be done with the following pattern: em { text-emphasis: dot; /* set text-emphasis for <em> elements */ } em rt { display: none; /* hide ruby inside <em> elements */ } specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification.
text-emphasis-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | [ [ filled | open ] | [ dot | circle | double-circle | triangle | sesame ] ] | <string> examples h2 { text-emphasis-style: sesame; } specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification.
text-emphasis - CSS: Cascading Style Sheets
css h2 { text-emphasis: triangle #d55; } html <h2>this is important!</h2> result specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification.
text-indent - CSS: Cascading Style Sheets
it, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> <p>lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> css p { text-indent: 30%; background: plum; } result specifications specification status comment css text module level 3the definition of 'text-indent' in that specification.
text-justify - CSS: Cascading Style Sheets
{ font-size: 1.5em; border: 1px solid black; padding: 10px; width: 95%; margin: 10px auto; text-align: justify; } .none { text-justify: none; } .auto { text-justify: auto; } .dist { text-justify: distribute; } .word { text-justify: inter-word; } .char { text-justify: inter-character; } specifications specification status comment css text module level 3the definition of 'text-justify' in that specification.
text-orientation - CSS: Cascading Style Sheets
ements, except table row groups, rows, column groups, and columnsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax mixed | upright | sideways examples html <p>lorem ipsum dolet semper quisquam.</p> css p { writing-mode: vertical-rl; text-orientation: upright; } result specifications specification status comment css writing modes module level 3the definition of 'text-orientation' in that specification.
text-overflow - CSS: Cascading Style Sheets
1234567890 specifications specification status comment css overflow module level 4 added the values <string> and fade and the fade() function css overflow module level 3the definition of 'text-overflow' in that specification.
text-size-adjust - CSS: Cascading Style Sheets
uto | <percentage> examples basic disabling usage as hinted at above, on a properly designed responsive site the text-size-adjust behavior is not needed, so developers can elect to turn it off by specifying a vlaue of none: p { -webkit-text-size-adjust: none; text-size-adjust: none; } specifications specification status comment css mobile text size adjustment module level 1the definition of 'text-size-adjust' in that specification.
text-transform - CSS: Cascading Style Sheets
full-size-kana <p>ァィゥェ ォヵㇰヶ ㇱㇲッㇳ ㇴㇵㇶㇷ ㇸㇹㇺャ ュョㇻㇼ ㇽㇾㇿヮ</p> <p>ァィゥェ ォヵㇰヶ ㇱㇲッㇳ ㇴㇵㇶㇷ ㇸㇹㇺャ ュョㇻㇼ ㇽㇾㇿヮ</p> </p> p:nth-of-type(2) { text-transform: full-size-kana; } specifications specification status comment css text module level 3the definition of 'text-transform' in that specification.
text-underline-offset - CSS: Cascading Style Sheets
only the bottom one is offset.</p> p { text-decoration: underline wavy red; text-underline-offset: 1em; } .twolines { text-decoration-color: purple; text-decoration-line: underline overline; } specifications specification status comment css text decoration module level 4the definition of 'text-underline-offset' in that specification.
text-underline-position - CSS: Cascading Style Sheets
:root { text-underline-position: under; } specifications specification status comment css text decoration module level 3the definition of 'text-underline-position' in that specification.
top - CSS: Cascading Style Sheets
WebCSStop
; formal syntax <length> | <percentage> | auto examples body { background: beige; } div { position: absolute; top: 10%; right: 40%; bottom: 20%; left: 15%; background: gold; border: 1px solid blue; } <div>the size of this content is determined by the position of its edges.</div> specifications specification status comment css positioned layout module level 3the definition of 'top' in that specification.
unicode-bidi - CSS: Cascading Style Sheets
valueas specifiedanimation typediscrete formal syntax normal | embed | isolate | bidi-override | isolate-override | plaintext examples css .bible-quote { direction: rtl; unicode-bidi: embed; } html <div class="bible-quote"> a line of text </div> <div> another line of text </div> result specifications specification status comment css writing modes module level 3the definition of 'unicode-bidi' in that specification.
user-select - CSS: Cascading Style Sheets
ss="all">clicking once will select all of this text.</p> css .unselectable { -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .all { -moz-user-select: all; -webkit-user-select: all; -ms-user-select: all; user-select: all; } result specifications specification status comment css basic user interface module level 4the definition of 'user-select' in that specification.
var() - CSS: Cascading Style Sheets
WebCSSvar
style: */ .component .header { color: var(--header-color, blue); /* header-color isn’t set, and so remains blue, the fallback value */ } .component .text { color: var(--text-color, black); } /* in the larger application’s style: */ .component { --text-color: #080; } specifications specification status comment css custom properties for cascading variables module level 1the definition of 'var()' in that specification.
visibility - CSS: Cascading Style Sheets
> <td>1.3</td> </tr> <tr class="collapse"> <td>2.1</td> <td>2.2</td> <td>2.3</td> </tr> <tr> <td>3.1</td> <td>3.2</td> <td>3.3</td> </tr> </table> css .collapse { visibility: collapse; } table { border: 1px solid red; } td { border: 1px solid gray; } specifications specification status comment css flexible box layout modulethe definition of 'visibility' in that specification.
white-space - CSS: Cascading Style Sheets
excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> result specifications specification status comment css text module level 3the definition of 'white-space' in that specification.
will-change - CSS: Cascading Style Sheets
mouseenter', hintbrowser); el.addeventlistener('animationend', removehint); function hintbrowser() { // the optimizable properties that are going to change // in the animation's keyframes block this.style.willchange = 'transform, opacity'; } function removehint() { this.style.willchange = 'auto'; } specifications specification status comment css will change module level 1the definition of 'will-change' in that specification.
word-break - CSS: Cascading Style Sheets
��</p> css .narrow { padding: 10px; border: 1px solid; width: 500px; margin: 0 auto; font-size: 20px; line-height: 1.5; letter-spacing: 1px; } .normal { word-break: normal; } .breakall { word-break: break-all; } .keepall { word-break: keep-all; } .breakword { word-break: break-word; } specifications specification status comment css text module level 3the definition of 'word-break' in that specification.
word-spacing - CSS: Cascading Style Sheets
inheritedyespercentagesrefer to the width of the affected glyphcomputed valuean optimum, minimum, and maximum value, each consisting of either an absolute length, a percentage, or the keyword normalanimation typea length formal syntax normal | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css text module level 3the definition of 'word-spacing' in that specification.
writing-mode - CSS: Cascading Style Sheets
candidate recommendation add sideways-lr and sideways-rl css writing modes module level 3the definition of 'writing-mode' in that specification.
Live streaming web audio and video - Developer guides
for rtmp transfer you can use the nginx rtmp module.
Block formatting context - Developer guides
to avoid the margin collapsing between two neighbor div: html <div class="blue"></div> <div class="red-outer"> <div class="red-inner">red inner</div> </div> css .blue, .red-inner { height: 50px; margin: 10px 0; } .blue { background: blue; } .red-outer { overflow: hidden; background: red; } specifications specification status comment css display module level 3the definition of 'block formatting context' in that specification.
HTML5 - Developer guides
WebGuideHTMLHTML5
this is often referred as css3, though css is not a monolithic specification any more and the different modules are not all at level 3: some are at level 1 and others at level 4, with all the intermediate levels covered.
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
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", ".s...
Standard metadata names - HTML: Hypertext Markup Language
WebHTMLElementmetaname
css color adjustment module level 1the definition of 'the "color-scheme" metadata name' in that specification.
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
226 link types: modulepreload attribute, html, link, link types, reference the modulepreload keyword for the rel attribute of the <link> element provides a declarative way to preemptively fetch a module script and its dependencies, and store them in the document's module map for later evaluation.
Link types - HTML: Hypertext Markup Language
<link> <a>, <area>, <form> modulepreload initiates early (and high-priority) loading of module scripts.
Common MIME types - HTTP
guages https://html.spec.whatwg.org/multipage/#dependencies:willful-violation https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/ .json json format application/json .jsonld json-ld format application/ld+json .mid .midi musical instrument digital interface (midi) audio/midi audio/x-midi .mjs javascript module text/javascript .mp3 mp3 audio audio/mpeg .mpeg mpeg video video/mpeg .mpkg apple installer package application/vnd.apple.installer+xml .odp opendocument presentation document application/vnd.oasis.opendocument.presentation .ods opendocument spreadsheet document application/vnd.oasis.opendocument.spreadsheet .o...
Compression in HTTP - HTTP
apache supports compression and uses mod_deflate; for nginx there is ngx_http_gzip_module; for iis, the <httpcompression> element.
Content-Encoding - HTTP
compression highly depends on server settings and used server modules.
CSP: base-uri - HTTP
examples meta tag configuration <meta http-equiv="content-security-policy" content="base-uri 'self'"> apache configuration <ifmodule mod_headers.c> header set content-security-policy "base-uri 'self'"; </ifmodule> nginx configuration add_header content-security-policy "base-uri 'self';" violation case since your domain isn't example.com, a <base> element with its href set to https://example.com will result in a csp violation.
CSP: form-action - HTTP
examples meta tag configuration <meta http-equiv="content-security-policy" content="form-action 'none'"> apache configuration <ifmodule mod_headers.c> header set content-security-policy "form-action 'none'; </ifmodule> nginx configuration add_header content-security-policy "form-action 'none';" violation case using a <form> element with an action set to inline javascript will result in a csp violation.
X-XSS-Protection - HTTP
example block pages from loading when they detect reflected xss attacks: x-xss-protection: 1; mode=block php header("x-xss-protection: 1; mode=block"); apache (.htaccess) <ifmodule mod_headers.c> header set x-xss-protection "1; mode=block" </ifmodule> nginx add_header "x-xss-protection" "1; mode=block"; specifications not part of any specifications or drafts.
CSS Houdini
<script> css.paintworklet.addmodule('csscomponent.js'); </script> this added module contains registerpaint() functions, which register completely configurable worklets.
Closures - JavaScript
note that these closures follow the module design pattern.
Using Promises - JavaScript
one case of special usefulness: when writing code for node.js, it's common that modules you include in your project may have unhandled rejected promises.
JavaScript Guide - JavaScript
ing objects defining methods getter and setter details of the object model prototype-based oop creating object hierarchies inheritance promises guarantees chaining error propagation composition timing iterators and generators iterators iterables generators meta programming proxy handlers and traps revocable proxy reflect javascript modules exporting importing default exports renaming features aggregating modules dynamic module loading next » ...
TypeError: "x" is not a function - JavaScript
using the latter will throw an error: const sixteen = 2(3 + 5); alert('2 x (3 + 5) is ' + string(sixteen)); //uncaught typeerror: 2 is not a function you can correct the code by adding a * operator: const sixteen = 2 * (3 + 5); alert('2 x (3 + 5) is ' + string(sixteen)); //2 x (3 + 5) is 16 import the exported module correctly ensure you are importing the module correctly.
getter - JavaScript
get notifier() { delete this.notifier; return this.notifier = document.getelementbyid('bookmarked-notification-anchor'); }, for firefox code, see also the xpcomutils.jsm code module, which defines the definelazygetter() function.
Atomics - JavaScript
description the atomic operations are installed on an atomics module.
Function.prototype.bind() - JavaScript
creating a bound function from the function, using the original object, neatly solves this problem: this.x = 9; // 'this' refers to global 'window' object here in a browser const module = { x: 81, getx: function() { return this.x; } }; module.getx(); // returns 81 const retrievex = module.getx; retrievex(); // returns 9; the function gets invoked at the global scope // create a new function with 'this' bound to module // new programmers might confuse the // global variable 'x' with module's property 'x' const boundgetx = retrievex.bind(module); boundgetx(); // retur...
Function - JavaScript
this is because the top-level scope in node is not the global scope, and x will be local to the module.
Math.clz32() - JavaScript
now, inversing the bits reveals the lowest zeros return 32 - clon(~integer) |0; */ } make these helper functions into asm.js module; then, you have a true performance masterpiece.
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).
WebAssembly.LinkError - JavaScript
the webassembly.linkerror object indicates an error during module instantiation (besides traps from the start function).
WebAssembly.Memory() constructor - JavaScript
var memory = new webassembly.memory({initial:10, maximum:100}); the second way to get a webassembly.memory object is to have it exported by a webassembly module.
WebAssembly.Memory - JavaScript
var memory = new webassembly.memory({initial:10, maximum:100}); the second way to get a webassembly.memory object is to have it exported by a webassembly module.
WebAssembly.Table.prototype.set() - JavaScript
var tbl = new webassembly.table({initial:2, element:"anyfunc"}); console.log(tbl.length); console.log(tbl.get(0)); console.log(tbl.get(1)); we then create an import object that contains a reference to the table: var importobj = { js: { tbl:tbl } }; finally, we load and instantiate a wasm module (table2.wasm) using the webassembly.instantiatestreaming(), log the table length, and invoke the two referenced functions that are now stored in the table (the table2.wasm module (see text representation) adds two function references to the table, both of which print out a simple value): webassembly.instantiatestreaming(fetch('table2.wasm'), importobject) .then(function(obj) { console.log(tbl.
globalThis - JavaScript
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.
Standard built-in objects - JavaScript
intl intl.collator intl.datetimeformat intl.listformat intl.numberformat intl.pluralrules intl.relativetimeformat intl.locale webassembly webassembly webassembly.module webassembly.instance webassembly.memory webassembly.table webassembly.compileerror webassembly.linkerror webassembly.runtimeerror other arguments ...
let - JavaScript
ivate = function() { return privatescope.get(this).hidden; }; } console.log(typeof privatescope); // "undefined" var thing = new thing(); console.log(thing); // thing {someproperty: "foo"} thing.showpublic(); // "foo" thing.showprivate(); // 1 the same privacy pattern with closures over local variables can be created with var, but those need a function scope (typically an iife in the module pattern) instead of just a block scope like in the example above.
var - JavaScript
note that in both nodejs commonjs modules and native ecmascript modules, top-level variable declarations are scoped to the module, and are not, therefore added as properties to the global object.
JavaScript reference - JavaScript
raybuffer 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 function function* async function ...
JavaScript shells - JavaScript
can use perl modules directly from javascript: dbi for database integration, gtk2 for gui apps, posix for system programming, etc.
Lazy loading - Web Performance
entry point splitting: separates code by entry point(s) in the app dynamic splitting: separates code where dynamic import() statements are used javascript script type module any script tag with type="module" is treated like a javascript module and is deferred by default.
Performance budgets - Web Performance
during development, there are a few tools to run checks against new or modified assets: a module bundler (e.g.
Progressive loading - Progressive web apps (PWAs)
conclusion less files to load initially, smaller files split into modules, use of placeholders, and loading more content on demand — this will help achieve faster initial load times, which brings benefits to the app creator and offers a smoother experience to the user.
Progressive web apps (PWAs)
sw-precache — a node module to generate service worker code that will precache specific resources.
amplitude - SVG: Scalable Vector Graphics
four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'amplitude' in that specification.
azimuth - SVG: Scalable Vector Graphics
WebSVGAttributeazimuth
ting> </filter> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight1);" /> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight2); transform: translatex(240px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'azimuth' in that specification.
baseFrequency - SVG: Scalable Vector Graphics
pe="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the definition of 'basefrequency' in that specification.
bias - SVG: Scalable Vector Graphics
WebSVGAttributebias
specifications specification status comment filter effects module level 1the definition of 'bias' in that specification.
clip-path - SVG: Scalable Vector Graphics
legend compatibility unknown compatibility unknown specifications specification status comment css masking module level 1the definition of 'clip-path' in that specification.
clip - SVG: Scalable Vector Graphics
WebSVGAttributeclip
specifications specification status comment css masking module level 1the definition of 'clip' in that specification.
clipPathUnits - SVG: Scalable Vector Graphics
specifications specification status comment css masking module level 1the definition of 'clippathunits' in that specification.
color-interpolation-filters - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'color-interpolation' in that specification.
diffuseConstant - SVG: Scalable Vector Graphics
x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'diffuseconstant' in that specification.
direction - SVG: Scalable Vector Graphics
600 72" xmlns="http://www.w3.org/2000/svg" direction="rtl" lang="fa"> <text x="300" y="50" text-anchor="middle" font-size="36">داستان svg 1.1 se طولا ني است.</text> </svg> usage notes value ltr | rtl default value ltr animatable yes specifications specification status comment css writing modes module level 3the definition of 'direction' in that specification.
divisor - SVG: Scalable Vector Graphics
WebSVGAttributedivisor
specifications specification status comment filter effects module level 1the definition of 'divisor' in that specification.
elevation - SVG: Scalable Vector Graphics
ting> </filter> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight1);" /> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight2); transform: translatex(240px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'elevation' in that specification.
exponent - SVG: Scalable Vector Graphics
ter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes <number> if the type attribute of the component element is set to gamma, this value specifies the exponent of the gamma function specifications specification status comment filter effects module level 1the definition of 'exponent' in that specification.
filter - SVG: Scalable Vector Graphics
WebSVGAttributefilter
specifications specification status comment filter effects module level 1the definition of 'filter' in that specification.
filterUnits - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'filterunits' in that specification.
flood-color - SVG: Scalable Vector Graphics
</filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood2); transform: translatex(220px);" /> </svg> usage notes value color initial value black animatable yes specifications specification status comment filter effects module level 1the definition of 'flood-color' in that specification.
flood-opacity - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'flood-opacity' in that specification.
font-size-adjust - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 3the definition of 'font-size-adjust' in that specification.
font-size - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 3the definition of 'font-size' in that specification.
href - SVG: Scalable Vector Graphics
WebSVGAttributehref
filter effects module level 1the definition of 'href for <feimage>' in that specification.
image-rendering - SVG: Scalable Vector Graphics
specifications specification status comment css images module level 3the definition of 'image-rendering' in that specification.
in - SVG: Scalable Vector Graphics
WebSVGAttributein
ge xlink:href="https://developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%"/> <feblend in2="sourcegraphic" mode="multiply"/> </filter> </defs> <circle cx="50%" cy="40%" r="40%" fill="#c00" style="filter:url(#imagemultiply);"/> </svg> </div> result specifications specification status comment filter effects module level 1the definition of 'in' in that specification.
intercept - SVG: Scalable Vector Graphics
style="filter: url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'intercept' in that specification.
k1 - SVG: Scalable Vector Graphics
WebSVGAttributek1
: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'k1' in that specification.
k2 - SVG: Scalable Vector Graphics
WebSVGAttributek2
: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'k2' in that specification.
k3 - SVG: Scalable Vector Graphics
WebSVGAttributek3
: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'k3' in that specification.
k4 - SVG: Scalable Vector Graphics
WebSVGAttributek4
: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'k4' in that specification.
kernelMatrix - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'kernelmatrix' in that specification.
letter-spacing - SVG: Scalable Vector Graphics
specifications specification status comment css text module level 3the definition of 'letter-spacing' in that specification.
lighting-color - SVG: Scalable Vector Graphics
x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> usage notes value color default value white animatable yes specifications specification status comment filter effects module level 1the definition of 'lighting-color' in that specification.
limitingConeAngle - SVG: Scalable Vector Graphics
er> <rect x="0" y="0" width="200" height="200" style="filter: url(#spotlight1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#spotlight2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'limitingconeangle' in that specification.
mask - SVG: Scalable Vector Graphics
WebSVGAttributemask
wing nineteen elements: <a>, <circle>, <clippath>, <ellipse>, <g>, <glyph>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <symbol>, <text>, <use> usage notes value see the css property mask default value none animatable yes specifications specification status comment css masking module level 1the definition of 'mask' in that specification.
maskContentUnits - SVG: Scalable Vector Graphics
specifications specification status comment css masking module level 1the definition of 'maskcontentunits' in that specification.
maskUnits - SVG: Scalable Vector Graphics
specifications specification status comment css masking module level 1the definition of 'maskunits' in that specification.
mode - SVG: Scalable Vector Graphics
WebSVGAttributemode
specifications specification status comment filter effects module level 1the definition of 'mode' in that specification.
numOctaves - SVG: Scalable Vector Graphics
<feturbulence basefrequency="0.05" numoctaves="3" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the definition of 'numoctaves' in that specification.
order - SVG: Scalable Vector Graphics
WebSVGAttributeorder
specifications specification status comment filter effects module level 1the definition of 'order' in that specification.
pointsAtX - SVG: Scalable Vector Graphics
lter> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default value 0 value <number> animatable yes specifications specification status comment filter effects module level 1the definition of 'pointsatx' in that specification.
pointsAtY - SVG: Scalable Vector Graphics
lter> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default value 0 value <number> animatable yes specifications specification status comment filter effects module level 1the definition of 'pointsaty' in that specification.
pointsAtZ - SVG: Scalable Vector Graphics
lter> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default value 0 value <number> animatable yes specifications specification status comment filter effects module level 1the definition of 'pointsatz' in that specification.
preserveAlpha - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'preservealpha' in that specification.
preserveAspectRatio - SVG: Scalable Vector Graphics
default value xmidymid meet animatable yes specification specification status comment filter effects module level 1the definition of 'preserveaspectratio' in that specification.
primitiveUnits - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'primitiveunits' in that specification.
radius - SVG: Scalable Vector Graphics
WebSVGAttributeradius
usage notes value <number-optional-number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'radius' in that specification.
result - SVG: Scalable Vector Graphics
WebSVGAttributeresult
specifications specification status comment filter effects module level 1the definition of 'result' in that specification.
scale - SVG: Scalable Vector Graphics
WebSVGAttributescale
specifications specification status comment filter effects module level 1the definition of 'scale' in that specification.
seed - SVG: Scalable Vector Graphics
WebSVGAttributeseed
<feturbulence basefrequency="0.05" seed="1000" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the definition of 'seed' in that specification.
specularConstant - SVG: Scalable Vector Graphics
="0" width="200" height="200" style="filter: url(#specularlighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#specularlighting2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'specularconstant' in that specification.
stdDeviation - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'stddeviation' in that specification.
stitchTiles - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'stitchtiles' in that specification.
tableValues - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'tablevalues' in that specification.
targetX - SVG: Scalable Vector Graphics
WebSVGAttributetargetX
specifications specification status comment filter effects module level 1the definition of 'targetx' in that specification.
targetY - SVG: Scalable Vector Graphics
WebSVGAttributetargetY
specifications specification status comment filter effects module level 1the definition of 'targety' in that specification.
text-decoration - SVG: Scalable Vector Graphics
specifications specification status comment css text decoration module level 3the definition of 'text-decoration' in that specification.
unicode-bidi - SVG: Scalable Vector Graphics
specifications specification status comment css writing modes module level 3the definition of 'unicode-bidi' in that specification.
values - SVG: Scalable Vector Graphics
WebSVGAttributevalues
specifications specification status comment filter effects module level 1the definition of 'values for <fecolormatrix>' in that specification.
word-spacing - SVG: Scalable Vector Graphics
specifications specification status comment css text module level 3the definition of 'word-spacing' in that specification.
writing-mode - SVG: Scalable Vector Graphics
specifications specification status comment css writing modes module level 3the definition of 'writing-mode' in that specification.
xChannelSelector - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'xchannelselector' in that specification.
yChannelSelector - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of 'ychannelselector' in that specification.
<clipPath> - SVG: Scalable Vector Graphics
WebSVGElementclipPath
e-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elements<text>, <use> specifications specification status comment css masking module level 1the definition of '<clippath>' in that specification.
<feBlend> - SVG: Scalable Vector Graphics
WebSVGElementfeBlend
olor="green" flood-opacity="1"/> <feblend in="sourcegraphic" in2="floodfill" mode="multiply"/> </filter> </defs> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%" style="filter:url(#spotlight);"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<feblend>' in that specification.
<feColorMatrix> - SVG: Scalable Vector Graphics
xt> <!-- luminancetoalpha --> <filter id="colormelta"> <fecolormatrix in="sourcegraphic" type="luminancetoalpha" /> </filter> <use href="#circles" transform="translate(0 350)" filter="url(#colormelta)" /> <text x="70" y="400">luminancetoalpha</text> </svg> result screenshotlive sample specifications specification status comment filter effects module level 1the definition of '<fecolormatrix>' in that specification.
<feComponentTransfer> - SVG: Scalable Vector Graphics
0" y="220">linear function</text> <rect x="0" y="230" width="100%" height="20" style="filter:url(#linear)"></rect> <text x="0" y="270">gamma function</text> <rect x="0" y="280" width="100%" height="20" style="filter:url(#gamma)"></rect> </g> </svg> css rect { fill: url(#rainbow); } result specifications specification status comment filter effects module level 1the definition of '<fecomponenttransfer>' in that specification.
<feComposite> - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of '<fecomposite>' in that specification.
<feConvolveMatrix> - SVG: Scalable Vector Graphics
<defs> <filter id="emboss"> <feconvolvematrix kernelmatrix="3 0 0 0 0 0 0 0 -3"/> </filter> </defs> <image xlink:href="/files/12668/mdn.svg" x="0" y="0" height="200" width="200" style="filter:url(#emboss);" /> </svg> result specifications specification status comment filter effects module level 1the definition of '<feconvolvematrix>' in that specification.
<feDiffuseLighting> - SVG: Scalable Vector Graphics
saty="80" pointsatz="0"/> </fediffuselighting> <fecomposite in="sourcegraphic" in2="light" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"/> </filter> <circle cx="390" cy="80" r="50" fill="green" filter="url(#lightme3)" /> </svg> expected rendering: live rendering: specifications specification status comment filter effects module level 1the definition of '<fediffuselighting>' in that specification.
<feDisplacementMap> - SVG: Scalable Vector Graphics
pe="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the definition of '<fedisplacementmap>' in that specification.
<feDistantLight> - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of '<fedistantlight>' in that specification.
<feDropShadow> - SVG: Scalable Vector Graphics
id styling attributes class, style filter primitive attributes height, in, result, x, y, width presentation attributes most notably: flood-color, flood-opacity usage notes categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <script>, <set> specifications specification status comment filter effects module level 1the definition of '<fedropshadow>' in that specification.
<feFlood> - SVG: Scalable Vector Graphics
WebSVGElementfeFlood
p://www.w3.org/2000/svg" width="200" height="200"> <defs> <filter id="floodfilter" filterunits="userspaceonuse"> <feflood x="50" y="50" width="100" height="100" flood-color="green" flood-opacity="0.5"/> </filter> </defs> <use style="filter: url(#floodfilter);"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<feflood>' in that specification.
<feFuncA> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncA
specifications specification status comment filter effects module level 1the definition of '<fefunca>' in that specification.
<feFuncB> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncB
specifications specification status comment filter effects module level 1the definition of '<fefuncb>' in that specification.
<feFuncG> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncG
specifications specification status comment filter effects module level 1the definition of '<fefuncg>' in that specification.
<feFuncR> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncR
specifications specification status comment filter effects module level 1the definition of '<fefuncr>' in that specification.
<feGaussianBlur> - SVG: Scalable Vector Graphics
ssianblur in="sourcealpha" stddeviation="3" /> <feoffset dx="2" dy="4" /> <femerge> <femergenode /> <femergenode in="sourcegraphic" /> </femerge> </filter> <circle cx="60" cy="60" r="50" fill="green" filter="url(#dropshadow)" /> </svg> result screenshotlive sample specifications specification status comment filter effects module level 1the definition of '<fegaussianblur>' in that specification.
<feImage> - SVG: Scalable Vector Graphics
WebSVGElementfeImage
" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="image"> <feimage xlink:href="/files/6457/mdn_logo_only_color.png"/> </filter> </defs> <rect x="10%" y="10%" width="80%" height="80%" style="filter:url(#image);"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<feimage>' in that specification.
<feMerge> - SVG: Scalable Vector Graphics
WebSVGElementfeMerge
specifications specification status comment filter effects module level 1the definition of '<femerge>' in that specification.
<feMergeNode> - SVG: Scalable Vector Graphics
specifications specification status comment filter effects module level 1the definition of '<femergenode>' in that specification.
<feMorphology> - SVG: Scalable Vector Graphics
<femorphology operator="dilate" radius="2"/> </filter> </svg> <p>normal text</p> <p id="thin">thinned text</p> <p id="thick">fattened text</p> css p { margin: 0; font-family: arial, helvetica, sans-serif; font-size: 3em; } #thin { filter: url(#erode); } #thick { filter: url(#dilate); } specifications specification status comment filter effects module level 1the definition of '<femorphology>' in that specification.
<feOffset> - SVG: Scalable Vector Graphics
WebSVGElementfeOffset
lter id="offset" width="180" height="180"> <feoffset in="sourcegraphic" dx="60" dy="60" /> </filter> </defs> <rect x="0" y="0" width="100" height="100" stroke="black" fill="green"/> <rect x="0" y="0" width="100" height="100" stroke="black" fill="green" filter="url(#offset)"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<feoffset>' in that specification.
<fePointLight> - SVG: Scalable Vector Graphics
ularlighting> <fecomposite in="sourcegraphic" in2="spotlight" operator="arithmetic" k1="0" k2="1" k3="1" k4="0"/> </filter> </defs> <image xlink:href="/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%" style="filter:url(#spotlight);"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<fepointlight>' in that specification.
<feSpecularLighting> - SVG: Scalable Vector Graphics
nent="20" lighting-color="#bbbbbb"> <fepointlight x="50" y="75" z="200"/> </fespecularlighting> <fecomposite in="sourcegraphic" in2="specout" operator="arithmetic" k1="0" k2="1" k3="1" k4="0"/> </filter> <circle cx="110" cy="110" r="100" style="filter:url(#filter)"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<fespecularlighting>' in that specification.
<feSpotLight> - SVG: Scalable Vector Graphics
/fespecularlighting> <fecomposite in="sourcegraphic" in2="spotlight" operator="out" k1="0" k2="1" k3="1" k4="0"/> </filter> </defs> <image xlink:href="/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%" style="filter:url(#spotlight);"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<fespotlight>' in that specification.
<feTile> - SVG: Scalable Vector Graphics
WebSVGElementfeTile
width="100%" height="100%"> <fetile in="sourcegraphic" x="50" y="50" width="100" height="100" /> <fetile/> </filter> </defs> <image xlink:href="/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%" style="filter:url(#tile);"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<fetile>' in that specification.
<feTurbulence> - SVG: Scalable Vector Graphics
pe="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the definition of '<feturbulence>' in that specification.
<filter> - SVG: Scalable Vector Graphics
WebSVGElementfilter
svg <svg width="230" height="120" xmlns="http://www.w3.org/2000/svg"> <filter id="blurme"> <fegaussianblur stddeviation="5"/> </filter> <circle cx="60" cy="60" r="50" fill="green" /> <circle cx="170" cy="60" r="50" fill="green" filter="url(#blurme)" /> </svg> result screenshotlive sample specifications specification status comment filter effects module level 1the definition of '<filter>' in that specification.
<mask> - SVG: Scalable Vector Graphics
WebSVGElementmask
the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment css masking module level 1the definition of '<mask>' in that specification.
<script> - SVG: Scalable Vector Graphics
WebSVGElementscript
while svg's script element is equivalent to the html <script> element, it has some discrepancies, like it uses the href attribute instead of src and it doesn't support ecmascript modules so far (see browser compatibility below for details) html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <script> // <![cdata[ window.addeventlistener('domcontentloaded', () => { function getcolor () { const r = math.round(math.random() * 255).tostring(16).padstart(2,'0') const g = math.round(math.random() * 255).tostring(16).padstart(2,'0') const b = math.round(math.random() * 255).tostring(16).padstart(2,'0') return `#${r}${g}${b}` } document.querysele...
SVG as an Image - SVG: Scalable Vector Graphics
css backgrounds and borders module level 3the definition of 'svg within 'background-image' css property' in that specification.